Diff of /trunk/src/map-tool.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 65 by harbaum, Wed Aug 19 14:21:14 2009 UTC revision 66 by harbaum, Wed Aug 19 20:03:28 2009 UTC
# Line 66  static const char *get_proxy_uri(appdata Line 66  static const char *get_proxy_uri(appdata
66    return NULL;    return NULL;
67  }  }
68    
69  /* TODO: This needs to be wired to the GPS button in osm_gps_map */  static void
70  #if 0  cb_map_gps(map_context_t *context) {
 static gboolean  
 cb_map_gps(GtkButton *button, map_context_t *context) {  
71    pos_t *refpos = get_pos(context->appdata);    pos_t *refpos = get_pos(context->appdata);
72    if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) {    if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) {
73      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),
# Line 79  cb_map_gps(GtkButton *button, map_contex Line 77  cb_map_gps(GtkButton *button, map_contex
77      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),      osm_gps_map_set_mapcenter(OSM_GPS_MAP(context->widget),
78                                0.0, 0.0, 1);                                0.0, 0.0, 1);
79    }    }
   
   return FALSE;  
80  }  }
 #endif  
81    
82  static int dist2pixel(map_context_t *context, float km, float lat) {  static int dist2pixel(map_context_t *context, float km, float lat) {
83    return 1000.0*km/osm_gps_map_get_scale(OSM_GPS_MAP(context->widget));    return 1000.0*km/osm_gps_map_get_scale(OSM_GPS_MAP(context->widget));
# Line 96  static gboolean map_gps_update(gpointer Line 91  static gboolean map_gps_update(gpointer
91    gboolean ok = (refpos!= NULL) && !isnan(refpos->lat) && !isnan(refpos->lon);    gboolean ok = (refpos!= NULL) && !isnan(refpos->lat) && !isnan(refpos->lon);
92    
93    /* ... and enable "goto" button if it's valid */    /* ... and enable "goto" button if it's valid */
94    /* TODO: gtk_widget_set_sensitive(context->gps, ok); */    osm_gps_map_osd_enable_gps (OSM_GPS_MAP(context->widget),
95                                  OSM_GPS_MAP_OSD_GPS_CALLBACK(ok?cb_map_gps:NULL), context);
96    
97    if(ok) {    if(ok) {
98      float heading = NAN;      float heading = NAN;
# Line 325  balloon_draw_cb(cairo_t *cr, OsmGpsMapRe Line 321  balloon_draw_cb(cairo_t *cr, OsmGpsMapRe
321  #ifndef BIG_BALLOONS  #ifndef BIG_BALLOONS
322    cairo_set_font_size (cr, 14.0);    cairo_set_font_size (cr, 14.0);
323  #else  #else
324    cairo_set_font_size (cr, 24.0);    cairo_set_font_size (cr, 22.0);
325  #endif  #endif
326    
327    if(cache->name) {    if(cache->name) {
# Line 516  void map(appdata_t *appdata) { Line 512  void map(appdata_t *appdata) {
512    g_signal_connect(G_OBJECT(context->widget), "button-release-event",    g_signal_connect(G_OBJECT(context->widget), "button-release-event",
513                     G_CALLBACK(on_map_button_release_event), context);                     G_CALLBACK(on_map_button_release_event), context);
514    
   /* TODO: gtk_widget_set_sensitive(context->gps, FALSE); */  
   
515    /* install handler for timed updates of the gps button */    /* install handler for timed updates of the gps button */
516    context->handler_id = gtk_timeout_add(1000, map_gps_update, context);    context->handler_id = gtk_timeout_add(1000, map_gps_update, context);
517    

Legend:
Removed from v.65  
changed lines
  Added in v.66