aboutsummaryrefslogtreecommitdiffstats
path: root/Panel.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
committerDaniel Lange <DLange@git.local>2020-12-07 10:26:01 +0100
commit65357c8c46154de4e4eca14075bfe5523bb5fc14 (patch)
tree8f430ee5a0d5de377c4e7c94e47842a27c70d7e8 /Panel.h
parentf80394a20254938142011855f2954b3f63fe5909 (diff)
downloaddebian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.gz
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.tar.bz2
debian_htop-65357c8c46154de4e4eca14075bfe5523bb5fc14.zip
New upstream version 3.0.3upstream/3.0.3
Diffstat (limited to 'Panel.h')
-rw-r--r--Panel.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/Panel.h b/Panel.h
index 480e2c0..86c134e 100644
--- a/Panel.h
+++ b/Panel.h
@@ -3,14 +3,19 @@
/*
htop - Panel.h
(C) 2004-2011 Hisham H. Muhammad
-Released under the GNU GPL, see the COPYING file
+Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
+#include <stdbool.h>
+
+#include "FunctionBar.h"
#include "Object.h"
+#include "RichString.h"
#include "Vector.h"
-#include "FunctionBar.h"
+
+struct Panel_;
typedef struct Panel_ Panel;
typedef enum HandlerResult_ {
@@ -22,11 +27,11 @@ typedef enum HandlerResult_ {
SYNTH_KEY = 0x20,
} HandlerResult;
-#define EVENT_SET_SELECTED -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)
+#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);
@@ -35,14 +40,13 @@ typedef struct PanelClass_ {
const Panel_EventHandler eventHandler;
} PanelClass;
-#define As_Panel(this_) ((PanelClass*)((this_)->super.klass))
+#define As_Panel(this_) ((const 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;
int x, y, w, h;
- WINDOW* window;
Vector* items;
int selected;
int oldSelected;
@@ -57,17 +61,17 @@ struct Panel_ {
int selectionColor;
};
-#define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0)
+#define Panel_setDefaultBar(this_) do { (this_)->currentBar = (this_)->defaultBar; } while (0)
#define KEY_CTRL(l) ((l)-'A'+1)
-extern PanelClass Panel_class;
+extern const PanelClass Panel_class;
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar);
+Panel* Panel_new(int x, int y, int w, int h, bool owner, const 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, FunctionBar* fuBar);
+void Panel_init(Panel* this, int x, int y, int w, int h, const ObjectClass* type, bool owner, FunctionBar* fuBar);
void Panel_done(Panel* this);
@@ -105,9 +109,9 @@ int Panel_size(Panel* this);
void Panel_setSelected(Panel* this, int selected);
-void Panel_draw(Panel* this, bool focus);
+void Panel_draw(Panel* this, bool focus, bool highlightSelected);
-void Panel_splice(Panel *this, Vector* from);
+void Panel_splice(Panel* this, Vector* from);
bool Panel_onKey(Panel* this, int key);

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