825 |
return FALSE; |
return FALSE; |
826 |
} |
} |
827 |
|
|
|
#ifdef USE_MAEMO |
|
828 |
static gboolean on_focus_out(GtkWidget *widget, GdkEventFocus *event, |
static gboolean on_focus_out(GtkWidget *widget, GdkEventFocus *event, |
829 |
gpointer data) { |
gpointer data) { |
830 |
map_context_t *context = (map_context_t*)data; |
map_context_t *context = (map_context_t*)data; |
831 |
|
|
832 |
printf("map lost focus\n"); |
printf("map lost focus\n"); |
833 |
|
|
834 |
|
/* save new map position */ |
835 |
|
gfloat lat, lon; |
836 |
|
g_object_get(widget, "latitude", &lat, "longitude", &lon, NULL); |
837 |
|
|
838 |
|
context->appdata->map.pos.lat = lat; |
839 |
|
context->appdata->map.pos.lon = lon; |
840 |
|
|
841 |
|
#ifdef USE_MAEMO |
842 |
gtk_timeout_remove(context->handler_id); |
gtk_timeout_remove(context->handler_id); |
843 |
context->handler_id = 0; |
context->handler_id = 0; |
844 |
|
#endif |
845 |
|
|
846 |
return FALSE; |
return FALSE; |
847 |
} |
} |
|
#endif |
|
848 |
|
|
849 |
void map_update(appdata_t *appdata) { |
void map_update(appdata_t *appdata) { |
850 |
printf("map_update\n"); |
printf("map_update\n"); |
939 |
g_signal_connect(G_OBJECT(context->widget), "focus-in-event", |
g_signal_connect(G_OBJECT(context->widget), "focus-in-event", |
940 |
G_CALLBACK(on_focus_in), context); |
G_CALLBACK(on_focus_in), context); |
941 |
|
|
|
#ifdef USE_MAEMO |
|
942 |
g_signal_connect(G_OBJECT(context->widget), "focus-out-event", |
g_signal_connect(G_OBJECT(context->widget), "focus-out-event", |
943 |
G_CALLBACK(on_focus_out), context); |
G_CALLBACK(on_focus_out), context); |
|
#endif |
|
944 |
|
|
945 |
g_signal_connect(G_OBJECT(context->widget), "configure-event", |
g_signal_connect(G_OBJECT(context->widget), "configure-event", |
946 |
G_CALLBACK(on_map_configure), context); |
G_CALLBACK(on_map_configure), context); |