X-Git-Url: https://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/27c03246ca5fe2612ec0dd80f3c5fcabf249f87d..c90d164c0aec8cfd6bafcad6d1c5adb81c86cf1f:/xmenu.h diff --git a/xmenu.h b/xmenu.h index ecb0d14..b5f1556 100644 --- a/xmenu.h +++ b/xmenu.h @@ -1,5 +1,12 @@ #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 */ + /* enum for keyboard menu navigation */ enum { ITEMPREV, ITEMNEXT, ITEMFIRST, ITEMLAST }; @@ -11,6 +18,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 GETNUM(n, s) { \ + unsigned long __TMP__; \ + if ((__TMP__ = strtoul((s), NULL, 10)) < INT_MAX) \ + (n) = __TMP__; \ + } /* color enum */ enum {ColorFG, ColorBG, ColorLast}; @@ -93,4 +105,5 @@ struct Menu { 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 */ };