aboutsummaryrefslogtreecommitdiffstats
path: root/AffinityPanel.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
commitc74c38760df69bb87e93dff18cf91464e5d02f37 (patch)
treeee2a19a0ef3a808bdfc8c1e6a00e96d79966dcb0 /AffinityPanel.c
parent9379132a8234eeedf62d37ef57713e52c12db6ab (diff)
downloaddebian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.gz
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.bz2
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.zip
Imported Upstream version 0.8.1upstream/0.8.1
Diffstat (limited to 'AffinityPanel.c')
-rw-r--r--AffinityPanel.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/AffinityPanel.c b/AffinityPanel.c
index 73cf165..47791ff 100644
--- a/AffinityPanel.c
+++ b/AffinityPanel.c
@@ -7,6 +7,24 @@
#include "debug.h"
#include <assert.h>
+static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
+ HandlerResult result = IGNORED;
+ CheckItem* selected = (CheckItem*) Panel_getSelected(this);
+ switch(ch) {
+ case KEY_MOUSE:
+ case ' ':
+ CheckItem_set(selected, ! (CheckItem_get(selected)) );
+ result = HANDLED;
+ break;
+ case 0x0a:
+ case 0x0d:
+ case KEY_ENTER:
+ result = BREAK_LOOP;
+ break;
+ }
+ return result;
+}
+
Panel* AffinityPanel_new(int processorCount, unsigned long mask) {
Panel* this = Panel_new(1, 1, 1, 1, CHECKITEM_CLASS, true, ListItem_compare);
this->eventHandler = AffinityPanel_eventHandler;
@@ -29,17 +47,3 @@ unsigned long AffinityPanel_getAffinity(Panel* this) {
}
return mask;
}
-
-HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
- HandlerResult result = IGNORED;
- CheckItem* selected = (CheckItem*) Panel_getSelected(this);
- switch(ch) {
- case 0x0a:
- case 0x0d:
- case KEY_ENTER:
- case ' ':
- CheckItem_set(selected, ! (CheckItem_get(selected)) );
- result = HANDLED;
- }
- return result;
-}

© 2014-2024 Faster IT GmbH | imprint | privacy policy