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.
 
 
 
 
 
 

38 lines
1.1 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. #define FG(dc, col) ((col)[(dc)->invert ? ColBG : ColFG])
  3. #define BG(dc, col) ((col)[(dc)->invert ? ColFG : ColBG])
  4. enum { ColBG, ColFG, ColBorder, ColLast };
  5. typedef struct {
  6. int x, y, w, h;
  7. Bool invert;
  8. Display *dpy;
  9. GC gc;
  10. Pixmap canvas;
  11. struct {
  12. int ascent;
  13. int descent;
  14. int height;
  15. XFontSet set;
  16. XFontStruct *xfont;
  17. } font;
  18. } DC; /* draw context */
  19. unsigned long getcolor(DC *dc, const char *colstr);
  20. void drawrect(DC *dc, int x, int y, unsigned int w, unsigned int h, Bool fill, unsigned long color);
  21. void drawtext(DC *dc, const char *text, unsigned long col[ColLast]);
  22. void drawtextn(DC *dc, const char *text, size_t n, unsigned long col[ColLast]);
  23. void initfont(DC *dc, const char *fontstr);
  24. void freedc(DC *dc);
  25. DC *initdc(void);
  26. void mapdc(DC *dc, Window win, unsigned int w, unsigned int h);
  27. void resizedc(DC *dc, unsigned int w, unsigned int h);
  28. int textnw(DC *dc, const char *text, size_t len);
  29. int textw(DC *dc, const char *text);
  30. void eprintf(const char *fmt, ...);
  31. void weprintf(const char *fmt, ...);
  32. const char *progname;