24 |
|
|
25 |
/* |
/* |
26 |
* TODO: |
* TODO: |
|
* - draw caches only once |
|
|
* - prefer duplicates from selected files |
|
27 |
* - make semi-transparent caches selectable |
* - make semi-transparent caches selectable |
28 |
*/ |
*/ |
29 |
|
|
493 |
|
|
494 |
#ifndef BIG_BALLOONS |
#ifndef BIG_BALLOONS |
495 |
#define ICON_SIZE ICON_CACHE_TYPE |
#define ICON_SIZE ICON_CACHE_TYPE |
|
#define LINE_SKIP 7 |
|
496 |
#else |
#else |
497 |
#define ICON_SIZE ICON_CACHE_TYPE_1_5X |
#define ICON_SIZE ICON_CACHE_TYPE_1_5X |
|
#define LINE_SKIP 7 |
|
498 |
#endif |
#endif |
499 |
|
|
500 |
|
#ifndef BIG_BALLOONS |
501 |
|
#define FONT_SIZE 14.0 |
502 |
|
#else |
503 |
|
#define FONT_SIZE 22.0 |
504 |
|
#endif |
505 |
|
#define LINE_SKIP (FONT_SIZE/4) |
506 |
|
|
507 |
|
|
508 |
static void |
static void |
509 |
balloon_cb(osm_gps_map_balloon_event_t *event, gpointer data) { |
balloon_cb(osm_gps_map_balloon_event_t *event, gpointer data) { |
510 |
printf("balloon event: "); |
printf("balloon event: "); |
574 |
CAIRO_FONT_SLANT_NORMAL, |
CAIRO_FONT_SLANT_NORMAL, |
575 |
CAIRO_FONT_WEIGHT_NORMAL); |
CAIRO_FONT_WEIGHT_NORMAL); |
576 |
|
|
|
#ifndef BIG_BALLOONS |
|
|
#define FONT_SIZE 14.0 |
|
|
#else |
|
|
#define FONT_SIZE 22.0 |
|
|
#endif |
|
|
|
|
577 |
cairo_set_font_size (event->data.draw.cr, FONT_SIZE); |
cairo_set_font_size (event->data.draw.cr, FONT_SIZE); |
578 |
|
|
579 |
if(cache->name) { |
if(cache->name) { |
580 |
/* draw cache name */ |
/* draw cache name */ |
581 |
cairo_text_extents (event->data.draw.cr, cache->name, &extents); |
cairo_text_extents (event->data.draw.cr, cache->name, &extents); |
582 |
y += extents.height; |
cairo_move_to (event->data.draw.cr, x, y - extents.y_bearing); |
|
cairo_move_to (event->data.draw.cr, x, y); |
|
583 |
cairo_set_source_rgba (event->data.draw.cr, 0, 0, 0, 1); |
cairo_set_source_rgba (event->data.draw.cr, 0, 0, 0, 1); |
584 |
cairo_show_text (event->data.draw.cr, cache->name); |
cairo_show_text (event->data.draw.cr, cache->name); |
585 |
cairo_stroke (event->data.draw.cr); |
cairo_stroke (event->data.draw.cr); |
586 |
|
|
587 |
/* return to the left border and below text */ |
/* return to the left border and below text */ |
588 |
y += LINE_SKIP; |
y += LINE_SKIP + FONT_SIZE; |
589 |
x = event->data.draw.rect->x; |
x = event->data.draw.rect->x; |
590 |
} |
} |
591 |
|
|