mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
rename a bunch of draw functions
This commit is contained in:
parent
e72a278080
commit
c232576631
8 changed files with 51 additions and 50 deletions
13
draw.c
13
draw.c
|
@ -52,7 +52,7 @@ draw_free_context(DrawCtx *ctx)
|
|||
}
|
||||
|
||||
void
|
||||
drawtext(DrawCtx *ctx, int x, int y, int w, int h, XftFont *font, const char *text, XColor fg, XColor bg)
|
||||
draw_text(DrawCtx *ctx, int x, int y, int w, int h, XftFont *font, const char *text, XColor fg, XColor bg)
|
||||
{
|
||||
int nw = 0;
|
||||
static char buf[256];
|
||||
|
@ -61,7 +61,7 @@ drawtext(DrawCtx *ctx, int x, int y, int w, int h, XftFont *font, const char *te
|
|||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
||||
drawrectangle(ctx, x, y, w, h, True, bg);
|
||||
draw_rectangle(ctx, x, y, w, h, True, bg);
|
||||
if(!a_strlen(text))
|
||||
return;
|
||||
|
||||
|
@ -100,7 +100,7 @@ drawtext(DrawCtx *ctx, int x, int y, int w, int h, XftFont *font, const char *te
|
|||
}
|
||||
|
||||
void
|
||||
drawrectangle(DrawCtx *ctx, int x, int y, int w, int h, Bool filled, XColor color)
|
||||
draw_rectangle(DrawCtx *ctx, int x, int y, int w, int h, Bool filled, XColor color)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
@ -126,7 +126,7 @@ drawrectangle(DrawCtx *ctx, int x, int y, int w, int h, Bool filled, XColor colo
|
|||
}
|
||||
|
||||
void
|
||||
drawcircle(DrawCtx *ctx, int x, int y, int r, Bool filled, XColor color)
|
||||
draw_circle(DrawCtx *ctx, int x, int y, int r, Bool filled, XColor color)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_t *cr;
|
||||
|
@ -175,7 +175,7 @@ void draw_image_from_argb_data(DrawCtx *ctx, int x, int y, int w, int h,
|
|||
}
|
||||
|
||||
void
|
||||
drawimage(DrawCtx *ctx, int x, int y, const char *filename)
|
||||
draw_image(DrawCtx *ctx, int x, int y, const char *filename)
|
||||
{
|
||||
cairo_surface_t *surface, *source;
|
||||
cairo_t *cr;
|
||||
|
@ -191,7 +191,8 @@ drawimage(DrawCtx *ctx, int x, int y, const char *filename)
|
|||
cairo_surface_destroy(surface);
|
||||
}
|
||||
|
||||
int draw_get_image_width(const char *filename)
|
||||
int
|
||||
draw_get_image_width(const char *filename)
|
||||
{
|
||||
int width;
|
||||
cairo_surface_t *surface;
|
||||
|
|
8
draw.h
8
draw.h
|
@ -38,10 +38,10 @@ struct DrawCtx
|
|||
|
||||
DrawCtx *draw_get_context(Display*, int, int, int);
|
||||
void draw_free_context(DrawCtx*);
|
||||
void drawtext(DrawCtx *, int, int, int, int, XftFont *, const char *, XColor fg, XColor bg);
|
||||
void drawrectangle(DrawCtx *, int, int, int, int, Bool, XColor);
|
||||
void drawcircle(DrawCtx *, int, int, int, Bool, XColor);
|
||||
void drawimage(DrawCtx *, int, int, const char *);
|
||||
void draw_text(DrawCtx *, int, int, int, int, XftFont *, const char *, XColor fg, XColor bg);
|
||||
void draw_rectangle(DrawCtx *, int, int, int, int, Bool, XColor);
|
||||
void draw_circle(DrawCtx *, int, int, int, Bool, XColor);
|
||||
void draw_image(DrawCtx *, int, int, const char *);
|
||||
void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *);
|
||||
int draw_get_image_width(const char *filename);
|
||||
Drawable draw_rotate(DrawCtx *, int, double, int, int);
|
||||
|
|
14
statusbar.c
14
statusbar.c
|
@ -48,13 +48,13 @@ statusbar_draw(int screen)
|
|||
DrawCtx *ctx = draw_get_context(globalconf.display, phys_screen,
|
||||
vscreen.statusbar->width,
|
||||
vscreen.statusbar->height);
|
||||
drawrectangle(ctx,
|
||||
0,
|
||||
0,
|
||||
vscreen.statusbar->width,
|
||||
vscreen.statusbar->height,
|
||||
True,
|
||||
vscreen.colors_normal[ColBG]);
|
||||
draw_rectangle(ctx,
|
||||
0,
|
||||
0,
|
||||
vscreen.statusbar->width,
|
||||
vscreen.statusbar->height,
|
||||
True,
|
||||
vscreen.colors_normal[ColBG]);
|
||||
for(widget = vscreen.statusbar->widgets; widget; widget = widget->next)
|
||||
if (widget->alignment == AlignLeft)
|
||||
left += widget->draw(widget, ctx, left, (left + right));
|
||||
|
|
|
@ -20,21 +20,21 @@ focustitle_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
|||
|
||||
if(sel)
|
||||
{
|
||||
drawtext(ctx, location, 0, vscreen.statusbar->width - used,
|
||||
vscreen.statusbar->height, vscreen.font, sel->name,
|
||||
vscreen.colors_selected[ColFG],
|
||||
vscreen.colors_selected[ColBG]);
|
||||
draw_text(ctx, location, 0, vscreen.statusbar->width - used,
|
||||
vscreen.statusbar->height, vscreen.font, sel->name,
|
||||
vscreen.colors_selected[ColFG],
|
||||
vscreen.colors_selected[ColBG]);
|
||||
if(sel->isfloating)
|
||||
drawcircle(ctx, location, 0,
|
||||
(vscreen.font->height + 2) / 4,
|
||||
sel->ismax,
|
||||
vscreen.colors_selected[ColFG]);
|
||||
draw_circle(ctx, location, 0,
|
||||
(vscreen.font->height + 2) / 4,
|
||||
sel->ismax,
|
||||
vscreen.colors_selected[ColFG]);
|
||||
}
|
||||
else
|
||||
drawtext(ctx, location, 0, vscreen.statusbar->width - used,
|
||||
vscreen.statusbar->height, vscreen.font, NULL,
|
||||
vscreen.colors_normal[ColFG],
|
||||
vscreen.colors_normal[ColBG]);
|
||||
draw_text(ctx, location, 0, vscreen.statusbar->width - used,
|
||||
vscreen.statusbar->height, vscreen.font, NULL,
|
||||
vscreen.colors_normal[ColFG],
|
||||
vscreen.colors_normal[ColBG]);
|
||||
return vscreen.statusbar->width - used;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
offset,
|
||||
widget->alignment);
|
||||
|
||||
drawimage(ctx, location, 0, widget->data);
|
||||
draw_image(ctx, location, 0, widget->data);
|
||||
|
||||
return width;
|
||||
}
|
||||
|
|
|
@ -41,13 +41,13 @@ layoutinfo_draw(Widget *widget,
|
|||
width,
|
||||
offset,
|
||||
widget->alignment);
|
||||
drawtext(ctx, location, 0,
|
||||
width,
|
||||
vscreen.statusbar->height,
|
||||
vscreen.font,
|
||||
get_current_layout(widget->statusbar->screen)->symbol,
|
||||
vscreen.colors_normal[ColFG],
|
||||
vscreen.colors_normal[ColBG]);
|
||||
draw_text(ctx, location, 0,
|
||||
width,
|
||||
vscreen.statusbar->height,
|
||||
vscreen.font,
|
||||
get_current_layout(widget->statusbar->screen)->symbol,
|
||||
vscreen.colors_normal[ColFG],
|
||||
vscreen.colors_normal[ColBG]);
|
||||
return width;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,18 +75,18 @@ taglist_draw(Widget *widget,
|
|||
colors = vscreen.colors_selected;
|
||||
else
|
||||
colors = vscreen.colors_normal;
|
||||
drawtext(ctx, location + width, 0, w,
|
||||
vscreen.statusbar->height,
|
||||
vscreen.font,
|
||||
tag->name,
|
||||
colors[ColFG],
|
||||
colors[ColBG]);
|
||||
draw_text(ctx, location + width, 0, w,
|
||||
vscreen.statusbar->height,
|
||||
vscreen.font,
|
||||
tag->name,
|
||||
colors[ColFG],
|
||||
colors[ColBG]);
|
||||
if(isoccupied(widget->statusbar->screen, tag))
|
||||
drawrectangle(ctx, location + width, 0, flagsize, flagsize,
|
||||
sel && is_client_tagged(sel,
|
||||
tag,
|
||||
widget->statusbar->screen),
|
||||
colors[ColFG]);
|
||||
draw_rectangle(ctx, location + width, 0, flagsize, flagsize,
|
||||
sel && is_client_tagged(sel,
|
||||
tag,
|
||||
widget->statusbar->screen),
|
||||
colors[ColFG]);
|
||||
width += w;
|
||||
}
|
||||
return width;
|
||||
|
|
|
@ -56,8 +56,8 @@ textbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
|||
offset,
|
||||
widget->alignment);
|
||||
|
||||
drawtext(ctx, location, 0, width, vscreen.statusbar->height,
|
||||
vscreen.font, d->text, d->fg, d->bg);
|
||||
draw_text(ctx, location, 0, width, vscreen.statusbar->height,
|
||||
vscreen.font, d->text, d->fg, d->bg);
|
||||
return width;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue