#define PROGNAME "xmenu"
+/* Actions for the main loop */
+#define ACTION_NOP 0
+#define ACTION_CLEAR 1<<0 /* clear text */
+#define ACTION_SELECT 1<<1 /* select item */
+#define ACTION_MAP 1<<2 /* remap menu windows */
+#define ACTION_DRAW 1<<3 /* redraw menu windows */
+#define ACTION_WARP 1<<4 /* warp the pointer */
+
/* enum for keyboard menu navigation */
enum { ITEMPREV, ITEMNEXT, ITEMFIRST, ITEMLAST };
#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};
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 */
};