diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-01-28 04:09:06 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-02-26 20:13:09 -0300 |
commit | b815e4c7a3cdcc64e3c5a28414ef2450bc9d5ebd (patch) | |
tree | 664a7c3d8366b13e48410cd11df55aa0ccd641a3 /ListItem.c | |
parent | 4791050ceaf24a32e08505015faf07c43580763c (diff) |
Add support for multiple screens, switchable using Tab
Diffstat (limited to 'ListItem.c')
-rw-r--r-- | ListItem.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; } |