diff options
author | Diogo Ferreira <defer@cyngn.com> | 2015-01-14 11:13:52 +0000 |
---|---|---|
committer | Diogo Ferreira <defer@cyngn.com> | 2015-01-14 11:38:57 +0000 |
commit | 841159c272ac08b1cd5bdef5167a8ce11383fbb5 (patch) | |
tree | d7272ef150e58eaa1acc9ab62cf9e6c0aecbc2da /DisplayOptionsPanel.c | |
parent | e1a8535012ab86d3e926bebfb7731dab1eb7320a (diff) | |
download | android_external_htop-cm-14.1.tar.gz android_external_htop-cm-14.1.tar.bz2 android_external_htop-cm-14.1.zip |
htop: Update to 1.0.3HEADreplicant-6.0-0004-transitionreplicant-6.0-0004-rc6replicant-6.0-0004-rc5-transitionreplicant-6.0-0004-rc5replicant-6.0-0004-rc4replicant-6.0-0004-rc3replicant-6.0-0004-rc2replicant-6.0-0004-rc1replicant-6.0-0004replicant-6.0-0003replicant-6.0-0002replicant-6.0-0001staging/cm-12.1stable/cm-13.0-ZNH5Ystable/cm-13.0-ZNH2KBstable/cm-13.0-ZNH2Kstable/cm-13.0-ZNH0Estable/cm-12.1-YOG7Dstable/cm-12.1-YOG4Pstable/cm-12.1-YOG3Cstable/cm-12.0-YNG4Nstable/cm-12.0-YNG3Cstable/cm-12.0-YNG1TAstable/cm-12.0-YNG1Tstable/cm-12.0-YNG1Ilineage-15.0cm-14.1cm-14.0cm-13.0cm-12.1cm-12.0
Change-Id: I416c44803b3a79c2fd752e342ea113875fa533e0
Diffstat (limited to 'DisplayOptionsPanel.c')
-rw-r--r-- | DisplayOptionsPanel.c | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c index 2b8ffc3..6153313 100644 --- a/DisplayOptionsPanel.c +++ b/DisplayOptionsPanel.c @@ -1,15 +1,22 @@ +/* +htop - DisplayOptionsPanel.c +(C) 2004-2011 Hisham H. Muhammad +Released under the GNU GPL, see the COPYING file +in the source distribution for its full text. +*/ #include "DisplayOptionsPanel.h" -#include "Panel.h" #include "CheckItem.h" -#include "Settings.h" -#include "ScreenManager.h" -#include "debug.h" #include <assert.h> +#include <stdlib.h> +#include <string.h> /*{ +#include "Panel.h" +#include "Settings.h" +#include "ScreenManager.h" typedef struct DisplayOptionsPanel_ { Panel super; @@ -47,32 +54,42 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) { this->settings->changed = true; Header* header = this->settings->header; Header_calculateHeight(header); + Header_reinit(header); Header_draw(header); ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2); } return result; } +PanelClass DisplayOptionsPanel_class = { + .super = { + .extends = Class(Panel), + .delete = DisplayOptionsPanel_delete + }, + .eventHandler = DisplayOptionsPanel_eventHandler +}; + DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) { - DisplayOptionsPanel* this = (DisplayOptionsPanel*) malloc(sizeof(DisplayOptionsPanel)); + DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel); Panel* super = (Panel*) this; - Panel_init(super, 1, 1, 1, 1, CHECKITEM_CLASS, true); - ((Object*)this)->delete = DisplayOptionsPanel_delete; + Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true); 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("Show custom thread names"), &(settings->pl->showThreadNames), 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 large numbers 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/Steal/Guest)"), &(settings->pl->detailedCPUTime), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Tree view"), &(settings->pl->treeView), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Shadow other users' processes"), &(settings->pl->shadowOtherUsers), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Hide kernel threads"), &(settings->pl->hideKernelThreads), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Hide userland threads"), &(settings->pl->hideUserlandThreads), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Display threads in a different color"), &(settings->pl->highlightThreads), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Show custom thread names"), &(settings->pl->showThreadNames), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Highlight program \"basename\""), &(settings->pl->highlightBaseName), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Highlight large numbers in memory counters"), &(settings->pl->highlightMegabytes), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Leave a margin around header"), &(settings->header->margin), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->pl->detailedCPUTime), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Count CPUs from 0 instead of 1"), &(settings->pl->countCPUsFromZero), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Update process names on every refresh"), &(settings->pl->updateProcessNames), false)); + Panel_add(super, (Object*) CheckItem_new(strdup("Add guest time in CPU meter percentage"), &(settings->pl->accountGuestInCPUMeter), false)); return this; } |