diff options
author | Daniel Lange <DLange@git.local> | 2022-06-03 08:55:20 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2022-06-03 08:55:20 +0200 |
commit | 937052b231259a47d881d539ad5748245ef55b99 (patch) | |
tree | 41071229fa007d8cf6902bb9253d2acd8cc66979 /OptionItem.c | |
parent | 1b805a31720727008b32b1129a167758519fd4db (diff) | |
download | debian_htop-937052b231259a47d881d539ad5748245ef55b99.tar.gz debian_htop-937052b231259a47d881d539ad5748245ef55b99.tar.bz2 debian_htop-937052b231259a47d881d539ad5748245ef55b99.zip |
New upstream version 3.2.1upstream/3.2.1
Diffstat (limited to 'OptionItem.c')
-rw-r--r-- | OptionItem.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OptionItem.c b/OptionItem.c index 7ab6900..962c0a9 100644 --- a/OptionItem.c +++ b/OptionItem.c @@ -25,6 +25,13 @@ static void OptionItem_delete(Object* cast) { free(this); } +static void TextItem_display(const Object* cast, RichString* out) { + const TextItem* this = (const TextItem*)cast; + assert (this != NULL); + + RichString_appendWide(out, CRT_colors[HELP_BOLD], this->super.text); +} + static void CheckItem_display(const Object* cast, RichString* out) { const CheckItem* this = (const CheckItem*)cast; assert (this != NULL); @@ -68,6 +75,16 @@ const OptionItemClass OptionItem_class = { } }; +const OptionItemClass TextItem_class = { + .super = { + .extends = Class(OptionItem), + .delete = OptionItem_delete, + .display = TextItem_display + }, + .kind = OPTION_ITEM_TEXT +}; + + const OptionItemClass CheckItem_class = { .super = { .extends = Class(OptionItem), @@ -77,6 +94,7 @@ const OptionItemClass CheckItem_class = { .kind = OPTION_ITEM_CHECK }; + const OptionItemClass NumberItem_class = { .super = { .extends = Class(OptionItem), @@ -86,6 +104,12 @@ const OptionItemClass NumberItem_class = { .kind = OPTION_ITEM_NUMBER }; +TextItem* TextItem_new(const char* text) { + TextItem* this = AllocThis(TextItem); + this->super.text = xStrdup(text); + return this; +} + CheckItem* CheckItem_newByRef(const char* text, bool* ref) { CheckItem* this = AllocThis(CheckItem); this->super.text = xStrdup(text); |