summaryrefslogtreecommitdiffstats
path: root/ListItem.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-01-28 04:09:06 -0200
committerHisham Muhammad <hisham@gobolinux.org>2018-02-26 20:13:09 -0300
commitb815e4c7a3cdcc64e3c5a28414ef2450bc9d5ebd (patch)
tree664a7c3d8366b13e48410cd11df55aa0ccd641a3 /ListItem.c
parent4791050ceaf24a32e08505015faf07c43580763c (diff)
Add support for multiple screens, switchable using Tab
Diffstat (limited to 'ListItem.c')
-rw-r--r--ListItem.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ListItem.c b/ListItem.c
index 05c5c0b3..55c73433 100644
--- a/ListItem.c
+++ b/ListItem.c
@@ -27,13 +27,13 @@ typedef struct ListItem_ {
}*/
-static void ListItem_delete(Object* cast) {
+void ListItem_delete(Object* cast) {
ListItem* this = (ListItem*)cast;
free(this->value);
free(this);
}
-static void ListItem_display(Object* cast, RichString* out) {
+void ListItem_display(Object* cast, RichString* out) {
ListItem* const this = (ListItem*)cast;
assert (this != NULL);
/*
@@ -59,11 +59,15 @@ ObjectClass ListItem_class = {
.compare = ListItem_compare
};
-ListItem* ListItem_new(const char* value, int key) {
- ListItem* this = AllocThis(ListItem);
+void ListItem_init(ListItem* this, const char* value, int key) {
this->value = xStrdup(value);
this->key = key;
this->moving = false;
+}
+
+ListItem* ListItem_new(const char* value, int key) {
+ ListItem* this = AllocThis(ListItem);
+ ListItem_init(this, value, key);
return this;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy