}
void
-drw_clr_create(Drw *drw, XftColor *dest, const char *clrname)
+drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
{
if (!drw || !dest || !clrname)
return;
/* Wrapper to create color schemes. The caller has to call free(3) on the
* returned color scheme when done using it. */
-Scm
+Clr *
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
{
size_t i;
- Scm ret;
+ Clr *ret;
/* need at least two colors for a scheme */
- if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor))))
+ if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(Clr))))
return NULL;
for (i = 0; i < clrcount; i++)
}
void
-drw_setscheme(Drw *drw, Scm scm)
+drw_setscheme(Drw *drw, Clr *scm)
{
if (drw)
drw->scheme = scm;
struct Fnt *next;
} Fnt;
-enum { ColFg, ColBg, ColCount }; /* Scm index */
-typedef XftColor *Scm;
+enum { ColFg, ColBg }; /* Clr scheme index */
+typedef XftColor Clr;
typedef struct {
unsigned int w, h;
Window root;
Drawable drawable;
GC gc;
- Scm scheme;
+ Clr *scheme;
Fnt *fonts;
} Drw;
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
/* Colorscheme abstraction */
-void drw_clr_create(Drw *drw, XftColor *dest, const char *clrname);
-Scm drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
+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);
/* 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);
static Atom wmatom[WMLast], netatom[NetLast];
static int running = 1;
static Cur *cursor[CurLast];
-static Scm *scheme;
+static Clr **scheme;
static Display *dpy;
static Drw *drw;
static Monitor *mons, *selmon;
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
/* init appearance */
- scheme = ecalloc(LENGTH(colors), sizeof(Scm));
+ scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 3);
/* init bars */