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.

80 lines
1.6 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. typedef struct _DDC DDC;
  3. /* X11 types - begin */
  4. typedef struct _XDraw Draw;
  5. struct _XDraw {
  6. unsigned int w, h;
  7. Display *dpy;
  8. Drawable drawable;
  9. GC gc;
  10. DDC *dc;
  11. };
  12. struct _XCol {
  13. unsigned long rgb;
  14. };
  15. typedef struct _XCol Col;
  16. struct _XFont {
  17. int ascent;
  18. int descent;
  19. unsigned int h, w;
  20. XFontSet set;
  21. XFontStruct *xfont;
  22. };
  23. typedef struct _XFont Fnt;
  24. /* X11 types - end */
  25. struct _DDC {
  26. Draw *draw;
  27. Col *fg;
  28. Col *bg;
  29. Fnt *font;
  30. Bool fill;
  31. DDC *next;
  32. };
  33. typedef struct {
  34. unsigned int w;
  35. unsigned int h;
  36. int x;
  37. int y;
  38. int xOff;
  39. int yOff;
  40. } TextExtents;
  41. /* Drawable abstraction */
  42. Draw *draw_create(Display *dpy, Window win, unsigned int w, unsigned int h);
  43. void draw_resize(Draw *draw, unsigned int w, unsigned int h);
  44. void draw_free(Draw *draw);
  45. /* Drawing context abstraction */
  46. DDC *dc_create(Draw *draw);
  47. void dc_free(DDC *dc);
  48. /* Fnt abstraction */
  49. Fnt *font_create(const char *fontname);
  50. void font_free(Fnt *font);
  51. /* Colour abstraction */
  52. Col *col_create(const char *colname);
  53. void col_free(Col *col);
  54. /* Drawing context manipulation */
  55. void dc_setfont(DDC *dc, Fnt *font);
  56. void dc_setfg(DDC *dc, Col *col);
  57. void dc_setbg(DDC *dc, Col *col);
  58. void dc_setfill(DDC *dc, Bool fill);
  59. /* Drawing functions */
  60. void dc_drawrect(DDC *dc, int x, int y, unsigned int w, unsigned int h);
  61. void dc_drawtext(DDC *dc, int x, int y, const char *text);
  62. /* Map functions */
  63. void dc_map(DDC *dc, int x, int y, unsigned int w, unsigned int h);
  64. /* Text functions */
  65. void dc_getextents(DDC *dc, const char *text, TextExtents *extents);