Adding config.mk
[xmenu] / xmenu.h
... / ...
CommitLineData
1#define PROGNAME "xmenu"
2
3/* macros for keyboard menu navigation */
4#define ITEMPREV 0
5#define ITEMNEXT 1
6
7/* macros */
8#define LEN(x) (sizeof (x) / sizeof (x[0]))
9#define MAX(x,y) ((x)>(y)?(x):(y))
10#define MIN(x,y) ((x)<(y)?(x):(y))
11#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
12
13/* color enum */
14enum {ColorFG, ColorBG, ColorLast};
15
16/* EWMH atoms */
17enum {NetWMName, NetWMWindowType, NetWMWindowTypePopupMenu, NetLast};
18
19/* configuration structure */
20struct Config {
21 /* the values below are set by config.h */
22 const char *font;
23 const char *background_color;
24 const char *foreground_color;
25 const char *selbackground_color;
26 const char *selforeground_color;
27 const char *separator_color;
28 const char *border_color;
29 int width_pixels;
30 int height_pixels;
31 int border_pixels;
32 int separator_pixels;
33 int gap_pixels;
34 int triangle_width;
35 int triangle_height;
36 int iconpadding;
37 int horzpadding;
38
39 /* the values below are set by options */
40 int monitor;
41 int posx, posy; /* rootmenu position */
42
43 /* the value below is computed by xmenu */
44 int iconsize;
45 int screenw, screenh; /* screen width and height */
46};
47
48/* draw context structure */
49struct DC {
50 XftColor normal[ColorLast];
51 XftColor selected[ColorLast];
52 XftColor border;
53 XftColor separator;
54
55 GC gc;
56
57 XftFont **fonts;
58 size_t nfonts;
59};
60
61/* menu item structure */
62struct Item {
63 char *label; /* string to be drawed on menu */
64 char *output; /* string to be outputed when item is clicked */
65 char *file; /* filename of the icon */
66 int y; /* item y position relative to menu */
67 int h; /* item height */
68 size_t labellen; /* strlen(label) */
69 struct Item *prev; /* previous item */
70 struct Item *next; /* next item */
71 struct Menu *submenu; /* submenu spawned by clicking on item */
72 Drawable sel, unsel; /* pixmap for selected and unselected item */
73 Imlib_Image icon;
74};
75
76/* monitor and cursor geometry structure */
77struct Monitor {
78 int x, y, w, h; /* monitor geometry */
79};
80
81/* menu structure */
82struct Menu {
83 struct Menu *parent; /* parent menu */
84 struct Item *caller; /* item that spawned the menu */
85 struct Item *list; /* list of items contained by the menu */
86 struct Item *selected; /* item currently selected in the menu */
87 int x, y, w, h; /* menu geometry */
88 int drawn; /* whether the menu was already drawn */
89 unsigned level; /* menu level relative to root */
90 Window win; /* menu window to map on the screen */
91};