Configuration of dwm for Mac Computers
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.

61 lines
1.4 KiB

  1. /* See LICENSE file for copyright and license details. */
  2. typedef struct {
  3. unsigned long rgb;
  4. } Clr;
  5. typedef struct {
  6. int ascent;
  7. int descent;
  8. unsigned int h;
  9. XFontSet set;
  10. XFontStruct *xfont;
  11. } Fnt;
  12. typedef struct {
  13. unsigned int w, h;
  14. Display *dpy;
  15. int screen;
  16. Window win;
  17. Drawable drwable;
  18. GC gc;
  19. Clr *fg;
  20. Clr *bg;
  21. Fnt *font;
  22. } Drw;
  23. typedef struct {
  24. unsigned int w;
  25. unsigned int h;
  26. int xOff;
  27. int yOff;
  28. } Extnts;
  29. /* Drawable abstraction */
  30. Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
  31. void drw_resize(Drw *drw, unsigned int w, unsigned int h);
  32. void drw_free(Drw *drw);
  33. /* Fnt abstraction */
  34. Fnt *drw_font_create(Drw *drw, const char *fontname);
  35. void drw_font_free(Drw *drw, Fnt *font);
  36. /* Clrour abstraction */
  37. Clr *drw_clr_create(Drw *drw, const char *clrname);
  38. void drw_clr_free(Drw *drw, Clr *clr);
  39. /* Drawing context manipulation */
  40. void drw_setfont(Drw *drw, Fnt *font);
  41. void drw_setfg(Drw *drw, Clr *clr);
  42. void drw_setbg(Drw *drw, Clr *clr);
  43. /* Drawing functions */
  44. void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, Bool filled, Bool empty, Bool invert);
  45. void drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, Bool invert);
  46. /* Map functions */
  47. void drw_map(Drw *drw, int x, int y, unsigned int w, unsigned int h);
  48. /* Text functions */
  49. void drw_getexts(Drw *drw, const char *text, unsigned int len, Extnts *extnts);