aboutsummaryrefslogtreecommitdiffstats
path: root/Panel.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
commitff9409b1737627857eb47f64f536a3f66b6a09a4 (patch)
tree61b631ba551e68a4f656b8b76ff7bd0d9955fc64 /Panel.h
parentf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (diff)
downloaddebian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.gz
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.bz2
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.zip
Imported Upstream version 2.0.0upstream/2.0.0
Diffstat (limited to 'Panel.h')
-rw-r--r--Panel.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/Panel.h b/Panel.h
index 91c0a40..6789770 100644
--- a/Panel.h
+++ b/Panel.h
@@ -13,16 +13,24 @@ in the source distribution for its full text.
#include "Object.h"
#include "Vector.h"
+#include "FunctionBar.h"
typedef struct Panel_ Panel;
typedef enum HandlerResult_ {
- HANDLED,
- IGNORED,
- BREAK_LOOP
+ HANDLED = 0x01,
+ IGNORED = 0x02,
+ BREAK_LOOP = 0x04,
+ REDRAW = 0x08,
+ RESCAN = 0x10,
+ SYNTH_KEY = 0x20,
} HandlerResult;
-#define EVENT_SETSELECTED -1
+#define EVENT_SET_SELECTED -1
+
+#define EVENT_HEADER_CLICK(x_) (-10000 + x_)
+#define EVENT_IS_HEADER_CLICK(ev_) (ev_ >= -10000 && ev_ <= -9000)
+#define EVENT_HEADER_CLICK_GET_X(ev_) (ev_ + 10000)
typedef HandlerResult(*Panel_EventHandler)(Panel*, int);
@@ -37,19 +45,23 @@ typedef struct PanelClass_ {
struct Panel_ {
Object super;
- PanelClass* class;
int x, y, w, h;
WINDOW* window;
Vector* items;
int selected;
int oldSelected;
- char* eventHandlerBuffer;
+ void* eventHandlerState;
int scrollV;
short scrollH;
bool needsRedraw;
+ FunctionBar* currentBar;
+ FunctionBar* defaultBar;
RichString header;
+ int selectionColor;
};
+#define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0)
+
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@@ -65,14 +77,16 @@ struct Panel_ {
extern PanelClass Panel_class;
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type);
+Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar);
void Panel_delete(Object* cast);
-void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner);
+void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar);
void Panel_done(Panel* this);
+void Panel_setSelectionColor(Panel* this, int color);
+
RichString* Panel_getHeader(Panel* this);
extern void Panel_setHeader(Panel* this, const char* header);

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