diff options
author | Connor Lane Smith <cls@lubutu.com> | 2010-06-23 13:29:15 +0100 |
---|---|---|
committer | Connor Lane Smith <cls@lubutu.com> | 2010-06-23 13:29:15 +0100 |
commit | 595e7976601fc77acf12015d3f5f6843e2cdd706 (patch) | |
tree | 1442293d945d760e548ed4a335a89e2a1e3bddce /dinput.c | |
parent | bba30e26863c75e66678f9d028d394883d86150a (diff) |
added draw.h
Diffstat (limited to 'dinput.c')
-rw-r--r-- | dinput.c | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -25,32 +25,27 @@ static void cleanup(void); static void drawcursor(void); static void drawinput(void); -static void eprint(const char *errstr, ...); static Bool grabkeyboard(void); static void kpress(XKeyEvent * e); static void run(void); static void setup(Bool topbar); #include "config.h" +#include "draw.h" /* variables */ static char *prompt = NULL; static char text[4096]; static int promptw = 0; static int ret = 0; -static int screen; -static unsigned int mw, mh; static unsigned int cursor = 0; static unsigned int numlockmask = 0; static Bool running = True; -static Display *dpy; -static Window parent, win; - -#include "draw.c" +static Window win; void cleanup(void) { - dccleanup(); + drawcleanup(); XDestroyWindow(dpy, win); XUngrabKeyboard(dpy, CurrentTime); } @@ -86,16 +81,6 @@ drawinput(void) XFlush(dpy); } -void -eprint(const char *errstr, ...) { - va_list ap; - - va_start(ap, errstr); - vfprintf(stderr, errstr, ap); - va_end(ap); - exit(EXIT_FAILURE); -} - Bool grabkeyboard(void) { unsigned int len; @@ -318,7 +303,7 @@ setup(Bool topbar) { DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); - dcsetup(); + drawsetup(); if(prompt) promptw = MIN(textw(prompt), mw / 5); cursor = strlen(text); |