My dmenu build
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.
 
 
 
 
 
 

49 lines
956 B

  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. /* color */
  10. enum { ColFG, ColBG, ColLast };
  11. typedef struct DC DC;
  12. typedef struct Fnt Fnt;
  13. struct Fnt {
  14. XFontStruct *xfont;
  15. XFontSet set;
  16. int ascent;
  17. int descent;
  18. int height;
  19. };
  20. struct DC { /* draw context */
  21. int x, y, w, h;
  22. unsigned long norm[ColLast];
  23. unsigned long sel[ColLast];
  24. Drawable drawable;
  25. Fnt font;
  26. GC gc;
  27. };
  28. extern int screen;
  29. extern Display *dpy;
  30. extern DC dc;
  31. /* draw.c */
  32. extern void drawtext(const char *text, unsigned long col[ColLast]);
  33. extern unsigned long getcolor(const char *colstr);
  34. extern void setfont(const char *fontstr);
  35. extern unsigned int textw(const char *text);
  36. /* util.c */
  37. extern void *emalloc(unsigned int size);
  38. extern void eprint(const char *errstr, ...);
  39. extern char *estrdup(const char *str);