projects
/
xmenu
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move actions to end of main loop
[xmenu]
/
xmenu.h
diff --git
a/xmenu.h
b/xmenu.h
index
ecb0d14
..
ee420da
100644
(file)
--- a/
xmenu.h
+++ b/
xmenu.h
@@
-1,5
+1,10
@@
#define PROGNAME "xmenu"
#define PROGNAME "xmenu"
+/* Actions for the main loop */
+#define ACTION_NOP 0
+#define ACTION_MAP 1<<0
+#define ACTION_DRAW 1<<1
+
/* enum for keyboard menu navigation */
enum { ITEMPREV, ITEMNEXT, ITEMFIRST, ITEMLAST };
/* enum for keyboard menu navigation */
enum { ITEMPREV, ITEMNEXT, ITEMFIRST, ITEMLAST };
@@
-11,6
+16,11
@@
enum {LeftAlignment, CenterAlignment, RightAlignment};
#define MAX(x,y) ((x)>(y)?(x):(y))
#define MIN(x,y) ((x)<(y)?(x):(y))
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
#define MAX(x,y) ((x)>(y)?(x):(y))
#define MIN(x,y) ((x)<(y)?(x):(y))
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
+#define GETNUM(n, s) { \
+ unsigned long __TMP__; \
+ if ((__TMP__ = strtoul((s), NULL, 10)) < INT_MAX) \
+ (n) = __TMP__; \
+ }
/* color enum */
enum {ColorFG, ColorBG, ColorLast};
/* color enum */
enum {ColorFG, ColorBG, ColorLast};
@@
-93,4
+103,5
@@
struct Menu {
int maxtextw; /* maximum text width */
unsigned level; /* menu level relative to root */
Window win; /* menu window to map on the screen */
int maxtextw; /* maximum text width */
unsigned level; /* menu level relative to root */
Window win; /* menu window to map on the screen */
+ XIC xic; /* input context */
};
};