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.

76 lines
1.5 KiB

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