summaryrefslogtreecommitdiff
path: root/drw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drw.h')
-rw-r--r--drw.h28
1 files changed, 10 insertions, 18 deletions
diff --git a/drw.h b/drw.h
index a2a586a..4c67419 100644
--- a/drw.h
+++ b/drw.h
@@ -1,27 +1,19 @@
/* See LICENSE file for copyright and license details. */
-#define DRW_FONT_CACHE_SIZE 32
typedef struct {
Cursor cursor;
} Cur;
-typedef struct Fnt Fnt;
-struct Fnt {
+typedef struct Fnt {
Display *dpy;
- int ascent;
- int descent;
unsigned int h;
XftFont *xfont;
FcPattern *pattern;
- Fnt *next;
-};
+ struct Fnt *next;
+} Fnt;
-typedef struct {
- struct {
- unsigned long pix;
- XftColor rgb;
- } fg, bg;
-} Scm;
+enum { ColFg, ColBg }; /* Clr scheme index */
+typedef XftColor Clr;
typedef struct {
unsigned int w, h;
@@ -30,7 +22,7 @@ typedef struct {
Window root;
Drawable drawable;
GC gc;
- Scm *scheme;
+ Clr *scheme;
Fnt *fonts;
} Drw;
@@ -46,8 +38,8 @@ unsigned int drw_fontset_getwidth(Drw *drw, const char *text);
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
/* Colorscheme abstraction */
-Scm *drw_scm_create(Drw *drw, const char *fgname, const char *bgname);
-void drw_scm_free(Scm *scm);
+void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
+Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
/* Cursor abstraction */
Cur *drw_cur_create(Drw *drw, int shape);
@@ -55,11 +47,11 @@ void drw_cur_free(Drw *drw, Cur *cursor);
/* Drawing context manipulation */
void drw_setfontset(Drw *drw, Fnt *set);
-void drw_setscheme(Drw *drw, Scm *scm);
+void drw_setscheme(Drw *drw, Clr *scm);
/* Drawing functions */
void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert);
-int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert);
+int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert);
/* Map functions */
void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h);