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-17 15:30:15 -0200
commit187a035a769fb490318091fee2b0051d9b188ad5 (patch)
treead74fe0bfe51adb320f2f2bbb8ce45fcd335f960 /ListItem.c
parentece89b8df0db61b8caaf53679afbe00e1c2ef22f (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