From 9fa01e34de239a50f89d94f2eb6f6269a592740d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 6 Jan 2008 22:57:23 +0100 Subject: [PATCH] rename textwidth to draw_textwidth --- draw.c | 4 ++-- draw.h | 2 +- widgets/taglist.c | 10 +++++----- widgets/textbox.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/draw.c b/draw.c index 20d095b2..2ebcaf89 100644 --- a/draw.c +++ b/draw.c @@ -107,7 +107,7 @@ draw_text(DrawCtx *ctx, len = sizeof(buf) - 1; memcpy(buf, text, len); buf[len] = 0; - while(len && (nw = (textwidth(font, buf)) + padding * 2) > w) + while(len && (nw = (draw_textwidth(font, buf)) + padding * 2) > w) buf[--len] = 0; if(nw > w) return; /* too long */ @@ -325,7 +325,7 @@ draw_rotate(DrawCtx *ctx, int screen, double angle, int tx, int ty) } unsigned short -textwidth(XftFont *font, char *text) +draw_textwidth(XftFont *font, char *text) { cairo_surface_t *surface; cairo_t *cr; diff --git a/draw.h b/draw.h index 798d988d..653754df 100644 --- a/draw.h +++ b/draw.h @@ -62,7 +62,7 @@ void draw_image(DrawCtx *, int, int, int, const char *); void draw_image_from_argb_data(DrawCtx *, int, int, int, int, int, unsigned char *); Area draw_get_image_size(const char *filename); Drawable draw_rotate(DrawCtx *, int, double, int, int); -unsigned short textwidth(XftFont *, char *); +unsigned short draw_textwidth(XftFont *, char *); Alignment draw_get_align(const char *); #endif diff --git a/widgets/taglist.c b/widgets/taglist.c index dc8c21ba..f04a085b 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -73,7 +73,7 @@ taglist_draw(Widget *widget, widget->area.width = 0; for(tag = vscreen.tags; tag; tag = tag->next) - widget->area.width += textwidth(vscreen.font, tag->name) + vscreen.font->height; + widget->area.width += draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(!widget->user_supplied_x) widget->area.x = widget_calculate_offset(widget->statusbar->width, @@ -87,7 +87,7 @@ taglist_draw(Widget *widget, widget->area.width = 0; for(tag = vscreen.tags; tag; tag = tag->next) { - w = textwidth(vscreen.font, tag->name) + vscreen.font->height; + w = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(tag->selected) colors = vscreen.colors_selected; else if(isurgent(tag)) @@ -132,7 +132,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) case Bottom: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(ev->x >= widget->area.x + prev_width && ev->x < widget->area.x + prev_width + width) { @@ -146,7 +146,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) case Right: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(ev->y >= widget->area.x + prev_width && ev->y < widget->area.x + prev_width + width) { @@ -160,7 +160,7 @@ taglist_button_press(Widget *widget, XButtonPressedEvent *ev) default: for(tag = vscreen.tags; tag; tag = tag->next, i++) { - width = textwidth(vscreen.font, tag->name) + vscreen.font->height; + width = draw_textwidth(vscreen.font, tag->name) + vscreen.font->height; if(widget->statusbar->width - ev->y >= widget->area.x + prev_width && widget->statusbar->width - ev->y < widget->area.x + prev_width + width) { diff --git a/widgets/textbox.c b/widgets/textbox.c index faea73e4..10900bea 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -44,7 +44,7 @@ textbox_draw(Widget *widget, DrawCtx *ctx, int offset, if(d->width) widget->area.width = d->width; else - widget->area.width = textwidth(widget->font, d->text); + widget->area.width = draw_textwidth(widget->font, d->text); widget->area.height = widget->statusbar->height;