aboutsummaryrefslogtreecommitdiffstats
path: root/Panel.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:33 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:33 +0200
commitf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (patch)
tree2a046e11678e798f3f9c7f7af4f9ac205c8d2731 /Panel.h
parent2004bbc3ef28ada3acca05f5d5fa9108121a6784 (diff)
downloaddebian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.gz
debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.tar.bz2
debian_htop-f75ab6d2c11e8a8e18191b087564aedebbeb96c5.zip
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'Panel.h')
-rw-r--r--Panel.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/Panel.h b/Panel.h
index 3f35583..91c0a40 100644
--- a/Panel.h
+++ b/Panel.h
@@ -26,19 +26,28 @@ typedef enum HandlerResult_ {
typedef HandlerResult(*Panel_EventHandler)(Panel*, int);
+typedef struct PanelClass_ {
+ const ObjectClass super;
+ const Panel_EventHandler eventHandler;
+} PanelClass;
+
+#define As_Panel(this_) ((PanelClass*)((this_)->super.klass))
+#define Panel_eventHandlerFn(this_) As_Panel(this_)->eventHandler
+#define Panel_eventHandler(this_, ev_) As_Panel(this_)->eventHandler((Panel*)(this_), ev_)
+
struct Panel_ {
Object super;
+ PanelClass* class;
int x, y, w, h;
WINDOW* window;
Vector* items;
int selected;
- int scrollV, scrollH;
- int scrollHAmount;
int oldSelected;
+ char* eventHandlerBuffer;
+ int scrollV;
+ short scrollH;
bool needsRedraw;
RichString header;
- Panel_EventHandler eventHandler;
- char* eventHandlerBuffer;
};
@@ -49,22 +58,18 @@ struct Panel_ {
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
-#ifdef DEBUG
-extern char* PANEL_CLASS;
-#else
-#define PANEL_CLASS NULL
-#endif
-
#define KEY_CTRLN 0016 /* control-n key */
#define KEY_CTRLP 0020 /* control-p key */
#define KEY_CTRLF 0006 /* control-f key */
#define KEY_CTRLB 0002 /* control-b key */
-Panel* Panel_new(int x, int y, int w, int h, char* type, bool owner, Object_Compare compare);
+extern PanelClass Panel_class;
+
+Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type);
void Panel_delete(Object* cast);
-void Panel_init(Panel* this, int x, int y, int w, int h, char* type, bool owner);
+void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner);
void Panel_done(Panel* this);
@@ -72,8 +77,6 @@ RichString* Panel_getHeader(Panel* this);
extern void Panel_setHeader(Panel* this, const char* header);
-void Panel_setEventHandler(Panel* this, Panel_EventHandler eh);
-
void Panel_move(Panel* this, int x, int y);
void Panel_resize(Panel* this, int w, int h);

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