You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Paul F. <pg...@us...> - 2006-11-02 01:39:26
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24418 Modified Files: roadmap_math.c roadmap_math.h roadmap_navigate.c roadmap_navigate.h Log Message: move focus area adjustment and checking code to roadmap_math.c. roadmap_navigate_retrieve_line() and roadmap_navigate_get_neighbours() now both take a focus area and a position, rather than position and accuracy. Index: roadmap_navigate.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_navigate.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** roadmap_navigate.c 27 Jun 2006 04:03:17 -0000 1.24 --- roadmap_navigate.c 2 Nov 2006 01:39:23 -0000 1.25 *************** *** 122,149 **** - static void roadmap_navigate_adjust_focus - (RoadMapArea *focus, const RoadMapGuiPoint *focused_point) { - - RoadMapPosition focus_position; - - roadmap_math_to_position (focused_point, &focus_position, 1); - - if (focus_position.longitude < focus->west) { - focus->west = focus_position.longitude; - } - if (focus_position.longitude > focus->east) { - focus->east = focus_position.longitude; - } - if (focus_position.latitude < focus->south) { - focus->south = focus_position.latitude; - } - if (focus_position.latitude > focus->north) { - focus->north = focus_position.latitude; - } - } - - static int roadmap_navigate_get_neighbours ! (const RoadMapPosition *position, int accuracy, RoadMapNeighbour *neighbours, int max) { --- 122,128 ---- static int roadmap_navigate_get_neighbours ! (const RoadMapArea *focus, ! const RoadMapPosition *position, RoadMapNeighbour *neighbours, int max) { *************** *** 151,190 **** int layers[128]; - RoadMapArea focus; - - RoadMapGuiPoint focus_point; - RoadMapPosition focus_position; - - roadmap_log_push ("roadmap_navigate_get_neighbours"); - roadmap_math_coordinate (position, &focus_point); - roadmap_math_rotate_coordinates (1, &focus_point); - - focus_point.x += accuracy; - focus_point.y += accuracy; - roadmap_math_to_position (&focus_point, &focus_position, 1); - - focus.west = focus_position.longitude; - focus.east = focus_position.longitude; - focus.north = focus_position.latitude; - focus.south = focus_position.latitude; - - accuracy *= 2; - - focus_point.x -= accuracy; - roadmap_navigate_adjust_focus (&focus, &focus_point); - - focus_point.y -= accuracy; - roadmap_navigate_adjust_focus (&focus, &focus_point); - - focus_point.x += accuracy; - roadmap_navigate_adjust_focus (&focus, &focus_point); - count = roadmap_layer_navigable (RoadMapCarMode, layers, 128); if (count > 0) { ! roadmap_math_set_focus (&focus); count = roadmap_street_get_closest --- 130,140 ---- int layers[128]; roadmap_log_push ("roadmap_navigate_get_neighbours"); count = roadmap_layer_navigable (RoadMapCarMode, layers, 128); if (count > 0) { ! roadmap_math_set_focus (focus); count = roadmap_street_get_closest *************** *** 218,223 **** ! int roadmap_navigate_retrieve_line (const RoadMapPosition *position, ! int accuracy, PluginLine *line, int *distance) { --- 168,173 ---- ! int roadmap_navigate_retrieve_line (const RoadMapArea *focus, ! const RoadMapPosition *position, PluginLine *line, int *distance) { *************** *** 226,230 **** if (roadmap_navigate_get_neighbours ! (position, accuracy, &closest, 1) <= 0) { return -1; --- 176,180 ---- if (roadmap_navigate_get_neighbours ! (focus, position, &closest, 1) <= 0) { return -1; *************** *** 546,549 **** --- 496,501 ---- static RoadMapTracking nominated; + RoadMapArea focus; + if (! RoadMapNavigateEnabled) { *************** *** 598,603 **** /* We must search again for the best street match. */ count = roadmap_navigate_get_neighbours ! (&RoadMapLatestPosition, roadmap_fuzzy_max_distance(), RoadMapNeighbourhood, ROADMAP_NEIGHBOURHOUD); --- 550,558 ---- /* We must search again for the best street match. */ + roadmap_math_focus_area + (&focus, &RoadMapLatestPosition, roadmap_fuzzy_max_distance()); + count = roadmap_navigate_get_neighbours ! (&focus, &RoadMapLatestPosition, RoadMapNeighbourhood, ROADMAP_NEIGHBOURHOUD); Index: roadmap_navigate.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_navigate.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_navigate.h 27 Nov 2005 06:07:22 -0000 1.6 --- roadmap_navigate.h 2 Nov 2006 01:39:23 -0000 1.7 *************** *** 31,36 **** void roadmap_navigate_enable (void); ! int roadmap_navigate_retrieve_line (const RoadMapPosition *position, ! int accuracy, PluginLine *line, int *distance); --- 31,36 ---- void roadmap_navigate_enable (void); ! int roadmap_navigate_retrieve_line (const RoadMapArea *focus, ! const RoadMapPosition *position, PluginLine *line, int *distance); Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** roadmap_math.h 16 Aug 2006 14:00:00 -0000 1.29 --- roadmap_math.h 2 Nov 2006 01:39:23 -0000 1.30 *************** *** 53,56 **** --- 53,58 ---- void roadmap_math_set_horizon (int horizon); + void roadmap_math_focus_area (RoadMapArea *focus, + const RoadMapPosition *position, int accuracy); void roadmap_math_set_focus (const RoadMapArea *focus); void roadmap_math_release_focus (void); *************** *** 130,135 **** int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, ! RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, ! RoadMapGuiPoint *isect); void roadmap_math_screen_edges (RoadMapArea *area); --- 132,137 ---- int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, ! RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, ! RoadMapGuiPoint *isect); void roadmap_math_screen_edges (RoadMapArea *area); Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** roadmap_math.c 16 Aug 2006 13:59:59 -0000 1.38 --- roadmap_math.c 2 Nov 2006 01:39:23 -0000 1.39 *************** *** 308,316 **** roadmap_math_trip_set_distance ! ('x', RoadMapContext.width * RoadMapContext.zoom_x * ! RoadMapContext.units->unit_per_longitude); roadmap_math_trip_set_distance ! ('y', RoadMapContext.height * RoadMapContext.zoom_y * ! RoadMapContext.units->unit_per_latitude); roadmap_math_set_orientation (orientation); --- 308,316 ---- roadmap_math_trip_set_distance ! ('x', RoadMapContext.width * RoadMapContext.zoom_x * ! RoadMapContext.units->unit_per_longitude); roadmap_math_trip_set_distance ! ('y', RoadMapContext.height * RoadMapContext.zoom_y * ! RoadMapContext.units->unit_per_latitude); roadmap_math_set_orientation (orientation); *************** *** 739,742 **** --- 739,794 ---- } + static void roadmap_math_adjust_focus + (RoadMapArea *focus, const RoadMapGuiPoint *focused_point) { + + RoadMapPosition focus_position; + + roadmap_math_to_position (focused_point, &focus_position, 1); + + if (focus_position.longitude < focus->west) { + focus->west = focus_position.longitude; + } + if (focus_position.longitude > focus->east) { + focus->east = focus_position.longitude; + } + if (focus_position.latitude < focus->south) { + focus->south = focus_position.latitude; + } + if (focus_position.latitude > focus->north) { + focus->north = focus_position.latitude; + } + } + + void + roadmap_math_focus_area + (RoadMapArea *focus, const RoadMapPosition *position, + int accuracy) { + + RoadMapGuiPoint focus_point; + RoadMapPosition focus_position; + roadmap_math_coordinate (position, &focus_point); + roadmap_math_rotate_coordinates (1, &focus_point); + + focus_point.x += accuracy; + focus_point.y += accuracy; + roadmap_math_to_position (&focus_point, &focus_position, 1); + + focus->west = focus_position.longitude; + focus->east = focus_position.longitude; + focus->north = focus_position.latitude; + focus->south = focus_position.latitude; + + accuracy *= 2; + + focus_point.x -= accuracy; + roadmap_math_adjust_focus (focus, &focus_point); + + focus_point.y -= accuracy; + roadmap_math_adjust_focus (focus, &focus_point); + + focus_point.x += accuracy; + roadmap_math_adjust_focus (focus, &focus_point); + } + void roadmap_math_set_focus (const RoadMapArea *focus) { |
From: Paul F. <pg...@us...> - 2006-11-02 01:34:33
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22853 Modified Files: roadmap_factory.c Log Message: make some config error messages more informative: give filename where error occurred. Index: roadmap_factory.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_factory.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** roadmap_factory.c 27 Oct 2006 17:37:32 -0000 1.23 --- roadmap_factory.c 2 Nov 2006 01:34:29 -0000 1.24 *************** *** 186,190 **** this_action = roadmap_factory_find_action (actions, p); if (this_action == NULL) { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", p); } else { loaded[count++] = this_action->name; --- 186,191 ---- this_action = roadmap_factory_find_action (actions, p); if (this_action == NULL) { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s' in %s%s%s", ! p, path ? path : "", path ? "/":"", file_name); } else { loaded[count++] = this_action->name; *************** *** 287,291 **** this_action = roadmap_factory_find_action (actions, fields[0]); if (this_action == NULL) { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", p); continue; } --- 288,293 ---- this_action = roadmap_factory_find_action (actions, fields[0]); if (this_action == NULL) { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s' in %s%s%s", ! p, path ? path : "", path ? "/":"", file_name); continue; } *************** *** 439,443 **** this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", item); } } --- 441,446 ---- this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s' in %s menu", ! item, userconfig ? "user" : "built-in"); } } *************** *** 474,478 **** this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", item); } } --- 477,482 ---- this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s' in %s toolbar", ! item, userconfig ? "user" : "built-in"); } } *************** *** 517,521 **** this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", item); } } --- 521,526 ---- this_action->callback); } else { ! roadmap_log (ROADMAP_ERROR, "invalid action name '%s' in %s popup", ! item, userconfig ? "user" : "built-in"); } } |
From: Paul F. <pg...@us...> - 2006-11-02 01:33:44
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22451 Modified Files: Makefile Log Message: comment: note where "convert" comes from Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Makefile 2 Oct 2006 14:49:08 -0000 1.84 --- Makefile 2 Nov 2006 01:32:55 -0000 1.85 *************** *** 353,357 **** ! # icon rule -- create xpm from png %.xpm : %.png $(CONVERT) $< $@ --- 353,357 ---- ! # icon rule -- create xpm from png with "convert" from imagemagick %.xpm : %.png $(CONVERT) $< $@ |
From: Paul F. <pg...@us...> - 2006-11-02 01:32:29
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22412 Modified Files: options.mk Log Message: comment: note where "convert" comes from Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** options.mk 17 Jul 2006 20:57:21 -0000 1.6 --- options.mk 2 Nov 2006 01:32:24 -0000 1.7 *************** *** 23,26 **** --- 23,28 ---- RANLIB = ranlib STRIP = strip + # the image conversion tool "convert" comes with ImageMagick. + # on debian or ubuntu: "apt-get install imagemagick" CONVERT = convert |
From: Paul F. <pg...@us...> - 2006-11-02 01:28:34
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20438 Modified Files: roadmap_layer.c Log Message: remove odd call to roadmap_check_allocted() Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_layer.c 6 Feb 2006 01:43:46 -0000 1.11 --- roadmap_layer.c 2 Nov 2006 01:27:42 -0000 1.12 *************** *** 578,583 **** - roadmap_check_allocated(sorted); - roadmap_layer_convert_after (set); roadmap_layer_convert_before (set); --- 578,581 ---- |
From: Paul F. <pg...@us...> - 2006-10-27 17:37:37
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11472 Modified Files: roadmap_factory.c Log Message: warn if configured popup menu isn't found. (but only if any popups exist at all.) Index: roadmap_factory.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_factory.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** roadmap_factory.c 26 Oct 2006 13:14:12 -0000 1.22 --- roadmap_factory.c 27 Oct 2006 17:37:32 -0000 1.23 *************** *** 624,627 **** --- 624,628 ---- if (title == NULL || title[0] == 0) return; /* No menu attached. */ + if (RoadMapFactoryPopupList == NULL) return; /* No menus configured */ for (popup = RoadMapFactoryPopupList; popup != NULL; popup = popup->next) { *************** *** 629,634 **** --- 630,637 ---- if (strcmp (popup->title, title) == 0) { roadmap_main_popup_menu (popup->menu, position); + return; } } + roadmap_log (ROADMAP_ERROR, "Couldn't find configured popup menu '%s'", title); } |
From: Paul F. <pg...@us...> - 2006-10-27 17:36:27
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11429 Modified Files: roadmap.popup Log Message: change menu name to match new configured default Index: roadmap.popup =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap.popup,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap.popup 18 Nov 2005 20:09:26 -0000 1.1 --- roadmap.popup 27 Oct 2006 17:36:24 -0000 1.2 *************** *** 1,3 **** ! /Map Menu setasdestination addaswaypoint --- 1,3 ---- ! /Right Click Popup setasdestination addaswaypoint |
From: Paul F. <pg...@us...> - 2006-10-27 16:18:17
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11827 Modified Files: README Log Message: finish support for long clicks, change default bindings for long and right clicks to be "Long Click Popup" and "Right Click Popup", since these names aren't visible anywhere but in the docs and the roadmap.popup file. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** README 24 Oct 2006 02:10:42 -0000 1.102 --- README 27 Oct 2006 16:18:12 -0000 1.103 *************** *** 1970,1973 **** --- 1970,1979 ---- the same places as other RoadMap configuration files. + By default, a long click of mouse button 1 will bring up the menu called + "/Long Click Popup" in road{map,gps}.popup, and a right click (button 3) + will bring up the menu called "/Right Click Popup". These bindings can be + changed by setting "Events:Long Click" or "Events:Right Click" in the + preferences. + There is a different list of possible actions for RoadMap and RoadGps. The list of valid action names can be obtained using the command line *************** *** 1982,1986 **** ---- ! /File preferences gpsconsole --- 1988,1992 ---- ---- ! /Right Click Popup preferences gpsconsole |
From: Paul F. <pg...@us...> - 2006-10-27 16:18:16
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11827/src Modified Files: roadmap_screen.c Log Message: finish support for long clicks, change default bindings for long and right clicks to be "Long Click Popup" and "Right Click Popup", since these names aren't visible anywhere but in the docs and the roadmap.popup file. Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** roadmap_screen.c 24 Oct 2006 03:24:20 -0000 1.74 --- roadmap_screen.c 27 Oct 2006 16:18:12 -0000 1.75 *************** *** 90,93 **** --- 90,96 ---- ROADMAP_CONFIG_ITEM("Events", "Right Click"); + static RoadMapConfigDescriptor RoadMapConfigEventLongClick = + ROADMAP_CONFIG_ITEM("Events", "Long Click"); + static RoadMapConfigDescriptor RoadMapConfigStylePrettyDrag = ROADMAP_CONFIG_ITEM("Style", "Pretty Lines when Dragging"); *************** *** 1117,1120 **** --- 1120,1128 ---- } + static void roadmap_screen_long_click (RoadMapGuiPoint *point) { + + roadmap_factory_popup (&RoadMapConfigEventLongClick, point); + } + static void roadmap_screen_reset_delta (void) { *************** *** 1443,1447 **** roadmap_config_declare ! ("preferences", &RoadMapConfigEventRightClick, "Map Menu"); roadmap_config_declare_enumeration --- 1451,1458 ---- roadmap_config_declare ! ("preferences", &RoadMapConfigEventRightClick, "Right Click Popup"); ! ! roadmap_config_declare ! ("preferences", &RoadMapConfigEventLongClick, "Long Click Popup"); roadmap_config_declare_enumeration *************** *** 1471,1474 **** --- 1482,1486 ---- roadmap_pointer_register_right_click (&roadmap_screen_right_click); + roadmap_pointer_register_long_click (&roadmap_screen_long_click); roadmap_pointer_register_scroll_up (&roadmap_screen_scroll_up); roadmap_pointer_register_scroll_down (&roadmap_screen_scroll_down); |
From: Paul F. <pg...@us...> - 2006-10-27 16:01:11
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4867/gtk Modified Files: roadmap_main.c Log Message: calling gtk_widget_show_all() causes gtk_menu_popup() to display correctly. Index: roadmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk/roadmap_main.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** roadmap_main.c 27 Oct 2006 02:33:14 -0000 1.21 --- roadmap_main.c 27 Oct 2006 16:00:58 -0000 1.22 *************** *** 274,277 **** --- 274,278 ---- if (menu != NULL) { + gtk_widget_show_all(GTK_WIDGET(menu)); gtk_menu_popup (GTK_MENU(menu), NULL, |
From: Paul F. <pg...@us...> - 2006-10-27 02:33:21
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8362/qt Modified Files: roadmap_main.cc Log Message: attempt at cleaning up trip management: now, if no trip is ever selected, and no "trip" changes are made (routes, trip landmarks), then no file will be written, and no trip name will appear in the config. doing "save as" will set the name, and doing a "save" on an unnamed trip will force a "save as". with more sensible trip loading, it's now safe to put the trip name in the window title bar. (if trip features aren't used, it will never appear.) Index: roadmap_main.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/roadmap_main.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_main.cc 3 Jul 2006 01:30:49 -0000 1.14 --- roadmap_main.cc 27 Oct 2006 02:33:14 -0000 1.15 *************** *** 77,93 **** void roadmap_main_new(const char* title, int width, int height) { ! mainWindow = new RMapMainWindow(title,width,height); #ifdef QWS ! app->showMainWidget(mainWindow); #else ! app->setMainWidget(mainWindow); #endif } void roadmap_main_set_keyboard(RoadMapKeyInput callback) { ! if (mainWindow) { ! mainWindow->setKeyboardCallback(callback); ! } } --- 77,97 ---- void roadmap_main_new(const char* title, int width, int height) { ! mainWindow = new RMapMainWindow(title,width,height); #ifdef QWS ! app->showMainWidget(mainWindow); #else ! app->setMainWidget(mainWindow); #endif } + void roadmap_main_title(char *fmt, ...) { + /* unimplemented */ + } + void roadmap_main_set_keyboard(RoadMapKeyInput callback) { ! if (mainWindow) { ! mainWindow->setKeyboardCallback(callback); ! } } *************** *** 117,123 **** void roadmap_main_add_menu(RoadMapMenu menu, const char* label) { ! if (mainWindow) { ! mainWindow->addMenu((QPopupMenu *)menu, label); ! } } --- 121,127 ---- void roadmap_main_add_menu(RoadMapMenu menu, const char* label) { ! if (mainWindow) { ! mainWindow->addMenu((QPopupMenu *)menu, label); ! } } *************** *** 127,146 **** RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->addMenuItem((QPopupMenu *)menu, label, tip, callback); ! } } void roadmap_main_add_separator(RoadMapMenu menu) { ! if (mainWindow) { ! mainWindow->addMenuSeparator((QPopupMenu *)menu); ! } } void roadmap_main_add_toolbar (const char *orientation) { ! if (mainWindow) { ! mainWindow->addToolbar(orientation); ! } } --- 131,150 ---- RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->addMenuItem((QPopupMenu *)menu, label, tip, callback); ! } } void roadmap_main_add_separator(RoadMapMenu menu) { ! if (mainWindow) { ! mainWindow->addMenuSeparator((QPopupMenu *)menu); ! } } void roadmap_main_add_toolbar (const char *orientation) { ! if (mainWindow) { ! mainWindow->addToolbar(orientation); ! } } *************** *** 150,184 **** RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->addTool(label, icon, tip, callback); ! } } void roadmap_main_add_tool_space(void) { ! if (mainWindow) { ! mainWindow->addToolSpace(); ! } } void roadmap_main_add_canvas(void) { // The canvas is implicitely added to the main window. ! // if (mainWindow) { ! // mainWindow->addCanvas(); ! // } } void roadmap_main_add_status(void) { ! // nothing to be done } void roadmap_main_show(void) { ! if (mainWindow) { ! mainWindow->show(); ! } } void roadmap_main_set_input(RoadMapIO *io, RoadMapInput callback) { ! if (mainWindow) { int i; --- 154,188 ---- RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->addTool(label, icon, tip, callback); ! } } void roadmap_main_add_tool_space(void) { ! if (mainWindow) { ! mainWindow->addToolSpace(); ! } } void roadmap_main_add_canvas(void) { // The canvas is implicitely added to the main window. ! // if (mainWindow) { ! // mainWindow->addCanvas(); ! // } } void roadmap_main_add_status(void) { ! // nothing to be done } void roadmap_main_show(void) { ! if (mainWindow) { ! mainWindow->show(); ! } } void roadmap_main_set_input(RoadMapIO *io, RoadMapInput callback) { ! if (mainWindow) { int i; *************** *** 194,198 **** } } ! } } --- 198,202 ---- } } ! } } *************** *** 202,206 **** int fd = io->os.file; /* All the same on UNIX. */ ! if (mainWindow) { mainWindow->removeInput(fd); } --- 206,210 ---- int fd = io->os.file; /* All the same on UNIX. */ ! if (mainWindow) { mainWindow->removeInput(fd); } *************** *** 212,216 **** break; } ! } } --- 216,220 ---- break; } ! } } *************** *** 218,224 **** void roadmap_main_set_periodic (int interval, RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->setTimer(interval, callback); ! } } --- 222,228 ---- void roadmap_main_set_periodic (int interval, RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->setTimer(interval, callback); ! } } *************** *** 226,244 **** void roadmap_main_remove_periodic (RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->removeTimer(callback); ! } } void roadmap_main_set_status(const char *text) { ! if (mainWindow) { ! mainWindow->setStatus(text); ! } } void roadmap_main_toggle_full_screen (void) { ! // Not yet implemented (how to do this ??) } --- 230,248 ---- void roadmap_main_remove_periodic (RoadMapCallback callback) { ! if (mainWindow) { ! mainWindow->removeTimer(callback); ! } } void roadmap_main_set_status(const char *text) { ! if (mainWindow) { ! mainWindow->setStatus(text); ! } } void roadmap_main_toggle_full_screen (void) { ! // Not yet implemented (how to do this ??) } *************** *** 283,288 **** void roadmap_main_exit(void) { ! roadmap_start_exit(); ! exit(0); } --- 287,292 ---- void roadmap_main_exit(void) { ! roadmap_start_exit(); ! exit(0); } *************** *** 292,298 **** #ifdef QWS ! app = new QPEApplication(argc, argv); #else ! app = new QApplication(argc, argv); #endif --- 296,302 ---- #ifdef QWS ! app = new QPEApplication(argc, argv); #else ! app = new QApplication(argc, argv); #endif *************** *** 300,307 **** RoadMapMainIo[i].io.subsystem = ROADMAP_IO_INVALID; RoadMapMainIo[i].io.os.file = -1; ! } ! roadmap_start(argc, argv); ! return app->exec(); } --- 304,311 ---- RoadMapMainIo[i].io.subsystem = ROADMAP_IO_INVALID; RoadMapMainIo[i].io.os.file = -1; ! } ! roadmap_start(argc, argv); ! return app->exec(); } |
From: Paul F. <pg...@us...> - 2006-10-27 02:33:21
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8362/win32 Modified Files: roadmap_main.cpp Log Message: attempt at cleaning up trip management: now, if no trip is ever selected, and no "trip" changes are made (routes, trip landmarks), then no file will be written, and no trip name will appear in the config. doing "save as" will set the name, and doing a "save" on an unnamed trip will force a "save as". with more sensible trip loading, it's now safe to put the trip name in the window title bar. (if trip features aren't used, it will never appear.) Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_main.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_main.cpp 20 Nov 2005 00:08:35 -0000 1.9 --- roadmap_main.cpp 27 Oct 2006 02:33:14 -0000 1.10 *************** *** 539,542 **** --- 539,545 ---- } + void roadmap_main_title(char *fmt, ...) { + /* unimplemented */ + } void roadmap_main_set_keyboard (RoadMapKeyInput callback) |
From: Paul F. <pg...@us...> - 2006-10-27 02:33:21
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8362 Modified Files: roadmap_main.h roadmap_start.c roadmap_trip.c roadmap_trip.h session Log Message: attempt at cleaning up trip management: now, if no trip is ever selected, and no "trip" changes are made (routes, trip landmarks), then no file will be written, and no trip name will appear in the config. doing "save as" will set the name, and doing a "save" on an unnamed trip will force a "save as". with more sensible trip loading, it's now safe to put the trip name in the window title bar. (if trip features aren't used, it will never appear.) Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** roadmap_trip.c 24 Oct 2006 03:24:20 -0000 1.69 --- roadmap_trip.c 27 Oct 2006 02:33:14 -0000 1.70 *************** *** 31,34 **** --- 31,35 ---- #include "roadmap.h" + #include "roadmap_main.h" #include "roadmap_types.h" #include "roadmap_time.h" *************** *** 79,82 **** --- 80,87 ---- ROADMAP_CONFIG_ITEM("Trip", "Waypoint Radius"); + /* + * try and put the trip name in the window title + */ + #define TRIP_TITLE_FMT " - trip %s" /* Default location is: 1 Market St, San Francisco, California, *************** *** 98,101 **** --- 103,108 ---- static int RoadMapTripFocusMoved = 1; + static int RoadMapTripUntitled = 1; + static RoadMapPen RoadMapTripRouteLinesPen = NULL; static int RoadMapTripDrawingActiveRoute; *************** *** 1977,2006 **** void roadmap_trip_new (void) { - const char *path = roadmap_path_trips(); - char name[50]; - int i; - - strcpy (name, "NewTrip"); - - i = 1; - while (roadmap_file_exists(path, name) && i < 1000) { - sprintf(name, "NewTrip-%d", i++); - } - if (i == 1000) { - roadmap_log (ROADMAP_WARNING, "over 1000 new trips!"); - strcpy (name, "NewTrip"); - } - if (RoadMapTripModified) { ! roadmap_trip_save (0); } roadmap_trip_clear (); ! roadmap_config_set (&RoadMapConfigTripName, name); ! ! roadmap_trip_set_modified(1); roadmap_screen_refresh (); } --- 1984,2004 ---- void roadmap_trip_new (void) { if (RoadMapTripModified) { ! if (!roadmap_trip_save (0)) { ! return; ! } } roadmap_trip_clear (); ! roadmap_trip_set_modified(0); roadmap_screen_refresh (); + + roadmap_main_title(""); + + /* NB: there may be a name in config, which couldn't be read + * at startup */ + RoadMapTripUntitled = 1; } *************** *** 2028,2032 **** } roadmap_config_declare ! ("session", &RoadMapConfigTripName, "default.gpx"); roadmap_config_declare ("session", &RoadMapConfigFocusName, "GPS"); --- 2026,2030 ---- } roadmap_config_declare ! ("session", &RoadMapConfigTripName, ""); roadmap_config_declare ("session", &RoadMapConfigFocusName, "GPS"); *************** *** 2053,2060 **** } /* File dialog support */ static int roadmap_trip_load_file (const char *name, int silent, int merge); ! static int roadmap_trip_save_file (const char *name, int force); static void roadmap_trip_file_dialog_ok --- 2051,2070 ---- } + const char *roadmap_trip_path_relative_to_trips(const char *filename) { + const char *p; + int pl; + p = roadmap_path_trips(); + pl = strlen(p); + if (strncmp(p, filename, pl) == 0) { + filename = filename + pl; + filename = roadmap_path_skip_separator (filename); + } + return filename; + } + /* File dialog support */ static int roadmap_trip_load_file (const char *name, int silent, int merge); ! static int roadmap_trip_save_file (const char *name); static void roadmap_trip_file_dialog_ok *************** *** 2062,2066 **** if (mode[0] == 'w') { ! roadmap_trip_save_file (filename, 1); } else { roadmap_trip_load_file (filename, 0, 0); --- 2072,2083 ---- if (mode[0] == 'w') { ! if (roadmap_trip_save_file (filename)) { ! if ( RoadMapTripUntitled ) { ! filename = roadmap_trip_path_relative_to_trips(filename); ! roadmap_config_set (&RoadMapConfigTripName, filename); ! roadmap_main_title(TRIP_TITLE_FMT, filename); ! RoadMapTripUntitled = 0; ! } ! } } else { roadmap_trip_load_file (filename, 0, 0); *************** *** 2143,2147 **** // work. if (RoadMapTripModified) { ! roadmap_trip_save (0); } roadmap_trip_clear(); --- 2160,2166 ---- // work. if (RoadMapTripModified) { ! if (!roadmap_trip_save (0)) { ! return 0; ! } } roadmap_trip_clear(); *************** *** 2152,2157 **** roadmap_config_set (&RoadMapConfigTripName, ! roadmap_path_skip_directories(name)); roadmap_trip_set_modified(0); } --- 2171,2178 ---- roadmap_config_set (&RoadMapConfigTripName, ! roadmap_trip_path_relative_to_trips(name)); roadmap_trip_set_modified(0); + roadmap_main_title(TRIP_TITLE_FMT, name); + RoadMapTripUntitled = 0; } *************** *** 2185,2188 **** --- 2206,2210 ---- } roadmap_screen_refresh (); + roadmap_main_title(TRIP_TITLE_FMT, roadmap_trip_current()); return ret; *************** *** 2190,2201 **** int roadmap_trip_load (int silent, int merge) { - int ret; - const char *name = roadmap_trip_current(); ! ret = roadmap_trip_load_file ( name, silent, merge); ! if (ret == 0) return 0; ! return ret; } --- 2212,2221 ---- int roadmap_trip_load (int silent, int merge) { ! const char *name = roadmap_trip_current(); ! if (!name || !name[0]) return 0; ! return roadmap_trip_load_file ( name, silent, merge); } *************** *** 2211,2215 **** } ! static int roadmap_trip_save_file (const char *name, int force) { const char *path = NULL; --- 2231,2235 ---- } ! static int roadmap_trip_save_file (const char *name) { const char *path = NULL; *************** *** 2219,2227 **** } - if (!force && !RoadMapTripModified) return 1; - - /* Always save if user-initiated. */ - roadmap_log (ROADMAP_DEBUG, "trip save_forced, or modified '%s'", name); - return roadmap_gpx_write_file (path, name, &RoadMapTripWaypointHead, &RoadMapTripRouteHead, &RoadMapTripTrackHead); --- 2239,2242 ---- *************** *** 2229,2243 **** } ! int roadmap_trip_save (int force) { ! int ret; ! const char *name = roadmap_trip_current(); ! ret = roadmap_trip_save_file ( name, force); return ret; } ! void roadmap_trip_save_as(int force) { roadmap_trip_file_dialog ("w"); } --- 2244,2286 ---- } ! int roadmap_trip_save (int manual) { ! int ret = 1; /* success */ ! if (RoadMapTripUntitled) { ! if (manual) { ! roadmap_trip_save_as(); ! } else if (RoadMapTripModified) { /* need to choose a name */ ! const char *path = roadmap_path_trips(); ! char name[50]; ! int i; ! ! strcpy (name, "SavedTrip.gpx"); ! ! i = 1; ! while (roadmap_file_exists(path, name) && i < 1000) { ! sprintf(name, "SavedTrip-%d.gpx", i++); ! } ! if (i == 1000) { ! roadmap_log (ROADMAP_WARNING, "over 1000 SavedTrips!"); ! strcpy (name, "SavedTrip.gpx"); ! } ! ! if (roadmap_trip_save_file (name)) { ! roadmap_config_set (&RoadMapConfigTripName, name); ! roadmap_main_title(TRIP_TITLE_FMT, name); ! RoadMapTripUntitled = 0; ! } ! } ! } else { ! if (manual || RoadMapTripModified) { ! ret = roadmap_trip_save_file (roadmap_trip_current()); ! } ! } return ret; } ! void roadmap_trip_save_as() { roadmap_trip_file_dialog ("w"); } Index: roadmap_trip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** roadmap_trip.h 24 Oct 2006 03:24:21 -0000 1.27 --- roadmap_trip.h 27 Oct 2006 02:33:14 -0000 1.28 *************** *** 81,85 **** int roadmap_trip_load_ask (int merge); int roadmap_trip_save (int force); ! void roadmap_trip_save_as (int force); void roadmap_trip_save_screenshot (void); --- 81,85 ---- int roadmap_trip_load_ask (int merge); int roadmap_trip_save (int force); ! void roadmap_trip_save_as (void); void roadmap_trip_save_screenshot (void); Index: session =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/session,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** session 7 Dec 2005 18:57:35 -0000 1.2 --- session 27 Oct 2006 02:33:14 -0000 1.3 *************** *** 4,8 **** Focus.Rotate: 0 Focus.Name: Address - Trip.Name: default.gpx Hold.Direction: 0 Hold.Position: 0,0 --- 4,7 ---- Index: roadmap_main.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_main.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_main.h 18 Nov 2005 20:11:26 -0000 1.10 --- roadmap_main.h 27 Oct 2006 02:33:14 -0000 1.11 *************** *** 36,39 **** --- 36,40 ---- void roadmap_main_new (const char *title, int width, int height); + void roadmap_main_title(char *fmt, ...); void roadmap_main_set_keyboard (RoadMapKeyInput callback); Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** roadmap_start.c 24 Oct 2006 02:10:42 -0000 1.107 --- roadmap_start.c 27 Oct 2006 02:33:14 -0000 1.108 *************** *** 197,201 **** static void roadmap_start_save_trip_as (void) { ! roadmap_trip_save_as (1); } --- 197,201 ---- static void roadmap_start_save_trip_as (void) { ! roadmap_trip_save_as (); } |
From: Paul F. <pg...@us...> - 2006-10-27 02:33:21
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8362/gtk Modified Files: roadmap_main.c Log Message: attempt at cleaning up trip management: now, if no trip is ever selected, and no "trip" changes are made (routes, trip landmarks), then no file will be written, and no trip name will appear in the config. doing "save as" will set the name, and doing a "save" on an unnamed trip will force a "save as". with more sensible trip loading, it's now safe to put the trip name in the window title bar. (if trip features aren't used, it will never appear.) Index: roadmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk/roadmap_main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** roadmap_main.c 27 Sep 2006 10:30:49 -0000 1.20 --- roadmap_main.c 27 Oct 2006 02:33:14 -0000 1.21 *************** *** 28,31 **** --- 28,33 ---- #include <time.h> #include <stdlib.h> + #include <stdio.h> + #include <string.h> #include <sys/time.h> *************** *** 62,65 **** --- 64,69 ---- + static char *RoadMapMainTitle = NULL; + static RoadMapKeyInput RoadMapMainInput = NULL; static GtkWidget *RoadMapMainWindow = NULL; *************** *** 178,181 **** --- 182,204 ---- gtk_window_set_title (GTK_WINDOW(RoadMapMainWindow), title); + + if (RoadMapMainTitle != NULL) { + free(RoadMapMainTitle); + } + RoadMapMainTitle = strdup (title); + } + + void roadmap_main_title(char *fmt, ...) { + + char newtitle[200]; + va_list ap; + int n; + + n = snprintf(newtitle, 200, "%s", RoadMapMainTitle); + va_start(ap, fmt); + vsnprintf(&newtitle[n], 200 - n, fmt, ap); + va_end(ap); + + gtk_window_set_title (GTK_WINDOW(RoadMapMainWindow), newtitle); } *************** *** 469,473 **** while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } --- 492,496 ---- while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } *************** *** 485,489 **** while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } --- 508,512 ---- while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } |
From: Paul F. <pg...@us...> - 2006-10-27 02:33:21
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8362/gtk2 Modified Files: roadmap_main.c Log Message: attempt at cleaning up trip management: now, if no trip is ever selected, and no "trip" changes are made (routes, trip landmarks), then no file will be written, and no trip name will appear in the config. doing "save as" will set the name, and doing a "save" on an unnamed trip will force a "save as". with more sensible trip loading, it's now safe to put the trip name in the window title bar. (if trip features aren't used, it will never appear.) Index: roadmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/roadmap_main.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** roadmap_main.c 27 Sep 2006 10:30:49 -0000 1.27 --- roadmap_main.c 27 Oct 2006 02:33:14 -0000 1.28 *************** *** 260,263 **** --- 260,277 ---- } + void roadmap_main_title(char *fmt, ...) { + + char newtitle[200]; + va_list ap; + int n; + + n = snprintf(newtitle, 200, "%s", RoadMapMainTitle); + va_start(ap, fmt); + vsnprintf(&newtitle[n], 200 - n, fmt, ap); + va_end(ap); + + gtk_window_set_title (GTK_WINDOW(RoadMapMainWindow), newtitle); + } + void roadmap_main_set_keyboard (RoadMapKeyInput callback) { *************** *** 566,570 **** while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } --- 580,584 ---- while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } *************** *** 582,586 **** while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } --- 596,600 ---- while (gtk_events_pending ()) { if (gtk_main_iteration ()) { ! exit(0); /* gtk_main_quit() called */ } } |
From: Paul F. <pg...@us...> - 2006-10-27 02:28:39
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7081/unix Modified Files: roadmap_file.c Log Message: restrict successful file opens to regular files only. Index: roadmap_file.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_file.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** roadmap_file.c 5 Jun 2006 22:49:17 -0000 1.18 --- roadmap_file.c 27 Oct 2006 02:28:01 -0000 1.19 *************** *** 57,60 **** --- 57,61 ---- int silent; FILE *file; + struct stat stat_buffer; const char *full_name = roadmap_path_join (path, name); *************** *** 70,73 **** --- 71,81 ---- file = fopen (full_name, mode); + if (file != NULL && fstat (fileno(file), &stat_buffer) == 0) { + /* read-only opens will succeed on directories */ + if (!S_ISREG(stat_buffer.st_mode)) { + fclose(file); + file = NULL; + } + } if ((file == NULL) && (! silent)) { *************** *** 203,207 **** RoadMapFileContext context; ! struct stat state_result; int open_mode; int map_mode; --- 211,215 ---- RoadMapFileContext context; ! struct stat stat_result; int open_mode; int map_mode; *************** *** 244,256 **** } ! if (fstat (context->fd, &state_result) != 0) { roadmap_log (ROADMAP_ERROR, "cannot stat file %s", context->name); roadmap_file_unmap (&context); return NULL; } ! context->size = state_result.st_size; context->base = mmap (NULL, ! (size_t)state_result.st_size, map_mode, map_flags, --- 252,264 ---- } ! if (fstat (context->fd, &stat_result) != 0) { roadmap_log (ROADMAP_ERROR, "cannot stat file %s", context->name); roadmap_file_unmap (&context); return NULL; } ! context->size = stat_result.st_size; context->base = mmap (NULL, ! (size_t)stat_result.st_size, map_mode, map_flags, |
From: Paul F. <pg...@us...> - 2006-10-27 02:04:21
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30226 Modified Files: roadmap_gpx.c Log Message: try (a little) harder to catch write errors Index: roadmap_gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpx.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_gpx.c 4 Oct 2006 20:25:03 -0000 1.6 --- roadmap_gpx.c 27 Oct 2006 02:03:30 -0000 1.7 *************** *** 169,172 **** --- 169,175 ---- ret = 0; + if (!ret) + roadmap_log (ROADMAP_ERROR, "GPX file save of %s / %s failed", path, name); + return ret; } *************** *** 204,207 **** --- 207,212 ---- ret = gpx_write(fp, NULL, &route_head, NULL); + if (ferror(fp)) + ret = 0; if (fclose(fp) != 0) *************** *** 240,244 **** if (! roadmap_gpx_told_no_expat) { ! roadmap_log (ROADMAP_ERROR, "No GPX file import (no expat library)"); roadmap_gpx_told_no_expat = 1; } --- 245,249 ---- if (! roadmap_gpx_told_no_expat) { ! roadmap_log (ROADMAP_ERROR, "No GPX file import/export (no expat library)"); roadmap_gpx_told_no_expat = 1; } |
From: Paul F. <pg...@us...> - 2006-10-26 13:14:17
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3176 Modified Files: roadmap_factory.c Log Message: flag invalid action names in popup configs Index: roadmap_factory.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_factory.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** roadmap_factory.c 16 Aug 2006 20:45:43 -0000 1.21 --- roadmap_factory.c 26 Oct 2006 13:14:12 -0000 1.22 *************** *** 516,519 **** --- 516,521 ---- this_action->tip, this_action->callback); + } else { + roadmap_log (ROADMAP_ERROR, "invalid action name '%s'", item); } } |
From: Paul F. <pg...@us...> - 2006-10-25 23:49:35
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2188 Modified Files: roadmap_track.c Log Message: don't close null file handle Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_track.c 24 Oct 2006 02:10:43 -0000 1.12 --- roadmap_track.c 25 Oct 2006 23:49:29 -0000 1.13 *************** *** 423,429 **** /* we don't need the "recent points" cache anymore */ roadmap_file_remove (path, RECENT_CSV); - fclose(RoadMapTrackRecentCSV); - RoadMapTrackRecentCSV = NULL; if (defaulted) { --- 423,431 ---- /* we don't need the "recent points" cache anymore */ + if (RoadMapTrackRecentCSV) { + fclose(RoadMapTrackRecentCSV); + RoadMapTrackRecentCSV = NULL; + } roadmap_file_remove (path, RECENT_CSV); if (defaulted) { |
From: Paul F. <pg...@us...> - 2006-10-24 03:24:24
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21514 Modified Files: roadmap_screen.c roadmap_trip.c roadmap_trip.h Log Message: when "Hold"ing the map, hold it at its current offset from the focus that's being held. (prevents the jump back to GPS when one has panned away from the GPS position, and then tried to stop the map's movement with Hold.) Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** roadmap_trip.c 22 Oct 2006 20:25:06 -0000 1.68 --- roadmap_trip.c 24 Oct 2006 03:24:20 -0000 1.69 *************** *** 1442,1445 **** --- 1442,1454 ---- } + void roadmap_trip_set_focus_position (RoadMapPosition *pos ) { + + if (RoadMapTripFocus != NULL) { + RoadMapTripFocus->map = *pos; + roadmap_config_set_position + (&RoadMapTripFocus->config_position, &RoadMapTripFocus->map); + } + } + static waypoint * roadmap_trip_choose_best_next (const RoadMapPosition *pos) { Index: roadmap_trip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** roadmap_trip.h 2 Oct 2006 14:53:25 -0000 1.26 --- roadmap_trip.h 24 Oct 2006 03:24:21 -0000 1.27 *************** *** 56,59 **** --- 56,60 ---- const RoadMapPosition *roadmap_trip_get_focus_position (void); + void roadmap_trip_set_focus_position (RoadMapPosition *pos ); void roadmap_trip_route_start (void); Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** roadmap_screen.c 2 Oct 2006 14:55:35 -0000 1.73 --- roadmap_screen.c 24 Oct 2006 03:24:20 -0000 1.74 *************** *** 1291,1294 **** --- 1291,1295 ---- roadmap_trip_copy_focus ("Hold"); roadmap_trip_set_focus ("Hold"); + roadmap_trip_set_focus_position (&RoadMapScreenCenter); } |
From: Paul F. <pg...@us...> - 2006-10-24 02:11:40
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25662 Modified Files: README Log Message: make track writing more robust. added an autosave timeout, and an interim log of trackpoints, so that even a crash should result in no lost trackpoints. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** README 13 Oct 2006 15:18:09 -0000 1.101 --- README 24 Oct 2006 02:10:42 -0000 1.102 *************** *** 1433,1436 **** --- 1433,1443 ---- trip's list, or your personal list. Continue adding waypoints to your route. + + (If you do much route creation, you should create a toolbar button for + the "addroutewaypoint" command. Then, the easy way to create a route + is to first create a trivial route between the two endpoints as + described above, and then points on the map and add them with your + toolbar button. The route will "snap" into place through each new + point you add.) Note that waypoints are always copied. So if you choose an *************** *** 2825,2838 **** files which are also stored in GPX format. - The "Current Track" file contains waypoints representing - where you've been -- a "breadcrumb trail", if you will. - This file (called "currenttrack.gpx" by default) will - only contain a single track when written. When read - (on startup, to restore previous state), only the first - track in the file will be read. All other routes or - tracks and waypoints will be ignored (and likely lost, - when the current track is saved at the end of the - session). - The "Personal Landmarks" files, called "landmarks.gpx" by default, contains landmarks (waypoints) which you might --- 2832,2835 ---- *************** *** 2844,2847 **** --- 2841,2863 ---- in the file are ignored. + The "Current Track" file contains waypoints representing + where you've been -- a "breadcrumb trail", if you will. + This file (called "currenttrack.gpx" by default) will + only contain a single track when written. When read (on + startup, to restore previous state), only the first track + in the file will be read. All other routes or tracks and + waypoints will be ignored (and likely lost, when the + current track is saved at the end of the session). Along + with the currenttrack.gpx, you may see "recenttrack.csv", + and one or more "savetrack-*.gpx" files (which will + include a date in their names). The "savetrack" files are + archival -- if the in-memory list gets too big, or if the + user "clears" the current track, then excess historical + trackpoints will be written to a "savetrack" file. The + "recenttrack.csv" file is a temporary file, used to keep + RoadMap from losing any track points in the event that it + dies (crashes) unexpectedly. The goal is to never lose a + track point. + (These files are not stored in the same directory as the other trip files, but instead in the same directory in which the |
From: Paul F. <pg...@us...> - 2006-10-24 02:10:46
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25662/src Modified Files: roadmap_start.c roadmap_track.c roadmap_track.h Log Message: make track writing more robust. added an autosave timeout, and an interim log of trackpoints, so that even a crash should result in no lost trackpoints. Index: roadmap_track.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_track.h 7 Dec 2005 14:06:03 -0000 1.1 --- roadmap_track.h 24 Oct 2006 02:10:43 -0000 1.2 *************** *** 27,35 **** void roadmap_track_display (void); ! void roadmap_track_clear (void); void roadmap_track_initialize (void); void roadmap_track_save (void); ! void roadmap_track_autosave (void); ! void roadmap_track_autoload(void); void roadmap_track_toggle_display(void); int roadmap_track_is_refresh_needed (void); --- 27,36 ---- void roadmap_track_display (void); ! void roadmap_track_reset (void); void roadmap_track_initialize (void); + void roadmap_track_activate (void); void roadmap_track_save (void); ! void roadmap_track_autowrite (void); ! void roadmap_track_autoload(void); void roadmap_track_toggle_display(void); int roadmap_track_is_refresh_needed (void); Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_track.c 4 Oct 2006 14:56:57 -0000 1.11 --- roadmap_track.c 24 Oct 2006 02:10:43 -0000 1.12 *************** *** 22,25 **** --- 22,43 ---- */ + + /* + * The trackpoints are stored in a list, like all other + * waypoints. We save the list to the "currenttrack" file on + * exit, and read an initial list from it on startup. + * + * Periodically in between, we save the list entire to disk. If + * the disk file would become too big, we save an initial chunk + * of the list to an archive file, and save the rest to the + * currenttrack file. + * + * To protect against trackpoint loss from a crash that migh + * occur in between the periodic saves, we write individual + * trackpoints to a small CSV file. On startup, if this file + * exists, we appendit to what we got from teh currenttrack file. + */ + + #include "roadmap.h" #include "roadmap_types.h" *************** *** 56,64 **** ROADMAP_CONFIG_ITEM("Track", "Initial Display"); static RoadMapConfigDescriptor RoadMapConfigLength = ! ROADMAP_CONFIG_ITEM("Track", "Length"); static RoadMapConfigDescriptor RoadMapConfigTrackName = ROADMAP_CONFIG_ITEM ("Track", "Name"); --- 74,139 ---- ROADMAP_CONFIG_ITEM("Track", "Initial Display"); static RoadMapConfigDescriptor RoadMapConfigLength = ! ROADMAP_CONFIG_ITEM("Track", "Saved Track Points"); ! static RoadMapConfigDescriptor RoadMapConfigAutoSaveInterval = ! ROADMAP_CONFIG_ITEM("Track", "Autosave Minutes"); static RoadMapConfigDescriptor RoadMapConfigTrackName = ROADMAP_CONFIG_ITEM ("Track", "Name"); + #define RECENT_CSV "recenttrack.csv" + #define ARCHIVED_GPX "savetrack" /* ".gpx" */ + + FILE *RoadMapTrackRecentCSV; + + void roadmap_track_add_recent (waypoint *w) { + + if (!RoadMapTrackRecentCSV) { + RoadMapTrackRecentCSV = roadmap_file_fopen + (roadmap_path_user(), RECENT_CSV, "a"); + } + fprintf(RoadMapTrackRecentCSV, "%ld, %0.6lf, %0.6lf, %f, %f, %f\n", + w->creation_time, + to_float(w->pos.longitude), + to_float(w->pos.latitude), + ((double)(w->altitude)), + w->speed, + w->course); + + fflush(RoadMapTrackRecentCSV); + } + + void roadmap_track_fetch_recent(const char *path, char *name) { + + char trkpoint[128]; + time_t t; + double lon, lat; + float alt, speed, course; + waypoint *w; + + /* read .csv file, add contents to RoadMapTrack */ + if ( roadmap_file_exists(path, name)) { + + RoadMapTrackRecentCSV = roadmap_file_fopen (path, name, "a+"); + if (!RoadMapTrackRecentCSV) return; + + while (fgets(trkpoint, sizeof(trkpoint), RoadMapTrackRecentCSV)) { + if (sscanf(trkpoint, "%ld, %lf, %lf, %f, %f, %f", + &t, &lon, &lat, &alt, &speed, &course) != 6) + continue; + w = waypt_new(); + w->creation_time = t; + w->pos.latitude = from_float(lat); + w->pos.longitude = from_float(lon); + w->altitude = alt; + w->speed = speed; + w->course = course; + route_add_wpt_tail (RoadMapTrack, w); + } + + /* the csv file will be removed and closed at the end of + * the autosave routine. + */ + } + } *************** *** 66,73 **** const RoadMapGpsPosition *gps_position) { ! int maxtrack; waypoint *w; w = waypt_new (); - w->pos.latitude = gps_position->latitude; w->pos.longitude = gps_position->longitude; --- 141,150 ---- const RoadMapGpsPosition *gps_position) { ! static time_t lastsave = -1; ! time_t now; ! int autosaveminutes; waypoint *w; + w = waypt_new (); w->pos.latitude = gps_position->latitude; w->pos.longitude = gps_position->longitude; *************** *** 81,95 **** w->creation_time = gps_time; route_add_wpt_tail (RoadMapTrack, w); RoadMapTrackGpsPosition = *gps_position; ! maxtrack = roadmap_config_get_integer (&RoadMapConfigLength); ! while (RoadMapTrack->rte_waypt_ct > maxtrack) { ! w = (waypoint *) ROADMAP_LIST_FIRST (&RoadMapTrack->waypoint_list); ! route_del_wpt ( RoadMapTrack, w); } ! RoadMapTrackModified = 1; } --- 158,181 ---- w->creation_time = gps_time; + /* append to the list */ route_add_wpt_tail (RoadMapTrack, w); + /* and write a new line to the interim .csv file */ + roadmap_track_add_recent(w); + RoadMapTrackGpsPosition = *gps_position; ! RoadMapTrackModified = 1; ! ! autosaveminutes = roadmap_config_get_integer ! (&RoadMapConfigAutoSaveInterval); ! time(&now); ! if (lastsave < 0) lastsave = now; ! if (now - autosaveminutes * 60 > lastsave) { ! roadmap_track_autowrite(); ! lastsave = now; } ! } *************** *** 256,281 **** } - void roadmap_track_clear (void) { - - route_free(RoadMapTrack); - RoadMapTrack = route_head_alloc(); - RoadMapTrackRefresh = 1; - RoadMapTrackModified = 1; - roadmap_screen_refresh(); - } - - void roadmap_track_save(void) { - char name[40]; - time_t now; - - time(&now); - strftime(name, sizeof(name), "Track-%Y-%m-%d-%H-%M-%S.gpx", - localtime(&now)); - - roadmap_gpx_write_track(roadmap_path_trips(), name, RoadMapTrack); - RoadMapTrackModified = 0; - - } - static const char *roadmap_track_filename(int *defaulted) { const char *name; --- 342,345 ---- *************** *** 293,299 **** } ! void roadmap_track_autosave(void) { const char *name; int defaulted, ret; --- 357,386 ---- } ! static int roadmap_track_save_worker ! (const char *path, const char *prefix, route_head *track) { ! char name[40]; ! time_t now; ! int prefixlen; ! ! prefixlen = sprintf(name, "%s", prefix); ! ! time(&now); ! strftime(&name[prefixlen], sizeof(name) - prefixlen, ! "-%Y-%m-%d-%H-%M-%S.gpx", localtime(&now)); ! ! return roadmap_gpx_write_track(path, name, track); ! ! } ! ! void roadmap_track_save(void) { ! ! roadmap_track_save_worker(roadmap_path_trips(), "Track-", RoadMapTrack); ! RoadMapTrackModified = 0; ! } ! ! static void roadmap_track_autosave(int hiwater, int lowater) { const char *name; + const char *path = roadmap_path_user(); int defaulted, ret; *************** *** 303,310 **** if (name == NULL) return; ! ret = roadmap_gpx_write_track(roadmap_path_user(), name, RoadMapTrack); if (ret == 0) return; if (defaulted) { roadmap_config_set (&RoadMapConfigTrackName, name); --- 390,430 ---- if (name == NULL) return; ! if (RoadMapTrack->rte_waypt_ct > hiwater) { + route_head *archive = route_head_alloc(); + + while (RoadMapTrack->rte_waypt_ct > lowater) { + waypoint *w; + w = (waypoint *)roadmap_list_remove + (ROADMAP_LIST_FIRST (&RoadMapTrack->waypoint_list)); + RoadMapTrack->rte_waypt_ct--; + + roadmap_list_append ( &archive->waypoint_list, &w->Q); + archive->rte_waypt_ct++; + } + + ret = roadmap_track_save_worker(path, ARCHIVED_GPX, archive); + if (ret == 0) { /* write failed -- restore points */ + /* this looks backwards, due to SPLICE's append behavior */ + ROADMAP_LIST_SPLICE + (&archive->waypoint_list, &RoadMapTrack->waypoint_list); + archive->rte_waypt_ct += RoadMapTrack->rte_waypt_ct; + + ROADMAP_LIST_MOVE(&RoadMapTrack->waypoint_list, &archive->waypoint_list); + RoadMapTrack->rte_waypt_ct = archive->rte_waypt_ct; + archive->rte_waypt_ct = 0; + } else { + route_free(archive); + } + } + + ret = roadmap_gpx_write_track(path, name, RoadMapTrack); if (ret == 0) return; + /* we don't need the "recent points" cache anymore */ + roadmap_file_remove (path, RECENT_CSV); + fclose(RoadMapTrackRecentCSV); + RoadMapTrackRecentCSV = NULL; + if (defaulted) { roadmap_config_set (&RoadMapConfigTrackName, name); *************** *** 315,318 **** --- 435,462 ---- } + void roadmap_track_reset (void) { + + roadmap_track_autosave(0, 0); + RoadMapTrackRefresh = 1; + RoadMapTrackModified = 1; + roadmap_screen_refresh(); + } + + + + void roadmap_track_autowrite(void) { + + int nominal; + + /* essentially, if we aquire 25% more points than we've been + * asked to save, we tell the autowriter to archive all but + * that 75% of what we've been asked for, and continue from + * there. + */ + nominal = roadmap_config_get_integer (&RoadMapConfigLength); + roadmap_track_autosave (5 * nominal / 4, 3 * nominal / 4); + + } + void roadmap_track_autoload(void) { *************** *** 324,337 **** if (name == NULL) return; ! if (! roadmap_file_exists(path, name)) return; /* not an error. */ ! ! ret = roadmap_gpx_read_one_track(path, name, &RoadMapTrack); ! if (ret == 0) return; ! if (defaulted) { ! roadmap_config_set (&RoadMapConfigTrackName, name); } RoadMapTrackModified = 0; --- 468,486 ---- if (name == NULL) return; ! if ( roadmap_file_exists(path, name)) { ! ret = roadmap_gpx_read_one_track(path, name, &RoadMapTrack); ! if (ret == 0) return; ! if (defaulted) { ! roadmap_config_set (&RoadMapConfigTrackName, name); ! } } + /* there may be "recent" trackpoints even if no currenttrack file */ + if ( roadmap_file_exists(path, RECENT_CSV) ) { + roadmap_track_fetch_recent(path, RECENT_CSV); + roadmap_track_autowrite(); + } RoadMapTrackModified = 0; *************** *** 342,345 **** --- 491,503 ---- roadmap_track_initialize(void) { + roadmap_config_declare + ("preferences", &RoadMapConfigAutoSaveInterval, "10"); /* minutes */ + + roadmap_config_declare + ("preferences", &RoadMapConfigLength, "1000"); + + roadmap_config_declare + ("preferences", &RoadMapConfigTrackName, ""); + /* We have to declare both the time and distance intervals, * though only one is used at a time. *************** *** 355,371 **** "off", "Deviation", "Distance", "Time", NULL); - roadmap_config_declare - ("preferences", &RoadMapConfigLength, "1000"); - - roadmap_config_declare - ("preferences", &RoadMapConfigTrackName, ""); - roadmap_config_declare_enumeration ("preferences", &RoadMapConfigDisplayString, "on", "off", NULL); - RoadMapTrack = route_head_alloc(); roadmap_gps_register_listener(roadmap_track_gps_update); RoadMapTrackDisplay = roadmap_config_match --- 513,526 ---- "off", "Deviation", "Distance", "Time", NULL); roadmap_config_declare_enumeration ("preferences", &RoadMapConfigDisplayString, "on", "off", NULL); RoadMapTrack = route_head_alloc(); roadmap_gps_register_listener(roadmap_track_gps_update); + } + + void + roadmap_track_activate(void) { RoadMapTrackDisplay = roadmap_config_match Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** roadmap_start.c 13 Oct 2006 15:17:26 -0000 1.106 --- roadmap_start.c 24 Oct 2006 02:10:42 -0000 1.107 *************** *** 465,470 **** "Save the current GPS breadcrumb track", roadmap_start_save_track}, ! {"trackclear", "Clear Current Track", "Clear Track", NULL, ! "Clear the current GPS breadcrumb track", roadmap_track_clear}, {"backtrackroute", "Create Backtrack Route", "BackTrack", NULL, --- 465,470 ---- "Save the current GPS breadcrumb track", roadmap_start_save_track}, ! {"trackreset", "Reset Current Track", "Reset Track", NULL, ! "Reset the current GPS breadcrumb track", roadmap_track_reset}, {"backtrackroute", "Create Backtrack Route", "BackTrack", NULL, *************** *** 664,668 **** "tracksave", ! "trackclear", "backtrackroute", "addtrack", --- 664,668 ---- "tracksave", ! "trackreset", "backtrackroute", "addtrack", *************** *** 1075,1078 **** --- 1075,1079 ---- roadmap_history_load (); + roadmap_track_activate (); #ifdef ROADMAP_USES_EXPAT roadmap_track_autoload (); *************** *** 1115,1119 **** roadmap_history_save(); #ifdef ROADMAP_USES_EXPAT ! roadmap_track_autosave (); roadmap_landmark_save (); roadmap_trip_save (0); --- 1116,1120 ---- roadmap_history_save(); #ifdef ROADMAP_USES_EXPAT ! roadmap_track_autowrite (); roadmap_landmark_save (); roadmap_trip_save (0); |
From: Paul F. <pg...@us...> - 2006-10-24 01:38:08
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12495 Modified Files: roadmap_list.h Log Message: comments Index: roadmap_list.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_list.h 3 Oct 2006 21:37:26 -0000 1.7 --- roadmap_list.h 24 Oct 2006 01:37:17 -0000 1.8 *************** *** 102,115 **** --- 102,119 ---- /* Inline functions (not macros) to help enforce type safety. */ + /* put e at end of list lh */ static inline void roadmap_list_append(RoadMapList *lh, RoadMapListItem *e) { roadmap_list_enqueue(e, (RoadMapListItem *)lh->list_last); } + /* put e at beginning of list lh */ static inline void roadmap_list_insert(RoadMapList *lh, RoadMapListItem *e) { roadmap_list_enqueue(e, (RoadMapListItem *)lh); } + /* put newe before olde */ static inline void roadmap_list_put_before (RoadMapListItem *olde, RoadMapListItem *newe) { roadmap_list_enqueue(newe, olde->prev); } + /* put newe after olde */ static inline void roadmap_list_put_after (RoadMapListItem *olde, RoadMapListItem *newe) { |
From: Paul F. <pg...@us...> - 2006-10-22 20:25:09
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21854 Modified Files: roadmap_trip.c Log Message: clean up waypoint and route edit dialogs. waypoint lat/lon can now be modified. Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** roadmap_trip.c 5 Oct 2006 15:45:25 -0000 1.67 --- roadmap_trip.c 22 Oct 2006 20:25:06 -0000 1.68 *************** *** 55,59 **** #include "roadmap_trip.h" - static RoadMapConfigDescriptor RoadMapConfigTripName = ROADMAP_CONFIG_ITEM("Trip", "Name"); --- 55,58 ---- *************** *** 285,334 **** } ! /* Edit dialog. ! * Lets user change name and description for waypoints or routes. ! */ ! struct namepointers { ! char **nameptr1; ! char **nameptr2; ! }; ! ! static void roadmap_trip_dialog_edit_okay (const char *name, void *data) { ! char *newname = (char *) roadmap_dialog_get_data ("Name", "Name:"); ! char *newdesc = (char *) roadmap_dialog_get_data ("Comment", "Comment:"); ! char **origname = ((struct namepointers *)data)->nameptr1; ! char **origdesc = ((struct namepointers *)data)->nameptr2; ! if (*origname) free(*origname); ! *origname = newname[0] ? strdup(newname) : NULL; ! if (*origdesc) free(*origdesc); ! *origdesc = newdesc[0] ? strdup(newdesc) : NULL; roadmap_dialog_hide (name); } ! void roadmap_trip_dialog_edit(char **namep, char **commentp, int use_keyboard) { ! static struct namepointers NamePointers; ! NamePointers.nameptr1 = namep; ! NamePointers.nameptr2 = commentp; ! if (roadmap_dialog_activate ("Rename", &NamePointers)) { ! roadmap_dialog_new_entry ("Comment", "Comment:"); ! roadmap_dialog_new_entry ("Name", "Name:"); roadmap_dialog_add_button ("Cancel", roadmap_trip_dialog_cancel); roadmap_dialog_add_button ("Okay", ! roadmap_trip_dialog_edit_okay); roadmap_dialog_complete (use_keyboard); } ! roadmap_dialog_set_data ("Comment", "Comment:", *commentp ? *commentp : ""); ! roadmap_dialog_set_data ("Name", "Name:", *namep ? *namep : ""); } --- 284,402 ---- } ! static void roadmap_trip_dialog_route_edit_okay (const char *name, void *data) { ! char *newname = (char *) roadmap_dialog_get_data ("Text", "Name:"); ! char *newdesc = (char *) roadmap_dialog_get_data ("Text", "Comment:"); ! route_head *route = data; ! if (route->rte_name) free(route->rte_name); ! route->rte_name = newname[0] ? strdup(newname) : NULL; ! if (route->rte_desc) free(route->rte_desc); ! route->rte_desc = newdesc[0] ? strdup(newdesc) : NULL; roadmap_dialog_hide (name); } ! static void roadmap_trip_dialog_route_edit ! (route_head *route, int use_keyboard) { ! if (roadmap_dialog_activate ("Route Edit", route)) { ! roadmap_dialog_new_entry ("Text", "Name:"); ! roadmap_dialog_new_entry ("Text", "Comment:"); ! roadmap_dialog_add_button ("Cancel", ! roadmap_trip_dialog_cancel); ! roadmap_dialog_add_button ("Okay", ! roadmap_trip_dialog_route_edit_okay); ! roadmap_dialog_complete (use_keyboard); ! } ! ! roadmap_dialog_set_data ! ("Text", "Name:", route->rte_name ? route->rte_name : ""); ! roadmap_dialog_set_data ! ("Text", "Comment:", route->rte_desc ? route->rte_desc : ""); ! ! } ! ! int ! safe_strcmp(char *s1, char *s2) ! { ! if (!s1) s1 = ""; ! if (!s2) s2 = ""; ! return strcmp(s1, s2); ! } ! ! static void roadmap_trip_dialog_waypoint_edit_okay (const char *name, void *data) { ! ! char *newname = (char *) roadmap_dialog_get_data ("Data", "Name:"); ! char *newdesc = (char *) roadmap_dialog_get_data ("Data", "Comment:"); ! char *newlon = (char *) roadmap_dialog_get_data ("Data", "Longitude:"); ! char *newlat = (char *) roadmap_dialog_get_data ("Data", "Latitude:"); ! waypoint *wpt = data; ! double tmp; ! ! if (safe_strcmp(wpt->shortname, newname)) { ! if (wpt->shortname) free(wpt->shortname); ! wpt->shortname = newname[0] ? strdup(newname) : NULL; ! RoadMapTripRefresh = 1; ! } ! ! if (safe_strcmp(wpt->description, newdesc)) { ! if (wpt->description) free(wpt->description); ! wpt->description = newdesc[0] ? strdup(newdesc) : NULL; ! RoadMapTripRefresh = 1; ! } ! ! if (sscanf(newlon, "%lf", &tmp) == 1 && fabs(tmp) <= 180.0) { ! if (wpt->pos.longitude != from_float(tmp)) { ! wpt->pos.longitude = from_float(tmp); ! RoadMapTripRefresh = 1; ! } ! } ! if (sscanf(newlat, "%lf", &tmp) == 1 && fabs(tmp) <= 90.0) { ! if (wpt->pos.latitude != from_float(tmp)) { ! wpt->pos.latitude = from_float(tmp); ! RoadMapTripRefresh = 1; ! } ! } ! ! roadmap_dialog_hide (name); ! ! if (RoadMapTripRefresh) ! roadmap_screen_refresh (); ! } ! ! static void roadmap_trip_dialog_waypoint_edit ! (waypoint *wpt, int use_keyboard) { ! ! static char lon[20], lat[20]; ! ! if (roadmap_dialog_activate ("Waypoint Edit", wpt)) { ! ! roadmap_dialog_new_entry ("Data", "Name:"); ! roadmap_dialog_new_entry ("Data", "Comment:"); ! roadmap_dialog_new_entry ("Data", "Longitude:"); ! roadmap_dialog_new_entry ("Data", "Latitude:"); roadmap_dialog_add_button ("Cancel", roadmap_trip_dialog_cancel); roadmap_dialog_add_button ("Okay", ! roadmap_trip_dialog_waypoint_edit_okay); roadmap_dialog_complete (use_keyboard); } ! roadmap_dialog_set_data ! ("Data", "Name:", wpt->shortname ? wpt->shortname : ""); ! roadmap_dialog_set_data ! ("Data", "Comment:", wpt->description ? wpt->description : ""); ! ! sprintf(lon, FLT_FMT, to_float(wpt->pos.longitude)); ! sprintf(lat, FLT_FMT, to_float(wpt->pos.latitude)); ! roadmap_dialog_set_data ("Data", "Longitude:", lon); ! roadmap_dialog_set_data ("Data", "Latitude:", lat); } *************** *** 478,502 **** /* Add Waypoint dialog */ - // FIXME -- Pascal, I'm not confident that i'm using the dialog - // routines correctly here. Feel free to educate me. :-) - - static void roadmap_trip_add_waypoint_dialog_okay - (const char *name, void *data) { - - RoadMapPosition *pos = (RoadMapPosition *)data; - char *point_name; - int where; - - point_name = (char *) roadmap_dialog_get_data ("Name", "Name:"); - - /* (long) cast to suppress warning on 64-bit platforms */ - where = (long) roadmap_dialog_get_data ("Name", ".placements"); - - if (point_name && point_name[0] != 0) { - roadmap_trip_add_waypoint (point_name, pos, where); - roadmap_dialog_hide (name); - } - } - #define PLACE_PERSONAL_MARK 0 #define PLACE_TRIP_MARK 1 --- 546,549 ---- *************** *** 533,536 **** --- 580,601 ---- static char **Placements = Placement_Choices; + static void roadmap_trip_add_waypoint_dialog_okay + (const char *name, void *data) { + + RoadMapPosition *pos = (RoadMapPosition *)data; + char *point_name; + int where; + + point_name = (char *) roadmap_dialog_get_data ("Name", "Name:"); + + /* (long) cast to suppress warning on 64-bit platforms */ + where = (long) roadmap_dialog_get_data ("Name", ".placements"); + + if (point_name && point_name[0] != 0) { + roadmap_trip_add_waypoint (point_name, pos, where); + roadmap_dialog_hide (name); + } + } + static void roadmap_trip_add_waypoint_dialog (const char *name, RoadMapPosition * position) { *************** *** 694,700 **** } ! roadmap_trip_dialog_edit ! ( &waypointp->shortname, &waypointp->description, ! roadmap_preferences_use_keyboard ()); roadmap_trip_set_modified(1); --- 759,764 ---- } ! roadmap_trip_dialog_waypoint_edit ! ( waypointp, roadmap_preferences_use_keyboard ()); roadmap_trip_set_modified(1); *************** *** 872,878 **** } ! roadmap_trip_dialog_edit ! ( &route->rte_name, &route->rte_desc, ! roadmap_preferences_use_keyboard ()); roadmap_trip_set_modified(1); --- 936,941 ---- } ! roadmap_trip_dialog_route_edit ! ( route, roadmap_preferences_use_keyboard ()); roadmap_trip_set_modified(1); *************** *** 1892,1896 **** void roadmap_trip_toggle_show_inactive(void) { ! RoadMapTripShowInactiveRoutes = ! RoadMapTripShowInactiveRoutes; RoadMapTripRefresh = 1; roadmap_screen_refresh(); --- 1955,1959 ---- void roadmap_trip_toggle_show_inactive(void) { ! RoadMapTripShowInactiveRoutes = ! RoadMapTripShowInactiveRoutes; RoadMapTripRefresh = 1; roadmap_screen_refresh(); *************** *** 1977,1981 **** RoadMapTripShowInactiveRoutes = ! roadmap_config_match (&RoadMapConfigTripShowInactiveRoutes, "yes"); } --- 2040,2044 ---- RoadMapTripShowInactiveRoutes = ! roadmap_config_match (&RoadMapConfigTripShowInactiveRoutes, "yes"); } *************** *** 2400,2405 **** } - #define FLT_FMT "%0.6lf" - #define to_float(x) ((double)((x) / 1000000.0)) snprintf(cmdbuf, sizeof(cmdbuf), --- 2463,2466 ---- |
From: Paul F. <pg...@us...> - 2006-10-22 20:17:59
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19150 Modified Files: roadmap_path.c Log Message: don't leak the DIR * (spotted with valgrind) Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_path.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** roadmap_path.c 2 Oct 2006 14:56:44 -0000 1.21 --- roadmap_path.c 22 Oct 2006 20:17:50 -0000 1.22 *************** *** 538,541 **** --- 538,542 ---- } *cursor = NULL; + closedir(directory); return result; |