My dmenu build
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

53 строки
1.3 KiB

  1. /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
  2. * See LICENSE file for license details.
  3. */
  4. #include <X11/Xlib.h>
  5. #include <X11/Xlocale.h>
  6. #define FONT "fixed"
  7. #define NORMBGCOLOR "#333366"
  8. #define NORMFGCOLOR "#cccccc"
  9. #define SELBGCOLOR "#666699"
  10. #define SELFGCOLOR "#eeeeee"
  11. #define SPACE 30 /* px */
  12. /* color */
  13. enum { ColFG, ColBG, ColLast };
  14. typedef struct DC DC;
  15. typedef struct Fnt Fnt;
  16. struct Fnt {
  17. XFontStruct *xfont;
  18. XFontSet set;
  19. int ascent;
  20. int descent;
  21. int height;
  22. };
  23. struct DC {
  24. int x, y, w, h;
  25. unsigned long norm[ColLast];
  26. unsigned long sel[ColLast];
  27. Drawable drawable;
  28. Fnt font;
  29. GC gc;
  30. }; /* draw context */
  31. extern int screen;
  32. extern Display *dpy;
  33. extern DC dc; /* global drawing context */
  34. /* draw.c */
  35. extern void drawtext(const char *text,
  36. unsigned long col[ColLast]); /* draws text with the defined color tuple */
  37. extern unsigned long getcolor(const char *colstr); /* returns color of colstr */
  38. extern void setfont(const char *fontstr); /* sets global font */
  39. extern unsigned int textw(const char *text); /* returns width of text in px */
  40. /* util.c */
  41. extern void *emalloc(unsigned int size); /* allocates memory, exits on error */
  42. extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
  43. extern char *estrdup(const char *str); /* duplicates str, exits on allocation error */