My dmenu build
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 
 

36 rader
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. int width;
  16. XFontSet set;
  17. XFontStruct *xfont;
  18. } font;
  19. } DC; /* draw context */
  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 eprintf(const char *fmt, ...);
  24. void freedc(DC *dc);
  25. unsigned long getcolor(DC *dc, const char *colstr);
  26. DC *initdc(void);
  27. void initfont(DC *dc, const char *fontstr);
  28. void mapdc(DC *dc, Window win, unsigned int w, unsigned int h);
  29. void resizedc(DC *dc, unsigned int w, unsigned int h);
  30. int textnw(DC *dc, const char *text, size_t len);
  31. int textw(DC *dc, const char *text);