1248 |
{ |
{ |
1249 |
OsmGpsMapPrivate *priv = map->priv; |
OsmGpsMapPrivate *priv = map->priv; |
1250 |
|
|
1251 |
|
/* on diablo the map comes up at 1x1 pixel size and */ |
1252 |
|
/* isn't really usable. we'll just ignore this ... */ |
1253 |
|
if((GTK_WIDGET(map)->allocation.width < 2) || |
1254 |
|
(GTK_WIDGET(map)->allocation.height < 2)) { |
1255 |
|
printf("not a useful sized map yet ...\n"); |
1256 |
|
return FALSE; |
1257 |
|
} |
1258 |
|
|
1259 |
priv->idle_map_redraw = 0; |
priv->idle_map_redraw = 0; |
1260 |
|
|
1261 |
|
#ifdef ENABLE_OSD |
1262 |
/* don't redraw the entire map while the OSD is doing */ |
/* don't redraw the entire map while the OSD is doing */ |
1263 |
/* some animation or the like. This is to keep the animation */ |
/* some animation or the like. This is to keep the animation */ |
1264 |
/* fluid */ |
/* fluid */ |
1265 |
if (priv->osd->busy(priv->osd)) |
if (priv->osd->busy(priv->osd)) |
1266 |
return FALSE; |
return FALSE; |
1267 |
|
#endif |
1268 |
|
|
1269 |
#ifdef DRAG_DEBUG |
#ifdef DRAG_DEBUG |
1270 |
printf("trying redraw\n"); |
printf("trying redraw\n"); |
2846 |
osm_gps_map_map_redraw_idle(map); |
osm_gps_map_map_redraw_idle(map); |
2847 |
} |
} |
2848 |
|
|
2849 |
osm_gps_map_osd_t *osm_gps_map_osd_get(OsmGpsMap *map) { |
osm_gps_map_osd_t * |
2850 |
|
osm_gps_map_osd_get(OsmGpsMap *map) |
2851 |
|
{ |
2852 |
g_return_val_if_fail (OSM_IS_GPS_MAP (map), NULL); |
g_return_val_if_fail (OSM_IS_GPS_MAP (map), NULL); |
2853 |
return map->priv->osd; |
return map->priv->osd; |
2854 |
} |
} |
2855 |
|
|
2856 |
void osm_gps_map_register_osd(OsmGpsMap *map, osm_gps_map_osd_t *osd) { |
void |
2857 |
|
osm_gps_map_register_osd(OsmGpsMap *map, osm_gps_map_osd_t *osd) |
2858 |
|
{ |
2859 |
OsmGpsMapPrivate *priv; |
OsmGpsMapPrivate *priv; |
2860 |
|
|
2861 |
g_return_if_fail (OSM_IS_GPS_MAP (map)); |
g_return_if_fail (OSM_IS_GPS_MAP (map)); |
2867 |
} |
} |
2868 |
|
|
2869 |
void |
void |
2870 |
osm_gps_map_repaint (OsmGpsMap *map) { |
osm_gps_map_repaint (OsmGpsMap *map) |
2871 |
|
{ |
2872 |
osm_gps_map_expose (GTK_WIDGET(map), NULL); |
osm_gps_map_expose (GTK_WIDGET(map), NULL); |
2873 |
} |
} |
2874 |
|
|
2875 |
|
coord_t * |
2876 |
|
osm_gps_map_get_gps (OsmGpsMap *map) |
2877 |
|
{ |
2878 |
|
g_return_val_if_fail (OSM_IS_GPS_MAP (map), NULL); |
2879 |
|
|
2880 |
|
if(!map->priv->gps_valid) |
2881 |
|
return NULL; |
2882 |
|
|
2883 |
|
return map->priv->gps; |
2884 |
|
} |
2885 |
|
|
2886 |
#endif |
#endif |