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_loc_apply_correction(GtkMenuItem *item)
269 printf("%s()\n", __PRETTY_FUNCTION__);
271 if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)))
273 /* Get difference between tap point and GPS location. */
275 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
276 _map_correction_unitx = unitx - _pos.unitx;
277 _map_correction_unity = unity - _pos.unity;
278 map_refresh_mark(TRUE);
279 MACRO_BANNER_SHOW_INFO(_window, _("Map correction applied."));
283 _map_correction_unitx = 0;
284 _map_correction_unity = 0;
285 map_refresh_mark(TRUE);
286 MACRO_BANNER_SHOW_INFO(_window, _("Map correction removed."));
289 printf("Map correction now set to: %d, %d\n");
291 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
296 cmenu_cb_way_show_latlon(GtkMenuItem *item)
300 printf("%s()\n", __PRETTY_FUNCTION__);
302 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
303 if((way = find_nearest_waypoint(unitx, unity)))
304 cmenu_show_latlon(way->point->unitx, way->point->unity);
307 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
311 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
316 cmenu_cb_way_show_desc(GtkMenuItem *item)
320 printf("%s()\n", __PRETTY_FUNCTION__);
322 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
323 if((way = find_nearest_waypoint(unitx, unity)))
325 MACRO_BANNER_SHOW_INFO(_window, way->desc);
329 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
332 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
337 cmenu_cb_way_clip_latlon(GtkMenuItem *item)
341 printf("%s()\n", __PRETTY_FUNCTION__);
343 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
344 if((way = find_nearest_waypoint(unitx, unity)))
345 cmenu_clip_latlon(way->point->unitx, way->point->unity);
348 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
351 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
356 cmenu_cb_way_clip_desc(GtkMenuItem *item)
360 printf("%s()\n", __PRETTY_FUNCTION__);
362 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
363 if((way = find_nearest_waypoint(unitx, unity)))
364 gtk_clipboard_set_text(
365 gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), way->desc, -1);
368 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
371 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
376 cmenu_cb_way_route_to(GtkMenuItem *item)
380 printf("%s()\n", __PRETTY_FUNCTION__);
382 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
383 if((way = find_nearest_waypoint(unitx, unity)))
384 cmenu_route_to(way->point->unitx, way->point->unity);
387 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
390 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
395 cmenu_cb_way_distance_to(GtkMenuItem *item)
399 printf("%s()\n", __PRETTY_FUNCTION__);
401 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
402 if((way = find_nearest_waypoint(unitx, unity)))
403 route_show_distance_to(way->point);
406 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
409 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
414 cmenu_cb_way_delete(GtkMenuItem *item)
418 printf("%s()\n", __PRETTY_FUNCTION__);
420 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
421 if((way = find_nearest_waypoint(unitx, unity)))
423 gchar buffer[BUFFER_SIZE];
426 snprintf(buffer, sizeof(buffer), "%s:\n%s\n",
427 _("Confirm delete of waypoint"), way->desc);
428 confirm = hildon_note_new_confirmation(GTK_WINDOW(_window), buffer);
430 if(GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
432 Point *pdel_min, *pdel_max, *pdel_start, *pdel_end;
435 /* Delete surrounding route data, too. */
436 if(way == _route.whead)
437 pdel_min = _route.head;
439 pdel_min = way[-1].point;
441 if(way == _route.wtail)
442 pdel_max = _route.tail;
444 pdel_max = way[1].point;
446 /* Find largest continuous segment around the waypoint, EXCLUDING
447 * pdel_min and pdel_max. */
448 for(pdel_start = way->point - 1; pdel_start->unity
449 && pdel_start > pdel_min; pdel_start--) { }
450 for(pdel_end = way->point + 1; pdel_end->unity
451 && pdel_end < pdel_max; pdel_end++) { }
453 /* If pdel_end is set to _route.tail, and if _route.tail is a
454 * non-zero point, then delete _route.tail. */
455 if(pdel_end == _route.tail && pdel_end->unity)
456 pdel_end++; /* delete _route.tail too */
457 /* else, if *both* endpoints are zero points, delete one. */
458 else if(!pdel_start->unity && !pdel_end->unity)
461 /* Delete BETWEEN pdel_start and pdel_end, exclusive. */
462 num_del = pdel_end - pdel_start - 1;
464 memmove(pdel_start + 1, pdel_end,
465 (_route.tail - pdel_end + 1) * sizeof(Point));
466 _route.tail -= num_del;
468 /* Remove waypoint and move/adjust subsequent waypoints. */
470 while(way++ != _route.wtail)
473 way[-1].point -= num_del;
477 route_find_nearest_point();
480 gtk_widget_destroy(confirm);
484 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
487 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
492 cmenu_cb_way_add_poi(GtkMenuItem *item)
496 printf("%s()\n", __PRETTY_FUNCTION__);
498 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
499 if((way = find_nearest_waypoint(unitx, unity)))
500 poi_add_dialog(_window, way->point->unitx, way->point->unity);
503 MACRO_BANNER_SHOW_INFO(_window, _("There are no waypoints."));
506 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
511 cmenu_cb_poi_route_to(GtkMenuItem *item)
515 printf("%s()\n", __PRETTY_FUNCTION__);
517 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
518 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
521 latlon2unit(poi.lat, poi.lon, unitx, unity);
522 cmenu_route_to(unitx, unity);
525 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
530 cmenu_cb_poi_distance_to(GtkMenuItem *item)
534 printf("%s()\n", __PRETTY_FUNCTION__);
536 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
537 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
540 latlon2unit(poi.lat, poi.lon, unitx, unity);
541 cmenu_distance_to(unitx, unity);
544 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
549 cmenu_cb_poi_add_route(GtkMenuItem *item)
553 printf("%s()\n", __PRETTY_FUNCTION__);
555 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
556 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
559 latlon2unit(poi.lat, poi.lon, unitx, unity);
560 cmenu_add_route(unitx, unity);
563 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
568 cmenu_cb_poi_add_way(GtkMenuItem *item)
572 printf("%s()\n", __PRETTY_FUNCTION__);
574 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
575 if(select_poi(unitx, unity, &poi, FALSE)) /* FALSE = not quick */
578 latlon2unit(poi.lat, poi.lon, unitx, unity);
579 route_add_way_dialog(unitx, unity);
582 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
587 cmenu_cb_poi_edit_poi(GtkMenuItem *item)
591 printf("%s()\n", __PRETTY_FUNCTION__);
593 memset(&poi, 0, sizeof(poi));
594 screen2unit(_cmenu_position_x, _cmenu_position_y, unitx, unity);
595 select_poi(unitx, unity, &poi, FALSE); /* FALSE = not quick */
596 poi_view_dialog(_window, &poi);
604 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
609 cmenu_cb_hide(GtkMenuItem *item)
611 printf("%s()\n", __PRETTY_FUNCTION__);
614 g_mutex_unlock(_mouse_mutex);
615 _mouse_is_down = _mouse_is_dragging = FALSE;
617 vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
623 /* Create needed handles. */
626 GtkWidget *menu_item;
627 printf("%s()\n", __PRETTY_FUNCTION__);
629 /* Setup the context menu. */
630 menu = GTK_MENU(gtk_menu_new());
632 /* Setup the map context menu. */
633 gtk_menu_append(menu, menu_item
634 = gtk_menu_item_new_with_label(_("Tap Point")));
635 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item),
636 submenu = gtk_menu_new());
638 /* Setup the map context menu. */
639 gtk_menu_append(submenu, _cmenu_loc_show_latlon_item
640 = gtk_menu_item_new_with_label(_("Show Lat/Lon")));
641 gtk_menu_append(submenu, gtk_separator_menu_item_new());
642 gtk_menu_append(submenu, _cmenu_loc_distance_to_item
643 = gtk_menu_item_new_with_label(_("Show Distance to")));
644 gtk_menu_append(submenu, _cmenu_loc_route_to_item
645 = gtk_menu_item_new_with_label(_("Download Route to...")));
646 gtk_menu_append(submenu, _cmenu_loc_download_poi_item
647 = gtk_menu_item_new_with_label(_("Download POI...")));
648 gtk_menu_append(submenu, _cmenu_loc_browse_poi_item
649 = gtk_menu_item_new_with_label(_("Browse POI...")));
650 gtk_menu_append(submenu, gtk_separator_menu_item_new());
651 gtk_menu_append(submenu, _cmenu_loc_add_route_item
652 = gtk_menu_item_new_with_label(_("Add Route Point")));
653 gtk_menu_append(submenu, _cmenu_loc_add_way_item
654 = gtk_menu_item_new_with_label(_("Add Waypoint...")));
655 gtk_menu_append(submenu, _cmenu_loc_add_poi_item
656 = gtk_menu_item_new_with_label(_("Add POI...")));
657 gtk_menu_append(submenu, gtk_separator_menu_item_new());
658 gtk_menu_append(submenu, _cmenu_loc_set_gps_item
659 = gtk_menu_item_new_with_label(_("Set as GPS Location")));
660 gtk_menu_append(submenu, _cmenu_loc_apply_correction_item
661 = gtk_check_menu_item_new_with_label(
662 _("Apply Map Correction")));
663 gtk_check_menu_item_set_active(
664 GTK_CHECK_MENU_ITEM(_cmenu_loc_apply_correction_item),
665 _map_correction_unitx != 0 || _map_correction_unity != 0);
667 /* Setup the waypoint context menu. */
668 gtk_menu_append(menu, menu_item
669 = gtk_menu_item_new_with_label(_("Waypoint")));
670 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item),
671 submenu = gtk_menu_new());
673 gtk_menu_append(submenu, _cmenu_way_show_latlon_item
674 = gtk_menu_item_new_with_label(_("Show Lat/Lon")));
675 gtk_menu_append(submenu, _cmenu_way_show_desc_item
676 = gtk_menu_item_new_with_label(_("Show Description")));
677 gtk_menu_append(submenu, _cmenu_way_clip_latlon_item
678 = gtk_menu_item_new_with_label(_("Copy Lat/Lon")));
679 gtk_menu_append(submenu, _cmenu_way_clip_desc_item
680 = gtk_menu_item_new_with_label(_("Copy Description")));
681 gtk_menu_append(submenu, gtk_separator_menu_item_new());
682 gtk_menu_append(submenu, _cmenu_way_distance_to_item
683 = gtk_menu_item_new_with_label(_("Show Distance to")));
684 gtk_menu_append(submenu, _cmenu_way_route_to_item
685 = gtk_menu_item_new_with_label(_("Download Route to...")));
686 gtk_menu_append(submenu, _cmenu_way_delete_item
687 = gtk_menu_item_new_with_label(_("Delete...")));
688 gtk_menu_append(submenu, gtk_separator_menu_item_new());
689 gtk_menu_append(submenu, _cmenu_way_add_poi_item
690 = gtk_menu_item_new_with_label(_("Add POI...")));
691 gtk_menu_append(submenu, gtk_separator_menu_item_new());
692 gtk_menu_append(submenu, _cmenu_way_goto_nextway_item
693 = gtk_menu_item_new_with_label(_("Go to Next")));
695 /* Setup the POI context menu. */
696 gtk_menu_append(menu, _cmenu_poi_submenu
697 = gtk_menu_item_new_with_label(_("POI")));
698 gtk_menu_item_set_submenu(GTK_MENU_ITEM(_cmenu_poi_submenu),
699 submenu = gtk_menu_new());
701 gtk_menu_append(submenu, _cmenu_poi_edit_poi_item
702 = gtk_menu_item_new_with_label(_("View/Edit...")));
703 gtk_menu_append(submenu, gtk_separator_menu_item_new());
704 gtk_menu_append(submenu, _cmenu_poi_distance_to_item
705 = gtk_menu_item_new_with_label(_("Show Distance to")));
706 gtk_menu_append(submenu, _cmenu_poi_route_to_item
707 = gtk_menu_item_new_with_label(_("Download Route to...")));
708 gtk_menu_append(submenu, gtk_separator_menu_item_new());
709 gtk_menu_append(submenu, _cmenu_poi_add_route_item
710 = gtk_menu_item_new_with_label(_("Add Route Point")));
711 gtk_menu_append(submenu, _cmenu_poi_add_way_item
712 = gtk_menu_item_new_with_label(_("Add Waypoint...")));
713 gtk_menu_append(submenu, gtk_separator_menu_item_new());
714 gtk_menu_append(submenu, _cmenu_poi_goto_nearpoi_item
715 = gtk_menu_item_new_with_label(_("Go to Nearest")));
717 /* Connect signals for context menu. */
718 g_signal_connect(G_OBJECT(_cmenu_loc_show_latlon_item), "activate",
719 G_CALLBACK(cmenu_cb_loc_show_latlon), NULL);
720 g_signal_connect(G_OBJECT(_cmenu_loc_route_to_item), "activate",
721 G_CALLBACK(cmenu_cb_loc_route_to), NULL);
722 g_signal_connect(G_OBJECT(_cmenu_loc_download_poi_item), "activate",
723 G_CALLBACK(cmenu_cb_loc_download_poi), NULL);
724 g_signal_connect(G_OBJECT(_cmenu_loc_browse_poi_item), "activate",
725 G_CALLBACK(cmenu_cb_loc_browse_poi), NULL);
726 g_signal_connect(G_OBJECT(_cmenu_loc_distance_to_item), "activate",
727 G_CALLBACK(cmenu_cb_loc_distance_to), NULL);
728 g_signal_connect(G_OBJECT(_cmenu_loc_add_route_item), "activate",
729 G_CALLBACK(cmenu_cb_loc_add_route), NULL);
730 g_signal_connect(G_OBJECT(_cmenu_loc_add_way_item), "activate",
731 G_CALLBACK(cmenu_cb_loc_add_way), NULL);
732 g_signal_connect(G_OBJECT(_cmenu_loc_add_poi_item), "activate",
733 G_CALLBACK(cmenu_cb_loc_add_poi), NULL);
734 g_signal_connect(G_OBJECT(_cmenu_loc_set_gps_item), "activate",
735 G_CALLBACK(cmenu_cb_loc_set_gps), NULL);
736 g_signal_connect(G_OBJECT(_cmenu_loc_apply_correction_item), "toggled",
737 G_CALLBACK(cmenu_cb_loc_apply_correction), NULL);
739 g_signal_connect(G_OBJECT(_cmenu_way_show_latlon_item), "activate",
740 G_CALLBACK(cmenu_cb_way_show_latlon), NULL);
741 g_signal_connect(G_OBJECT(_cmenu_way_show_desc_item), "activate",
742 G_CALLBACK(cmenu_cb_way_show_desc), NULL);
743 g_signal_connect(G_OBJECT(_cmenu_way_clip_latlon_item), "activate",
744 G_CALLBACK(cmenu_cb_way_clip_latlon), NULL);
745 g_signal_connect(G_OBJECT(_cmenu_way_clip_desc_item), "activate",
746 G_CALLBACK(cmenu_cb_way_clip_desc), NULL);
747 g_signal_connect(G_OBJECT(_cmenu_way_route_to_item), "activate",
748 G_CALLBACK(cmenu_cb_way_route_to), NULL);
749 g_signal_connect(G_OBJECT(_cmenu_way_distance_to_item), "activate",
750 G_CALLBACK(cmenu_cb_way_distance_to), NULL);
751 g_signal_connect(G_OBJECT(_cmenu_way_delete_item), "activate",
752 G_CALLBACK(cmenu_cb_way_delete), NULL);
753 g_signal_connect(G_OBJECT(_cmenu_way_add_poi_item), "activate",
754 G_CALLBACK(cmenu_cb_way_add_poi), NULL);
755 g_signal_connect(G_OBJECT(_cmenu_way_goto_nextway_item), "activate",
756 G_CALLBACK(menu_cb_view_goto_nextway), NULL);
758 g_signal_connect(G_OBJECT(_cmenu_poi_edit_poi_item), "activate",
759 G_CALLBACK(cmenu_cb_poi_edit_poi), NULL);
760 g_signal_connect(G_OBJECT(_cmenu_poi_route_to_item), "activate",
761 G_CALLBACK(cmenu_cb_poi_route_to), NULL);
762 g_signal_connect(G_OBJECT(_cmenu_poi_distance_to_item), "activate",
763 G_CALLBACK(cmenu_cb_poi_distance_to), NULL);
764 g_signal_connect(G_OBJECT(_cmenu_poi_add_route_item), "activate",
765 G_CALLBACK(cmenu_cb_poi_add_route), NULL);
766 g_signal_connect(G_OBJECT(_cmenu_poi_add_way_item), "activate",
767 G_CALLBACK(cmenu_cb_poi_add_way), NULL);
768 g_signal_connect(G_OBJECT(_cmenu_poi_goto_nearpoi_item), "activate",
769 G_CALLBACK(menu_cb_view_goto_nearpoi), NULL);
771 gtk_widget_show_all(GTK_WIDGET(menu));
773 gtk_widget_tap_and_hold_setup(_map_widget, GTK_WIDGET(menu), NULL, 0);
775 /* Add a "hide" signal event handler to handle dismissing the context
777 g_signal_connect(GTK_WIDGET(menu), "hide",
778 G_CALLBACK(cmenu_cb_hide), NULL);
780 vprintf("%s(): return\n", __PRETTY_FUNCTION__);