aboutsummaryrefslogtreecommitdiff
path: root/dmenu.h
blob: 4cc13f4635cddbe2b7d4c4d0ae781f4b8b4a074c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <X11/Xlib.h>
#include <draw.h>
#include "config.h"

/* macros */
#define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH))
#define MIN(a, b)               ((a) < (b) ? (a) : (b))
#define MAX(a, b)               ((a) > (b) ? (a) : (b))
#define IS_UTF8_1ST_CHAR(c)     ((((c) & 0xc0) == 0xc0) || !((c) & 0x80))

/* forward declarations */
void drawbar(void);
void grabkeyboard(void);
void kpress(XKeyEvent *e);
void run(void);
void setup(unsigned int lines);

/* variables */
extern char *prompt;
extern char text[4096];
extern int promptw;
extern int screen;
extern unsigned int numlockmask;
extern unsigned int mw, mh;
extern unsigned long normcol[ColLast];
extern unsigned long selcol[ColLast];
extern Bool topbar;
extern DC dc;
extern Display *dpy;
extern Window win, root;