2 * Copyright (C) 2006, 2007 John Costigan.
4 * POI and GPS-Info code originally written by Cezary Jackiewicz.
6 * Default map data provided by http://www.openstreetmap.org/
8 * This file is part of Maemo Mapper.
10 * Maemo Mapper is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * Maemo Mapper is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Maemo Mapper. If not, see <http://www.gnu.org/licenses/>.
35 # include <hildon/hildon-note.h>
36 # include <hildon/hildon-banner.h>
38 # include <hildon-widgets/hildon-note.h>
39 # include <hildon-widgets/hildon-banner.h>
48 #include "gdk-pixbuf-rotate.h"
56 cmenu_show_latlon(gint unitx, gint unity)
59 gchar buffer[80], tmp1[LL_FMT_LEN], tmp2[LL_FMT_LEN];
60 printf("%s()\n", __PRETTY_FUNCTION__);
62 unit2latlon(unitx, unity, lat, lon);
63 lat_format(lat, tmp1);
64 lon_format(lon, tmp2);
66 snprintf(buffer, sizeof(buffer),
70 _("Longitude"), tmp2);
72 MACRO_BANNER_SHOW_INFO(_window, buffer);
74 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
78 cmenu_clip_latlon(gint unitx, gint unity)
82 printf("%s()\n", __PRETTY_FUNCTION__);
84 unit2latlon(unitx, unity, lat, lon);
86 snprintf(buffer, sizeof(buffer), "%.06f,%.06f", lat, lon);
88 gtk_clipboard_set_text(
89 gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), buffer, -1);
91 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
95 cmenu_route_to(gint unitx, gint unity)
101 printf("%s()\n", __PRETTY_FUNCTION__);
103 unit2latlon(unitx, unity, lat, lon);
105 g_ascii_formatd(strlat, 32, "%.06f", lat);
106 g_ascii_formatd(strlon, 32, "%.06f", lon);
107 snprintf(buffer, sizeof(buffer), "%s, %s", strlat, strlon);
109 route_download(buffer);
111 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
115 cmenu_distance_to(gint unitx, gint unity)
119 printf("%s()\n", __PRETTY_FUNCTION__);
121 unit2latlon(unitx, unity, lat, lon);
123 snprintf(buffer, sizeof(buffer), "%s: %.02f %s", _("Distance"),
124 calculate_distance(_gps.lat, _gps.lon, lat, lon)
125 * UNITS_CONVERT[_units],
126 UNITS_ENUM_TEXT[_units]);
127 MACRO_BANNER_SHOW_INFO(_window, buffer);
129 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
133 cmenu_add_route(gint unitx, gint unity)
135 printf("%s()\n", __PRETTY_FUNCTION__);
136 MACRO_PATH_INCREMENT_TAIL(_route);
137 screen2unit(_cmenu_position_x, _cmenu_position_y,
138 _route.tail->unitx, _route.tail->unity);
139 route_find_nearest_point();
141 vprintf("%s(): return\n", __PRETTY_FUNCTION__);
145 cmenu_cb_loc_show_latlon(GtkMenuItem *item)
149 printf("%s()\n", __PRETTY_FUNCTION__);
151 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
152 unit2latlon(unitx, unity, lat, lon);
154 latlon_dialog(lat, lon);
156 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
161 cmenu_cb_loc_route_to(GtkMenuItem *item)
164 printf("%s()\n", __PRETTY_FUNCTION__);
166 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
167 cmenu_route_to(unitx, unity);
169 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
174 cmenu_cb_loc_download_poi(GtkMenuItem *item)
177 printf("%s()\n", __PRETTY_FUNCTION__);
179 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
180 poi_download_dialog(unitx, unity);
182 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
187 cmenu_cb_loc_browse_poi(GtkMenuItem *item)
190 printf("%s()\n", __PRETTY_FUNCTION__);
192 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
193 poi_browse_dialog(unitx, unity);
195 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
200 cmenu_cb_loc_distance_to(GtkMenuItem *item)
203 printf("%s()\n", __PRETTY_FUNCTION__);
205 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
206 cmenu_distance_to(unitx, unity);
208 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
213 cmenu_cb_loc_add_route(GtkMenuItem *item)
216 printf("%s()\n", __PRETTY_FUNCTION__);
218 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
219 cmenu_add_route(unitx, unity);
221 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
226 cmenu_cb_loc_add_way(GtkMenuItem *item)
229 printf("%s()\n", __PRETTY_FUNCTION__);
231 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
232 route_add_way_dialog(unitx, unity);
234 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
239 cmenu_cb_loc_add_poi(GtkMenuItem *item)
242 printf("%s()\n", __PRETTY_FUNCTION__);
244 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
245 poi_add_dialog(_window, unitx, unity);
247 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
252 cmenu_cb_loc_set_gps(GtkMenuItem *item)
254 printf("%s()\n", __PRETTY_FUNCTION__);
256 screen2unit(_cmenu_position_x, _cmenu_position_y, _pos.unitx, _pos.unity);
257 unit2latlon(_pos.unitx, _pos.unity, _gps.lat, _gps.lon);
259 /* Move mark to new location. */
260 map_refresh_mark(_center_mode > 0);
262 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
267 cmenu_cb_way_show_latlon(GtkMenuItem *item)
271 printf("%s()\n", __PRETTY_FUNCTION__);
273 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
274 if((way = find_nearest_waypoint(unitx, unity)))
275 cmenu_show_latlon(way->point->unitx, way->point->unity);
278 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
282 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
287 cmenu_cb_way_show_desc(GtkMenuItem *item)
291 printf("%s()\n", __PRETTY_FUNCTION__);
293 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
294 if((way = find_nearest_waypoint(unitx, unity)))
296 MACRO_BANNER_SHOW_INFO(_window, way->desc);
300 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
303 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
308 cmenu_cb_way_clip_latlon(GtkMenuItem *item)
312 printf("%s()\n", __PRETTY_FUNCTION__);
314 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
315 if((way = find_nearest_waypoint(unitx, unity)))
316 cmenu_clip_latlon(way->point->unitx, way->point->unity);
319 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
322 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
327 cmenu_cb_way_clip_desc(GtkMenuItem *item)
331 printf("%s()\n", __PRETTY_FUNCTION__);
333 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
334 if((way = find_nearest_waypoint(unitx, unity)))
335 gtk_clipboard_set_text(
336 gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), way->desc, -1);
339 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
342 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
347 cmenu_cb_way_route_to(GtkMenuItem *item)
351 printf("%s()\n", __PRETTY_FUNCTION__);
353 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
354 if((way = find_nearest_waypoint(unitx, unity)))
355 cmenu_route_to(way->point->unitx, way->point->unity);
358 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
361 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
366 cmenu_cb_way_distance_to(GtkMenuItem *item)
370 printf("%s()\n", __PRETTY_FUNCTION__);
372 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
373 if((way = find_nearest_waypoint(unitx, unity)))
374 route_show_distance_to(way->point);
377 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
380 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
385 cmenu_cb_way_delete(GtkMenuItem *item)
389 printf("%s()\n", __PRETTY_FUNCTION__);
391 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
392 if((way = find_nearest_waypoint(unitx, unity)))
394 gchar buffer[BUFFER_SIZE];
397 snprintf(buffer, sizeof(buffer), "%s:\n%s\n",
398 _("Confirm delete of waypoint"), way->desc);
399 confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), buffer);
401 if(GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
403 Point *pdel_min, *pdel_max, *pdel_start, *pdel_end;
406 /* Delete surrounding route data, too. */
407 if(way == _route.whead)
408 pdel_min = _route.head;
410 pdel_min = way[-1].point;
412 if(way == _route.wtail)
413 pdel_max = _route.tail;
415 pdel_max = way[1].point;
417 /* Find largest continuous segment around the waypoint, EXCLUDING
418 * pdel_min and pdel_max. */
419 for(pdel_start = way->point - 1; pdel_start->unity
420 && pdel_start > pdel_min; pdel_start--) { }
421 for(pdel_end = way->point + 1; pdel_end->unity
422 && pdel_end < pdel_max; pdel_end++) { }
424 /* If pdel_end is set to _route.tail, and if _route.tail is a
425 * non-zero point, then delete _route.tail. */
426 if(pdel_end == _route.tail && pdel_end->unity)
427 pdel_end++; /* delete _route.tail too */
428 /* else, if *both* endpoints are zero points, delete one. */
429 else if(!pdel_start->unity && !pdel_end->unity)
432 /* Delete BETWEEN pdel_start and pdel_end, exclusive. */
433 num_del = pdel_end - pdel_start - 1;
435 memmove(pdel_start + 1, pdel_end,
436 (_route.tail - pdel_end + 1) * sizeof(Point));
437 _route.tail -= num_del;
439 /* Remove waypoint and move/adjust subsequent waypoints. */
441 while(way++ != _route.wtail)
444 way[-1].point -= num_del;
448 route_find_nearest_point();
451 gtk_widget_destroy(confirm);
455 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
458 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
463 cmenu_cb_way_add_poi(GtkMenuItem *item)
467 printf("%s()\n", __PRETTY_FUNCTION__);
469 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
470 if((way = find_nearest_waypoint(unitx, unity)))
471 poi_add_dialog(_window, way->point->unitx, way->point->unity);
474 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
477 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
482 cmenu_cb_poi_route_to(GtkMenuItem *item)
486 printf("%s()\n", __PRETTY_FUNCTION__);
488 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
489 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
492 latlon2unit(poi.lat, poi.lon, unitx, unity);
493 cmenu_route_to(unitx, unity);
496 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
501 cmenu_cb_poi_distance_to(GtkMenuItem *item)
505 printf("%s()\n", __PRETTY_FUNCTION__);
507 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
508 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
511 latlon2unit(poi.lat, poi.lon, unitx, unity);
512 cmenu_distance_to(unitx, unity);
515 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
520 cmenu_cb_poi_add_route(GtkMenuItem *item)
524 printf("%s()\n", __PRETTY_FUNCTION__);
526 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
527 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
530 latlon2unit(poi.lat, poi.lon, unitx, unity);
531 cmenu_add_route(unitx, unity);
534 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
539 cmenu_cb_poi_add_way(GtkMenuItem *item)
543 printf("%s()\n", __PRETTY_FUNCTION__);
545 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
546 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
549 latlon2unit(poi.lat, poi.lon, unitx, unity);
550 route_add_way_dialog(unitx, unity);
553 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
558 cmenu_cb_poi_edit_poi(GtkMenuItem *item)
562 printf("%s()\n", __PRETTY_FUNCTION__);
564 memset(&poi, 0, sizeof(poi));
565 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
566 select_poi(unitx, unity, &poi, FALSE); /* FALSE = not quick */
567 poi_view_dialog(_window, &poi);
575 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
580 cmenu_cb_hide(GtkMenuItem *item)
582 printf("%s()\n", __PRETTY_FUNCTION__);
585 g_mutex_unlock(_mouse_mutex);
586 _mouse_is_down = _mouse_is_dragging = FALSE;
588 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
594 /* Create needed handles. */
597 GtkWidget *menu_item;
598 printf("%s()\n", __PRETTY_FUNCTION__);
600 /* Setup the context menu. */
601 menu = GTK_MENU(gtk_menu_new());
603 /* Setup the map context menu. */
604 gtk_menu_append(menu, menu_item
605 = gtk_menu_item_new_with_label(_("Tap Point")));
606 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item),
607 submenu = gtk_menu_new());
609 /* Setup the map context menu. */
610 gtk_menu_append(submenu, _cmenu_loc_show_latlon_item
611 = gtk_menu_item_new_with_label(_("Show Lat/Lon")));
612 gtk_menu_append(submenu, gtk_separator_menu_item_new());
613 gtk_menu_append(submenu, _cmenu_loc_distance_to_item
614 = gtk_menu_item_new_with_label(_("Show Distance to")));
615 gtk_menu_append(submenu, _cmenu_loc_route_to_item
616 = gtk_menu_item_new_with_label(_("Download Route to...")));
617 gtk_menu_append(submenu, _cmenu_loc_download_poi_item
618 = gtk_menu_item_new_with_label(_("Download POI...")));
619 gtk_menu_append(submenu, _cmenu_loc_browse_poi_item
620 = gtk_menu_item_new_with_label(_("Browse POI...")));
621 gtk_menu_append(submenu, gtk_separator_menu_item_new());
622 gtk_menu_append(submenu, _cmenu_loc_add_route_item
623 = gtk_menu_item_new_with_label(_("Add Route Point")));
624 gtk_menu_append(submenu, _cmenu_loc_add_way_item
625 = gtk_menu_item_new_with_label(_("Add Waypoint...")));
626 gtk_menu_append(submenu, _cmenu_loc_add_poi_item
627 = gtk_menu_item_new_with_label(_("Add POI...")));
628 gtk_menu_append(submenu, gtk_separator_menu_item_new());
629 gtk_menu_append(submenu, _cmenu_loc_set_gps_item
630 = gtk_menu_item_new_with_label(_("Set as GPS Location")));
632 /* Setup the waypoint context menu. */
633 gtk_menu_append(menu, menu_item
634 = gtk_menu_item_new_with_label(_("Waypoint")));
635 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item),
636 submenu = gtk_menu_new());
638 gtk_menu_append(submenu, _cmenu_way_show_latlon_item
639 = gtk_menu_item_new_with_label(_("Show Lat/Lon")));
640 gtk_menu_append(submenu, _cmenu_way_show_desc_item
641 = gtk_menu_item_new_with_label(_("Show Description")));
642 gtk_menu_append(submenu, _cmenu_way_clip_latlon_item
643 = gtk_menu_item_new_with_label(_("Copy Lat/Lon")));
644 gtk_menu_append(submenu, _cmenu_way_clip_desc_item
645 = gtk_menu_item_new_with_label(_("Copy Description")));
646 gtk_menu_append(submenu, gtk_separator_menu_item_new());
647 gtk_menu_append(submenu, _cmenu_way_distance_to_item
648 = gtk_menu_item_new_with_label(_("Show Distance to")));
649 gtk_menu_append(submenu, _cmenu_way_route_to_item
650 = gtk_menu_item_new_with_label(_("Download Route to...")));
651 gtk_menu_append(submenu, _cmenu_way_delete_item
652 = gtk_menu_item_new_with_label(_("Delete...")));
653 gtk_menu_append(submenu, gtk_separator_menu_item_new());
654 gtk_menu_append(submenu, _cmenu_way_add_poi_item
655 = gtk_menu_item_new_with_label(_("Add POI...")));
656 gtk_menu_append(submenu, gtk_separator_menu_item_new());
657 gtk_menu_append(submenu, _cmenu_way_goto_nextway_item
658 = gtk_menu_item_new_with_label(_("Go to Next")));
660 /* Setup the POI context menu. */
661 gtk_menu_append(menu, _cmenu_poi_submenu
662 = gtk_menu_item_new_with_label(_("POI")));
663 gtk_menu_item_set_submenu(GTK_MENU_ITEM(_cmenu_poi_submenu),
664 submenu = gtk_menu_new());
666 gtk_menu_append(submenu, _cmenu_poi_edit_poi_item
667 = gtk_menu_item_new_with_label(_("View/Edit...")));
668 gtk_menu_append(submenu, gtk_separator_menu_item_new());
669 gtk_menu_append(submenu, _cmenu_poi_distance_to_item
670 = gtk_menu_item_new_with_label(_("Show Distance to")));
671 gtk_menu_append(submenu, _cmenu_poi_route_to_item
672 = gtk_menu_item_new_with_label(_("Download Route to...")));
673 gtk_menu_append(submenu, gtk_separator_menu_item_new());
674 gtk_menu_append(submenu, _cmenu_poi_add_route_item
675 = gtk_menu_item_new_with_label(_("Add Route Point")));
676 gtk_menu_append(submenu, _cmenu_poi_add_way_item
677 = gtk_menu_item_new_with_label(_("Add Waypoint...")));
678 gtk_menu_append(submenu, gtk_separator_menu_item_new());
679 gtk_menu_append(submenu, _cmenu_poi_goto_nearpoi_item
680 = gtk_menu_item_new_with_label(_("Go to Nearest")));
682 /* Connect signals for context menu. */
683 g_signal_connect(G_OBJECT(_cmenu_loc_show_latlon_item), "activate",
684 G_CALLBACK(cmenu_cb_loc_show_latlon), NULL);
685 g_signal_connect(G_OBJECT(_cmenu_loc_route_to_item), "activate",
686 G_CALLBACK(cmenu_cb_loc_route_to), NULL);
687 g_signal_connect(G_OBJECT(_cmenu_loc_download_poi_item), "activate",
688 G_CALLBACK(cmenu_cb_loc_download_poi), NULL);
689 g_signal_connect(G_OBJECT(_cmenu_loc_browse_poi_item), "activate",
690 G_CALLBACK(cmenu_cb_loc_browse_poi), NULL);
691 g_signal_connect(G_OBJECT(_cmenu_loc_distance_to_item), "activate",
692 G_CALLBACK(cmenu_cb_loc_distance_to), NULL);
693 g_signal_connect(G_OBJECT(_cmenu_loc_add_route_item), "activate",
694 G_CALLBACK(cmenu_cb_loc_add_route), NULL);
695 g_signal_connect(G_OBJECT(_cmenu_loc_add_way_item), "activate",
696 G_CALLBACK(cmenu_cb_loc_add_way), NULL);
697 g_signal_connect(G_OBJECT(_cmenu_loc_add_poi_item), "activate",
698 G_CALLBACK(cmenu_cb_loc_add_poi), NULL);
699 g_signal_connect(G_OBJECT(_cmenu_loc_set_gps_item), "activate",
700 G_CALLBACK(cmenu_cb_loc_set_gps), NULL);
702 g_signal_connect(G_OBJECT(_cmenu_way_show_latlon_item), "activate",
703 G_CALLBACK(cmenu_cb_way_show_latlon), NULL);
704 g_signal_connect(G_OBJECT(_cmenu_way_show_desc_item), "activate",
705 G_CALLBACK(cmenu_cb_way_show_desc), NULL);
706 g_signal_connect(G_OBJECT(_cmenu_way_clip_latlon_item), "activate",
707 G_CALLBACK(cmenu_cb_way_clip_latlon), NULL);
708 g_signal_connect(G_OBJECT(_cmenu_way_clip_desc_item), "activate",
709 G_CALLBACK(cmenu_cb_way_clip_desc), NULL);
710 g_signal_connect(G_OBJECT(_cmenu_way_route_to_item), "activate",
711 G_CALLBACK(cmenu_cb_way_route_to), NULL);
712 g_signal_connect(G_OBJECT(_cmenu_way_distance_to_item), "activate",
713 G_CALLBACK(cmenu_cb_way_distance_to), NULL);
714 g_signal_connect(G_OBJECT(_cmenu_way_delete_item), "activate",
715 G_CALLBACK(cmenu_cb_way_delete), NULL);
716 g_signal_connect(G_OBJECT(_cmenu_way_add_poi_item), "activate",
717 G_CALLBACK(cmenu_cb_way_add_poi), NULL);
718 g_signal_connect(G_OBJECT(_cmenu_way_goto_nextway_item), "activate",
719 G_CALLBACK(menu_cb_view_goto_nextway), NULL);
721 g_signal_connect(G_OBJECT(_cmenu_poi_edit_poi_item), "activate",
722 G_CALLBACK(cmenu_cb_poi_edit_poi), NULL);
723 g_signal_connect(G_OBJECT(_cmenu_poi_route_to_item), "activate",
724 G_CALLBACK(cmenu_cb_poi_route_to), NULL);
725 g_signal_connect(G_OBJECT(_cmenu_poi_distance_to_item), "activate",
726 G_CALLBACK(cmenu_cb_poi_distance_to), NULL);
727 g_signal_connect(G_OBJECT(_cmenu_poi_add_route_item), "activate",
728 G_CALLBACK(cmenu_cb_poi_add_route), NULL);
729 g_signal_connect(G_OBJECT(_cmenu_poi_add_way_item), "activate",
730 G_CALLBACK(cmenu_cb_poi_add_way), NULL);
731 g_signal_connect(G_OBJECT(_cmenu_poi_goto_nearpoi_item), "activate",
732 G_CALLBACK(menu_cb_view_goto_nearpoi), NULL);
734 gtk_widget_show_all(GTK_WIDGET(menu));
736 gtk_widget_tap_and_hold_setup(_map_widget, GTK_WIDGET(menu), NULL, 0);
738 /* Add a "hide" signal event handler to handle dismissing the context
740 g_signal_connect(GTK_WIDGET(menu), "hide",
741 G_CALLBACK(cmenu_cb_hide), NULL);
743 vprintf("%s(): return\n", __PRETTY_FUNCTION__);