My dmenu build
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

42 linhas
1.0 KiB

  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. int screen;
  26. Display *dpy;
  27. 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 */