dmenu for lunch applications in dwm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
911 B

18 years ago
18 years ago
18 years ago
18 years ago
  1. /*
  2. * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  3. * See LICENSE file for license details.
  4. */
  5. #include "config.h"
  6. #include <X11/Xlib.h>
  7. #include <X11/Xlocale.h>
  8. #define SPACE 30 /* px */
  9. typedef struct DC DC;
  10. typedef struct Fnt Fnt;
  11. struct Fnt {
  12. XFontStruct *xfont;
  13. XFontSet set;
  14. int ascent;
  15. int descent;
  16. int height;
  17. };
  18. struct DC { /* draw context */
  19. int x, y, w, h;
  20. unsigned long bg;
  21. unsigned long fg;
  22. unsigned long border;
  23. Drawable drawable;
  24. Fnt font;
  25. GC gc;
  26. };
  27. extern int screen;
  28. extern Display *dpy;
  29. extern DC dc;
  30. /* draw.c */
  31. extern void drawtext(const char *text, Bool invert, Bool border);
  32. extern unsigned long getcolor(const char *colstr);
  33. extern void setfont(const char *fontstr);
  34. extern unsigned int textw(const char *text);
  35. /* util.c */
  36. extern void *emalloc(unsigned int size);
  37. extern void eprint(const char *errstr, ...);
  38. extern char *estrdup(const char *str);