98 |
coord_t *gps; |
coord_t *gps; |
99 |
gboolean gps_valid; |
gboolean gps_valid; |
100 |
|
|
101 |
|
#ifdef ENABLE_BALLOON |
102 |
//a balloon with additional info |
//a balloon with additional info |
103 |
struct { |
struct { |
104 |
coord_t *coo; |
coord_t *coo; |
107 |
OsmGpsMapBalloonCallback cb; |
OsmGpsMapBalloonCallback cb; |
108 |
gpointer data; |
gpointer data; |
109 |
} balloon; |
} balloon; |
110 |
|
#endif |
111 |
|
|
112 |
#ifdef ENABLE_OSD |
#ifdef ENABLE_OSD |
113 |
//the osd controls |
//the osd controls |
653 |
} |
} |
654 |
} |
} |
655 |
|
|
656 |
|
#ifdef ENABLE_BALLOON |
657 |
/* most visual effects are hardcoded by now, but may be made */ |
/* most visual effects are hardcoded by now, but may be made */ |
658 |
/* available via properties later */ |
/* available via properties later */ |
659 |
|
#ifndef BALLOON_AREA_WIDTH |
660 |
#define BALLOON_AREA_WIDTH 290 |
#define BALLOON_AREA_WIDTH 290 |
661 |
|
#endif |
662 |
|
#ifndef BALLOON_AREA_HEIGHT |
663 |
#define BALLOON_AREA_HEIGHT 75 |
#define BALLOON_AREA_HEIGHT 75 |
664 |
|
#endif |
665 |
|
#ifndef BALLOON_CORNER_RADIUS |
666 |
#define BALLOON_CORNER_RADIUS 20 |
#define BALLOON_CORNER_RADIUS 20 |
667 |
|
#endif |
668 |
|
|
669 |
#define BALLOON_BORDER (BALLOON_CORNER_RADIUS/4) |
#define BALLOON_BORDER (BALLOON_CORNER_RADIUS/4) |
670 |
#define BALLOON_WIDTH (BALLOON_AREA_WIDTH + 2 * BALLOON_BORDER) |
#define BALLOON_WIDTH (BALLOON_AREA_WIDTH + 2 * BALLOON_BORDER) |
671 |
#define BALLOON_HEIGHT (BALLOON_AREA_HEIGHT + 2 * BALLOON_BORDER) |
#define BALLOON_HEIGHT (BALLOON_AREA_HEIGHT + 2 * BALLOON_BORDER) |
859 |
(y > priv->balloon.rect.y) && |
(y > priv->balloon.rect.y) && |
860 |
(y < priv->balloon.rect.y + priv->balloon.rect.h)); |
(y < priv->balloon.rect.y + priv->balloon.rect.h)); |
861 |
} |
} |
862 |
|
#endif // ENABLE_BALLOON |
863 |
|
|
864 |
static void |
static void |
865 |
osm_gps_map_blit_tile(OsmGpsMap *map, GdkPixbuf *pixbuf, int offset_x, int offset_y) |
osm_gps_map_blit_tile(OsmGpsMap *map, GdkPixbuf *pixbuf, int offset_x, int offset_y) |
1776 |
osm_gps_map_print_tracks(map); |
osm_gps_map_print_tracks(map); |
1777 |
osm_gps_map_draw_gps_point(map); |
osm_gps_map_draw_gps_point(map); |
1778 |
osm_gps_map_print_images(map); |
osm_gps_map_print_images(map); |
1779 |
|
#ifdef ENABLE_BALLOON |
1780 |
osm_gps_map_draw_balloon_int(map); |
osm_gps_map_draw_balloon_int(map); |
1781 |
|
#endif |
1782 |
#ifdef ENABLE_OSD |
#ifdef ENABLE_OSD |
1783 |
osm_gps_map_osd_draw_controls(map, 0, 0); |
osm_gps_map_osd_draw_controls(map, 0, 0); |
1784 |
#endif |
#endif |
1813 |
priv->gps = g_new0(coord_t, 1); |
priv->gps = g_new0(coord_t, 1); |
1814 |
priv->gps_valid = FALSE; |
priv->gps_valid = FALSE; |
1815 |
|
|
1816 |
|
#ifdef ENABLE_BALLOON |
1817 |
priv->balloon.coo = g_new0(coord_t, 1); |
priv->balloon.coo = g_new0(coord_t, 1); |
1818 |
priv->balloon.valid = FALSE; |
priv->balloon.valid = FALSE; |
1819 |
priv->balloon.cb = NULL; |
priv->balloon.cb = NULL; |
1820 |
|
#endif |
1821 |
|
|
1822 |
#ifdef ENABLE_OSD |
#ifdef ENABLE_OSD |
1823 |
priv->osd.backup = NULL; |
priv->osd.backup = NULL; |
1981 |
g_source_remove (priv->idle_map_redraw); |
g_source_remove (priv->idle_map_redraw); |
1982 |
|
|
1983 |
g_free(priv->gps); |
g_free(priv->gps); |
1984 |
|
|
1985 |
|
#ifdef ENABLE_BALLOON |
1986 |
g_free(priv->balloon.coo); |
g_free(priv->balloon.coo); |
1987 |
|
#endif |
1988 |
|
|
1989 |
#ifdef ENABLE_OSD |
#ifdef ENABLE_OSD |
1990 |
if (priv->osd.backup) |
if (priv->osd.backup) |
2206 |
{ |
{ |
2207 |
OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); |
OsmGpsMapPrivate *priv = OSM_GPS_MAP_PRIVATE(widget); |
2208 |
|
|
2209 |
|
#ifdef ENABLE_BALLOON |
2210 |
/* don't drag if the user clicked within the balloon */ |
/* don't drag if the user clicked within the balloon */ |
2211 |
if (osm_gps_map_in_balloon(priv, |
if (osm_gps_map_in_balloon(priv, |
2212 |
event->x + EXTRA_BORDER, |
event->x + EXTRA_BORDER, |
2215 |
priv->drag_counter = -1; |
priv->drag_counter = -1; |
2216 |
return FALSE; |
return FALSE; |
2217 |
} |
} |
2218 |
|
#endif |
2219 |
|
|
2220 |
#ifdef ENABLE_OSD |
#ifdef ENABLE_OSD |
2221 |
/* also don't drag on clicks into the control OSD */ |
/* also don't drag on clicks into the control OSD */ |
2284 |
} |
} |
2285 |
#endif |
#endif |
2286 |
|
|
2287 |
|
#ifdef ENABLE_BALLOON |
2288 |
/* released inside the balloon? */ |
/* released inside the balloon? */ |
2289 |
if (osm_gps_map_in_balloon(priv, |
if (osm_gps_map_in_balloon(priv, |
2290 |
event->x + EXTRA_BORDER, |
event->x + EXTRA_BORDER, |
2294 |
event->x - priv->balloon.rect.x + EXTRA_BORDER, |
event->x - priv->balloon.rect.x + EXTRA_BORDER, |
2295 |
event->y - priv->balloon.rect.y + EXTRA_BORDER); |
event->y - priv->balloon.rect.y + EXTRA_BORDER); |
2296 |
} |
} |
2297 |
|
#endif |
2298 |
|
|
2299 |
if (priv->dragging) |
if (priv->dragging) |
2300 |
{ |
{ |
3240 |
return osm_gps_map_get_scale_at_point(priv->map_zoom, priv->center_rlat, priv->center_rlon); |
return osm_gps_map_get_scale_at_point(priv->map_zoom, priv->center_rlat, priv->center_rlon); |
3241 |
} |
} |
3242 |
|
|
3243 |
|
#ifdef ENABLE_BALLOON |
3244 |
void |
void |
3245 |
osm_gps_map_draw_balloon (OsmGpsMap *map, float latitude, float longitude, |
osm_gps_map_draw_balloon (OsmGpsMap *map, float latitude, float longitude, |
3246 |
OsmGpsMapBalloonCallback cb, gpointer data) |
OsmGpsMapBalloonCallback cb, gpointer data) |
3276 |
|
|
3277 |
osm_gps_map_map_redraw_idle(map); |
osm_gps_map_map_redraw_idle(map); |
3278 |
} |
} |
3279 |
|
#endif |