From c232576631c8028abda2aa285f5e595a241c11c1 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 22 Dec 2007 20:17:24 +0100 Subject: [PATCH] rename a bunch of draw functions --- draw.c | 13 +++++++------ draw.h | 8 ++++---- statusbar.c | 14 +++++++------- widgets/focustitle.c | 24 ++++++++++++------------ widgets/iconbox.c | 2 +- widgets/layoutinfo.c | 14 +++++++------- widgets/taglist.c | 22 +++++++++++----------- widgets/textbox.c | 4 ++-- 8 files changed, 51 insertions(+), 50 deletions(-) diff --git a/draw.c b/draw.c index 216765b09..4869c2a15 100644 --- a/draw.c +++ b/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; diff --git a/draw.h b/draw.h index e0787510d..ca27fe9ca 100644 --- a/draw.h +++ b/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); diff --git a/statusbar.c b/statusbar.c index 07e169b61..9ca811076 100644 --- a/statusbar.c +++ b/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)); diff --git a/widgets/focustitle.c b/widgets/focustitle.c index 3c60ebc30..97938d994 100644 --- a/widgets/focustitle.c +++ b/widgets/focustitle.c @@ -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; } diff --git a/widgets/iconbox.c b/widgets/iconbox.c index 0f67babfc..3ce47629d 100644 --- a/widgets/iconbox.c +++ b/widgets/iconbox.c @@ -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; } diff --git a/widgets/layoutinfo.c b/widgets/layoutinfo.c index 8ec426104..5ed82d5e0 100644 --- a/widgets/layoutinfo.c +++ b/widgets/layoutinfo.c @@ -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; } diff --git a/widgets/taglist.c b/widgets/taglist.c index 776b72842..4ebe0324c 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -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; diff --git a/widgets/textbox.c b/widgets/textbox.c index d24457eb3..2a79b3a9a 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -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; }