1 /* See LICENSE file for copyright and license details. */
15 enum { ColFg
, ColBg
, ColBorder
}; /* Clr scheme index */
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
);
35 Fnt
*drw_fontset_create(Drw
* drw
, const char *fonts
[], size_t fontcount
);
36 void drw_fontset_free(Fnt
* set
);
37 unsigned int drw_fontset_getwidth(Drw
*drw
, const char *text
);
38 void drw_font_getexts(Fnt
*font
, const char *text
, unsigned int len
, unsigned int *w
, unsigned int *h
);
40 /* Colorscheme abstraction */
41 void drw_clr_create(Drw
*drw
, Clr
*dest
, const char *clrname
);
42 Clr
*drw_scm_create(Drw
*drw
, const char *clrnames
[], size_t clrcount
);
44 /* Cursor abstraction */
45 Cur
*drw_cur_create(Drw
*drw
, int shape
);
46 void drw_cur_free(Drw
*drw
, Cur
*cursor
);
48 /* Drawing context manipulation */
49 void drw_setfontset(Drw
*drw
, Fnt
*set
);
50 void drw_setscheme(Drw
*drw
, Clr
*scm
);
52 /* Drawing functions */
53 void drw_rect(Drw
*drw
, int x
, int y
, unsigned int w
, unsigned int h
, int filled
, int invert
);
54 int drw_text(Drw
*drw
, int x
, int y
, unsigned int w
, unsigned int h
, unsigned int lpad
, const char *text
, int invert
);
57 void drw_map(Drw
*drw
, Window win
, int x
, int y
, unsigned int w
, unsigned int h
);