diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2008-03-09 08:58:38 +0000 |
commit | da23c8c5a188324455c8f417293c10d85f65cb63 (patch) | |
tree | d7a4b8cb0af705de6650e20e00ba3da04d84b27f /DisplayOptionsPanel.c | |
parent | 12f4f09e6ed288bdedc86e4ef22f3cc34f0e787a (diff) |
Clean up headers by using 'static' whenever possible.
Reduces resulting code size.
Diffstat (limited to 'DisplayOptionsPanel.c')
-rw-r--r-- | DisplayOptionsPanel.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c index ceab53c4..f87dd044 100644 --- a/DisplayOptionsPanel.c +++ b/DisplayOptionsPanel.c @@ -20,37 +20,14 @@ typedef struct DisplayOptionsPanel_ { }*/ -DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { - DisplayOptionsPanel* this = (DisplayOptionsPanel*) malloc(sizeof(DisplayOptionsPanel)); - Panel* super = (Panel*) this; - Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); - ((Object*)this)->delete = DisplayOptionsPanel_delete; - - this->settings = settings; - this->scr = scr; - super->eventHandler = DisplayOptionsPanel_eventHandler; - - Panel_setHeader(super, "Display options"); - Panel_add(super, (Object*) CheckItem_new(String_copy("Tree view"), &(settings->pl->treeView), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Shadow other users' processes"), &(settings->pl->shadowOtherUsers), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Hide kernel threads"), &(settings->pl->hideKernelThreads), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Hide userland threads"), &(settings->pl->hideUserlandThreads), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Display threads in a different color"), &(settings->pl->highlightThreads), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Highlight program \"basename\""), &(settings->pl->highlightBaseName), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Highlight megabytes in memory counters"), &(settings->pl->highlightMegabytes), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Leave a margin around header"), &(settings->header->margin), false)); - Panel_add(super, (Object*) CheckItem_new(String_copy("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ)"), &(settings->pl->detailedCPUTime), false)); - return this; -} - -void DisplayOptionsPanel_delete(Object* object) { +static void DisplayOptionsPanel_delete(Object* object) { Panel* super = (Panel*) object; DisplayOptionsPanel* this = (DisplayOptionsPanel*) object; Panel_done(super); free(this); } -HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { +static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { DisplayOptionsPanel* this = (DisplayOptionsPanel*) super; HandlerResult result = IGNORED; @@ -75,3 +52,25 @@ HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { return result; } +DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { + DisplayOptionsPanel* this = (DisplayOptionsPanel*) malloc(sizeof(DisplayOptionsPanel)); + Panel* super = (Panel*) this; + Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); + ((Object*)this)->delete = DisplayOptionsPanel_delete; + + this->settings = settings; + this->scr = scr; + super->eventHandler = DisplayOptionsPanel_eventHandler; + + Panel_setHeader(super, "Display options"); + Panel_add(super, (Object*) CheckItem_new(String_copy("Tree view"), &(settings->pl->treeView), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Shadow other users' processes"), &(settings->pl->shadowOtherUsers), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Hide kernel threads"), &(settings->pl->hideKernelThreads), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Hide userland threads"), &(settings->pl->hideUserlandThreads), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Display threads in a different color"), &(settings->pl->highlightThreads), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Highlight program \"basename\""), &(settings->pl->highlightBaseName), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Highlight megabytes in memory counters"), &(settings->pl->highlightMegabytes), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Leave a margin around header"), &(settings->header->margin), false)); + Panel_add(super, (Object*) CheckItem_new(String_copy("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ)"), &(settings->pl->detailedCPUTime), false)); + return this; +} |