rename textwidth to draw_textwidth

This commit is contained in:
Julien Danjou 2008-01-06 22:57:23 +01:00
parent bdfb84f3b5
commit 9fa01e34de
4 changed files with 9 additions and 9 deletions

4
draw.c
View File

@ -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;

2
draw.h
View File

@ -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

View File

@ -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)
{

View File

@ -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;