304 |
cairo_paint(cr); |
cairo_paint(cr); |
305 |
} |
} |
306 |
|
|
307 |
|
#define LINE_SKIP 10 |
308 |
|
|
309 |
static void |
static void |
310 |
balloon_draw_cb(cairo_t *cr, OsmGpsMapRect_t *rect, gpointer data) { |
balloon_draw_cb(cairo_t *cr, OsmGpsMapRect_t *rect, gpointer data) { |
311 |
cache_t *cache = (cache_t*)data; |
cache_t *cache = (cache_t*)data; |
338 |
cairo_set_font_size (cr, 20.0); |
cairo_set_font_size (cr, 20.0); |
339 |
cairo_text_extents (cr, cache->id, &extents); |
cairo_text_extents (cr, cache->id, &extents); |
340 |
|
|
341 |
/* draw right of icon vertically centered */ |
/* display id right of icon vertically centered */ |
342 |
x += gdk_pixbuf_get_width(icon) + 5; |
x += gdk_pixbuf_get_width(icon) + 5; |
343 |
y += (gdk_pixbuf_get_height(icon) + extents.height)/2; |
y += (gdk_pixbuf_get_height(icon) + extents.height)/2; |
|
|
|
344 |
cairo_move_to (cr, x,y); |
cairo_move_to (cr, x,y); |
|
printf("trying to draw %s\n", cache->id); |
|
345 |
cairo_set_source_rgba (cr, 0, 0, 0, 1); |
cairo_set_source_rgba (cr, 0, 0, 0, 1); |
346 |
cairo_show_text (cr, cache->id); |
cairo_show_text (cr, cache->id); |
347 |
cairo_stroke (cr); |
cairo_stroke (cr); |
348 |
|
|
349 |
|
/* return to the left border and below icon/text */ |
350 |
|
x = rect->x; |
351 |
|
y += (gdk_pixbuf_get_height(icon) - extents.height)/2 + LINE_SKIP; |
352 |
|
|
353 |
|
cairo_select_font_face (cr, "Sans", |
354 |
|
CAIRO_FONT_SLANT_NORMAL, |
355 |
|
CAIRO_FONT_WEIGHT_NORMAL); |
356 |
|
cairo_set_font_size (cr, 14.0); |
357 |
|
cairo_text_extents (cr, cache->name, &extents); |
358 |
|
|
359 |
|
cairo_move_to (cr, x,y); |
360 |
|
cairo_show_text (cr, cache->name); |
361 |
|
cairo_stroke (cr); |
362 |
|
|
363 |
|
/* return to the left border and below text */ |
364 |
|
x = rect->x; |
365 |
|
y += extents.height + LINE_SKIP; |
366 |
} |
} |
367 |
|
|
368 |
static gboolean |
static gboolean |