Configuration file for DWM on MacBook Air
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.

64 lines
1.5 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. struct _XCol {
  3. unsigned long rgb;
  4. };
  5. typedef struct _XCol Col;
  6. struct _XFont {
  7. int ascent;
  8. int descent;
  9. unsigned int h;
  10. XFontSet set;
  11. XFontStruct *xfont;
  12. };
  13. typedef struct _XFont Fnt;
  14. typedef struct _XDraw Draw;
  15. struct _XDraw {
  16. unsigned int w, h;
  17. Display *dpy;
  18. int screen;
  19. Window win;
  20. Drawable drawable;
  21. GC gc;
  22. Col *fg;
  23. Col *bg;
  24. Fnt *font;
  25. };
  26. typedef struct {
  27. unsigned int w;
  28. unsigned int h;
  29. int xOff;
  30. int yOff;
  31. } TextExtents;
  32. /* Drawable abstraction */
  33. Draw *draw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
  34. void draw_resize(Draw *draw, unsigned int w, unsigned int h);
  35. void draw_free(Draw *draw);
  36. /* Fnt abstraction */
  37. Fnt *draw_font_create(Draw *draw, const char *fontname);
  38. void draw_font_free(Draw *draw, Fnt *font);
  39. /* Colour abstraction */
  40. Col *draw_col_create(Draw *draw, const char *colname);
  41. void draw_col_free(Draw *draw, Col *col);
  42. /* Drawing context manipulation */
  43. void draw_setfont(Draw *draw, Fnt *font);
  44. void draw_setfg(Draw *draw, Col *col);
  45. void draw_setbg(Draw *draw, Col *col);
  46. /* Drawing functions */
  47. void draw_rect(Draw *draw, int x, int y, unsigned int w, unsigned int h, Bool filled, Bool empty, Bool invert);
  48. void draw_text(Draw *draw, int x, int y, unsigned int w, unsigned int h, const char *text, Bool invert);
  49. /* Map functions */
  50. void draw_map(Draw *draw, int x, int y, unsigned int w, unsigned int h);
  51. /* Text functions */
  52. void draw_getextents(Draw *draw, const char *text, unsigned int len, TextExtents *extents);