[draw] Rename var

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-08 10:58:48 +02:00
parent 4f0dbdabb0
commit 8776b3adb5
1 changed files with 10 additions and 9 deletions

View File

@ -1009,20 +1009,21 @@ draw_rotate(draw_context_t *ctx,
cairo_surface_destroy(surface); cairo_surface_destroy(surface);
} }
/** Return the width of a text in pixel /** Return the width and height of a text in pixel.
* \param conn Connection ref * \param conn Connection ref.
* \param font font to use * \param phys_screen Physical screen number.
* \param text the text * \param font Font to use.
* \return text width * \param text The text.
* \return Text height and width.
*/ */
area_t area_t
draw_text_extents(xcb_connection_t *conn, int default_screen, font_t *font, const char *text) draw_text_extents(xcb_connection_t *conn, int phys_screen, font_t *font, const char *text)
{ {
cairo_surface_t *surface; cairo_surface_t *surface;
cairo_t *cr; cairo_t *cr;
PangoLayout *layout; PangoLayout *layout;
PangoRectangle ext; PangoRectangle ext;
xcb_screen_t *s = xcb_aux_get_screen(conn, default_screen); xcb_screen_t *s = xcb_aux_get_screen(conn, phys_screen);
area_t geom = { 0, 0, 0, 0, NULL, NULL }; area_t geom = { 0, 0, 0, 0, NULL, NULL };
ssize_t len; ssize_t len;
char *buf, *utf8; char *buf, *utf8;
@ -1039,7 +1040,7 @@ draw_text_extents(xcb_connection_t *conn, int default_screen, font_t *font, cons
p_clear(&parser_data, 1); p_clear(&parser_data, 1);
parser_data.connection = conn; parser_data.connection = conn;
parser_data.phys_screen = default_screen; parser_data.phys_screen = phys_screen;
if(draw_text_markup_expand(&parser_data, utf8, len)) if(draw_text_markup_expand(&parser_data, utf8, len))
{ {
buf = parser_data.text; buf = parser_data.text;
@ -1050,7 +1051,7 @@ draw_text_extents(xcb_connection_t *conn, int default_screen, font_t *font, cons
len = a_strlen(buf); len = a_strlen(buf);
surface = cairo_xcb_surface_create(conn, default_screen, surface = cairo_xcb_surface_create(conn, phys_screen,
draw_screen_default_visual(s), draw_screen_default_visual(s),
s->width_in_pixels, s->width_in_pixels,
s->height_in_pixels); s->height_in_pixels);