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.

45 lines
875 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. Drawable drawable;
  23. Fnt font;
  24. GC gc;
  25. };
  26. extern int screen;
  27. extern Display *dpy;
  28. extern DC dc;
  29. /* draw.c */
  30. extern void drawtext(const char *text, Bool invert);
  31. extern unsigned long getcolor(const char *colstr);
  32. extern void setfont(const char *fontstr);
  33. extern unsigned int textw(const char *text);
  34. /* util.c */
  35. extern void *emalloc(unsigned int size);
  36. extern void eprint(const char *errstr, ...);
  37. extern char *estrdup(const char *str);