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.

41 lines
1.1 KiB

18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
17 years ago
18 years ago
18 years ago
17 years ago
  1. /* See LICENSE file for copyright and license details. */
  2. #include <X11/Xlib.h>
  3. #define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
  4. #define NORMBGCOLOR "#eeeeee"
  5. #define NORMFGCOLOR "#222222"
  6. #define SELBGCOLOR "#006699"
  7. #define SELFGCOLOR "#ffffff"
  8. #define SPACE 30 /* px */
  9. /* color */
  10. enum { ColFG, ColBG, ColLast };
  11. typedef struct {
  12. int x, y, w, h;
  13. unsigned long norm[ColLast];
  14. unsigned long sel[ColLast];
  15. Drawable drawable;
  16. GC gc;
  17. struct {
  18. XFontStruct *xfont;
  19. XFontSet set;
  20. int ascent;
  21. int descent;
  22. int height;
  23. } font;
  24. } DC; /* draw context */
  25. extern int screen;
  26. extern Display *dpy;
  27. extern DC dc; /* global drawing context */
  28. /* draw.c */
  29. void drawtext(const char *text, unsigned long col[ColLast]);
  30. unsigned int textw(const char *text);
  31. unsigned int textnw(const char *text, unsigned int len);
  32. /* util.c */
  33. void *emalloc(unsigned int size); /* allocates memory, exits on error */
  34. void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
  35. char *estrdup(const char *str); /* duplicates str, exits on allocation error */