Streamline xcolor_t.
Do not have a ->name char * field, but a char[32] instead. This isn't a big problem, the longest color in /etc/X11/rgb.txt is 23 chars long, and if it becomes a problem one day, one could just strip the name and generate an hexadecimal representation on the fly instead. But allocating the name is asking for a lot of trouble. Since we do not allocate anything anymore, just don't allocate anything anymore at all, it avoids the mess of xcolor_copy/_wipe and fixes a lot of sleeping bugs (p_dup were used e.g., which is wrong). Pass xcolor_t *, xcolor_t becomes too big to be passed by value. Add consts at some places. xcolor_new allocates nothing, hence is renamed xcolor_init, has xcolor_t as a first argument (OO-style, this is self), and doesn't touch the structure at all if it returns false, which allow us to skip a lot of intermediates values. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
b8310ffd38
commit
924078c898
|
@ -401,8 +401,8 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
/* init default font and colors */
|
/* init default font and colors */
|
||||||
globalconf.font = draw_font_new(globalconf.connection, globalconf.default_screen, "sans 8");
|
globalconf.font = draw_font_new(globalconf.connection, globalconf.default_screen, "sans 8");
|
||||||
xcolor_new(globalconf.connection, globalconf.default_screen, "black", &globalconf.colors.fg);
|
xcolor_init(&globalconf.colors.fg, globalconf.connection, globalconf.default_screen, "black");
|
||||||
xcolor_new(globalconf.connection, globalconf.default_screen, "white", &globalconf.colors.bg);
|
xcolor_init(&globalconf.colors.bg, globalconf.connection, globalconf.default_screen, "white");
|
||||||
|
|
||||||
/* init cursors */
|
/* init cursors */
|
||||||
globalconf.cursor[CurNormal] = xutil_cursor_new(globalconf.connection, CURSOR_LEFT_PTR);
|
globalconf.cursor[CurNormal] = xutil_cursor_new(globalconf.connection, CURSOR_LEFT_PTR);
|
||||||
|
|
8
client.c
8
client.c
|
@ -1127,7 +1127,6 @@ luaA_client_newindex(lua_State *L)
|
||||||
bool b;
|
bool b;
|
||||||
double d;
|
double d;
|
||||||
int i;
|
int i;
|
||||||
xcolor_t color;
|
|
||||||
titlebar_t **t = NULL;
|
titlebar_t **t = NULL;
|
||||||
|
|
||||||
switch(a_tokenize(buf, len))
|
switch(a_tokenize(buf, len))
|
||||||
|
@ -1180,11 +1179,10 @@ luaA_client_newindex(lua_State *L)
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, (*c)->phys_screen, buf, &color))
|
&& xcolor_init(&(*c)->border_color, globalconf.connection, (*c)->phys_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*c)->border_color);
|
xcb_change_window_attributes(globalconf.connection, (*c)->win,
|
||||||
(*c)->border_color = color;
|
XCB_CW_BORDER_PIXEL, &(*c)->border_color.pixel);
|
||||||
xcb_change_window_attributes(globalconf.connection, (*c)->win, XCB_CW_BORDER_PIXEL, &color.pixel);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case A_TK_COORDS:
|
case A_TK_COORDS:
|
||||||
|
|
140
common/draw.c
140
common/draw.c
|
@ -133,7 +133,7 @@ draw_screen_default_visual(xcb_screen_t *s)
|
||||||
draw_context_t *
|
draw_context_t *
|
||||||
draw_context_new(xcb_connection_t *conn, int phys_screen,
|
draw_context_new(xcb_connection_t *conn, int phys_screen,
|
||||||
int width, int height, xcb_pixmap_t px,
|
int width, int height, xcb_pixmap_t px,
|
||||||
xcolor_t fg, xcolor_t bg)
|
const xcolor_t *fg, const xcolor_t *bg)
|
||||||
{
|
{
|
||||||
draw_context_t *d = p_new(draw_context_t, 1);
|
draw_context_t *d = p_new(draw_context_t, 1);
|
||||||
xcb_screen_t *s = xutil_screen_get(conn, phys_screen);
|
xcb_screen_t *s = xutil_screen_get(conn, phys_screen);
|
||||||
|
@ -148,8 +148,8 @@ draw_context_new(xcb_connection_t *conn, int phys_screen,
|
||||||
d->surface = cairo_xcb_surface_create(conn, px, d->visual, width, height);
|
d->surface = cairo_xcb_surface_create(conn, px, d->visual, width, height);
|
||||||
d->cr = cairo_create(d->surface);
|
d->cr = cairo_create(d->surface);
|
||||||
d->layout = pango_cairo_create_layout(d->cr);
|
d->layout = pango_cairo_create_layout(d->cr);
|
||||||
d->fg = fg;
|
d->fg = *fg;
|
||||||
d->bg = bg;
|
d->bg = *bg;
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
};
|
};
|
||||||
|
@ -220,8 +220,7 @@ draw_markup_on_element(markup_parser_data_t *p, const char *elem,
|
||||||
switch(a_tokenize(*names, -1))
|
switch(a_tokenize(*names, -1))
|
||||||
{
|
{
|
||||||
case A_TK_COLOR:
|
case A_TK_COLOR:
|
||||||
data->has_bg_color = xcolor_new(data->connection, data->phys_screen,
|
data->has_bg_color = xcolor_init(&data->bg_color, data->connection, data->phys_screen, *values);
|
||||||
*values, &data->bg_color);
|
|
||||||
break;
|
break;
|
||||||
case A_TK_IMAGE:
|
case A_TK_IMAGE:
|
||||||
if(data->bg_image)
|
if(data->bg_image)
|
||||||
|
@ -244,8 +243,8 @@ draw_markup_on_element(markup_parser_data_t *p, const char *elem,
|
||||||
data->align = draw_align_fromstr(*values, -1);
|
data->align = draw_align_fromstr(*values, -1);
|
||||||
break;
|
break;
|
||||||
case A_TK_SHADOW:
|
case A_TK_SHADOW:
|
||||||
xcolor_new(data->connection, data->phys_screen, *values,
|
xcolor_init(&data->shadow.color, data->connection,
|
||||||
&data->shadow.color);
|
data->phys_screen, *values);
|
||||||
break;
|
break;
|
||||||
case A_TK_SHADOW_OFFSET:
|
case A_TK_SHADOW_OFFSET:
|
||||||
data->shadow.offset = atoi(*values);
|
data->shadow.offset = atoi(*values);
|
||||||
|
@ -340,7 +339,7 @@ draw_text(draw_context_t *ctx, font_t *font,
|
||||||
olen = len;
|
olen = len;
|
||||||
|
|
||||||
if(pdata->has_bg_color)
|
if(pdata->has_bg_color)
|
||||||
draw_rectangle(ctx, area, 1.0, true, pdata->bg_color);
|
draw_rectangle(ctx, area, 1.0, true, &pdata->bg_color);
|
||||||
|
|
||||||
if(pdata->bg_image)
|
if(pdata->bg_image)
|
||||||
{
|
{
|
||||||
|
@ -424,13 +423,15 @@ draw_text(draw_context_t *ctx, font_t *font,
|
||||||
*/
|
*/
|
||||||
static cairo_pattern_t *
|
static cairo_pattern_t *
|
||||||
draw_setup_cairo_color_source(draw_context_t *ctx, area_t rect,
|
draw_setup_cairo_color_source(draw_context_t *ctx, area_t rect,
|
||||||
xcolor_t *pcolor, xcolor_t *pcolor_center,
|
const xcolor_t *pcolor, const xcolor_t *pcolor_center,
|
||||||
xcolor_t *pcolor_end)
|
const xcolor_t *pcolor_end)
|
||||||
{
|
{
|
||||||
cairo_pattern_t *pat = NULL;
|
cairo_pattern_t *pat = NULL;
|
||||||
|
bool has_center = pcolor_center->name[0] != '\0';
|
||||||
|
bool has_end = pcolor_end->name[0] != '\0';
|
||||||
|
|
||||||
/* no need for a real pattern: */
|
/* no need for a real pattern: */
|
||||||
if(!pcolor_end && !pcolor_center)
|
if(!has_end && !has_center)
|
||||||
cairo_set_source_rgba(ctx->cr,
|
cairo_set_source_rgba(ctx->cr,
|
||||||
pcolor->red / 65535.0,
|
pcolor->red / 65535.0,
|
||||||
pcolor->green / 65535.0,
|
pcolor->green / 65535.0,
|
||||||
|
@ -447,14 +448,14 @@ draw_setup_cairo_color_source(draw_context_t *ctx, area_t rect,
|
||||||
pcolor->blue / 65535.0,
|
pcolor->blue / 65535.0,
|
||||||
pcolor->alpha / 65535.0);
|
pcolor->alpha / 65535.0);
|
||||||
|
|
||||||
if(pcolor_center)
|
if(has_center)
|
||||||
cairo_pattern_add_color_stop_rgba(pat, 0.5,
|
cairo_pattern_add_color_stop_rgba(pat, 0.5,
|
||||||
pcolor_center->red / 65535.0,
|
pcolor_center->red / 65535.0,
|
||||||
pcolor_center->green / 65535.0,
|
pcolor_center->green / 65535.0,
|
||||||
pcolor_center->blue / 65535.0,
|
pcolor_center->blue / 65535.0,
|
||||||
pcolor_center->alpha / 65535.0);
|
pcolor_center->alpha / 65535.0);
|
||||||
|
|
||||||
if(pcolor_end)
|
if(has_end)
|
||||||
cairo_pattern_add_color_stop_rgba(pat, 1.0,
|
cairo_pattern_add_color_stop_rgba(pat, 1.0,
|
||||||
pcolor_end->red / 65535.0,
|
pcolor_end->red / 65535.0,
|
||||||
pcolor_end->green / 65535.0,
|
pcolor_end->green / 65535.0,
|
||||||
|
@ -479,17 +480,18 @@ draw_setup_cairo_color_source(draw_context_t *ctx, area_t rect,
|
||||||
* \param color color to use
|
* \param color color to use
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_rectangle(draw_context_t *ctx, area_t geometry, float line_width, bool filled, xcolor_t color)
|
draw_rectangle(draw_context_t *ctx, area_t geometry,
|
||||||
|
float line_width, bool filled, const xcolor_t *color)
|
||||||
{
|
{
|
||||||
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
|
cairo_set_antialias(ctx->cr, CAIRO_ANTIALIAS_NONE);
|
||||||
cairo_set_line_width(ctx->cr, line_width);
|
cairo_set_line_width(ctx->cr, line_width);
|
||||||
cairo_set_miter_limit(ctx->cr, 10.0);
|
cairo_set_miter_limit(ctx->cr, 10.0);
|
||||||
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
|
cairo_set_line_join(ctx->cr, CAIRO_LINE_JOIN_MITER);
|
||||||
cairo_set_source_rgba(ctx->cr,
|
cairo_set_source_rgba(ctx->cr,
|
||||||
color.red / 65535.0,
|
color->red / 65535.0,
|
||||||
color.green / 65535.0,
|
color->green / 65535.0,
|
||||||
color.blue / 65535.0,
|
color->blue / 65535.0,
|
||||||
color.alpha / 65535.0);
|
color->alpha / 65535.0);
|
||||||
if(filled)
|
if(filled)
|
||||||
{
|
{
|
||||||
cairo_rectangle(ctx->cr, geometry.x, geometry.y,
|
cairo_rectangle(ctx->cr, geometry.x, geometry.y,
|
||||||
|
@ -516,8 +518,8 @@ draw_rectangle(draw_context_t *ctx, area_t geometry, float line_width, bool fill
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
|
draw_rectangle_gradient(draw_context_t *ctx, area_t geometry, float line_width, bool filled,
|
||||||
area_t pattern_rect, xcolor_t *pcolor,
|
area_t pattern_rect, const xcolor_t *pcolor,
|
||||||
xcolor_t *pcolor_center, xcolor_t *pcolor_end)
|
const xcolor_t *pcolor_center, const xcolor_t *pcolor_end)
|
||||||
{
|
{
|
||||||
cairo_pattern_t *pat;
|
cairo_pattern_t *pat;
|
||||||
|
|
||||||
|
@ -571,8 +573,8 @@ draw_graph_setup(draw_context_t *ctx)
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_graph(draw_context_t *ctx, area_t rect, int *from, int *to, int cur_index,
|
draw_graph(draw_context_t *ctx, area_t rect, int *from, int *to, int cur_index,
|
||||||
position_t grow, area_t patt_rect,
|
position_t grow, area_t patt_rect, const xcolor_t *pcolor,
|
||||||
xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end)
|
const xcolor_t *pcolor_center, const xcolor_t *pcolor_end)
|
||||||
{
|
{
|
||||||
int i = -1;
|
int i = -1;
|
||||||
float x = rect.x + 0.5; /* middle of a pixel */
|
float x = rect.x + 0.5; /* middle of a pixel */
|
||||||
|
@ -624,8 +626,8 @@ draw_graph(draw_context_t *ctx, area_t rect, int *from, int *to, int cur_index,
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_graph_line(draw_context_t *ctx, area_t rect, int *to, int cur_index,
|
draw_graph_line(draw_context_t *ctx, area_t rect, int *to, int cur_index,
|
||||||
position_t grow, area_t patt_rect,
|
position_t grow, area_t patt_rect, const xcolor_t *pcolor,
|
||||||
xcolor_t *pcolor, xcolor_t *pcolor_center, xcolor_t *pcolor_end)
|
const xcolor_t *pcolor_center, const xcolor_t *pcolor_end)
|
||||||
{
|
{
|
||||||
int i, w;
|
int i, w;
|
||||||
float x, y;
|
float x, y;
|
||||||
|
@ -697,14 +699,14 @@ draw_graph_line(draw_context_t *ctx, area_t rect, int *to, int cur_index,
|
||||||
* \param color Color to use.
|
* \param color Color to use.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
draw_circle(draw_context_t *ctx, int x, int y, int r, bool filled, xcolor_t color)
|
draw_circle(draw_context_t *ctx, int x, int y, int r, bool filled, const xcolor_t *color)
|
||||||
{
|
{
|
||||||
cairo_set_line_width(ctx->cr, 1.0);
|
cairo_set_line_width(ctx->cr, 1.0);
|
||||||
cairo_set_source_rgba(ctx->cr,
|
cairo_set_source_rgba(ctx->cr,
|
||||||
color.red / 65535.0,
|
color->red / 65535.0,
|
||||||
color.green / 65535.0,
|
color->green / 65535.0,
|
||||||
color.blue / 65535.0,
|
color->blue / 65535.0,
|
||||||
color.alpha / 65535.0);
|
color->alpha / 65535.0);
|
||||||
|
|
||||||
cairo_new_sub_path(ctx->cr); /* don't draw from the old reference point to.. */
|
cairo_new_sub_path(ctx->cr); /* don't draw from the old reference point to.. */
|
||||||
|
|
||||||
|
@ -1087,22 +1089,20 @@ draw_align_tostr(alignment_t a)
|
||||||
#define RGB_COLOR_8_TO_16(i) (65535 * ((i) & 0xff) / 255)
|
#define RGB_COLOR_8_TO_16(i) (65535 * ((i) & 0xff) / 255)
|
||||||
|
|
||||||
/** Initialize an X color.
|
/** Initialize an X color.
|
||||||
|
* \param color xcolor_t struct to store color into.
|
||||||
* \param conn Connection ref.
|
* \param conn Connection ref.
|
||||||
* \param phys_screen Physical screen number.
|
* \param phys_screen Physical screen number.
|
||||||
* \param colstr Color specification.
|
* \param colstr Color specification.
|
||||||
* \param color xcolor_t struct to store color to.
|
|
||||||
* \return True if color allocation was successfull.
|
* \return True if color allocation was successfull.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t *color)
|
xcolor_init(xcolor_t *color, xcb_connection_t *conn, int phys_screen,
|
||||||
|
const char *colstr)
|
||||||
{
|
{
|
||||||
xcb_screen_t *s = xutil_screen_get(conn, phys_screen);
|
xcb_screen_t *s = xutil_screen_get(conn, phys_screen);
|
||||||
xcb_alloc_color_reply_t *hexa_color = NULL;
|
|
||||||
xcb_alloc_named_color_reply_t *named_color = NULL;
|
|
||||||
unsigned long colnum;
|
unsigned long colnum;
|
||||||
uint16_t red, green, blue;
|
uint16_t red, green, blue, alpha = 0xffff;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
char *buf;
|
|
||||||
|
|
||||||
if(!(len = a_strlen(colstr)))
|
if(!(len = a_strlen(colstr)))
|
||||||
return false;
|
return false;
|
||||||
|
@ -1110,76 +1110,70 @@ xcolor_new(xcb_connection_t *conn, int phys_screen, const char *colstr, xcolor_t
|
||||||
/* The color is given in RGB value */
|
/* The color is given in RGB value */
|
||||||
if(colstr[0] == '#')
|
if(colstr[0] == '#')
|
||||||
{
|
{
|
||||||
errno = 0;
|
xcb_alloc_color_cookie_t cookie;
|
||||||
|
xcb_alloc_color_reply_t *hexa_color;
|
||||||
|
char *p;
|
||||||
|
|
||||||
if(len == 7)
|
if(len == 7)
|
||||||
{
|
{
|
||||||
colnum = strtoul(&colstr[1], NULL, 16);
|
colnum = strtoul(colstr + 1, &p, 16);
|
||||||
color->alpha = 0xffff;
|
if(p - colstr != 7)
|
||||||
|
goto invalid;
|
||||||
}
|
}
|
||||||
/* we have alpha */
|
/* we have alpha */
|
||||||
else if(len == 9)
|
else if(len == 9)
|
||||||
{
|
{
|
||||||
buf = a_strndup(colstr + 1, 6);
|
colnum = strtoul(colstr + 1, &p, 16);
|
||||||
colnum = strtoul(buf, NULL, 16);
|
if(p - colstr != 9)
|
||||||
p_delete(&buf);
|
goto invalid;
|
||||||
color->alpha = RGB_COLOR_8_TO_16(strtoul(&colstr[7], NULL, 16));
|
alpha = RGB_COLOR_8_TO_16(colnum);
|
||||||
if(errno != 0)
|
colnum >>= 8;
|
||||||
{
|
|
||||||
warn("awesome: error, invalid color '%s'", colstr);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
invalid:
|
||||||
warn("awesome: error, invalid color '%s'", colstr);
|
warn("awesome: error, invalid color '%s'", colstr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(errno != 0)
|
red = RGB_COLOR_8_TO_16(colnum >> 16);
|
||||||
{
|
|
||||||
warn("awesome: error, invalid color '%s'", colstr);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
red = RGB_COLOR_8_TO_16(colnum >> 16);
|
|
||||||
green = RGB_COLOR_8_TO_16(colnum >> 8);
|
green = RGB_COLOR_8_TO_16(colnum >> 8);
|
||||||
blue = RGB_COLOR_8_TO_16(colnum);
|
blue = RGB_COLOR_8_TO_16(colnum);
|
||||||
|
|
||||||
hexa_color = xcb_alloc_color_reply(conn,
|
cookie = xcb_alloc_color_unchecked(conn, s->default_colormap,
|
||||||
xcb_alloc_color_unchecked(conn,
|
red, green, blue),
|
||||||
s->default_colormap,
|
hexa_color = xcb_alloc_color_reply(conn, cookie, NULL);
|
||||||
red, green, blue),
|
|
||||||
NULL);
|
|
||||||
|
|
||||||
if(hexa_color)
|
if(hexa_color)
|
||||||
{
|
{
|
||||||
color->pixel = hexa_color->pixel;
|
color->pixel = hexa_color->pixel;
|
||||||
color->red = hexa_color->red;
|
color->red = hexa_color->red;
|
||||||
color->green = hexa_color->green;
|
color->green = hexa_color->green;
|
||||||
color->blue = hexa_color->blue;
|
color->blue = hexa_color->blue;
|
||||||
color->name = a_strdup(colstr);
|
color->alpha = alpha;
|
||||||
|
a_strcpy(color->name, sizeof(color->name), colstr);
|
||||||
p_delete(&hexa_color);
|
p_delete(&hexa_color);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
named_color = xcb_alloc_named_color_reply(conn,
|
xcb_alloc_named_color_reply_t *named_color = NULL;
|
||||||
xcb_alloc_named_color_unchecked(conn,
|
xcb_alloc_named_color_cookie_t cookie;
|
||||||
s->default_colormap,
|
|
||||||
len,
|
cookie = xcb_alloc_named_color_unchecked(conn, s->default_colormap, len,
|
||||||
colstr),
|
colstr),
|
||||||
NULL);
|
named_color = xcb_alloc_named_color_reply(conn, cookie, NULL);
|
||||||
|
|
||||||
if(named_color)
|
if(named_color)
|
||||||
{
|
{
|
||||||
color->pixel = named_color->pixel;
|
color->pixel = named_color->pixel;
|
||||||
color->red = named_color->visual_red;
|
color->red = named_color->visual_red;
|
||||||
color->green = named_color->visual_green;
|
color->green = named_color->visual_green;
|
||||||
color->blue = named_color->visual_blue;
|
color->blue = named_color->visual_blue;
|
||||||
color->alpha = 0xffff;
|
color->alpha = 0xffff;
|
||||||
color->name = a_strdup(colstr);
|
color->alpha = alpha;
|
||||||
|
a_strcpy(color->name, sizeof(color->name), colstr);
|
||||||
p_delete(&named_color);
|
p_delete(&named_color);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/** Color name */
|
/** Color name */
|
||||||
char *name;
|
char name[32];
|
||||||
uint32_t pixel;
|
uint32_t pixel;
|
||||||
uint16_t red;
|
uint16_t red;
|
||||||
uint16_t green;
|
uint16_t green;
|
||||||
|
@ -119,7 +119,9 @@ typedef struct
|
||||||
size_t height;
|
size_t height;
|
||||||
} draw_image_t;
|
} draw_image_t;
|
||||||
|
|
||||||
draw_context_t *draw_context_new(xcb_connection_t *, int, int, int, xcb_drawable_t, xcolor_t, xcolor_t);
|
draw_context_t *
|
||||||
|
draw_context_new(xcb_connection_t *, int, int, int, xcb_drawable_t,
|
||||||
|
const xcolor_t *, const xcolor_t*);
|
||||||
|
|
||||||
/** Delete a draw context.
|
/** Delete a draw context.
|
||||||
* \param ctx The draw_context_t to delete.
|
* \param ctx The draw_context_t to delete.
|
||||||
|
@ -183,13 +185,16 @@ void draw_parser_data_init(draw_parser_data_t *);
|
||||||
void draw_parser_data_wipe(draw_parser_data_t *);
|
void draw_parser_data_wipe(draw_parser_data_t *);
|
||||||
|
|
||||||
void draw_text(draw_context_t *, font_t *, area_t, const char *, draw_parser_data_t *);
|
void draw_text(draw_context_t *, font_t *, area_t, const char *, draw_parser_data_t *);
|
||||||
void draw_rectangle(draw_context_t *, area_t, float, bool, xcolor_t);
|
void draw_rectangle(draw_context_t *, area_t, float, bool, const xcolor_t *);
|
||||||
void draw_rectangle_gradient(draw_context_t *, area_t, float, bool, area_t, xcolor_t *, xcolor_t *, xcolor_t *);
|
void draw_rectangle_gradient(draw_context_t *, area_t, float, bool, area_t,
|
||||||
|
const xcolor_t *, const xcolor_t *, const xcolor_t *);
|
||||||
|
|
||||||
void draw_graph_setup(draw_context_t *);
|
void draw_graph_setup(draw_context_t *);
|
||||||
void draw_graph(draw_context_t *, area_t, int *, int *, int, position_t, area_t, xcolor_t *, xcolor_t *, xcolor_t *);
|
void draw_graph(draw_context_t *, area_t, int *, int *, int, position_t, area_t,
|
||||||
void draw_graph_line(draw_context_t *, area_t, int *, int, position_t, area_t, xcolor_t *, xcolor_t *, xcolor_t *);
|
const xcolor_t *, const xcolor_t *, const xcolor_t *);
|
||||||
void draw_circle(draw_context_t *, int, int, int, bool, xcolor_t);
|
void draw_graph_line(draw_context_t *, area_t, int *, int, position_t, area_t,
|
||||||
|
const xcolor_t *, const xcolor_t *, const xcolor_t *);
|
||||||
|
void draw_circle(draw_context_t *, int, int, int, bool, const xcolor_t *);
|
||||||
draw_image_t *draw_image_new(const char *);
|
draw_image_t *draw_image_new(const char *);
|
||||||
void draw_image_delete(draw_image_t **);
|
void draw_image_delete(draw_image_t **);
|
||||||
void draw_image(draw_context_t *, int, int, int, draw_image_t *);
|
void draw_image(draw_context_t *, int, int, int, draw_image_t *);
|
||||||
|
@ -199,33 +204,7 @@ area_t draw_text_extents(xcb_connection_t *, int, font_t *, const char *, draw_p
|
||||||
alignment_t draw_align_fromstr(const char *, ssize_t);
|
alignment_t draw_align_fromstr(const char *, ssize_t);
|
||||||
const char *draw_align_tostr(alignment_t);
|
const char *draw_align_tostr(alignment_t);
|
||||||
|
|
||||||
/** Wipe a color resources.
|
bool xcolor_init(xcolor_t *c, xcb_connection_t *, int, const char *);
|
||||||
* \param color The color to wipe out.
|
|
||||||
*/
|
|
||||||
static inline void
|
|
||||||
xcolor_wipe(xcolor_t *color)
|
|
||||||
{
|
|
||||||
if(color)
|
|
||||||
{
|
|
||||||
p_delete(&color->name);
|
|
||||||
p_clear(color, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline xcolor_t
|
|
||||||
xcolor_copy(xcolor_t *color)
|
|
||||||
{
|
|
||||||
xcolor_t c;
|
|
||||||
|
|
||||||
assert(color);
|
|
||||||
|
|
||||||
c = *color;
|
|
||||||
c.name = a_strdup(color->name);
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool xcolor_new(xcb_connection_t *, int, const char *, xcolor_t *);
|
|
||||||
|
|
||||||
void area_array_remove(area_array_t *, area_t);
|
void area_array_remove(area_array_t *, area_t);
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ simplewindow_border_width_set(simple_window_t *sw, uint32_t border_width)
|
||||||
* \param color The border color.
|
* \param color The border color.
|
||||||
*/
|
*/
|
||||||
static inline void
|
static inline void
|
||||||
simplewindow_border_color_set(simple_window_t *sw, xcolor_t *color)
|
simplewindow_border_color_set(simple_window_t *sw, const xcolor_t *color)
|
||||||
{
|
{
|
||||||
xcb_change_window_attributes(sw->connection, sw->window,
|
xcb_change_window_attributes(sw->connection, sw->window,
|
||||||
XCB_CW_BORDER_PIXEL, &color->pixel);
|
XCB_CW_BORDER_PIXEL, &color->pixel);
|
||||||
|
|
20
lua.c
20
lua.c
|
@ -394,24 +394,16 @@ static int
|
||||||
luaA_colors_set(lua_State *L)
|
luaA_colors_set(lua_State *L)
|
||||||
{
|
{
|
||||||
const char *buf;
|
const char *buf;
|
||||||
xcolor_t color;
|
|
||||||
|
|
||||||
luaA_checktable(L, 1);
|
luaA_checktable(L, 1);
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 1, "fg", NULL))
|
if((buf = luaA_getopt_string(L, 1, "fg", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
xcolor_init(&globalconf.colors.fg, globalconf.connection,
|
||||||
{
|
globalconf.default_screen, buf);
|
||||||
xcolor_wipe(&globalconf.colors.fg);
|
|
||||||
globalconf.colors.fg = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 1, "bg", NULL))
|
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
|
||||||
xcolor_wipe(&globalconf.colors.bg);
|
|
||||||
globalconf.colors.bg = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if((buf = luaA_getopt_string(L, 1, "bg", NULL)))
|
||||||
|
xcolor_init(&globalconf.colors.bg, globalconf.connection,
|
||||||
|
globalconf.default_screen, buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
6
mouse.c
6
mouse.c
|
@ -244,7 +244,7 @@ mouse_infobox_draw(draw_context_t *ctx,
|
||||||
|
|
||||||
snprintf(size, sizeof(size), "<text align=\"center\"/>%dx%d+%d+%d",
|
snprintf(size, sizeof(size), "<text align=\"center\"/>%dx%d+%d+%d",
|
||||||
geometry.width, geometry.height, geometry.x, geometry.y);
|
geometry.width, geometry.height, geometry.x, geometry.y);
|
||||||
draw_rectangle(ctx, draw_geometry, 1.0, true, globalconf.colors.bg);
|
draw_rectangle(ctx, draw_geometry, 1.0, true, &globalconf.colors.bg);
|
||||||
draw_text(ctx, globalconf.font, draw_geometry, size, NULL);
|
draw_text(ctx, globalconf.font, draw_geometry, size, NULL);
|
||||||
simplewindow_move(sw,
|
simplewindow_move(sw,
|
||||||
geometry.x + ((2 * border + geometry.width) - sw->geometry.width) / 2,
|
geometry.x + ((2 * border + geometry.width) - sw->geometry.width) / 2,
|
||||||
|
@ -283,8 +283,8 @@ mouse_infobox_new(int phys_screen, int border, area_t geometry,
|
||||||
*ctx = draw_context_new(globalconf.connection, sw->phys_screen,
|
*ctx = draw_context_new(globalconf.connection, sw->phys_screen,
|
||||||
sw->geometry.width, sw->geometry.height,
|
sw->geometry.width, sw->geometry.height,
|
||||||
sw->pixmap,
|
sw->pixmap,
|
||||||
globalconf.colors.fg,
|
&globalconf.colors.fg,
|
||||||
globalconf.colors.bg);
|
&globalconf.colors.bg);
|
||||||
|
|
||||||
xcb_map_window(globalconf.connection, sw->window);
|
xcb_map_window(globalconf.connection, sw->window);
|
||||||
mouse_infobox_draw(*ctx, sw, geometry, border);
|
mouse_infobox_draw(*ctx, sw, geometry, border);
|
||||||
|
|
37
statusbar.c
37
statusbar.c
|
@ -180,8 +180,8 @@ statusbar_position_update(statusbar_t *statusbar, position_t position)
|
||||||
statusbar->width,
|
statusbar->width,
|
||||||
statusbar->height,
|
statusbar->height,
|
||||||
dw,
|
dw,
|
||||||
statusbar->colors.fg,
|
&statusbar->colors.fg,
|
||||||
statusbar->colors.bg);
|
&statusbar->colors.bg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(!statusbar->width_user)
|
if(!statusbar->width_user)
|
||||||
|
@ -194,8 +194,8 @@ statusbar_position_update(statusbar_t *statusbar, position_t position)
|
||||||
statusbar->width,
|
statusbar->width,
|
||||||
statusbar->height,
|
statusbar->height,
|
||||||
statusbar->sw->pixmap,
|
statusbar->sw->pixmap,
|
||||||
statusbar->colors.fg,
|
&statusbar->colors.fg,
|
||||||
statusbar->colors.bg);
|
&statusbar->colors.bg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,14 +441,17 @@ luaA_statusbar_new(lua_State *L)
|
||||||
sb->name = a_strdup(buf);
|
sb->name = a_strdup(buf);
|
||||||
|
|
||||||
if(!(buf = luaA_getopt_string(L, 2, "fg", NULL))
|
if(!(buf = luaA_getopt_string(L, 2, "fg", NULL))
|
||||||
|| !xcolor_new(globalconf.connection, globalconf.default_screen,
|
|| !xcolor_init(&sb->colors.fg, globalconf.connection, globalconf.default_screen, buf))
|
||||||
buf, &sb->colors.fg))
|
{
|
||||||
sb->colors.fg = xcolor_copy(&globalconf.colors.fg);
|
sb->colors.fg = globalconf.colors.fg;
|
||||||
|
}
|
||||||
|
|
||||||
if(!(buf = luaA_getopt_string(L, 2, "bg", NULL))
|
if(!(buf = luaA_getopt_string(L, 2, "bg", NULL))
|
||||||
|| !xcolor_new(globalconf.connection, globalconf.default_screen,
|
|| !xcolor_init(&sb->colors.bg, globalconf.connection,
|
||||||
buf, &sb->colors.bg))
|
globalconf.default_screen, buf))
|
||||||
sb->colors.bg = xcolor_copy(&globalconf.colors.bg);
|
{
|
||||||
|
sb->colors.bg = globalconf.colors.bg;
|
||||||
|
}
|
||||||
|
|
||||||
buf = luaA_getopt_lstring(L, 2, "align", "left", &len);
|
buf = luaA_getopt_lstring(L, 2, "align", "left", &len);
|
||||||
sb->align = draw_align_fromstr(buf, len);
|
sb->align = draw_align_fromstr(buf, len);
|
||||||
|
@ -538,7 +541,6 @@ luaA_statusbar_newindex(lua_State *L)
|
||||||
size_t len;
|
size_t len;
|
||||||
statusbar_t *s, **statusbar = luaA_checkudata(L, 1, "statusbar");
|
statusbar_t *s, **statusbar = luaA_checkudata(L, 1, "statusbar");
|
||||||
const char *buf, *attr = luaL_checklstring(L, 2, &len);
|
const char *buf, *attr = luaL_checklstring(L, 2, &len);
|
||||||
xcolor_t color;
|
|
||||||
position_t p;
|
position_t p;
|
||||||
|
|
||||||
switch(a_tokenize(attr, len))
|
switch(a_tokenize(attr, len))
|
||||||
|
@ -550,24 +552,19 @@ luaA_statusbar_newindex(lua_State *L)
|
||||||
break;
|
break;
|
||||||
case A_TK_FG:
|
case A_TK_FG:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
&& xcolor_init(&(*statusbar)->colors.fg, globalconf.connection,
|
||||||
|
globalconf.default_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*statusbar)->colors.fg);
|
|
||||||
(*statusbar)->colors.fg = color;
|
|
||||||
|
|
||||||
if((*statusbar)->ctx)
|
if((*statusbar)->ctx)
|
||||||
(*statusbar)->ctx->fg = (*statusbar)->colors.fg;
|
(*statusbar)->ctx->fg = (*statusbar)->colors.fg;
|
||||||
|
|
||||||
(*statusbar)->need_update = true;
|
(*statusbar)->need_update = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case A_TK_BG:
|
case A_TK_BG:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
&& xcolor_init(&(*statusbar)->colors.bg, globalconf.connection,
|
||||||
|
globalconf.default_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*statusbar)->colors.bg);
|
|
||||||
(*statusbar)->colors.bg = color;
|
|
||||||
|
|
||||||
if((*statusbar)->ctx)
|
if((*statusbar)->ctx)
|
||||||
(*statusbar)->ctx->bg = (*statusbar)->colors.bg;
|
(*statusbar)->ctx->bg = (*statusbar)->colors.bg;
|
||||||
|
|
||||||
|
|
48
titlebar.c
48
titlebar.c
|
@ -98,16 +98,16 @@ titlebar_draw(client_t *c)
|
||||||
c->titlebar->sw->geometry.height,
|
c->titlebar->sw->geometry.height,
|
||||||
c->titlebar->sw->geometry.width,
|
c->titlebar->sw->geometry.width,
|
||||||
dw,
|
dw,
|
||||||
c->titlebar->colors.fg,
|
&c->titlebar->colors.fg,
|
||||||
c->titlebar->colors.bg);
|
&c->titlebar->colors.bg);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ctx = draw_context_new(globalconf.connection, c->titlebar->sw->phys_screen,
|
ctx = draw_context_new(globalconf.connection, c->titlebar->sw->phys_screen,
|
||||||
c->titlebar->sw->geometry.width,
|
c->titlebar->sw->geometry.width,
|
||||||
c->titlebar->sw->geometry.height,
|
c->titlebar->sw->geometry.height,
|
||||||
c->titlebar->sw->pixmap,
|
c->titlebar->sw->pixmap,
|
||||||
c->titlebar->colors.fg,
|
&c->titlebar->colors.fg,
|
||||||
c->titlebar->colors.bg);
|
&c->titlebar->colors.bg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,19 +315,25 @@ luaA_titlebar_new(lua_State *L)
|
||||||
tb->position = position_fromstr(buf, len);
|
tb->position = position_fromstr(buf, len);
|
||||||
|
|
||||||
if(!(buf = luaA_getopt_string(L, 2, "fg", NULL))
|
if(!(buf = luaA_getopt_string(L, 2, "fg", NULL))
|
||||||
|| !xcolor_new(globalconf.connection, globalconf.default_screen,
|
|| !xcolor_init(&tb->colors.fg, globalconf.connection,
|
||||||
buf, &tb->colors.fg))
|
globalconf.default_screen, buf))
|
||||||
tb->colors.fg = xcolor_copy(&globalconf.colors.fg);
|
{
|
||||||
|
tb->colors.fg = globalconf.colors.fg;
|
||||||
|
}
|
||||||
|
|
||||||
if(!(buf = luaA_getopt_string(L, 2, "bg", NULL))
|
if(!(buf = luaA_getopt_string(L, 2, "bg", NULL))
|
||||||
|| !xcolor_new(globalconf.connection, globalconf.default_screen,
|
|| !xcolor_init(&tb->colors.bg, globalconf.connection,
|
||||||
buf, &tb->colors.bg))
|
globalconf.default_screen, buf))
|
||||||
tb->colors.bg = xcolor_copy(&globalconf.colors.bg);
|
{
|
||||||
|
tb->colors.bg = globalconf.colors.bg;
|
||||||
|
}
|
||||||
|
|
||||||
if(!(buf = luaA_getopt_string(L, 2, "border_color", NULL))
|
if(!(buf = luaA_getopt_string(L, 2, "border_color", NULL))
|
||||||
|| !xcolor_new(globalconf.connection, globalconf.default_screen,
|
|| !xcolor_init(&tb->border.color, globalconf.connection,
|
||||||
buf, &tb->border.color))
|
globalconf.default_screen, buf))
|
||||||
tb->border.color = xcolor_copy(&globalconf.colors.fg);
|
{
|
||||||
|
tb->border.color = globalconf.colors.fg;
|
||||||
|
}
|
||||||
|
|
||||||
tb->border.width = luaA_getopt_number(L, 2, "border_width", 0);
|
tb->border.width = luaA_getopt_number(L, 2, "border_width", 0);
|
||||||
|
|
||||||
|
@ -457,7 +463,6 @@ luaA_titlebar_newindex(lua_State *L)
|
||||||
titlebar_t **titlebar = luaA_checkudata(L, 1, "titlebar");
|
titlebar_t **titlebar = luaA_checkudata(L, 1, "titlebar");
|
||||||
const char *buf, *attr = luaL_checklstring(L, 2, &len);
|
const char *buf, *attr = luaL_checklstring(L, 2, &len);
|
||||||
client_t *c;
|
client_t *c;
|
||||||
xcolor_t color;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
switch(a_tokenize(attr, len))
|
switch(a_tokenize(attr, len))
|
||||||
|
@ -476,11 +481,9 @@ luaA_titlebar_newindex(lua_State *L)
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
&& xcolor_init(&(*titlebar)->border.color, globalconf.connection,
|
||||||
|
globalconf.default_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*titlebar)->border.color);
|
|
||||||
(*titlebar)->border.color = color;
|
|
||||||
|
|
||||||
if((*titlebar)->sw)
|
if((*titlebar)->sw)
|
||||||
xcb_change_window_attributes(globalconf.connection, (*titlebar)->sw->window,
|
xcb_change_window_attributes(globalconf.connection, (*titlebar)->sw->window,
|
||||||
XCB_CW_BORDER_PIXEL, &(*titlebar)->border.color.pixel);
|
XCB_CW_BORDER_PIXEL, &(*titlebar)->border.color.pixel);
|
||||||
|
@ -488,19 +491,16 @@ luaA_titlebar_newindex(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
case A_TK_FG:
|
case A_TK_FG:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
&& xcolor_init(&(*titlebar)->colors.fg, globalconf.connection,
|
||||||
|
globalconf.default_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*titlebar)->colors.fg);
|
|
||||||
(*titlebar)->colors.fg = color;
|
|
||||||
titlebar_draw(client_getbytitlebar(*titlebar));
|
titlebar_draw(client_getbytitlebar(*titlebar));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
case A_TK_BG:
|
case A_TK_BG:
|
||||||
if((buf = luaL_checkstring(L, 3))
|
if((buf = luaL_checkstring(L, 3))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
&& xcolor_init(&(*titlebar)->colors.bg, globalconf.connection, globalconf.default_screen, buf))
|
||||||
{
|
{
|
||||||
xcolor_wipe(&(*titlebar)->colors.bg);
|
|
||||||
(*titlebar)->colors.bg = color;
|
|
||||||
titlebar_draw(client_getbytitlebar(*titlebar));
|
titlebar_draw(client_getbytitlebar(*titlebar));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
2
widget.c
2
widget.c
|
@ -149,7 +149,7 @@ widget_render(widget_node_t *wnode, draw_context_t *ctx, xcb_gcontext_t gc, xcb_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, ctx->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &ctx->bg);
|
||||||
|
|
||||||
for(w = wnode; w; w = w->next)
|
for(w = wnode; w; w = w->next)
|
||||||
if(w->widget->isvisible && w->widget->align == AlignLeft)
|
if(w->widget->isvisible && w->widget->align == AlignLeft)
|
||||||
|
|
|
@ -63,9 +63,9 @@ struct plot_t
|
||||||
/** Color of them */
|
/** Color of them */
|
||||||
xcolor_t color_start;
|
xcolor_t color_start;
|
||||||
/** Color at middle of graph */
|
/** Color at middle of graph */
|
||||||
xcolor_t *pcolor_center;
|
xcolor_t pcolor_center;
|
||||||
/** Color at end of graph */
|
/** Color at end of graph */
|
||||||
xcolor_t *pcolor_end;
|
xcolor_t pcolor_end;
|
||||||
/** Create a vertical color gradient */
|
/** Create a vertical color gradient */
|
||||||
bool vertical_gradient;
|
bool vertical_gradient;
|
||||||
/** Next and previous graph */
|
/** Next and previous graph */
|
||||||
|
@ -78,8 +78,6 @@ plot_delete(plot_t **g)
|
||||||
p_delete(&(*g)->title);
|
p_delete(&(*g)->title);
|
||||||
p_delete(&(*g)->lines);
|
p_delete(&(*g)->lines);
|
||||||
p_delete(&(*g)->values);
|
p_delete(&(*g)->values);
|
||||||
p_delete(&(*g)->pcolor_center);
|
|
||||||
p_delete(&(*g)->pcolor_end);
|
|
||||||
p_delete(g);
|
p_delete(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,7 +122,7 @@ graph_plot_add(graph_data_t *d, const char *title)
|
||||||
plot->values = p_new(float, d->size);
|
plot->values = p_new(float, d->size);
|
||||||
plot->lines = p_new(int, d->size);
|
plot->lines = p_new(int, d->size);
|
||||||
plot->max_value = 100.0;
|
plot->max_value = 100.0;
|
||||||
plot->color_start = xcolor_copy(&globalconf.colors.fg);
|
plot->color_start = globalconf.colors.fg;
|
||||||
plot->vertical_gradient = true;
|
plot->vertical_gradient = true;
|
||||||
|
|
||||||
plot_list_append(&d->plots, plot);
|
plot_list_append(&d->plots, plot);
|
||||||
|
@ -172,7 +170,7 @@ graph_draw(draw_context_t *ctx,
|
||||||
rectangle.y = margin_top + 1;
|
rectangle.y = margin_top + 1;
|
||||||
rectangle.width = d->size;
|
rectangle.width = d->size;
|
||||||
rectangle.height = d->box_height;
|
rectangle.height = d->box_height;
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, d->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &d->bg);
|
||||||
|
|
||||||
/* for plot drawing */
|
/* for plot drawing */
|
||||||
rectangle.y = margin_top + d->box_height + 1; /* bottom left corner as starting point */
|
rectangle.y = margin_top + d->box_height + 1; /* bottom left corner as starting point */
|
||||||
|
@ -213,7 +211,7 @@ graph_draw(draw_context_t *ctx,
|
||||||
d->draw_to[y] = d->box_height - plot->lines[y]; /* i.e. on full plot -> 0 = bottom */
|
d->draw_to[y] = d->box_height - plot->lines[y]; /* i.e. on full plot -> 0 = bottom */
|
||||||
}
|
}
|
||||||
draw_graph(ctx, rectangle , d->draw_from, d->draw_to, plot->index, d->grow, pattern_area,
|
draw_graph(ctx, rectangle , d->draw_from, d->draw_to, plot->index, d->grow, pattern_area,
|
||||||
&plot->color_start, plot->pcolor_center, plot->pcolor_end);
|
&plot->color_start, &plot->pcolor_center, &plot->pcolor_end);
|
||||||
break;
|
break;
|
||||||
case Bottom_Style:
|
case Bottom_Style:
|
||||||
pattern_area.y = rectangle.y;
|
pattern_area.y = rectangle.y;
|
||||||
|
@ -234,7 +232,7 @@ graph_draw(draw_context_t *ctx,
|
||||||
|
|
||||||
p_clear(d->draw_from, d->size);
|
p_clear(d->draw_from, d->size);
|
||||||
draw_graph(ctx, rectangle, d->draw_from, plot->lines, plot->index, d->grow, pattern_area,
|
draw_graph(ctx, rectangle, d->draw_from, plot->lines, plot->index, d->grow, pattern_area,
|
||||||
&plot->color_start, plot->pcolor_center, plot->pcolor_end);
|
&plot->color_start, &plot->pcolor_center, &plot->pcolor_end);
|
||||||
break;
|
break;
|
||||||
case Line_Style:
|
case Line_Style:
|
||||||
pattern_area.y = rectangle.y;
|
pattern_area.y = rectangle.y;
|
||||||
|
@ -253,7 +251,7 @@ graph_draw(draw_context_t *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_graph_line(ctx, rectangle, plot->lines, plot->index, d->grow, pattern_area,
|
draw_graph_line(ctx, rectangle, plot->lines, plot->index, d->grow, pattern_area,
|
||||||
&plot->color_start, plot->pcolor_center, plot->pcolor_end);
|
&plot->color_start, &plot->pcolor_center, &plot->pcolor_end);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +260,7 @@ graph_draw(draw_context_t *ctx,
|
||||||
rectangle.y = margin_top;
|
rectangle.y = margin_top;
|
||||||
rectangle.width = d->size + 2;
|
rectangle.width = d->size + 2;
|
||||||
rectangle.height = d->box_height + 2;
|
rectangle.height = d->box_height + 2;
|
||||||
draw_rectangle(ctx, rectangle, 1.0, false, d->border_color);
|
draw_rectangle(ctx, rectangle, 1.0, false, &d->border_color);
|
||||||
|
|
||||||
w->area.width = d->width;
|
w->area.width = d->width;
|
||||||
w->area.height = ctx->height;
|
w->area.height = ctx->height;
|
||||||
|
@ -286,7 +284,6 @@ luaA_graph_plot_properties_set(lua_State *L)
|
||||||
const char *title, *buf;
|
const char *title, *buf;
|
||||||
size_t len;
|
size_t len;
|
||||||
plot_t *plot;
|
plot_t *plot;
|
||||||
xcolor_t color;
|
|
||||||
|
|
||||||
title = luaL_checkstring(L, 2);
|
title = luaL_checkstring(L, 2);
|
||||||
luaA_checktable(L, 3);
|
luaA_checktable(L, 3);
|
||||||
|
@ -298,25 +295,22 @@ luaA_graph_plot_properties_set(lua_State *L)
|
||||||
if(!plot)
|
if(!plot)
|
||||||
plot = graph_plot_add(d, title);
|
plot = graph_plot_add(d, title);
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(&plot->color_start);
|
xcolor_init(&plot->color_start, globalconf.connection,
|
||||||
plot->color_start = color;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg_center", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg_center", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(plot->pcolor_center);
|
xcolor_init(&plot->pcolor_center, globalconf.connection,
|
||||||
plot->pcolor_center = p_dup(&color, 1);
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg_end", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg_end", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(plot->pcolor_end);
|
xcolor_init(&plot->pcolor_end, globalconf.connection,
|
||||||
plot->pcolor_end = p_dup(&color, 1);
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
plot->vertical_gradient = luaA_getopt_boolean(L, 3, "vertical_gradient", plot->vertical_gradient);
|
plot->vertical_gradient = luaA_getopt_boolean(L, 3, "vertical_gradient", plot->vertical_gradient);
|
||||||
|
@ -489,7 +483,6 @@ luaA_graph_newindex(lua_State *L, awesome_token_t token)
|
||||||
int width;
|
int width;
|
||||||
plot_t *plot;
|
plot_t *plot;
|
||||||
position_t pos;
|
position_t pos;
|
||||||
xcolor_t color;
|
|
||||||
|
|
||||||
switch(token)
|
switch(token)
|
||||||
{
|
{
|
||||||
|
@ -517,21 +510,13 @@ luaA_graph_newindex(lua_State *L, awesome_token_t token)
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case A_TK_BG:
|
case A_TK_BG:
|
||||||
if(xcolor_new(globalconf.connection, globalconf.default_screen, luaL_checkstring(L, 3), &color))
|
if (!xcolor_init(&d->bg, globalconf.connection, globalconf.default_screen,
|
||||||
{
|
luaL_checkstring(L, 3)))
|
||||||
xcolor_wipe(&d->bg);
|
|
||||||
d->bg = color;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case A_TK_BORDER_COLOR:
|
case A_TK_BORDER_COLOR:
|
||||||
if(xcolor_new(globalconf.connection, globalconf.default_screen, luaL_checkstring(L, 3), &color))
|
if (!xcolor_init(&d->border_color, globalconf.connection,
|
||||||
{
|
globalconf.default_screen, luaL_checkstring(L, 3)))
|
||||||
xcolor_wipe(&d->border_color);
|
|
||||||
d->border_color = color;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
case A_TK_GROW:
|
case A_TK_GROW:
|
||||||
|
@ -596,8 +581,8 @@ graph_new(alignment_t align)
|
||||||
d->draw_from = p_new(int, d->size);
|
d->draw_from = p_new(int, d->size);
|
||||||
d->draw_to = p_new(int, d->size);
|
d->draw_to = p_new(int, d->size);
|
||||||
|
|
||||||
d->bg = xcolor_copy(&globalconf.colors.bg);
|
d->bg = globalconf.colors.bg;
|
||||||
d->border_color = xcolor_copy(&globalconf.colors.fg);
|
d->border_color = globalconf.colors.fg;
|
||||||
|
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,9 @@ struct bar_t
|
||||||
/** Foreground color of turned-off ticks */
|
/** Foreground color of turned-off ticks */
|
||||||
xcolor_t fg_off;
|
xcolor_t fg_off;
|
||||||
/** Foreground color when bar is half-full */
|
/** Foreground color when bar is half-full */
|
||||||
xcolor_t *pfg_center;
|
xcolor_t pfg_center;
|
||||||
/** Foreground color when bar is full */
|
/** Foreground color when bar is full */
|
||||||
xcolor_t *pfg_end;
|
xcolor_t pfg_end;
|
||||||
/** Background color */
|
/** Background color */
|
||||||
xcolor_t bg;
|
xcolor_t bg;
|
||||||
/** Border color */
|
/** Border color */
|
||||||
|
@ -63,8 +63,6 @@ static void
|
||||||
bar_delete(bar_t **bar)
|
bar_delete(bar_t **bar)
|
||||||
{
|
{
|
||||||
p_delete(&(*bar)->title);
|
p_delete(&(*bar)->title);
|
||||||
p_delete(&(*bar)->pfg_center);
|
|
||||||
p_delete(&(*bar)->pfg_end);
|
|
||||||
p_delete(bar);
|
p_delete(bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,10 +101,10 @@ progressbar_bar_add(progressbar_data_t *d, const char *title)
|
||||||
bar_t *bar = p_new(bar_t, 1);
|
bar_t *bar = p_new(bar_t, 1);
|
||||||
|
|
||||||
bar->title = a_strdup(title);
|
bar->title = a_strdup(title);
|
||||||
bar->fg = xcolor_copy(&globalconf.colors.fg);
|
bar->fg = globalconf.colors.fg;
|
||||||
bar->fg_off = xcolor_copy(&globalconf.colors.bg);
|
bar->fg_off = globalconf.colors.bg;
|
||||||
bar->bg = xcolor_copy(&globalconf.colors.bg);
|
bar->bg = globalconf.colors.bg;
|
||||||
bar->border_color = xcolor_copy(&globalconf.colors.fg);
|
bar->border_color = globalconf.colors.fg;
|
||||||
bar->max_value = 100.0;
|
bar->max_value = 100.0;
|
||||||
|
|
||||||
/* append the bar in the list */
|
/* append the bar in the list */
|
||||||
|
@ -228,8 +226,8 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
rectangle.height = pb_height + 2 * (d->border_padding + d->border_width);
|
rectangle.height = pb_height + 2 * (d->border_padding + d->border_width);
|
||||||
|
|
||||||
if(d->border_padding)
|
if(d->border_padding)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->bg);
|
||||||
draw_rectangle(ctx, rectangle, d->border_width, false, bar->border_color);
|
draw_rectangle(ctx, rectangle, d->border_width, false, &bar->border_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern_rect.x = pb_x;
|
pattern_rect.x = pb_x;
|
||||||
|
@ -260,10 +258,10 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
|
|
||||||
/* fg color */
|
/* fg color */
|
||||||
if(bar->reverse)
|
if(bar->reverse)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->fg_off);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->fg_off);
|
||||||
else
|
else
|
||||||
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
||||||
&bar->fg, bar->pfg_center, bar->pfg_end);
|
&bar->fg, &bar->pfg_center, &bar->pfg_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* top part */
|
/* top part */
|
||||||
|
@ -277,9 +275,9 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
/* bg color */
|
/* bg color */
|
||||||
if(bar->reverse)
|
if(bar->reverse)
|
||||||
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
||||||
&bar->fg, bar->pfg_center, bar->pfg_end);
|
&bar->fg, &bar->pfg_center, &bar->pfg_end);
|
||||||
else
|
else
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->fg_off);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->fg_off);
|
||||||
}
|
}
|
||||||
/* draw gaps TODO: improve e.g all in one */
|
/* draw gaps TODO: improve e.g all in one */
|
||||||
if(d->ticks_count && d->ticks_gap)
|
if(d->ticks_count && d->ticks_gap)
|
||||||
|
@ -290,7 +288,7 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
for(rectangle.y = pb_y + (unit - d->ticks_gap);
|
for(rectangle.y = pb_y + (unit - d->ticks_gap);
|
||||||
pb_y + pb_height - d->ticks_gap >= rectangle.y;
|
pb_y + pb_height - d->ticks_gap >= rectangle.y;
|
||||||
rectangle.y += unit)
|
rectangle.y += unit)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->bg);
|
||||||
}
|
}
|
||||||
pb_offset += pb_width + d->gap + 2 * (d->border_width + d->border_padding);
|
pb_offset += pb_width + d->gap + 2 * (d->border_width + d->border_padding);
|
||||||
}
|
}
|
||||||
|
@ -328,8 +326,8 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
rectangle.height = pb_height + 2 * (d->border_padding + d->border_width);
|
rectangle.height = pb_height + 2 * (d->border_padding + d->border_width);
|
||||||
|
|
||||||
if(d->border_padding)
|
if(d->border_padding)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->bg);
|
||||||
draw_rectangle(ctx, rectangle, d->border_width, false, bar->border_color);
|
draw_rectangle(ctx, rectangle, d->border_width, false, &bar->border_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
pattern_rect.y = pb_y;
|
pattern_rect.y = pb_y;
|
||||||
|
@ -358,10 +356,10 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
|
|
||||||
/* fg color */
|
/* fg color */
|
||||||
if(bar->reverse)
|
if(bar->reverse)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->fg_off);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->fg_off);
|
||||||
else
|
else
|
||||||
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
||||||
&bar->fg, bar->pfg_center, bar->pfg_end);
|
&bar->fg, &bar->pfg_center, &bar->pfg_end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* right part */
|
/* right part */
|
||||||
|
@ -375,9 +373,9 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
/* bg color */
|
/* bg color */
|
||||||
if(bar->reverse)
|
if(bar->reverse)
|
||||||
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
draw_rectangle_gradient(ctx, rectangle, 1.0, true, pattern_rect,
|
||||||
&bar->fg, bar->pfg_center, bar->pfg_end);
|
&bar->fg, &bar->pfg_center, &bar->pfg_end);
|
||||||
else
|
else
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->fg_off);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->fg_off);
|
||||||
}
|
}
|
||||||
/* draw gaps TODO: improve e.g all in one */
|
/* draw gaps TODO: improve e.g all in one */
|
||||||
if(d->ticks_count && d->ticks_gap)
|
if(d->ticks_count && d->ticks_gap)
|
||||||
|
@ -388,7 +386,7 @@ progressbar_draw(draw_context_t *ctx,
|
||||||
for(rectangle.x = pb_x + (unit - d->ticks_gap);
|
for(rectangle.x = pb_x + (unit - d->ticks_gap);
|
||||||
pb_x + pb_width - d->ticks_gap >= rectangle.x;
|
pb_x + pb_width - d->ticks_gap >= rectangle.x;
|
||||||
rectangle.x += unit)
|
rectangle.x += unit)
|
||||||
draw_rectangle(ctx, rectangle, 1.0, true, bar->bg);
|
draw_rectangle(ctx, rectangle, 1.0, true, &bar->bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
pb_offset += pb_height + d->gap + 2 * (d->border_width + d->border_padding);
|
pb_offset += pb_height + d->gap + 2 * (d->border_width + d->border_padding);
|
||||||
|
@ -414,7 +412,6 @@ luaA_progressbar_bar_properties_set(lua_State *L)
|
||||||
const char *buf, *title = luaL_checkstring(L, 2);
|
const char *buf, *title = luaL_checkstring(L, 2);
|
||||||
bar_t *bar;
|
bar_t *bar;
|
||||||
progressbar_data_t *d = (*widget)->data;
|
progressbar_data_t *d = (*widget)->data;
|
||||||
xcolor_t color;
|
|
||||||
|
|
||||||
luaA_checktable(L, 3);
|
luaA_checktable(L, 3);
|
||||||
|
|
||||||
|
@ -427,46 +424,40 @@ luaA_progressbar_bar_properties_set(lua_State *L)
|
||||||
if(!bar)
|
if(!bar)
|
||||||
bar = progressbar_bar_add(d, title);
|
bar = progressbar_bar_add(d, title);
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(&bar->fg);
|
xcolor_init(&bar->fg, globalconf.connection,
|
||||||
bar->fg = color;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg_off", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg_off", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(&bar->fg_off);
|
xcolor_init(&bar->fg_off, globalconf.connection,
|
||||||
bar->fg_off = color;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "bg", NULL))
|
if((buf = luaA_getopt_string(L, 3, "bg", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(&bar->bg);
|
xcolor_init(&bar->bg, globalconf.connection,
|
||||||
bar->bg = color;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "border_color", NULL))
|
if((buf = luaA_getopt_string(L, 3, "border_color", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(&bar->border_color);
|
xcolor_init(&bar->border_color, globalconf.connection,
|
||||||
bar->border_color = color;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg_center", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg_center", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(bar->pfg_center);
|
xcolor_init(&bar->pfg_center, globalconf.connection,
|
||||||
bar->pfg_center = p_dup(&color, 1);;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((buf = luaA_getopt_string(L, 3, "fg_end", NULL))
|
if((buf = luaA_getopt_string(L, 3, "fg_end", NULL)))
|
||||||
&& xcolor_new(globalconf.connection, globalconf.default_screen, buf, &color))
|
|
||||||
{
|
{
|
||||||
xcolor_wipe(bar->pfg_end);
|
xcolor_init(&bar->pfg_end, globalconf.connection,
|
||||||
bar->pfg_end = p_dup(&color, 1);;
|
globalconf.default_screen, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
bar->min_value = luaA_getopt_number(L, 3, "min_value", bar->min_value);
|
bar->min_value = luaA_getopt_number(L, 3, "min_value", bar->min_value);
|
||||||
|
|
|
@ -241,7 +241,7 @@ taglist_draw(draw_context_t *ctx, int screen, widget_node_t *w,
|
||||||
rectangle.x = r->x;
|
rectangle.x = r->x;
|
||||||
rectangle.y = r->y;
|
rectangle.y = r->y;
|
||||||
draw_rectangle(ctx, rectangle, 1.0,
|
draw_rectangle(ctx, rectangle, 1.0,
|
||||||
sel && is_client_tagged(sel, tag), ctx->fg);
|
sel && is_client_tagged(sel, tag), &ctx->fg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,9 +92,8 @@ tasklist_markup_on_elem(markup_parser_data_t *p, const char *elem,
|
||||||
if(!a_strcmp(*names, "color"))
|
if(!a_strcmp(*names, "color"))
|
||||||
{
|
{
|
||||||
xcolor_t bg_color;
|
xcolor_t bg_color;
|
||||||
xcolor_new(ctx->connection, ctx->phys_screen, *values, &bg_color);
|
xcolor_init(&bg_color, ctx->connection, ctx->phys_screen, *values);
|
||||||
draw_rectangle(ctx, *data->area, 1.0, true, bg_color);
|
draw_rectangle(ctx, *data->area, 1.0, true, &bg_color);
|
||||||
xcolor_wipe(&bg_color);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,7 +214,7 @@ tasklist_draw(draw_context_t *ctx, int screen,
|
||||||
draw_circle(ctx, w->area.x + icon_width + box_width * i,
|
draw_circle(ctx, w->area.x + icon_width + box_width * i,
|
||||||
w->area.y,
|
w->area.y,
|
||||||
(globalconf.font->height + 2) / 4,
|
(globalconf.font->height + 2) / 4,
|
||||||
c->ismax, ctx->fg);
|
c->ismax, &ctx->fg);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue