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.

69 lines
1.6 KiB

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