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: Danny B. <dan...@us...> - 2009-02-12 19:05:41
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10398 Modified Files: roadmap_gps.c Log Message: Add a configuration item to indicate that the GPS is a Bluetooth device. If it is, then we want RoadMap to enable the Bluetooth module at startup. Index: roadmap_gps.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gps.c,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** roadmap_gps.c 16 Jan 2009 17:03:29 -0000 1.50 --- roadmap_gps.c 12 Feb 2009 19:05:36 -0000 1.51 *************** *** 1,4 **** ! /* roadmap_gps.c - GPS interface for the RoadMap application. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_gps.h */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_gps.c - GPS interface for the RoadMap application. */ *************** *** 62,65 **** --- 62,67 ---- static RoadMapConfigDescriptor RoadMapConfigGPSBaudRate = ROADMAP_CONFIG_ITEM("GPS", "Baud Rate"); + RoadMapConfigDescriptor RoadMapConfigGPSOnBluetooth = + ROADMAP_CONFIG_ITEM("GPS", "On Bluetooth"); #endif *************** *** 135,139 **** /* Basic support functions -------------------------------------------- */ ! static int roadmap_gps_reception_state (void) { --- 137,144 ---- /* Basic support functions -------------------------------------------- */ ! /** ! * @brief ! * @return ! */ static int roadmap_gps_reception_state (void) { *************** *** 141,145 **** } ! static void roadmap_gps_update_reception (void) { --- 146,152 ---- } ! /** ! * @brief ! */ static void roadmap_gps_update_reception (void) { *************** *** 178,181 **** --- 185,193 ---- } + /** + * @brief + * @param status + * @return + */ static char roadmap_gps_update_status (char status) { *************** *** 218,227 **** } static void roadmap_gps_got_data(void) { - RoadMapGpsLatestData = time(NULL); } ! static void roadmap_gps_call_all_listeners (void) { --- 230,243 ---- } + /** + * @brief + */ static void roadmap_gps_got_data(void) { RoadMapGpsLatestData = time(NULL); } ! /** ! * @brief ! */ static void roadmap_gps_call_all_listeners (void) { *************** *** 240,244 **** } ! static void roadmap_gps_call_all_monitors (void) { --- 256,262 ---- } ! /** ! * @brief ! */ static void roadmap_gps_call_all_monitors (void) { *************** *** 258,262 **** } ! static void roadmap_gps_call_loggers (const char *data) { --- 276,283 ---- } ! /** ! * @brief ! * @param data ! */ static void roadmap_gps_call_loggers (const char *data) { *************** *** 269,273 **** } ! static void roadmap_gps_keep_alive (void) { --- 290,296 ---- } ! /** ! * @brief ! */ static void roadmap_gps_keep_alive (void) { *************** *** 319,323 **** static RoadMapNmeaAccount RoadMapGpsExtendedAccount; ! static void roadmap_gps_pgrmm (void *context, const RoadMapNmeaFields *fields) { --- 342,350 ---- static RoadMapNmeaAccount RoadMapGpsExtendedAccount; ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_pgrmm (void *context, const RoadMapNmeaFields *fields) { *************** *** 330,334 **** } ! static void roadmap_gps_pgrme (void *context, const RoadMapNmeaFields *fields) { --- 357,365 ---- } ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_pgrme (void *context, const RoadMapNmeaFields *fields) { *************** *** 369,373 **** } ! static void roadmap_gps_gll (void *context, const RoadMapNmeaFields *fields) { --- 400,408 ---- } ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_gll (void *context, const RoadMapNmeaFields *fields) { *************** *** 388,392 **** } ! static void roadmap_gps_rmc (void *context, const RoadMapNmeaFields *fields) { --- 423,431 ---- } ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_rmc (void *context, const RoadMapNmeaFields *fields) { *************** *** 418,422 **** } ! static void roadmap_gps_gsa (void *context, const RoadMapNmeaFields *fields) { --- 457,465 ---- } ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_gsa (void *context, const RoadMapNmeaFields *fields) { *************** *** 442,446 **** } ! static void roadmap_gps_gsv (void *context, const RoadMapNmeaFields *fields) { --- 485,493 ---- } ! /** ! * @brief ! * @param context ! * @param fields ! */ static void roadmap_gps_gsv (void *context, const RoadMapNmeaFields *fields) { *************** *** 495,499 **** } ! static RoadMapNmeaAccount roadmap_gps_subscribe (const char *title) { --- 542,549 ---- } ! /** ! * @brief ! * @param title ! */ static RoadMapNmeaAccount roadmap_gps_subscribe (const char *title) { *************** *** 513,516 **** --- 563,569 ---- } + /** + * @brief + */ static void roadmap_gps_nmea (void) { *************** *** 689,692 **** --- 742,752 ---- roadmap_config_declare ("preferences", &RoadMapConfigGPSBaudRate, "4800"); + /* The Bluetooth configuration would be better off in roadmap_serial.c but + * then I'd have to add all kinds of overhead there. + * The same applies to other variables here, btw, so I'm following the + * approach for these other variables. + */ + roadmap_config_declare_enumeration + ("preferences", &RoadMapConfigGPSOnBluetooth, "yes", "no", NULL); #endif roadmap_config_declare *************** *** 714,718 **** } ! void roadmap_gps_register_listener (roadmap_gps_listener listener) { --- 774,781 ---- } ! /** ! * @brief add listener, this function will be called when new information is available ! * @param listener this is the function to be called ! */ void roadmap_gps_register_listener (roadmap_gps_listener listener) { *************** *** 727,731 **** } ! void roadmap_gps_register_monitor (roadmap_gps_monitor monitor) { --- 790,797 ---- } ! /** ! * @brief ! * @param monitor ! */ void roadmap_gps_register_monitor (roadmap_gps_monitor monitor) { |
|
From: Danny B. <dan...@us...> - 2009-02-12 19:02:17
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10170 Modified Files: roadmap_shape.c Log Message: Add a bit of documentation. Index: roadmap_shape.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_shape.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_shape.c 17 Dec 2007 22:30:54 -0000 1.8 --- roadmap_shape.c 12 Feb 2009 19:02:11 -0000 1.9 *************** *** 1,4 **** ! /* roadmap_shape.c - Manage the tiger shape points. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,32 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * int roadmap_shape_in_square (int square, int *first, int *last); ! * int roadmap_shape_of_line (int line, int begin, int end, ! * int *first, int *last); ! * void roadmap_shape_get_position (int shape, RoadMapPosition *position); ! * ! * These functions are used to retrieve the shape points that belong to a line. */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief Manage shape points. */ *************** *** 199,203 **** } ! int roadmap_shape_of_line (int line, int begin, int end, int *first, int *last) { --- 194,206 ---- } ! /** ! * @brief query the number of shape points of a line, and its first and last ! * @param line the line number ! * @param begin weird beginning index to use in binary search ! * @param end weird end index to use in binary search ! * @param first return the number of the first shape point ! * @param last return the number of the last shape point ! * @return return the number of points found ! */ int roadmap_shape_of_line (int line, int begin, int end, int *first, int *last) { *************** *** 262,270 **** } ! void roadmap_shape_get_position (int shape, RoadMapPosition *position) { - position->longitude += RoadMapShapeActive->Shape[shape].delta_longitude; position->latitude += RoadMapShapeActive->Shape[shape].delta_latitude; } - --- 265,275 ---- } ! /** ! * @brief query the successive points in a shape, note this requires the right order ! * @param shape the index of this shape ! * @param position parameter to return incremental results in ! */ void roadmap_shape_get_position (int shape, RoadMapPosition *position) { position->longitude += RoadMapShapeActive->Shape[shape].delta_longitude; position->latitude += RoadMapShapeActive->Shape[shape].delta_latitude; } |
|
From: Danny B. <dan...@us...> - 2009-02-12 19:00:23
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9866 Modified Files: roadmap_hash.c Log Message: Add empty documentation stubs Index: roadmap_hash.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_hash.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_hash.c 2 Jan 2008 17:21:41 -0000 1.7 --- roadmap_hash.c 12 Feb 2009 19:00:18 -0000 1.8 *************** *** 1,4 **** ! /* roadmap_hash.c - A simple hash index mechanism for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,38 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * RoadMapHash *roadmap_hash_new (int size); ! * ! * void roadmap_hash_add (RoadMapHash *hash, int key, int index); ! * int roadmap_hash_get_first (RoadMapHash *hash, int key); ! * int roadmap_hash_get_next (RoadMapHash *hash, int index); ! * void roadmap_hash_resize (RoadMapHash *hash, int size); ! * ! * void roadmap_hash_summary (void); ! * void roadmap_hash_reset (void); ! * ! * These functions are used to build a hash index. The idea is to ! * accelerate scanning a BuildMap table. */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief A simple hash index mechanism for RoadMap, to accelerate scanning a BuildMap table. */ *************** *** 48,52 **** static RoadMapHash *HashLast = NULL; ! static void roadmap_hash_free (RoadMapHash *hash) { --- 37,44 ---- static RoadMapHash *HashLast = NULL; ! /** ! * @brief ! * @param hash ! */ static void roadmap_hash_free (RoadMapHash *hash) { *************** *** 58,62 **** } ! RoadMapHash *roadmap_hash_new (char *name, int size) { --- 50,59 ---- } ! /** ! * @brief ! * @parma name ! * @param size ! * @return ! */ RoadMapHash *roadmap_hash_new (char *name, int size) { *************** *** 88,92 **** } ! void roadmap_hash_add (RoadMapHash *hash, int key, int index) { --- 85,94 ---- } ! /** ! * @brief ! * @param hash ! * @param key ! * @param index ! */ void roadmap_hash_add (RoadMapHash *hash, int key, int index) { *************** *** 108,112 **** } ! int roadmap_hash_get_first (RoadMapHash *hash, int key) { --- 110,118 ---- } ! /** ! * @brief ! * @param hash ! * @param key ! */ int roadmap_hash_get_first (RoadMapHash *hash, int key) { *************** *** 118,122 **** } ! int roadmap_hash_get_next (RoadMapHash *hash, int index) { --- 124,132 ---- } ! /** ! * @brief ! * @param hash ! * @param index ! */ int roadmap_hash_get_next (RoadMapHash *hash, int index) { *************** *** 131,135 **** } ! void roadmap_hash_resize (RoadMapHash *hash, int size) { --- 141,149 ---- } ! /** ! * @brief ! * @param hash ! * @param size ! */ void roadmap_hash_resize (RoadMapHash *hash, int size) { *************** *** 150,154 **** } ! void roadmap_hash_set_value (RoadMapHash *hash, int index, void *value) { --- 164,173 ---- } ! /** ! * @brief ! * @param hash ! * @param index ! * @param value ! */ void roadmap_hash_set_value (RoadMapHash *hash, int index, void *value) { *************** *** 166,170 **** } ! void *roadmap_hash_get_value (RoadMapHash *hash, int index) { --- 185,193 ---- } ! /** ! * @brief ! * @param hash ! * @param index ! */ void *roadmap_hash_get_value (RoadMapHash *hash, int index) { *************** *** 179,183 **** } ! void roadmap_hash_summary (void) { --- 202,208 ---- } ! /** ! * @brief ! */ void roadmap_hash_summary (void) { *************** *** 213,217 **** } ! void roadmap_hash_delete (RoadMapHash *hash) { --- 238,245 ---- } ! /** ! * @brief ! * @param hash ! */ void roadmap_hash_delete (RoadMapHash *hash) { *************** *** 240,244 **** } ! void roadmap_hash_reset (void) { --- 268,274 ---- } ! /** ! * @brief ! */ void roadmap_hash_reset (void) { *************** *** 255,258 **** --- 285,292 ---- } + /** + * @brief + * @param str + */ int roadmap_hash_string (const char *str) { |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:56:18
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8738 Modified Files: roadmap_fuzzy.c Log Message: Just documentation stubs. Index: roadmap_fuzzy.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_fuzzy.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_fuzzy.c 17 Dec 2005 07:38:56 -0000 1.6 --- roadmap_fuzzy.c 12 Feb 2009 18:56:13 -0000 1.7 *************** *** 1,4 **** ! /* roadmap_fuzzy.c - implement fuzzy operators for roadmap navigation. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_fuzzy.h. */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief implement fuzzy operators for roadmap navigation. */ *************** *** 53,57 **** static int RoadMapError; ! void roadmap_fuzzy_start_cycle (void) { --- 53,59 ---- static int RoadMapError; ! /** ! * @brief ! */ void roadmap_fuzzy_start_cycle (void) { *************** *** 62,66 **** } ! int roadmap_fuzzy_max_distance (void) { --- 64,71 ---- } ! /** ! * @brief ! * @return ! */ int roadmap_fuzzy_max_distance (void) { *************** *** 71,77 **** ! /* Angle fuzzyfication: * max fuzzy value if same angle as reference, 0 if 90 degree difference, * constant slope in between. */ RoadMapFuzzy roadmap_fuzzy_direction --- 76,88 ---- ! /** ! * @brief Angle fuzzyfication: * max fuzzy value if same angle as reference, 0 if 90 degree difference, * constant slope in between. + * + * @param direction + * @param reference + * @param symetric + * @return */ RoadMapFuzzy roadmap_fuzzy_direction *************** *** 103,110 **** } ! ! /* Distance fuzzyfication: * max fuzzy value if distance is small, 0 if objects far away, * constant slope in between. */ RoadMapFuzzy roadmap_fuzzy_distance (int distance) { --- 114,124 ---- } ! /** ! * @brief Distance fuzzyfication: * max fuzzy value if distance is small, 0 if objects far away, * constant slope in between. + * + * @param distance + * @return */ RoadMapFuzzy roadmap_fuzzy_distance (int distance) { *************** *** 118,122 **** } ! RoadMapFuzzy roadmap_fuzzy_connected (const RoadMapNeighbour *street, --- 132,142 ---- } ! /** ! * @brief ! * @param street ! * @param reference ! * @param connection ! * @return ! */ RoadMapFuzzy roadmap_fuzzy_connected (const RoadMapNeighbour *street, *************** *** 168,172 **** } ! RoadMapFuzzy roadmap_fuzzy_and (RoadMapFuzzy a, RoadMapFuzzy b) { --- 188,197 ---- } ! /** ! * @brief ! * @param a ! * @param b ! * @return ! */ RoadMapFuzzy roadmap_fuzzy_and (RoadMapFuzzy a, RoadMapFuzzy b) { *************** *** 176,180 **** } ! RoadMapFuzzy roadmap_fuzzy_or (RoadMapFuzzy a, RoadMapFuzzy b) { --- 201,210 ---- } ! /** ! * @brief ! * @param a ! * @param b ! * @return ! */ RoadMapFuzzy roadmap_fuzzy_or (RoadMapFuzzy a, RoadMapFuzzy b) { *************** *** 184,188 **** } ! RoadMapFuzzy roadmap_fuzzy_not (RoadMapFuzzy a) { --- 214,222 ---- } ! /** ! * @brief ! * @param a ! * @return ! */ RoadMapFuzzy roadmap_fuzzy_not (RoadMapFuzzy a) { *************** *** 191,207 **** RoadMapFuzzy roadmap_fuzzy_false (void) { return 0; } ! int roadmap_fuzzy_is_acceptable (RoadMapFuzzy a) { return (a >= RoadMapConfidence); } int roadmap_fuzzy_is_good (RoadMapFuzzy a) { return (a >= FUZZY_TRUTH_MAX / 2); } int roadmap_fuzzy_is_certain (RoadMapFuzzy a) { --- 225,259 ---- + /** + * @brief + * @return + */ RoadMapFuzzy roadmap_fuzzy_false (void) { return 0; } ! /** ! * @brief ! * @param a ! * @return ! */ int roadmap_fuzzy_is_acceptable (RoadMapFuzzy a) { return (a >= RoadMapConfidence); } + /** + * @brief + * @param a + * @return + */ int roadmap_fuzzy_is_good (RoadMapFuzzy a) { return (a >= FUZZY_TRUTH_MAX / 2); } + /** + * @brief + * @param a + * @return + */ int roadmap_fuzzy_is_certain (RoadMapFuzzy a) { *************** *** 209,213 **** } ! void roadmap_fuzzy_initialize (void) { --- 261,268 ---- } ! /** ! * @brief ! * @return ! */ void roadmap_fuzzy_initialize (void) { |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:51:46
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8107 Modified Files: roadmap_dialog.h Log Message: Move documentation to the source files as in other cases. Implement two additional functions. Can someone do this for gtk ? Index: roadmap_dialog.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_dialog.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_dialog.h 7 Dec 2008 13:02:16 -0000 1.8 --- roadmap_dialog.h 12 Feb 2009 18:51:38 -0000 1.9 *************** *** 1,7 **** ! /* roadmap_dialog.h - manage the roadmap dialogs is used for user input. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * DESCRIPTION: * * This module define an API to create and manipulate dialog windows. --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_dialog.h - manage the roadmap dialogs is used for user input. * * This module define an API to create and manipulate dialog windows. *************** *** 58,88 **** - /* This function activates a dialog: - * If the dialog did not exist yet, it will create an empty dialog - * and roadmap_dialog_activate() returns 1; the application must then - * enumerate all the dialog's items. - * If the dialog did exist already, it will be shown on top and - * roadmap_dialog_activate() returns 0. - * This function never fails. The given dialog becomes the curent dialog. - */ int roadmap_dialog_activate (const char *name, void *context); - - /* Hide the given dialog, if it exists. */ void roadmap_dialog_hide (const char *name); - - /* Add one text label item to the current dialog. */ void roadmap_dialog_new_label (const char *frame, const char *name); - - /* Add one text entry item to the current dialog. */ void roadmap_dialog_new_entry (const char *frame, const char *name); - - /* Add one color selection item to to the current dialog. */ void roadmap_dialog_new_color (const char *frame, const char *name); - - /* Add one choice item (a selection box or menu). - * The optional callback is called each time a new selection is being made, - * not when the OK button is called--that is the job of the OK button - * callback. - */ void roadmap_dialog_new_choice (const char *frame, const char *name, --- 61,69 ---- *************** *** 92,104 **** void *values, RoadMapDialogCallback callback); - - /* Add one list item. - * This item is similar to the choice one, except for two things: - * 1) it uses a scrollable list widget instead of a combo box. - * 2) the list of items shown is dynamic and can be modified - * (it is initially empty). - */ void roadmap_dialog_new_list (const char *frame, const char *name); - void roadmap_dialog_show_list (const char *frame, const char *name, --- 73,77 ---- *************** *** 107,121 **** void **values, RoadMapDialogCallback callback); - - - /* Add one button to the bottom of the dialog. */ void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback); - - /* Add one hidden data item to the current dialog. */ void roadmap_dialog_new_hidden (const char *frame, const char *name); - - /* When all done with building the dialog, call this to finalize and show: */ void roadmap_dialog_complete (int use_keyboard); - void roadmap_dialog_select (const char *dialog); void *roadmap_dialog_get_data (const char *frame, const char *name); --- 80,86 ---- *************** *** 237,239 **** --- 202,206 ---- #endif + void roadmap_dialog_new_progress (const char *frame, const char *name); + void roadmap_dialog_set_progress (const char *frame, const char *name, int progress); #endif // INCLUDE__ROADMAP_DIALOG__H |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:51:45
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8107/gtk2 Modified Files: roadmap_dialog.c Log Message: Move documentation to the source files as in other cases. Implement two additional functions. Can someone do this for gtk ? Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/roadmap_dialog.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** roadmap_dialog.c 2 Apr 2008 17:28:07 -0000 1.20 --- roadmap_dialog.c 12 Feb 2009 18:51:38 -0000 1.21 *************** *** 1,7 **** ! /* roadmap_dialog.c - manage the Widget used in roadmap dialogs. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_dialog.h */ --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief gtk2/roadmap_dialog.c - manage the Widget used in roadmap dialogs. */ *************** *** 347,351 **** } ! int roadmap_dialog_activate (const char *name, void *context) { --- 348,363 ---- } ! /** ! * @brief This function activates a dialog: ! * If the dialog did not exist yet, it will create an empty dialog ! * and roadmap_dialog_activate() returns 1; the application must then ! * enumerate all the dialog's items. ! * If the dialog did exist already, it will be shown on top and ! * roadmap_dialog_activate() returns 0. ! * This function never fails. The given dialog becomes the curent dialog. ! * @param name ! * @param context ! * @return returns 1 if this is a new, undefined, dialog; 0 otherwise. ! */ int roadmap_dialog_activate (const char *name, void *context) { *************** *** 382,386 **** } ! void roadmap_dialog_hide (const char *name) { --- 394,401 ---- } ! /** ! * @brief Hide the given dialog, if it exists. ! * @param name the dialog name ! */ void roadmap_dialog_hide (const char *name) { *************** *** 388,392 **** } ! void roadmap_dialog_new_entry (const char *frame, const char *name) { --- 403,411 ---- } ! /** ! * @brief Add one text entry item to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_entry (const char *frame, const char *name) { *************** *** 397,401 **** } ! void roadmap_dialog_new_label (const char *frame, const char *name) { --- 416,424 ---- } ! /** ! * @brief Add one text label item to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_label (const char *frame, const char *name) { *************** *** 406,410 **** } ! void roadmap_dialog_new_color (const char *frame, const char *name) { --- 429,437 ---- } ! /** ! * @brief Add one color selection item to to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_color (const char *frame, const char *name) { *************** *** 412,416 **** } ! void roadmap_dialog_new_hidden (const char *frame, const char *name) { RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, 0, 0); --- 439,449 ---- } ! /** ! * @brief Add one hidden data item to the current dialog ! * @param frame ! * @param name ! */ ! void roadmap_dialog_new_hidden (const char *frame, const char *name) ! { RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, 0, 0); *************** *** 418,421 **** --- 451,466 ---- } + /** + * @brief Add one choice item (a selection box or menu). + * The optional callback is called each time a new selection is being made, + * not when the OK button is called--that is the job of the OK button callback. + * @param frame + * @param name + * @param count + * @param current + * @param labels + * @param values + * @param callback + */ void roadmap_dialog_new_choice (const char *frame, const char *name, *************** *** 469,473 **** } ! void roadmap_dialog_new_list (const char *frame, const char *name) { --- 514,525 ---- } ! /** ! * @brief Add one list item. ! * This item is similar to the choice one, except for two things: ! * 1) it uses a scrollable list widget instead of a combo box. ! * 2) the list of items shown is dynamic and can be modified (it is initially empty). ! * @param frame ! * @param name ! */ void roadmap_dialog_new_list (const char *frame, const char *name) { *************** *** 572,579 **** } ! ! void roadmap_dialog_add_button (const char *label, ! RoadMapDialogCallback callback) { ! RoadMapDialogItem dialog = RoadMapDialogCurrent; RoadMapDialogItem child; --- 624,634 ---- } ! /** ! * @brief Add one button to the bottom of the dialog ! * @param label ! * @param callback ! */ ! void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) ! { RoadMapDialogItem dialog = RoadMapDialogCurrent; RoadMapDialogItem child; *************** *** 598,604 **** } ! ! void roadmap_dialog_complete (int use_keyboard) { ! int count; RoadMapDialogItem dialog = RoadMapDialogCurrent; --- 653,662 ---- } ! /** ! * @brief When all done with building the dialog, call this to finalize and show. ! * @param use_keyboard ! */ ! void roadmap_dialog_complete (int use_keyboard) ! { int count; RoadMapDialogItem dialog = RoadMapDialogCurrent; *************** *** 754,755 **** --- 812,823 ---- } + void roadmap_dialog_new_progress (const char *frame, const char *name) + { + #warning implement roadmap_dialog_new_progress + } + + void roadmap_dialog_set_progress (const char *frame, const char *name, int progress) + { + #warning implement roadmap_dialog_set_progress + } + |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:51:44
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8107/win32 Modified Files: roadmap_dialog.c Log Message: Move documentation to the source files as in other cases. Implement two additional functions. Can someone do this for gtk ? Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_dialog.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_dialog.c 7 Dec 2008 13:02:16 -0000 1.13 --- roadmap_dialog.c 12 Feb 2009 18:51:38 -0000 1.14 *************** *** 265,269 **** } ! int roadmap_dialog_activate (const char *name, void *context) { --- 265,280 ---- } ! /** ! * @brief This function activates a dialog: ! * If the dialog did not exist yet, it will create an empty dialog ! * and roadmap_dialog_activate() returns 1; the application must then ! * enumerate all the dialog's items. ! * If the dialog did exist already, it will be shown on top and ! * roadmap_dialog_activate() returns 0. ! * This function never fails. The given dialog becomes the curent dialog. ! * @param name ! * @param context ! * @return returns 1 if this is a new, undefined, dialog; 0 otherwise. ! */ int roadmap_dialog_activate (const char *name, void *context) { *************** *** 288,291 **** --- 299,306 ---- + /** + * @brief Hide the given dialog, if it exists. + * @param name the dialog name + */ void roadmap_dialog_hide (const char *name) { *************** *** 293,297 **** } ! void roadmap_dialog_new_entry (const char *frame, const char *name) { --- 308,316 ---- } ! /** ! * @brief Add one text entry item to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_entry (const char *frame, const char *name) { *************** *** 301,305 **** } ! void roadmap_dialog_new_label (const char *frame, const char *name) { --- 320,328 ---- } ! /** ! * @brief Add one text label item to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_label (const char *frame, const char *name) { *************** *** 309,313 **** } ! void roadmap_dialog_new_color (const char *frame, const char *name) { --- 332,340 ---- } ! /** ! * @brief Add one color selection item to to the current dialog ! * @param frame ! * @param name ! */ void roadmap_dialog_new_color (const char *frame, const char *name) { *************** *** 315,318 **** --- 342,350 ---- } + /** + * @brief Add one hidden data item to the current dialog + * @param frame + * @param name + */ void roadmap_dialog_new_hidden (const char *frame, const char *name) { *************** *** 322,325 **** --- 354,369 ---- } + /** + * @brief Add one choice item (a selection box or menu). + * The optional callback is called each time a new selection is being made, + * not when the OK button is called--that is the job of the OK button callback. + * @param frame + * @param name + * @param count + * @param current + * @param labels + * @param values + * @param callback + */ void roadmap_dialog_new_choice (const char *frame, const char *name, *************** *** 356,360 **** } ! void roadmap_dialog_new_list (const char *frame, const char *name) { --- 400,411 ---- } ! /** ! * @brief Add one list item. ! * This item is similar to the choice one, except for two things: ! * 1) it uses a scrollable list widget instead of a combo box. ! * 2) the list of items shown is dynamic and can be modified (it is initially empty). ! * @param frame ! * @param name ! */ void roadmap_dialog_new_list (const char *frame, const char *name) { *************** *** 420,424 **** } ! void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { --- 471,479 ---- } ! /** ! * @brief Add one button to the bottom of the dialog ! * @param label ! * @param callback ! */ void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { *************** *** 447,450 **** --- 502,509 ---- + /** + * @brief When all done with building the dialog, call this to finalize and show. + * @param use_keyboard + */ void roadmap_dialog_complete (int use_keyboard) { *************** *** 1106,1109 **** --- 1165,1188 ---- } + void roadmap_dialog_new_progress (const char *frame, const char *name) + { + RoadMapDialogItem child = roadmap_dialog_new_item (frame, name); + child->widget_type = ROADMAP_WIDGET_PROGRESS; + } + + void roadmap_dialog_set_progress (const char *frame, const char *name, int progress) + { + RoadMapDialogItem this_frame; + RoadMapDialogItem this_item; + + this_frame = roadmap_dialog_get (RoadMapDialogCurrent, frame); + this_item = roadmap_dialog_get (this_frame, name); + + if (this_item->widget_type != ROADMAP_WIDGET_PROGRESS) + return; + + SendMessage(this_item->w, PBM_SETPOS, (WPARAM)progress, 0); + } + /** * @brief note the screen resolution, use it to influence dialog appearance |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:22:28
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4241 Modified Files: roadmap_types.h Log Message: Add a few definitions. Index: roadmap_types.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_types.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_types.h 6 Feb 2006 01:45:49 -0000 1.3 --- roadmap_types.h 12 Feb 2009 18:22:23 -0000 1.4 *************** *** 1,7 **** ! /* roadmap_types.h - general type definitions used in RoadMap. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 22,25 **** --- 22,29 ---- */ + /** + * @file + * @brief general type definitions used in RoadMap. + */ #ifndef INCLUDED__ROADMAP_TYPES__H #define INCLUDED__ROADMAP_TYPES__H *************** *** 45,48 **** --- 49,60 ---- } RoadMapArea; + #if defined(HAVE_TRIP_PLUGIN) || defined(HAVE_NAVIGATE_PLUGIN) + typedef unsigned char LineRouteFlag; + typedef unsigned char LineRouteMax; + typedef unsigned short LineRouteTime; + + typedef void (*RoadMapShapeItr) (int shape, RoadMapPosition *position); + #endif + #endif // INCLUDED__ROADMAP_TYPES__H |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:21:28
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4096 Modified Files: roadmap_line.c Log Message: Add copyright Index: roadmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_line.c 12 Feb 2009 18:13:21 -0000 1.13 --- roadmap_line.c 12 Feb 2009 18:21:23 -0000 1.14 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, 2009, Danny Backx. * * This file is part of RoadMap. |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:20:58
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4025 Modified Files: roadmap_square.c Log Message: Add some comments. Index: roadmap_square.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_square.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** roadmap_square.c 10 Jun 2008 03:24:11 -0000 1.16 --- roadmap_square.c 12 Feb 2009 18:20:52 -0000 1.17 *************** *** 1,7 **** ! /* roadmap_square.c - Manage a county area, divided in small squares. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_square.h. * * These functions are used to retrieve the squares that make the county --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief Manage a county area, divided in small squares. * * These functions are used to retrieve the squares that make the county *************** *** 44,48 **** static char *RoadMapSquareType = "RoadMapSquareContext"; ! typedef struct { --- 45,51 ---- static char *RoadMapSquareType = "RoadMapSquareContext"; ! /** ! * @brief ! */ typedef struct { *************** *** 52,59 **** RoadMapSquare *Square; ! short *SquareGrid; /* keep small: large grids can use a lot of them */ int SquareGridCount; int SquareGridBitmapped; ! int SquareLastLookup; /* lookup cache for bitmapped grids */ int SquareLastIndex; } RoadMapSquareContext; --- 55,62 ---- RoadMapSquare *Square; ! short *SquareGrid; /**< keep small: large grids can use a lot of them */ int SquareGridCount; int SquareGridBitmapped; ! int SquareLastLookup; /**< lookup cache for bitmapped grids */ int SquareLastIndex; } RoadMapSquareContext; *************** *** 354,357 **** --- 357,365 ---- } + /** + * @brief find the square that a given position is in + * @param position the position whose square we want to find + * @return the square + */ int roadmap_square_search (const RoadMapPosition *position) { *************** *** 444,447 **** --- 452,460 ---- + /** + * @brief + * @param square + * @return + */ int roadmap_square_index (int square) { |
|
From: Danny B. <dan...@us...> - 2009-02-12 18:13:27
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2668 Modified Files: roadmap_line.c Log Message: This commit contains an ugly hack. I'm committing it as is so it's easy to reproduce. Comment out the two lines under the comment (lines 409, 410) and you'll see that the build fails. I think this means that roadmap_layer.c contains two types of functions, we should separate them into two sources. Index: roadmap_line.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_line.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_line.c 18 Mar 2008 02:23:30 -0000 1.12 --- roadmap_line.c 12 Feb 2009 18:13:21 -0000 1.13 *************** *** 1,4 **** ! /* roadmap_line.c - Manage the tiger lines. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,37 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * int roadmap_line_in_square ! * (int square, int layer, int *first, int *last); ! * int roadmap_line_in_square2 ! * (int square, int layer, int *first, int *last); ! * int roadmap_line_get_from_index2 (int index); ! * void roadmap_line_from (int line, RoadMapPosition *position); ! * void roadmap_line_to (int line, RoadMapPosition *position); ! * ! * int roadmap_line_count (void); ! * ! * These functions are used to retrieve the points that make the lines. */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_line.c - retrieve the points that make the lines. */ *************** *** 50,57 **** #include "roadmap_shape.h" #include "roadmap_square.h" ! static char *RoadMapLineType = "RoadMapLineContext"; typedef struct { --- 40,50 ---- #include "roadmap_shape.h" #include "roadmap_square.h" ! #include "roadmap_layer.h" static char *RoadMapLineType = "RoadMapLineContext"; + /** + * @brief + */ typedef struct { *************** *** 218,222 **** }; ! int roadmap_line_in_square (int square, int layer, int *first, int *last) { --- 211,222 ---- }; ! /** ! * @brief get the list of lines in a square, and a specified layer ! * @param square input parameter ! * @param layer input parameter ! * @param first return index of first line that complies ! * @param last return index of last line that complies ! * @return success indicator ! */ int roadmap_line_in_square (int square, int layer, int *first, int *last) { *************** *** 277,281 **** } ! void roadmap_line_from (int line, RoadMapPosition *position) { --- 277,285 ---- } ! /** ! * @brief store the position of the "from" point of the line ! * @param line the line ! * @param position the position to store ! */ void roadmap_line_from (int line, RoadMapPosition *position) { *************** *** 288,293 **** } ! ! void roadmap_line_to (int line, RoadMapPosition *position) { #ifdef ROADMAP_INDEX_DEBUG --- 292,301 ---- } ! /** ! * @brief store the position of the "to" point of the line ! * @param line the line ! * @param position the position to store ! */ ! void roadmap_line_to (int line, RoadMapPosition *position) { #ifdef ROADMAP_INDEX_DEBUG *************** *** 349,353 **** } ! void roadmap_line_points (int line, int *from, int *to) { --- 357,366 ---- } ! /** ! * @brief query the points at both ends of the given line ! * @param line this line is to be queried ! * @param from return the point at one end of the line ! * @param to return the point at the other end of the line ! */ void roadmap_line_points (int line, int *from, int *to) { *************** *** 375,376 **** --- 388,468 ---- } + /** + * @brief determine the layer that some line is in + * note: rewritten completely, I guess Ehud's data model is different from trunk + * @param line_id the line whose layer we want to query + * @return the layer + */ + int roadmap_line_get_layer (int line_id) + { + int *index; + int first, last, layer, i; + int square; + RoadMapPosition pos; + int last_road_layer; + + /* + * This is hacked for now, we can't call roadmap_layer_() functions from here + * because this would pull roadmap_canvas_() functions into executables that + * aren't linked with that (e.g. roadgps). + */ + #define roadmap_layer_road_last() 11 + #warning Hack for roadmap_layer_road_last + + last_road_layer = roadmap_layer_road_last(); + + if (RoadMapLineActive == NULL) + return 0; /* No line. */ + + roadmap_point_position(RoadMapLineActive->Line[line_id].from, &pos); + square = roadmap_square_search (&pos); + + square = roadmap_square_index(square); + if (square < 0) { + return 0; /* This square is empty. */ + } + + index = RoadMapLineActive->LineByLayer1 + RoadMapLineActive->LineBySquare1[square].first; + + for (layer = 1; layer < last_road_layer; layer++) { + first = index[layer-1]; + last = index[layer]-1; + + for (i=first; i<last; i++) + if (i == line_id) { + return layer; + } + } + return 0; + } + + #if defined(HAVE_NAVIGATE_PLUGIN) + /** + * @brief look up the point that a line is coming "from" + * @param line the id of this line + * @return the point that the line is coming "from" + */ + int roadmap_line_from_point (int line) + { + #ifdef ROADMAP_INDEX_DEBUG + if (line < 0 || line >= RoadMapLineActive->LineCount) { + roadmap_log (ROADMAP_FATAL, "illegal line index %d", line); + } + #endif + return RoadMapLineActive->Line[line].from; + } + /** + * @brief look up the point that a line is going "to" + * @param line the id of this line + * @return the point that the line is going to + */ + int roadmap_line_to_point (int line) + { + #ifdef ROADMAP_INDEX_DEBUG + if (line < 0 || line >= RoadMapLineActive->LineCount) { + roadmap_log (ROADMAP_FATAL, "illegal line index %d", line); + } + #endif + return RoadMapLineActive->Line[line].to; + } + #endif |
|
From: Danny B. <dan...@us...> - 2009-02-12 17:54:50
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32430 Modified Files: roadmap_config.h roadmap_config.c Log Message: Add some documentation stubs and one additional function. Index: roadmap_config.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_config.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** roadmap_config.c 2 Jul 2008 14:05:19 -0000 1.30 --- roadmap_config.c 12 Feb 2009 17:54:46 -0000 1.31 *************** *** 1,7 **** ! /* roadmap_config.c - A module to handle all RoadMap configuration issues. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_config.h. */ --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief A module to handle all RoadMap configuration issues. */ *************** *** 821,825 **** } ! int roadmap_config_get_integer(RoadMapConfigDescriptor *descriptor) { --- 822,830 ---- } ! /** ! * @brief get the value from a configuration item ! * @param pointer to the descriptor ! * @return the value ! */ int roadmap_config_get_integer(RoadMapConfigDescriptor *descriptor) { *************** *** 858,865 **** ! const char *roadmap_config_get_from (const char *config, ! const char *category, ! const char *name) { ! RoadMapConfig *file; RoadMapConfigItem *item; --- 863,875 ---- ! /** ! * @brief ! * @param config ! * @param category ! * @param name ! * @return ! */ ! const char *roadmap_config_get_from (const char *config, const char *category, const char *name) ! { RoadMapConfig *file; RoadMapConfigItem *item; *************** *** 994,996 **** --- 1004,1040 ---- } + /** + * @brief reload a part of the configuration + * @param s names the configuration to be reloaded + */ + void roadmap_config_reload(const char *name) + { + const char *p; + RoadMapConfig *file; + + for (file = RoadMapConfigFiles; file->name != NULL; ++file) { + if (!strcmp (file->name, name)) + break; + } + if (file->name == NULL) { + roadmap_log (ROADMAP_ERROR, "config_reload found no '%s' config file", name); + return; + } else { + int loaded = 0; + for (p = roadmap_path_first(file->file_name); + p != NULL; + p = roadmap_path_next(file->file_name, p)) { + loaded = roadmap_config_load_file (p, file, ROADMAP_CONFIG_CLEAN); + if (loaded) + break; + } + if (file->required && (!loaded)) { + roadmap_log (ROADMAP_ERROR, + "found no '%s' config file, check RoadMap installation", + file->name); + return; + } + return; + } + } Index: roadmap_config.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_config.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_config.h 2 Jan 2008 17:21:40 -0000 1.7 --- roadmap_config.h 12 Feb 2009 17:54:46 -0000 1.8 *************** *** 1,7 **** ! /* roadmap_config.h - A module to handle all RoadMap configuration issues. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2009, Danny Backx * * This file is part of RoadMap. *************** *** 22,25 **** --- 22,29 ---- */ + /** + * @brief + * @file roadmap_config.h - A module to handle all RoadMap configuration issues. + */ #ifndef _ROADMAP_CONFIG__H_ #define _ROADMAP_CONFIG__H_ *************** *** 93,97 **** void roadmap_config_load (void); void roadmap_config_save (int force); ! int roadmap_config_get_type (RoadMapConfigDescriptor *descriptor); --- 97,101 ---- void roadmap_config_load (void); void roadmap_config_save (int force); ! void roadmap_config_reload (const char *); int roadmap_config_get_type (RoadMapConfigDescriptor *descriptor); |
|
From: Danny B. <dan...@us...> - 2009-02-12 16:35:13
|
Update of /cvsroot/roadmap/roadmap/src/default In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21214/default Modified Files: All Log Message: I checked in the wrong file a couple of minutes ago :-( It lacked the speed settings. Index: All =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/default/All,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** All 12 Feb 2009 16:12:39 -0000 1.5 --- All 12 Feb 2009 16:35:08 -0000 1.6 *************** *** 14,17 **** --- 14,18 ---- Freeways.Declutter: 10000 Freeways.Thickness: 6 + Freeways.Speed: 120 Ramps.Color: black Ramps.Color1: red *************** *** 19,22 **** --- 20,24 ---- Ramps.Declutter: 160 Ramps.Thickness: 3 + Ramps.Speed: 120 Highways.Color: black Highways.Color1: yellow *************** *** 24,27 **** --- 26,30 ---- Highways.Declutter: 1300 Highways.Thickness: 3 + Highways.Speed: 120 Streets.Color: black Streets.Color1: white *************** *** 29,67 **** --- 32,83 ---- Streets.Declutter: 160 Streets.Thickness: 2 + Streets.Speed: 90 Trails.Color: DarkGrey Trails.Declutter: 160 Trails.Thickness: 1 + Trails.Speed: 50 Railroads.Color: black Railroads.Declutter: 250 Railroads.Style: dashed Railroads.Thickness: 1 + Railroads.Speeds: 1 Rivers.Color: LightBlue Rivers.Declutter: 300 Rivers.Thickness: 3 + Rivers.Speed: 1 Shore.Color: LightSlateBlue Shore.Declutter: 2000 Shore.Thickness: 2 + Shore.Speed: 30 Hospitals.Color: red Hospitals.Declutter: 4096 Hospitals.Thickness: 1 + Hospitals.Speed: 1 Malls.Color: yellow Malls.Declutter: 4096 Malls.Thickness: 1 + Malls.Speed: 1 Airports.Color: grey Airports.Declutter: 4096 Airports.Thickness: 1 + Airports.Speed: 1 Stations.Color: grey Stations.Declutter: 4096 Stations.Thickness: 1 + Stations.Speed: 1 Lakes.Color: LightBlue Lakes.Declutter: 1300 Lakes.Thickness: 1 + Lakes.Speed: 1 Parks.Color: green Parks.Declutter: 4096 Parks.Thickness: 1 + Parks.Speed: 30 Sea.Color: SlateBlue Sea.Declutter: 2147483647 Sea.Thickness: 1 + Sea.Speed: 1 Boundaries.Color: darkgreen Boundaries.Thickness: 2 Boundaries.Declutter: 2147483647 + Boundaries.Speed: 1 |
|
From: Danny B. <dan...@us...> - 2009-02-12 16:13:00
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17755 Modified Files: roadmap_layer.h roadmap_layer.c Log Message: Add new functionality to the layer module. Also add the sample definitions that I'm using to the "All" file. Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** roadmap_layer.c 26 Oct 2008 00:51:16 -0000 1.20 --- roadmap_layer.c 12 Feb 2009 16:12:39 -0000 1.21 *************** *** 1,7 **** ! /* roadmap_layer.c - Layer management: declutter, filtering, etc.. ! * * LICENSE: * * Copyright 2003 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2003 Pascal F. Martin + * Copyright (c) 2008, 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ! * SYNOPSYS: ! * ! * See roadmap_layer.h. */ --- 20,33 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + /** + * @file + * @brief Layer management: declutter, filtering, etc.. * ! * This source file has a problem : it should be split into one that provides basic ! * layer functionality, and another one that cause roadmap_canvas.c to be pulled in. ! * Right now this makes it impossible to call a roadmap_layer function from ! * roadmap_line.c (and roadmap_line_get_layer() would like to use roadmap_layer_road_last()). */ *************** *** 41,45 **** ! /* This is the maximum number of layers PER CLASS. As there is no limit on * the number of classes, the total number of layers is actually unlimited. * We could have implemented support for an unlimited number of layers per --- 47,52 ---- ! /** ! * @brief This is the maximum number of layers PER CLASS. As there is no limit on * the number of classes, the total number of layers is actually unlimited. * We could have implemented support for an unlimited number of layers per *************** *** 50,54 **** #define ROADMAP_MAX_LAYERS 1024 ! /* There is a maximum number of navigation modules that can be registered. * This is not really a limitation for now, since there is currently only * one navigation mode (car) and any other would be hiking, boat, plane, --- 57,62 ---- #define ROADMAP_MAX_LAYERS 1024 ! /** ! * @brief There is a maximum number of navigation modules that can be registered. * This is not really a limitation for now, since there is currently only * one navigation mode (car) and any other would be hiking, boat, plane, *************** *** 58,62 **** #define ROADMAP_MAX_NAVIGATION_MODES (8*sizeof(int)) ! /* Some layers may be displayed using more than one pen. * For example, a freeway could be displayed using 3 pens: * border, fill, center divider. --- 66,71 ---- #define ROADMAP_MAX_NAVIGATION_MODES (8*sizeof(int)) ! /** ! * @brief Some layers may be displayed using more than one pen. * For example, a freeway could be displayed using 3 pens: * border, fill, center divider. *************** *** 74,79 **** static unsigned int RoadMapNavigationModeCount = 0; ! ! /* CLASSES. ----------------------------------------------------------- * A class represent a group of categories that have the same basic * properties or which come from a single source. For example, the "Road" --- 83,90 ---- static unsigned int RoadMapNavigationModeCount = 0; ! /* ----------------------------------------------------------- */ ! /** ! * @brief CLASSES ! * * A class represent a group of categories that have the same basic * properties or which come from a single source. For example, the "Road" *************** *** 82,85 **** --- 93,97 ---- * of the same class: the organization of layers into classes is only * a map creator's convention. + * * The lines and the polygons arrays are consecutive to each other, * i.e. a single array where the lines are listed first, so that we *************** *** 106,110 **** ! /* LAYERS. ------------------------------------------------------------ * A layer represents a group of map objects that are represented * using the same pen (i.e. same color, thickness) and the same --- 118,125 ---- ! /* LAYERS. ------------------------------------------------------------ */ ! /** ! * @brief LAYERS ! * * A layer represents a group of map objects that are represented * using the same pen (i.e. same color, thickness) and the same *************** *** 126,130 **** int delta_thickness[ROADMAP_MAX_LAYER_PENS]; ! int navigation_modes; } RoadMapLayer; --- 141,146 ---- int delta_thickness[ROADMAP_MAX_LAYER_PENS]; ! int navigation_modes; /**< bitwise OR of the navigation modes supported */ ! RoadMapConfigDescriptor speed; /**< max speed */ } RoadMapLayer; *************** *** 134,138 **** ! /* SETS. -------------------------------------------------------------- * A set represent a full configuration of classes. One set only is * active at any given time. The sets are always predefined (for now?). --- 150,157 ---- ! /* SETS. -------------------------------------------------------------- */ ! /** ! * @brief SETS ! * * A set represent a full configuration of classes. One set only is * active at any given time. The sets are always predefined (for now?). *************** *** 233,238 **** ! int roadmap_layer_navigable (int mode, int *layers, int size) { ! int i; int mask = 1 << mode; --- 252,264 ---- ! /** ! * @brief query the layers navigable for a given navigation mode (e.g. car) ! * @param mode ! * @param layers ! * @param size ! * @return ! */ ! int roadmap_layer_navigable (int mode, int *layers, int size) ! { int i; int mask = 1 << mode; *************** *** 260,267 **** } ! ! int roadmap_layer_visible_lines ! (int *layers, int size, unsigned int pen_index) { ! int i; int count = 0; --- 286,291 ---- } ! int roadmap_layer_visible_lines (int *layers, int size, unsigned int pen_index) ! { int i; int count = 0; *************** *** 381,384 **** --- 405,414 ---- + /** + * @brief + * @param layer + * @param pen_index + * @return + */ RoadMapPen roadmap_layer_get_pen (int layer, unsigned int pen_index) { *************** *** 486,489 **** --- 516,528 ---- /* Initialization code. ------------------------------------------- */ + /** + * @brief + * @param config + * @param category + * @param id + * @param args + * @param max + * @return + */ static int roadmap_layer_decode (const char *config, const char *category, const char *id, *************** *** 659,663 **** } ! static void roadmap_layer_load_file (const char *class_file) { --- 698,705 ---- } ! /** ! * @brief load a "class file" ! * @param class_file which file to load ! */ static void roadmap_layer_load_file (const char *class_file) { *************** *** 676,679 **** --- 718,722 ---- const char *class_name; + roadmap_log (ROADMAP_WARNING, "roadmap_layer_load_file(%s)", class_file); if (class_config == NULL) { roadmap_log (ROADMAP_FATAL, "cannot access class file %s", class_file); *************** *** 721,724 **** --- 764,770 ---- roadmap_check_allocated(new_class); + roadmap_log (ROADMAP_WARNING, "Class [%s] lines %d polygons %d", + class_name, lines_count, polygons_count); + new_class->name = class_name; new_class->lines_count = lines_count; *************** *** 759,762 **** --- 805,809 ---- other_pen = realloc(other_pen, other_pen_length); + roadmap_log(ROADMAP_DEBUG, "Layer %d is %s", i, layers[i]); layer->name = layers[i]; layer->class = new_class; *************** *** 772,775 **** --- 819,826 ---- layer->declutter.name = "Declutter"; roadmap_config_declare (class_config, &layer->declutter, "20248000000"); + + layer->speed.category = layers[i]; + layer->speed.name = "Speed"; + roadmap_config_declare (class_config, &layer->speed, "120"); for (pen_index = 0; pen_index < ROADMAP_MAX_LAYER_PENS; ++pen_index) { *************** *** 868,871 **** --- 919,927 ---- /* Retrieve the navigation modes associated with each layer. */ + RoadMapNavigationModeCount = roadmap_layer_decode (class_config, "Class", "NavigationModes", + RoadMapNavigationMode, ROADMAP_MAX_NAVIGATION_MODES); + if (RoadMapNavigationModeCount <= 0) return; + + roadmap_log (ROADMAP_WARNING, "RoadMapNavigationModeCount %d", RoadMapNavigationModeCount); for (i = 0; i < (int)RoadMapNavigationModeCount; ++i) { *************** *** 881,884 **** --- 937,943 ---- navigation_layers, ROADMAP_MAX_LAYERS); + roadmap_log (ROADMAP_WARNING, "Navigation %d [%s] -> %d modes", + i, RoadMapNavigationMode[i], layers_count); + for (j = layers_count - 1; j >= 0; --j) { *************** *** 894,900 **** } ! ! void roadmap_layer_load (void) { ! char *class_path; char **classes; --- 953,961 ---- } ! /** ! * @brief Load the configuration files ! */ ! void roadmap_layer_load (void) ! { char *class_path; char **classes; *************** *** 947,950 **** --- 1008,1016 ---- + /** + * @brief add a navigation mode (car, bike, ..) + * @param name the name of this mode + * @return the id of this navigation mode + */ int roadmap_layer_declare_navigation_mode (const char *name) { *************** *** 966,967 **** --- 1032,1125 ---- } + /** + * @brief returns true if this layer is a street + * Based on the list of lines (Class.Lines) in default/All . + * The code relies on the fact that Lines have the lowest numbers, + * this is how they're loaded. + * @param layer the layer's integer value + * @return true if this is a street / line + */ + int roadmap_layer_is_street(int layer) + { + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_is_street : no current class"); + return 0; + } + return (layer <= RoadMapLayerCurrentClass->lines_count); + } + + /** + * @brief get the id of the first "road" type (assumption: they're consecutive) + * @return id of the first road type (whatever the first may be, this is actually meaningless) + */ + int roadmap_layer_road_first(void) + { + return 0; + } + + /** + * @brief get the id of the next road type (whatever "next" may mean) + * @param layer the current road type + * @return the next road type + */ + int roadmap_layer_road_next(int layer) + { + return layer + 1; + } + + /** + * @brief + * @return + */ + int roadmap_layer_count_roads(void) + { + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_count_roads : no current class"); + return 0; + } + return RoadMapLayerCurrentClass->lines_count; + } + + /** + * @brief + */ + int roadmap_layer_road_last(void) + { + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_road_last : no current class"); + return 0; + } + return RoadMapLayerCurrentClass->lines_count; + } + + /** + * @brief + * @return + */ + int roadmap_layer_last(void) + { + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_last : no current class"); + return 0; + } + return RoadMapLayerCurrentClass->lines_count; + } + + /** + * @brief returns the value of the Speed parameter of this layer, from default/All. + * @param layer + * @return + */ + int roadmap_layer_speed(int layer) + { + RoadMapLayer *TheLayer; + RoadMapConfigItem *r; + + if (RoadMapLayerCurrentClass == NULL) { + roadmap_log (ROADMAP_FATAL, "roadmap_layer_road_last : no current class"); + return 0; + } + + TheLayer = RoadMapLayerCurrentClass->layers + layer - 1; + return roadmap_config_get_integer (&TheLayer->speed); + } Index: roadmap_layer.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_layer.h 7 Oct 2008 00:29:47 -0000 1.6 --- roadmap_layer.h 12 Feb 2009 16:12:39 -0000 1.7 *************** *** 1,7 **** ! /* roadmap_layer.h - layer management: declutter, filter, etc.. ! * * LICENSE: * * Copyright 2003 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2003 Pascal F. Martin + * Copyright (c) 2008, 2009, Danny Backx. * * This file is part of RoadMap. *************** *** 20,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * DESCRIPTION: * * This module gives access to the layers provided by the current maps. --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_layer.h - layer management: declutter, filter, etc.. * * This module gives access to the layers provided by the current maps. *************** *** 85,90 **** int roadmap_layer_navigable (int mode, int *layers, int size); ! int roadmap_layer_visible_lines ! (int *layers, int size, unsigned int pen_index); int roadmap_layer_line_is_visible (int layer); --- 88,92 ---- int roadmap_layer_navigable (int mode, int *layers, int size); ! int roadmap_layer_visible_lines (int *layers, int size, unsigned int pen_index); int roadmap_layer_line_is_visible (int layer); *************** *** 102,105 **** void roadmap_layer_initialize (void); ! #endif // INCLUDED__ROADMAP_LAYER__H --- 104,117 ---- void roadmap_layer_initialize (void); ! int roadmap_layer_last(void); ! int roadmap_layer_is_street(int layer); ! int roadmap_layer_road_first(void); ! int roadmap_layer_road_next(int layer); ! int roadmap_layer_count_roads(void); ! int roadmap_layer_road_street(void); ! int roadmap_layer_road_last(void); ! ! int roadmap_layer_speed(int layer); ! + #endif // INCLUDED__ROADMAP_LAYER__H |
|
From: Danny B. <dan...@us...> - 2009-02-12 16:12:44
|
Update of /cvsroot/roadmap/roadmap/src/default In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17755/default Modified Files: All Log Message: Add new functionality to the layer module. Also add the sample definitions that I'm using to the "All" file. Index: All =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/default/All,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** All 7 Jun 2007 15:59:18 -0000 1.4 --- All 12 Feb 2009 16:12:39 -0000 1.5 *************** *** 2,6 **** Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls ! Navigation.Car: Freeways Ramps Highways Streets Trails Freeways.Color: black Freeways.Color1: IndianRed --- 2,10 ---- Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls ! Class.NavigationModes: Car Bike Foot Boat ! Navigation.Car: Freeways Ramps Highways Streets ! Navigation.Bike: Streets Trails Shore Parks ! Navigation.Foot: Streets Trails Shore Parks Stations Malls Hospitals Airports ! Navigation.Boat: Rivers Shore Lakes Sea Freeways.Color: black Freeways.Color1: IndianRed |
|
From: Danny B. <dan...@us...> - 2009-02-10 19:04:43
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv24672 Modified Files: roadmap_display.c Log Message: A longer allocation for the caller of roadmap_time_get_hours_minutes(). Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_display.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** roadmap_display.c 16 Jan 2009 16:56:40 -0000 1.36 --- roadmap_display.c 10 Feb 2009 19:04:38 -0000 1.37 *************** *** 738,742 **** if (roadmap_message_time_in_use()) { ! char nowtime[16]; strcpy(nowtime, roadmap_time_get_hours_minutes (now)); --- 738,742 ---- if (roadmap_message_time_in_use()) { ! char nowtime[32]; strcpy(nowtime, roadmap_time_get_hours_minutes (now)); |
|
From: Danny B. <dan...@us...> - 2009-02-10 19:02:06
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21570/unix Modified Files: roadmap_time.c Log Message: Include the date Index: roadmap_time.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_time.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_time.c 7 Aug 2007 01:32:10 -0000 1.4 --- roadmap_time.c 10 Feb 2009 19:01:57 -0000 1.5 *************** *** 1,7 **** ! /* roadmap_time.c - Manage time information & display. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_time.h */ --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief unix/roadmap_time.c - Manage time information & display. */ *************** *** 35,42 **** #include "roadmap_time.h" ! char *roadmap_time_get_hours_minutes (time_t gmt) { ! static char image[16]; struct tm *tm; --- 36,47 ---- #include "roadmap_time.h" ! /** ! * @brief convert time_t into a string ! * @param gmt the input time ! * @return the string that can be printed ! */ char *roadmap_time_get_hours_minutes (time_t gmt) { ! static char image[32]; struct tm *tm; *************** *** 44,56 **** tm = localtime (&gmt); snprintf (image, sizeof(image), "%2d:%02d", tm->tm_hour, tm->tm_min); return image; } ! unsigned long tv_to_msec(struct timeval *tv) { return (tv->tv_sec & 0xffff) * 1000 + tv->tv_usec/1000; } unsigned long roadmap_time_get_millis(void) { struct timeval tv; --- 49,68 ---- tm = localtime (&gmt); snprintf (image, sizeof(image), "%2d:%02d", tm->tm_hour, tm->tm_min); + snprintf (image, sizeof(image), "%4d.%02d.%02d %2d:%02d", + 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min); return image; } ! static unsigned long tv_to_msec(struct timeval *tv) { return (tv->tv_sec & 0xffff) * 1000 + tv->tv_usec/1000; } + /** + * @brief Get some kind of time indication in milliseconds, on UNIX it's the current time + * @return return the time in milliseconds + */ unsigned long roadmap_time_get_millis(void) { struct timeval tv; *************** *** 60,63 **** } - - --- 72,73 ---- |
|
From: Danny B. <dan...@us...> - 2009-02-10 19:02:05
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21570/win32 Modified Files: roadmap_time.c Log Message: Include the date Index: roadmap_time.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_time.c 7 Aug 2007 01:32:10 -0000 1.2 --- roadmap_time.c 10 Feb 2009 19:02:01 -0000 1.3 *************** *** 1,7 **** ! /* roadmap_time.c - Manage time information & display. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_time.h */ --- 20,29 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief win32/roadmap_time.c - Manage time information & display. ! * @ingroup windows */ *************** *** 29,45 **** #include "../roadmap_time.h" ! char *roadmap_time_get_hours_minutes (time_t gmt) { ! ! static char image[16]; ! struct tm *tm; ! tm = localtime (&gmt); ! snprintf (image, sizeof(image), "%2d:%02d", tm->tm_hour, tm->tm_min); return image; } unsigned long roadmap_time_get_millis(void) { --- 31,57 ---- #include "../roadmap_time.h" ! /** ! * @brief convert time_t into a string ! * @param gmt the input time ! * @return the string that can be printed ! */ char *roadmap_time_get_hours_minutes (time_t gmt) { ! ! static char image[32]; struct tm *tm; ! tm = localtime (&gmt); ! snprintf (image, sizeof(image), "%4d.%02d.%02d %2d:%02d", ! 1900 + tm->tm_year, tm->tm_mon + 1, tm->tm_mday, ! tm->tm_hour, tm->tm_min); return image; } + /** + * @brief Get some kind of time indication in milliseconds, on Windows it's the time since boot + * @brief Get the time since last boot + * @return return the time in milliseconds + */ unsigned long roadmap_time_get_millis(void) { *************** *** 47,50 **** } - - --- 59,60 ---- |
|
From: Paul F. <pg...@us...> - 2009-02-10 13:28:24
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4739 Modified Files: roadmap_copyright.h Log Message: mark version as post-1.2.1 Index: roadmap_copyright.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_copyright.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** roadmap_copyright.h 8 Feb 2009 22:45:33 -0000 1.33 --- roadmap_copyright.h 10 Feb 2009 13:28:02 -0000 1.34 *************** *** 27,31 **** #define INCLUDE__ROADMAP_COPYRIGHT__H ! #define ROADMAP_VERSION "1.2.1" #define ROADMAP_YEAR "2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009" --- 27,31 ---- #define INCLUDE__ROADMAP_COPYRIGHT__H ! #define ROADMAP_VERSION "post-1.2.1" #define ROADMAP_YEAR "2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009" |
|
From: Danny B. <dan...@us...> - 2009-02-10 13:16:49
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27496 Modified Files: roadmap_factory.c roadmap_factory.h roadmap_start.c Log Message: Readability remark by Alessandro in roadmap_start.c . roadmap_factory : add mostly documentation stubs but also something that'll allow us to add to the menu system from inside a plugin. Index: roadmap_factory.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_factory.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_factory.h 24 May 2008 21:24:28 -0000 1.13 --- roadmap_factory.h 10 Feb 2009 11:41:02 -0000 1.14 *************** *** 1,7 **** ! /* roadmap_factory.h - The menu/toolbar/binding factory for RoadMap. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 22,25 **** --- 22,30 ---- */ + /** + * @file + * @brief roadmap_factory.h - the menu/toolbar/binding factory for RoadMap. + */ + #ifndef INCLUDE__ROADMAP_FACTORY__H #define INCLUDE__ROADMAP_FACTORY__H *************** *** 30,35 **** typedef struct { - const char *name; char *label_long; --- 35,42 ---- + /** + * @brief table used to create the menu, accelarators, .. + */ typedef struct { const char *name; char *label_long; *************** *** 37,44 **** char *label_terse; const char *tip; ! const char *key; /* filled in at run-time, based on key mappings */ ! RoadMapCallback callback; - } RoadMapAction; --- 44,49 ---- char *label_terse; const char *tip; ! const char *key; /**< filled in at run-time, based on key mappings */ RoadMapCallback callback; } RoadMapAction; Index: roadmap_factory.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_factory.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** roadmap_factory.c 24 May 2008 21:24:28 -0000 1.34 --- roadmap_factory.c 10 Feb 2009 11:41:01 -0000 1.35 *************** *** 1,4 **** ! /* roadmap_factory.c - The menu/toolbar/shortcut factory for RoadMap. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 20,27 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_factory.h */ --- 19,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief The menu/toolbar/shortcut factory for RoadMap. */ *************** *** 43,46 **** --- 43,47 ---- #include "roadmap_factory.h" + #include "roadmap_plugin.h" *************** *** 61,69 **** const char RoadMapFactoryHelpTopics[] = "--help-topics--"; typedef struct { ! ! RoadMapCallback action; ! char *title; ! } RoadMapFactoryMenuPopup; --- 62,71 ---- const char RoadMapFactoryHelpTopics[] = "--help-topics--"; + /** + * @brief + */ typedef struct { ! RoadMapCallback action; /**< */ ! char *title; /**< */ } RoadMapFactoryMenuPopup; *************** *** 139,143 **** int RoadMapFactoryMenuPopupCount; ! void roadmap_factory_menu_popup_n(int n) { --- 141,148 ---- int RoadMapFactoryMenuPopupCount; ! /** ! * @brief ! * @param n ! */ void roadmap_factory_menu_popup_n(int n) { *************** *** 155,180 **** } struct RoadMapFactoryKeyMap { ! ! const char *key; ! const RoadMapAction *action; }; static struct RoadMapFactoryKeyMap *RoadMapFactoryBindings = NULL; static int RoadMapFactoryKeyLength = 0; ! struct RoadMapFactoryPopup { ! ! const char *title; ! RoadMapMenu menu; ! ! struct RoadMapFactoryPopup *next; }; static struct RoadMapFactoryPopup *RoadMapFactoryPopupList = NULL; ! static void roadmap_factory_keyboard (char *key) { --- 160,196 ---- } + /** + * @brief + */ struct RoadMapFactoryKeyMap { ! const char *key; /**< */ ! const RoadMapAction *action; /**< */ }; + /** + * @brief + */ static struct RoadMapFactoryKeyMap *RoadMapFactoryBindings = NULL; + /** + * @brief + */ static int RoadMapFactoryKeyLength = 0; ! /** ! * @brief ! */ struct RoadMapFactoryPopup { ! const char *title; /**< */ ! RoadMapMenu menu; /**< */ ! struct RoadMapFactoryPopup *next; /**< */ }; static struct RoadMapFactoryPopup *RoadMapFactoryPopupList = NULL; ! /** ! * @brief ! * @param key ! */ static void roadmap_factory_keyboard (char *key) { *************** *** 199,202 **** --- 215,222 ---- } + /** + * @brief + * @param menu + */ static void roadmap_factory_add_help (RoadMapMenu menu) { *************** *** 218,221 **** --- 238,247 ---- + /** + * @brief + * @param actions + * @param item + * @return + */ static RoadMapAction *roadmap_factory_find_action (RoadMapAction *actions, const char *item) { *************** *** 229,233 **** } ! static const char *roadmap_factory_terse (const RoadMapAction *action) { --- 255,263 ---- } ! /** ! * @brief ! * @param action ! * @return ! */ static const char *roadmap_factory_terse (const RoadMapAction *action) { *************** *** 242,245 **** --- 272,282 ---- + /** + * @brief + * @param file_name + * @param actions + * @param path + * @return + */ static const char **roadmap_factory_load_config (const char *file_name, RoadMapAction *actions, *************** *** 309,312 **** --- 346,356 ---- } + /** + * @brief + * @param name + * @param category + * @param actions + * @return + */ static const char **roadmap_factory_user_config (const char *name, *************** *** 339,343 **** } ! static int roadmap_factory_load_action_labels (const char *file_name, RoadMapAction *actions, --- 383,393 ---- } ! /** ! * @brief ! * @param file_name ! * @param actions ! * @param path ! * @return ! */ static int roadmap_factory_load_action_labels (const char *file_name, RoadMapAction *actions, *************** *** 436,439 **** --- 486,496 ---- } + /** + * @brief + * @param name + * @param category + * @param actions + * @return + */ static int roadmap_factory_user_action_labels (const char *name, *************** *** 467,470 **** --- 524,532 ---- } + /** + * @brief + * @param menu + * @param title + */ static void roadmap_factory_add_popup (RoadMapMenu menu, const char *title) { *************** *** 483,486 **** --- 545,552 ---- } + /** + * @brief + * @param title + */ static RoadMapAction * roadmap_factory_menu_dummy_action (const char *title) { *************** *** 523,526 **** --- 589,598 ---- } + /** + * @brief + * @param actions + * @param item + * @return + */ RoadMapAction *roadmap_factory_find_action_or_menu (RoadMapAction *actions, const char *item) { *************** *** 535,538 **** --- 607,616 ---- } + /** + * @brief + * @param use_tips + * @param this_action + * @return + */ static const char *roadmap_factory_set_tip (int use_tips, const RoadMapAction *this_action) { *************** *** 555,558 **** --- 633,643 ---- } + /** + * @brief + * @param item + * @param actions + * @param doing_menus + * @param use_tips + */ void roadmap_factory_config_menu (const char **item, RoadMapAction *actions, *************** *** 619,622 **** --- 704,714 ---- } + /** + * @brief + * @param item + * @param actions + * @param use_icons + * @param use_tips + */ void roadmap_factory_config_toolbar (const char **item, RoadMapAction *actions, *************** *** 661,664 **** --- 753,783 ---- } + /** + * @brief handler for plugin actions/menu + * Drawback of this simplistic implementation : plugin menus can only use their own actions. + * + * To fix this, the actions from the plugin should somehow be concatenated with the ones + * RoadMap grabbed initially. + * I am not convinced that this is an absolute necessity so I've left that out now. + * + * @param actions the list of actions for this plugin + * @param menu the menu configuration for this plugin + */ + static void roadmap_factory_handle_plugin_actions_menu(RoadMapAction *actions, const char **menu) + { + int use_tips; + + roadmap_log(ROADMAP_DEBUG, "roadmap_factory_handle_plugin_actions_menu"); + use_tips = roadmap_config_match (&RoadMapConfigGeneralTooltips, "yes"); + roadmap_factory_config_menu(menu, actions, 1, use_tips); + } + + /** + * @brief create toolbar, menus, .. based on the tables passed + * @param name + * @param actions + * @param menu + * @param toolbar + */ void roadmap_factory (const char *name, RoadMapAction *actions, *************** *** 724,730 **** roadmap_main_set_keyboard (roadmap_factory_keyboard); } - } void roadmap_factory_keymap (RoadMapAction *actions, const char *shortcuts[]) { --- 843,855 ---- roadmap_main_set_keyboard (roadmap_factory_keyboard); } + roadmap_plugin_actions_menu(roadmap_factory_handle_plugin_actions_menu); + } + /** + * @brief + * @param actions + * @param shortcuts + */ void roadmap_factory_keymap (RoadMapAction *actions, const char *shortcuts[]) { *************** *** 813,817 **** } ! static void roadmap_factory_show_keymap (void) { --- 938,944 ---- } ! /** ! * @brief print the keymap, only called from roadmap_factory_usage ! */ static void roadmap_factory_show_keymap (void) { *************** *** 834,838 **** } ! void roadmap_factory_popup (const char *title, const RoadMapGuiPoint *position) { --- 961,969 ---- } ! /** ! * @brief ! * @param title ! * @param position ! */ void roadmap_factory_popup (const char *title, const RoadMapGuiPoint *position) { *************** *** 854,858 **** } ! void roadmap_factory_usage (const char *section, const RoadMapAction *action) { --- 985,993 ---- } ! /** ! * @brief Print either the keymap or the list of supported actions ! * @param section table from which to get the information to print ! * @param action determines whether to print keymap or action list ! */ void roadmap_factory_usage (const char *section, const RoadMapAction *action) { *************** *** 872,874 **** } } - --- 1007,1008 ---- Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** roadmap_start.c 9 Feb 2009 23:24:04 -0000 1.153 --- roadmap_start.c 10 Feb 2009 11:41:02 -0000 1.154 *************** *** 1443,1454 **** roadmap_option (argc, argv, 1, roadmap_start_usage); - roadmap_log (ROADMAP_WARNING, #ifdef _WIN32 "RoadMap build %s starting, time %s", ! roadmap_build(), #else "RoadMap starting, time %s", - #endif roadmap_start_now()); roadmap_start_set_unit (); --- 1443,1455 ---- roadmap_option (argc, argv, 1, roadmap_start_usage); #ifdef _WIN32 + roadmap_log (ROADMAP_WARNING, "RoadMap build %s starting, time %s", ! roadmap_build(), roadmap_start_now()); #else + roadmap_log (ROADMAP_WARNING, "RoadMap starting, time %s", roadmap_start_now()); + #endif roadmap_start_set_unit (); |
|
From: Danny B. <dan...@us...> - 2009-02-09 23:24:12
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17795 Modified Files: roadmap_start.c Log Message: Add a build timestamp so I know which version I'm testing. Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** roadmap_start.c 8 Feb 2009 21:17:51 -0000 1.152 --- roadmap_start.c 9 Feb 2009 23:24:04 -0000 1.153 *************** *** 90,93 **** --- 90,97 ---- #include "roadmap_start.h" + #ifdef _WIN32 + extern const char *roadmap_build(void); + #endif + static const char *RoadMapMainTitle = "RoadMap"; *************** *** 1439,1443 **** roadmap_option (argc, argv, 1, roadmap_start_usage); ! roadmap_log (ROADMAP_WARNING, "RoadMap starting, time %s", roadmap_start_now()); roadmap_start_set_unit (); --- 1443,1454 ---- roadmap_option (argc, argv, 1, roadmap_start_usage); ! roadmap_log (ROADMAP_WARNING, ! #ifdef _WIN32 ! "RoadMap build %s starting, time %s", ! roadmap_build(), ! #else ! "RoadMap starting, time %s", ! #endif ! roadmap_start_now()); roadmap_start_set_unit (); |
|
From: Danny B. <dan...@us...> - 2009-02-09 23:24:10
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17795/win32 Modified Files: Makefile Added Files: roadmap_build.c Log Message: Add a build timestamp so I know which version I'm testing. --- NEW FILE: roadmap_build.c --- /* * LICENSE: * * Copyright 2008 Danny Backx * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief insert a build timestamp * @ingroup windows */ const char *roadmap_build(void) { return ROADMAP_BUILD_DATE_TIME; } Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/Makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile 9 Feb 2009 19:39:17 -0000 1.19 --- Makefile 9 Feb 2009 23:24:04 -0000 1.20 *************** *** 9,12 **** --- 9,17 ---- # + # + # Produce a build timestamp + # + BUILD_DATETIME = `date +%Y%m%d.%H%M` + TOP = .. *************** *** 66,71 **** --- 71,79 ---- wroadmap.exe: roadmap_main.o libwroadmap.a roadmap.rsc \ + roadmap_build.c \ $(TOP)/libguiroadmap.a $(filter %.a, $(LIBS)) + $(CC) -DROADMAP_BUILD_DATE_TIME='"'$(BUILD_DATETIME)'"' -c roadmap_build.c $(CC) $(LDFLAGS) -o wroadmap.exe roadmap_main.o roadmap.rsc \ + roadmap_build.o \ $(TOP)/libguiroadmap.a libwroadmap.a $(LIBS) \ libwroadmap.a -lcommctrl -laygshell -lws2 |
|
From: Danny B. <dan...@us...> - 2009-02-09 19:39:24
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27104/win32 Modified Files: CEDevice.h CEException.h Makefile wince_input_mon.c wince_input_mon.h Added Files: CEDevice.c CEException.c roadmap_main.c Removed Files: CEDevice.cpp CEException.cpp roadmap_main.cpp Log Message: Replace C++ files by equivalent C files, we weren't really doing any C++. win32/Makefile : replace C++ compiler call by C compiler call. Options.mk : bump up the flag that indicates which version of WinCE we're using, to access stuff in the pm.h include file. This allows us to figure out when the device is being power cycled. (Note the code to actually use this is not in place yet.) --- CEDevice.cpp DELETED --- --- roadmap_main.cpp DELETED --- Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/Makefile,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile 28 Jan 2009 20:59:52 -0000 1.18 --- Makefile 9 Feb 2009 19:39:17 -0000 1.19 *************** *** 18,22 **** roadmap_file.c \ roadmap_library.c \ ! roadmap_main.cpp \ roadmap_fileselection.c \ roadmap_net.c \ --- 18,22 ---- roadmap_file.c \ roadmap_library.c \ ! roadmap_main.c \ roadmap_fileselection.c \ roadmap_net.c \ *************** *** 29,34 **** wince_input_mon.c \ roadmap_progress.c \ ! CEDevice.cpp \ ! CEException.cpp \ roadmap_gps_detect.c \ roadmap_colors.c --- 29,34 ---- wince_input_mon.c \ roadmap_progress.c \ ! CEDevice.c \ ! CEException.c \ roadmap_gps_detect.c \ roadmap_colors.c *************** *** 37,42 **** # roadmap_signals.c \ ! RMLIBOBJ1 = $(RMLIBSRC:.cpp=.o) ! RMLIBOBJ = $(CANVAS_OBJS) $(RMLIBOBJ1:.c=.o) HEADERS = \ --- 37,41 ---- # roadmap_signals.c \ ! RMLIBOBJ = $(CANVAS_OBJS) $(RMLIBSRC:.c=.o) HEADERS = \ *************** *** 68,72 **** wroadmap.exe: roadmap_main.o libwroadmap.a roadmap.rsc \ $(TOP)/libguiroadmap.a $(filter %.a, $(LIBS)) ! $(CXX) $(LDFLAGS) -o wroadmap.exe roadmap_main.o roadmap.rsc \ $(TOP)/libguiroadmap.a libwroadmap.a $(LIBS) \ libwroadmap.a -lcommctrl -laygshell -lws2 --- 67,71 ---- wroadmap.exe: roadmap_main.o libwroadmap.a roadmap.rsc \ $(TOP)/libguiroadmap.a $(filter %.a, $(LIBS)) ! $(CC) $(LDFLAGS) -o wroadmap.exe roadmap_main.o roadmap.rsc \ $(TOP)/libguiroadmap.a libwroadmap.a $(LIBS) \ libwroadmap.a -lcommctrl -laygshell -lws2 *************** *** 77,81 **** # wroadgps: roadmap_main.o libwroadmap.a roadmap.rsc \ # $(TOP)/libguiroadgps.a $(filter %.a, $(LIBS)) ! # $(CXX) $(LDFLAGS) -o wroadgps roadmap_main.o roadmap.rsc \ # $(TOP)/libguiroadgps.a libwroadmap.a $(LIBS) \ # libwroadmap.a -lcommctrl -laygshell -lws2 --- 76,80 ---- # wroadgps: roadmap_main.o libwroadmap.a roadmap.rsc \ # $(TOP)/libguiroadgps.a $(filter %.a, $(LIBS)) ! # $(CC) $(LDFLAGS) -o wroadgps roadmap_main.o roadmap.rsc \ # $(TOP)/libguiroadgps.a libwroadmap.a $(LIBS) \ # libwroadmap.a -lcommctrl -laygshell -lws2 --- CEException.cpp DELETED --- Index: wince_input_mon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/wince_input_mon.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wince_input_mon.c 12 May 2008 08:45:37 -0000 1.5 --- wince_input_mon.c 9 Feb 2009 19:39:17 -0000 1.6 *************** *** 1,8 **** ! /* wince_input_mon.c - monitor for inputs (serial / network / file). ! * * LICENSE: * * Copyright 2005 Ehud Shabtai ! * Copyright 2008 Danny Backx * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2005 Ehud Shabtai ! * Copyright (c) 2008, 2009 Danny Backx * * This file is part of RoadMap. *************** *** 21,35 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * */ #include <windows.h> #include "../roadmap.h" #include "../roadmap_io.h" #include "../roadmap_serial.h" #include "wince_input_mon.h" extern HWND RoadMapMainWindow; DWORD WINAPI SerialMonThread(LPVOID lpParam) { --- 20,47 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief monitor for inputs (serial / network / file) and power management events. */ #include <windows.h> + #include <msgqueue.h> + #include <pm.h> + #include "../roadmap.h" #include "../roadmap_io.h" #include "../roadmap_serial.h" #include "wince_input_mon.h" + #include "roadmap_time.h" extern HWND RoadMapMainWindow; + /** + * @brief + * @param lpParam + * @return + */ DWORD WINAPI SerialMonThread(LPVOID lpParam) { *************** *** 78,85 **** free(io); return 0; } ! DWORD WINAPI SocketMonThread(LPVOID lpParam) { --- 90,102 ---- free(io); + roadmap_log (ROADMAP_WARNING, "SerialMonThread: terminate"); return 0; } ! /** ! * @brief ! * @param lpParam ! * @return ! */ DWORD WINAPI SocketMonThread(LPVOID lpParam) { *************** *** 111,121 **** free(io); return 0; } ! ! /* This is not a real monitor thread. As this is a file we assume that input ! * is always ready and so we loop until a request to remove this input is ! * received. */ DWORD WINAPI FileMonThread(LPVOID lpParam) --- 128,141 ---- free(io); + roadmap_log (ROADMAP_WARNING, "SocketMonThread: terminate"); return 0; } ! /** ! * @brief This is not a real monitor thread. ! * As this is a file we assume that input is always ready and so we loop until ! * a request to remove this input is received. ! * @param lpParam ! * @return */ DWORD WINAPI FileMonThread(LPVOID lpParam) *************** *** 132,136 **** --- 152,264 ---- free(io); + roadmap_log (ROADMAP_WARNING, "FileMonThread: terminate"); return 0; } + static HANDLE power_msg_handle = NULL, + power_req_handle = NULL; + static HANDLE power_thread = NULL; + static POWER_BROADCAST buf[4]; /* enough */ + + /** + * @brief list of functions to call after suspend/resume cycle + */ + static roadmap_power_callback *power_callbacks = NULL; + static int npower_callbacks = 0, + maxpower_callbacks = 0; + + static void roadmap_main_power_suspend(void) + { + int i; + + roadmap_log (ROADMAP_WARNING, "Success (%s) !\r\nMsg %d flags %d length %d", + roadmap_time_get_hours_minutes(time(NULL)), + buf[0].Message, + buf[0].Flags, + buf[0].Length); + + for (i=0; i<npower_callbacks; i++) + (*power_callbacks[i])(); + } + + /** + * @brief + * @param func + */ + void roadmap_power_register(roadmap_power_callback func) + { + if (npower_callbacks == maxpower_callbacks) { + maxpower_callbacks += 4; + power_callbacks = (roadmap_power_callback *)realloc((void *)power_callbacks, + sizeof(roadmap_power_callback) * maxpower_callbacks); + } + power_callbacks[npower_callbacks++] = func; + } + + /** + * @brief Monitor power + * @param lpParam + * @return + */ + DWORD WINAPI PowerMonThread(LPVOID lpParam) + { + DWORD nread; /**< number of bytes read */ + DWORD dwflags; + + roadmap_log (ROADMAP_WARNING, "PowerMonThread"); + + while (1) { + if (ReadMsgQueue(power_msg_handle, buf, sizeof(buf), + &nread, INFINITE, &dwflags) == FALSE) { + DWORD e = GetLastError(); + roadmap_log (ROADMAP_WARNING, "Power: ReadMsgQueue failed %d", e); + return 0; /* stop thread */ + } + if (buf[0].Message == PBT_RESUME) { + roadmap_main_power_suspend(); + } else { + ; /* ignore */ + } + } + return 0; /* never happens */ + } + + /** + * @brief start something to monitor power changes + */ + void roadmap_main_power_monitor_start(void) + { + MSGQUEUEOPTIONS mqo; + + roadmap_log (ROADMAP_WARNING, "roadmap_main_power_monitor_start"); + mqo.dwSize = sizeof(mqo); + mqo.dwFlags = MSGQUEUE_NOPRECOMMIT; + mqo.dwMaxMessages = 0; + mqo.cbMaxMessage = 100; /* ?? */ + mqo.bReadAccess = TRUE; /* read access to the queue */ + + power_msg_handle = CreateMsgQueue(NULL, &mqo); + if (power_msg_handle == NULL) + return; + + power_req_handle = RequestPowerNotifications(power_msg_handle, PBT_RESUME); + + power_thread = CreateThread(NULL, 0, PowerMonThread, NULL, 0, NULL); + } + + /** + * @brief stop monitoring power changes + */ + void roadmap_main_power_monitor_stop(void) + { + roadmap_log (ROADMAP_WARNING, "roadmap_main_power_monitor_stop"); + if (power_req_handle) + StopPowerNotifications(power_req_handle); + power_req_handle = NULL; + + if (power_msg_handle) + if (CloseMsgQueue(power_msg_handle) == FALSE) { + ; /* FIX ME */ + } + power_msg_handle = NULL; + } Index: CEDevice.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/CEDevice.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEDevice.h 7 May 2008 14:01:11 -0000 1.1 --- CEDevice.h 9 Feb 2009 19:39:17 -0000 1.2 *************** *** 23,37 **** #define CEDEVICE ! class CEDevice { ! public: ! static void init(); ! static void end(); ! static void wakeUp(); ! static bool hasPocketPCResolution(); ! static bool hasDesktopResolution(); ! static bool hasWideResolution(); ! static bool hasSmartphoneResolution(); ! static bool isSmartphone(); ! }; ! #endif --- 23,28 ---- #define CEDEVICE ! void ce_device_init(void); ! void ce_device_wakeup(void); ! void ce_device_end(void); #endif Index: CEException.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/CEException.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CEException.h 7 May 2008 14:01:12 -0000 1.1 --- CEException.h 9 Feb 2009 19:39:17 -0000 1.2 *************** *** 22,33 **** #include <windows.h> ! class CEException { ! public: ! static bool writeException(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers); ! private: ! static void writeString(HANDLE file, char *data); ! static void writeBreak(HANDLE file); ! static void dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context); ! static void dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord); ! ! }; --- 22,24 ---- #include <windows.h> ! BOOL ce_exception_write(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers); --- NEW FILE: CEDevice.c --- /* ScummVM - Scumm Interpreter * Copyright (C) 2001-2006 The ScummVM project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Header: /cvsroot/roadmap/roadmap/src/win32/CEDevice.c,v 1.1 2009/02/09 19:39:17 dannybackx Exp $ * */ #include "windows.h" #include "CEDevice.h" /** * @file * @brief Windows CE power management code * @ingroup windows * * This code uses three techniques : * - Call SetPowerRequirement once on the backlight device BLK1: to keep the light on * - Periodically call SystemIdleTimerReset to keep the system from powering down * - Periodically call SHIdleTimerReset to keep the shell from locking the device or * reverting to the Today screen. * * Power management code borrowed from MoDaCo & Betaplayer. Thanks ! */ static void (WINAPI* _SHIdleTimerReset)(void) = NULL; static HANDLE (WINAPI* _SetPowerRequirement)(const void *,int,ULONG,PVOID,ULONG) = NULL; static DWORD (WINAPI* _ReleasePowerRequirement)(HANDLE) = NULL; static HANDLE _hPowerManagement = NULL; static DWORD _lastTime = 0; #define TIMER_TRIGGER 9000 void ce_device_init(void) { HINSTANCE dll = LoadLibrary(TEXT("aygshell.dll")); if (dll) { *(FARPROC*)&_SHIdleTimerReset = GetProcAddress(dll, MAKEINTRESOURCE(2006)); } dll = LoadLibrary(TEXT("coredll.dll")); if (dll) { *(FARPROC*)&_SetPowerRequirement = GetProcAddress(dll, TEXT("SetPowerRequirement")); *(FARPROC*)&_ReleasePowerRequirement = GetProcAddress(dll, TEXT("ReleasePowerRequirement")); } if (_SetPowerRequirement) _hPowerManagement = _SetPowerRequirement(TEXT("BKL1:"), 0, 1, NULL, 0); _lastTime = GetTickCount(); } void ce_device_end(void) { if (_ReleasePowerRequirement && _hPowerManagement) { _ReleasePowerRequirement(_hPowerManagement); } } void ce_device_wakeup(void) { DWORD currentTime = GetTickCount(); if (currentTime > _lastTime + TIMER_TRIGGER) { _lastTime = currentTime; SystemIdleTimerReset(); if (_SHIdleTimerReset) _SHIdleTimerReset(); } } --- NEW FILE: CEException.c --- /* ScummVM - Scumm Interpreter * Copyright (C) 2001-2006 The ScummVM project * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Header: /cvsroot/roadmap/roadmap/src/win32/CEException.c,v 1.1 2009/02/09 19:39:17 dannybackx Exp $ * */ #include "CEException.h" void ce_exception_writestring(HANDLE file, char *data) { DWORD dummy; WriteFile(file, data, strlen(data), &dummy, NULL); WriteFile(file, "\r\n", 2, &dummy, NULL); } void ce_exception_writeBreak(HANDLE file) { char tempo[100]; int i; memset(tempo, 0, sizeof(tempo)); for (i=0; i<40; i++) tempo[i] = '-'; ce_exception_writestring(file, tempo); } void ce_exception_dumpContext(HANDLE file, HANDLE hProcess, CONTEXT *context) { char tempo[200]; unsigned char memoryDump[100]; DWORD size; unsigned int i; #ifdef ARM ce_exception_writeBreak(file); ce_exception_writestring(file, (char *)"Context dump"); sprintf(tempo, "R0=%.8lx R1=%.8lx R2=%.8lx R3=%.8lx R4=%.8lx", context->R0, context->R1, context->R2, context->R3, context->R4); ce_exception_writestring(file, tempo); sprintf(tempo, "R5=%.8lx R6=%.8lx R7=%.8lx R8=%.8lx R9=%.8lx", context->R5, context->R6, context->R7, context->R8, context->R9); ce_exception_writestring(file, tempo); sprintf(tempo, "R10=%.8lx R11=%.8lx R12=%.8lx", context->R10, context->R11, context->R12); ce_exception_writestring(file, tempo); sprintf(tempo, "Sp=%.8lx Lr=%.8lx Pc=%.8lx Psr=%.8lx", context->Sp, context->Lr, context->Pc, context->Psr); ce_exception_writestring(file, tempo); ce_exception_writeBreak(file); sprintf(tempo, "Memory dump at %.8lx", context->Pc - (sizeof(memoryDump) / 2)); ce_exception_writestring(file, tempo); if (ReadProcessMemory(hProcess, (LPCVOID)(context->Pc - (sizeof(memoryDump) / 2)), memoryDump, sizeof(memoryDump), &size)) { for (i=0; i<size; i+=8) { int j; char digit[3]; int max; max = size - i; if (max > 8) max = 8; tempo[0] = '\0'; for (j=0; j<max; j++) { sprintf(digit, "%.2x ", memoryDump[i + j]); strcat(tempo, digit); } ce_exception_writestring(file, tempo); } } #else ce_exception_writeBreak(file); ce_exception_writestring(file, "Context dump only available on ARM devices"); #endif } void ce_exception_dumpException(HANDLE file, EXCEPTION_RECORD *exceptionRecord) { char tempo[200]; char exceptionName[50]; unsigned int i; #if (_WIN32_WCE >= 300) ce_exception_writeBreak(file); switch(exceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION : strcpy(exceptionName, "Access Violation"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED : strcpy(exceptionName, "Array Bounds Exceeded"); break; case EXCEPTION_DATATYPE_MISALIGNMENT : strcpy(exceptionName, "Datatype Misalignment"); break; case EXCEPTION_IN_PAGE_ERROR : strcpy(exceptionName, "In Page Error"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO : strcpy(exceptionName, "Int Divide By Zero"); break; case EXCEPTION_INT_OVERFLOW : strcpy(exceptionName, "Int Overflow"); break; case EXCEPTION_STACK_OVERFLOW : strcpy(exceptionName, "Stack Overflow"); break; default: sprintf(exceptionName, "%.8lx", exceptionRecord->ExceptionCode); break; } sprintf(tempo, "Exception %s Flags %.8lx Address %.8lx", exceptionName, exceptionRecord->ExceptionFlags, (long unsigned int)exceptionRecord->ExceptionAddress); ce_exception_writestring(file, tempo); if (exceptionRecord->NumberParameters) { for (i=0; i<exceptionRecord->NumberParameters; i++) { sprintf(tempo, "Parameter %d %.8lx", i, exceptionRecord->ExceptionInformation[i]); ce_exception_writestring(file, tempo); } } if (exceptionRecord->ExceptionRecord) ce_exception_dumpException(file, exceptionRecord->ExceptionRecord); #else ce_exception_writeBreak(file); ce_exception_writestring(file, "Cannot get exception information on this CE version"); #endif } BOOL ce_exception_write(TCHAR *path, EXCEPTION_POINTERS *exceptionPointers) { HANDLE dumpFile; TCHAR dumpFileName[MAX_PATH]; SYSTEMTIME systemTime; GetSystemTime(&systemTime); wsprintf(dumpFileName, TEXT("%s_%.2d_%.2d_%.4d_%.2d_%.2d_%.2d.txt"), path, systemTime.wDay, systemTime.wMonth, systemTime.wYear, systemTime.wHour, systemTime.wMinute, systemTime.wSecond); dumpFile = CreateFile(dumpFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (dumpFile == INVALID_HANDLE_VALUE) return FALSE; ce_exception_dumpException(dumpFile, exceptionPointers->ExceptionRecord); ce_exception_dumpContext(dumpFile, GetCurrentProcess(), exceptionPointers->ContextRecord); CloseHandle(dumpFile); return TRUE; } Index: wince_input_mon.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/wince_input_mon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wince_input_mon.h 2 Aug 2007 15:44:59 -0000 1.2 --- wince_input_mon.h 9 Feb 2009 19:39:17 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- RoadMapInput callback; int is_valid; + DWORD thread; } roadmap_main_io; *************** *** 17,19 **** --- 18,25 ---- DWORD WINAPI FileMonThread(LPVOID lpParam); + void roadmap_main_power_monitor_start(void); + void roadmap_main_power_monitor_stop(void); + + typedef void (*roadmap_power_callback) (void); + void roadmap_power_register(roadmap_power_callback func); #endif //__WINCE_SERIAL_ --- NEW FILE: roadmap_main.c --- /* * LICENSE: * * Copyright 2005 Ehud Shabtai * Copyright (c) 2008, 2009, Danny Backx * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License [...1225 lines suppressed...] } } static RoadMapCallback idle_callback; static int roadmap_main_set_idle_function_helper (void *data) { if (idle_callback) idle_callback(); return 0; } void roadmap_main_set_idle_function (RoadMapCallback callback) { idle_callback = callback; } void roadmap_main_remove_idle_function (void) { idle_callback = 0; } |
|
From: Danny B. <dan...@us...> - 2009-02-09 19:39:23
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv27104 Modified Files: options.mk Log Message: Replace C++ files by equivalent C files, we weren't really doing any C++. win32/Makefile : replace C++ compiler call by C compiler call. Options.mk : bump up the flag that indicates which version of WinCE we're using, to access stuff in the pm.h include file. This allows us to figure out when the device is being power cycled. (Note the code to actually use this is not in place yet.) Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** options.mk 5 Nov 2008 13:25:52 -0000 1.30 --- options.mk 9 Feb 2009 19:39:17 -0000 1.31 *************** *** 252,256 **** ifeq ($(DESKTOP),WINCE) CFLAGS += -I$(TOP) -I$(TOP)/win32 \ ! -DNDEBUG -D_WIN32_WCE=0x0300 -D_WIN32_IE=0x0300 \ -D_TXT=\".txt\" -D_EXE=\".exe\" LIBS := $(LIBS) -lm --- 252,256 ---- ifeq ($(DESKTOP),WINCE) CFLAGS += -I$(TOP) -I$(TOP)/win32 \ ! -DNDEBUG -D_WIN32_WCE=0x0400 -D_WIN32_IE=0x0300 \ -D_TXT=\".txt\" -D_EXE=\".exe\" LIBS := $(LIBS) -lm |
|
From: Danny B. <dan...@us...> - 2009-02-09 19:24:33
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv26087 Modified Files: roadmap_plugin.c roadmap_plugin.h Log Message: Upgrade the plugin mechanism in preparation for actually using it. Index: roadmap_plugin.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_plugin.h 26 Jun 2006 19:59:53 -0000 1.2 --- roadmap_plugin.h 9 Feb 2009 19:24:27 -0000 1.3 *************** *** 1,7 **** ! /* roadmap_plugin.h - plugin interfaces ! * * LICENSE: * * Copyright 2005 Ehud Shabtai * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2005 Ehud Shabtai + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,25 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * DESCRIPTION: * * There are two types: PluginLine and PluginStreet. These types are --- 20,28 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_plugin.h - plugin interfaces * * There are two types: PluginLine and PluginStreet. These types are *************** *** 74,87 **** } PluginStreetProperties; ! typedef struct { ! PluginLine line; ! int distance; ! RoadMapPosition from; ! RoadMapPosition to; ! RoadMapPosition intersection; ! } RoadMapNeighbour; #define PLUGIN_MAKE_LINE(plugin_id, line_id, layer, fips) \ --- 77,95 ---- } PluginStreetProperties; ! typedef struct RoadMapNeighbour_t { ! PluginLine line; ! int distance; ! RoadMapPosition from; ! RoadMapPosition to; ! RoadMapPosition intersection; ! } RoadMapNeighbour; ! #define INVALID_PLUGIN_ID -1 ! #define ROADMAP_PLUGIN_ID 0 ! #define PLUGIN_VALID(plugin) (plugin.plugin_id >= 0) ! #define INVALIDATE_PLUGIN(plugin) (plugin.plugin_id = -1) + #define PLUGIN_STREET_ONLY 0x1 #define PLUGIN_MAKE_LINE(plugin_id, line_id, layer, fips) \ *************** *** 93,96 **** --- 101,106 ---- + void roadmap_plugin_initialize_all_plugins (void); + int roadmap_plugin_same_line (const PluginLine *line1, const PluginLine *line2); *************** *** 127,131 **** int roadmap_plugin_get_distance (RoadMapPosition *point, PluginLine *line, ! RoadMapNeighbour *result); --- 137,141 ---- int roadmap_plugin_get_distance (RoadMapPosition *point, PluginLine *line, ! struct RoadMapNeighbour_t *result); *************** *** 147,151 **** typedef int (*plugin_get_distance_func) (const RoadMapPosition *point, PluginLine *line, ! RoadMapNeighbour *result); typedef void (*plugin_get_street_func) (const PluginLine *line, --- 157,161 ---- typedef int (*plugin_get_distance_func) (const RoadMapPosition *point, PluginLine *line, ! struct RoadMapNeighbour_t *result); typedef void (*plugin_get_street_func) (const PluginLine *line, *************** *** 165,183 **** (int layer, int thickness, int pen_count); ! typedef struct { ! const char *name; ! plugin_line_pos_func line_from; ! plugin_line_pos_func line_to; ! plugin_activate_db_func activate_db; ! plugin_get_distance_func get_distance; ! plugin_override_line_hook override_line; ! plugin_override_pen_hook override_pen; ! plugin_screen_repaint_hook screen_repaint; ! plugin_get_street_func get_street; ! plugin_street_full_name_func get_street_full_name; ! plugin_street_properties_func get_street_properties; ! plugin_find_connected_lines_func find_connected_lines; ! plugin_adjust_layer_hook adjust_layer; } RoadMapPluginHooks; --- 175,222 ---- (int layer, int thickness, int pen_count); ! typedef int (*plugin_get_closest_func) ! (const RoadMapPosition *position, ! int *categories, int categories_count, ! struct RoadMapNeighbour_t *neighbours, int count, ! int max); ! ! typedef int (*plugin_line_route_direction) (PluginLine *line, int who); ! ! typedef void (*plugin_shutdown) (void); ! typedef void (*plugin_initialize) (void); ! ! #include "roadmap_factory.h" ! ! typedef RoadMapAction *plugin_actions; ! typedef char **plugin_menu; ! typedef void (*plugin_after_refresh) (void); ! typedef void (*plugin_format_messages) (void); + /** + * @brief definition of a plugin + */ + typedef struct { + const char *name; /**< plugin name */ + const int size; /**< structure size, a failsafe */ + plugin_line_pos_func line_from; + plugin_line_pos_func line_to; + plugin_activate_db_func activate_db; + plugin_get_distance_func get_distance; + plugin_override_line_hook override_line; + plugin_override_pen_hook override_pen; + plugin_screen_repaint_hook screen_repaint; + plugin_get_street_func get_street; + plugin_street_full_name_func get_street_full_name; + plugin_street_properties_func get_street_properties; + plugin_find_connected_lines_func find_connected_lines; + plugin_adjust_layer_hook adjust_layer; + plugin_get_closest_func get_closest; + plugin_line_route_direction route_direction; + plugin_shutdown shutdown; + plugin_initialize initialize; + plugin_actions actions; /**< Additional actions */ + plugin_menu menu; /**< Additional menu definition */ + plugin_after_refresh after_refresh; /**< Call this after refresh */ + plugin_format_messages format_messages; /**< Display directions */ } RoadMapPluginHooks; *************** *** 205,209 **** const char *roadmap_plugin_street_full_name (PluginLine *line); ! void roadmap_plugin_get_street_properties (PluginLine *line, PluginStreetProperties *props); --- 244,248 ---- const char *roadmap_plugin_street_full_name (PluginLine *line); ! void roadmap_plugin_get_street_properties (const PluginLine *line, PluginStreetProperties *props); *************** *** 216,219 **** int pen_count); ! #endif /* INCLUDED__ROADMAP_PLUGIN__H */ --- 255,289 ---- int pen_count); ! int roadmap_plugin_get_closest ! (const RoadMapPosition *position, ! int *categories, ! int categories_count, ! struct RoadMapNeighbour_t *neighbours, ! int count, ! int max); ! ! int roadmap_plugin_get_direction (PluginLine *line, int who); ! ! int roadmap_plugin_calc_length (const RoadMapPosition *position, ! const PluginLine *line, ! int *total_length); ! ! void roadmap_plugin_shutdown (void); ! ! typedef void (*roadmap_plugin_action_menu_handler) (RoadMapAction *, const char **); ! ! void roadmap_plugin_actions_menu(roadmap_plugin_action_menu_handler); ! ! char *roadmap_plugin_list_all_plugins(void); ! void roadmap_plugin_after_refresh(); ! void roadmap_plugin_format_messages(); + #ifdef HAVE_NAVIGATE_PLUGIN + void roadmap_plugin_get_line_points (const PluginLine *line, + RoadMapPosition *from_pos, + RoadMapPosition *to_pos, + int *first_shape, + int *last_shape, + RoadMapShapeItr *shape_itr); + #endif + #endif /* INCLUDED__ROADMAP_PLUGIN__H */ Index: roadmap_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_plugin.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_plugin.c 3 Aug 2007 21:39:48 -0000 1.4 --- roadmap_plugin.c 9 Feb 2009 19:24:27 -0000 1.5 *************** *** 1,7 **** ! /* roadmap_plugin.c - plugin layer ! * * LICENSE: * * Copyright 2005 Ehud Shabtai * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2005 Ehud Shabtai + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,73 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * SYNOPSYS: - * - * See roadmap_plugin.h. */ #include <assert.h> #include <stdlib.h> #include "roadmap.h" #include "roadmap_line.h" #include "roadmap_locator.h" #include "roadmap_street.h" ! #include "roadmap_plugin.h" #define MAX_PLUGINS 10 ! static RoadMapPluginHooks *hooks[MAX_PLUGINS] = {0}; static int PluginCount = 0; static RoadMapPluginHooks *get_hooks (int id) { assert (id < MAX_PLUGINS); ! return hooks[id]; } ! int roadmap_plugin_register (RoadMapPluginHooks *hook) { int i; for (i=1; i<MAX_PLUGINS; i++) { ! if (hooks[i] == NULL) { ! hooks[i] = hook; PluginCount = i; return i; } } return -1; } ! void roadmap_plugin_unregister (int plugin_id) { ! hooks[plugin_id] = NULL; } int roadmap_plugin_same_line (const PluginLine *line1, const PluginLine *line2) { --- 20,161 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + /** + * @file + * @brief roadmap_plugin.c - plugin layer + */ #include <assert.h> #include <stdlib.h> + #include <string.h> #include "roadmap.h" #include "roadmap_line.h" #include "roadmap_locator.h" #include "roadmap_street.h" ! #include "roadmap_shape.h" ! #include "roadmap_file.h" ! #include "roadmap_library.h" #include "roadmap_plugin.h" + #ifdef HAVE_NAVIGATE_PLUGIN + #include "roadmap_line_route.h" + #endif + #include "roadmap_messagebox.h" #define MAX_PLUGINS 10 ! /** ! * @brief an internal structure to hide private fields in ! */ ! typedef struct RoadMapPrivateHooks { ! int initialized; /**< */ ! RoadMapPluginHooks *plugin; /**< */ ! } RoadMapPrivateHooks; ! ! // static RoadMapPluginHooks *hooks[MAX_PLUGINS] = {0}; ! static RoadMapPrivateHooks hooks[MAX_PLUGINS]; static int PluginCount = 0; + /** + * @brief access function for the plugin hooks structures, guards array size and initialisation + * @param id the plugin selected + * @return a pointer to the plugin structure + */ static RoadMapPluginHooks *get_hooks (int id) { assert (id < MAX_PLUGINS); ! /* This make sure we don't call a plugin method before the plugins are initialized. ! * An exception to this : the roadmap_plugin_actions_menu function. ! */ ! if (hooks[id].initialized) ! return hooks[id].plugin; ! return NULL; } ! /** ! * @brief register a plugin ! * @param hook the plugin structure ! * @return an identifier for this plugin ! */ int roadmap_plugin_register (RoadMapPluginHooks *hook) { int i; + + roadmap_log(ROADMAP_WARNING, "roadmap_plugin_register(%s)", hook->name); + if (PluginCount == 0) { + for (i=1; i<MAX_PLUGINS; i++) { + hooks[i].initialized = 0; + hooks[i].plugin = NULL; + } + } + + if (hook->size != sizeof(RoadMapPluginHooks)) { + roadmap_log(ROADMAP_FATAL, "Size of hook for plugin '%s' is invalid (%d, should be %d)", + hook->name, + hook->size, + sizeof(RoadMapPluginHooks)); + } + for (i=1; i<MAX_PLUGINS; i++) { ! if (hooks[i].plugin == NULL) { ! hooks[i].plugin= hook; ! hooks[i].initialized = 0; PluginCount = i; + roadmap_log (ROADMAP_DEBUG, "roadmap_plugin_register(%s) -> %d", + hook->name, i); return i; } } + roadmap_log (ROADMAP_WARNING, "roadmap_plugin_register: too many plugins"); return -1; } ! /** ! * @brief stop using some plugin ! * @param plugin_id identifier for the plugin ! */ void roadmap_plugin_unregister (int plugin_id) { ! hooks[plugin_id].plugin = NULL; ! hooks[plugin_id].initialized = -1; } + /** + * @brief list the active plugins + * @return a string that should be freed by the caller + */ + char *roadmap_plugin_list_all_plugins(void) + { + int i, len; + char *r, num[8]; + + for (i=len=0; i<=PluginCount; i++) { + if (hooks[i].initialized && hooks[i].plugin && hooks[i].plugin->name) + len += strlen(hooks[i].plugin->name) + 10; + } + r = malloc(len); + r[0] = '\0'; + for (i=0; i<=PluginCount; i++) + if (hooks[i].initialized && hooks[i].plugin && hooks[i].plugin->name) { + sprintf(num, "%d - ", i); + strcat(r, num); + strcat(r, hooks[i].plugin->name); + #ifdef _WIN32 + strcat(r, "\r\n"); + #else + strcat(r, "\n"); + #endif + } + return r; + } + /** + * @brief + * @param line1 + * @param line2 + * @return + */ int roadmap_plugin_same_line (const PluginLine *line1, const PluginLine *line2) { *************** *** 78,82 **** } ! int roadmap_plugin_same_street (const PluginStreet *street1, const PluginStreet *street2) { --- 166,175 ---- } ! /** ! * @brief ! * @param street1 ! * @param street2 ! * @return ! */ int roadmap_plugin_same_street (const PluginStreet *street1, const PluginStreet *street2) { *************** *** 86,109 **** } ! int roadmap_plugin_get_id (const PluginLine *line) { return line->plugin_id; } ! int roadmap_plugin_get_fips (const PluginLine *line) { return line->fips; } ! int roadmap_plugin_get_line_id (const PluginLine *line) { return line->line_id; } int roadmap_plugin_get_street_id (const PluginStreet *street) { return street->street_id; } ! void roadmap_plugin_set_line (PluginLine *line, int plugin_id, --- 179,227 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ int roadmap_plugin_get_id (const PluginLine *line) { return line->plugin_id; } ! /** ! * @brief ! * @param line ! * @return ! */ int roadmap_plugin_get_fips (const PluginLine *line) { return line->fips; } ! /** ! * @brief ! * @param line ! * @return ! */ int roadmap_plugin_get_line_id (const PluginLine *line) { return line->line_id; } + /** + * @brief + * @param street + * @return + */ int roadmap_plugin_get_street_id (const PluginStreet *street) { return street->street_id; } ! /** ! * @brief ! * @param line ! * @param plugin_id ! * @param line_id ! * @param layer ! * @param fips ! * @return ! */ void roadmap_plugin_set_line (PluginLine *line, int plugin_id, *************** *** 118,122 **** } ! void roadmap_plugin_set_street (PluginStreet *street, int plugin_id, --- 236,246 ---- } ! /** ! * @brief ! * @param street ! * @param plugin_id ! * @param street_id ! * @return ! */ void roadmap_plugin_set_street (PluginStreet *street, int plugin_id, *************** *** 127,131 **** } ! int roadmap_plugin_activate_db (const PluginLine *line) { --- 251,259 ---- } ! /** ! * @brief ! * @param line ! * @return ! */ int roadmap_plugin_activate_db (const PluginLine *line) { *************** *** 139,145 **** } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 267,273 ---- } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 148,153 **** } ! if (hooks->activate_db != NULL) { ! return (*hooks->activate_db) (line); } --- 276,281 ---- } ! if (hp->activate_db != NULL) { ! return (*hp->activate_db) (line); } *************** *** 157,185 **** ! int roadmap_plugin_get_distance ! (RoadMapPosition *point, ! PluginLine *line, ! RoadMapNeighbour *result) { ! if (line->plugin_id == ROADMAP_PLUGIN_ID) { ! ! return roadmap_street_get_distance ! (point, ! line->line_id, ! line->layer, ! result); } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); ! ! if (hooks == NULL) { ! roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", ! line->plugin_id); ! return 0; } ! if (hooks->get_distance != NULL) { ! return (*hooks->get_distance) (point, line, result); } --- 285,309 ---- ! /** ! * @brief calculate the distance between a point and a line ! * @param point the point to use ! * @param line the line to use ! * @param result store results in this structure ! * @result whether something sensible was found ! */ ! int roadmap_plugin_get_distance (RoadMapPosition *point, PluginLine *line, RoadMapNeighbour *result) ! { if (line->plugin_id == ROADMAP_PLUGIN_ID) { ! return roadmap_street_get_distance (point, line->line_id, line->layer, result); } else { + RoadMapPluginHooks *hp = get_hooks (line->plugin_id); ! if (hp == NULL) { ! roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); return 0; } ! if (hp->get_distance != NULL) { ! return (*hp->get_distance) (point, line, result); } *************** *** 195,201 **** roadmap_line_from (line->line_id, pos); } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 319,325 ---- roadmap_line_from (line->line_id, pos); } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 205,210 **** } ! if (hooks->line_from != NULL) { ! (*hooks->line_from) (line, pos); } else { --- 329,334 ---- } ! if (hp->line_from != NULL) { ! (*hp->line_from) (line, pos); } else { *************** *** 223,229 **** roadmap_line_to (line->line_id, pos); } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 347,353 ---- roadmap_line_to (line->line_id, pos); } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 233,238 **** } ! if (hooks->line_to != NULL) { ! (*hooks->line_to) (line, pos); } else { --- 357,362 ---- } ! if (hp->line_to != NULL) { ! (*hp->line_to) (line, pos); } else { *************** *** 251,260 **** for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hooks = get_hooks (i); ! if (hooks == NULL) continue; ! if (hooks->override_line != NULL) { ! int res = hooks->override_line (line, layer, fips); if (res) return res; --- 375,384 ---- for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp == NULL) continue; ! if (hp->override_line != NULL) { ! int res = hp->override_line (line, layer, fips); if (res) return res; *************** *** 275,284 **** for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hooks = get_hooks (i); ! if (hooks == NULL) continue; ! if (hooks->override_pen != NULL) { ! int res = hooks->override_pen (line, layer, fips, pen_type, override_pen); --- 399,408 ---- for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp == NULL) continue; ! if (hp->override_pen != NULL) { ! int res = hp->override_pen (line, layer, fips, pen_type, override_pen); *************** *** 297,304 **** for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hooks = get_hooks (i); ! if ((hooks == NULL) || (hooks->screen_repaint == NULL)) continue; ! hooks->screen_repaint (max_pen); } } --- 421,428 ---- for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if ((hp == NULL) || (hp->screen_repaint == NULL)) continue; ! hp->screen_repaint (max_pen); } } *************** *** 316,323 **** } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); street->plugin_id = line->plugin_id; ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 440,447 ---- } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); street->plugin_id = line->plugin_id; ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 327,332 **** } ! if (hooks->get_street != NULL) { ! (*hooks->get_street) (line, street); } else { --- 451,456 ---- } ! if (hp->get_street != NULL) { ! (*hp->get_street) (line, street); } else { *************** *** 349,355 **** } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 473,479 ---- } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 358,363 **** } ! if (hooks->get_street_full_name != NULL) { ! return (*hooks->get_street_full_name) (line); } --- 482,487 ---- } ! if (hp->get_street_full_name != NULL) { ! return (*hp->get_street_full_name) (line); } *************** *** 366,376 **** } ! ! void roadmap_plugin_get_street_properties (PluginLine *line, ! PluginStreetProperties *props) { if (line->plugin_id == ROADMAP_PLUGIN_ID) { RoadMapStreetProperties rm_properties; roadmap_street_get_properties (line->line_id, &rm_properties); --- 490,501 ---- } ! void roadmap_plugin_get_street_properties (const PluginLine *line, ! PluginStreetProperties *props) ! { if (line->plugin_id == ROADMAP_PLUGIN_ID) { RoadMapStreetProperties rm_properties; + roadmap_street_get_properties (line->line_id, &rm_properties); *************** *** 384,388 **** } else { ! RoadMapPluginHooks *hooks = get_hooks (line->plugin_id); props->address = ""; --- 509,513 ---- } else { ! RoadMapPluginHooks *hp = get_hooks (line->plugin_id); props->address = ""; *************** *** 390,394 **** props->city = ""; ! if (hooks == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); --- 515,519 ---- props->city = ""; ! if (hp == NULL) { roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.", line->plugin_id); *************** *** 397,402 **** } ! if (hooks->get_street_properties != NULL) { ! (*hooks->get_street_properties) (line, props); } --- 522,527 ---- } ! if (hp->get_street_properties != NULL) { ! (*hp->get_street_properties) (line, props); } *************** *** 405,413 **** } - int roadmap_plugin_find_connected_lines (RoadMapPosition *crossing, PluginLine *plugin_lines, ! int max) { ! int i; int count = 0; --- 530,537 ---- } int roadmap_plugin_find_connected_lines (RoadMapPosition *crossing, PluginLine *plugin_lines, ! int max) ! { int i; int count = 0; *************** *** 415,424 **** for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hooks = get_hooks (i); ! if ((hooks == NULL) || (hooks->find_connected_lines == NULL)) continue; ! ! count += ! hooks->find_connected_lines ! (crossing, plugin_lines + count, max - count); } --- 539,545 ---- for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp && hp->find_connected_lines) ! count += hp->find_connected_lines (crossing, plugin_lines + count, max - count); } *************** *** 426,441 **** } ! void roadmap_plugin_adjust_layer (int layer, ! int thickness, ! int pen_count) { int i; for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hooks = get_hooks (i); ! if ((hooks == NULL) || (hooks->adjust_layer == NULL)) continue; ! hooks->adjust_layer (layer, thickness, pen_count); } } --- 547,642 ---- } ! void roadmap_plugin_adjust_layer (int layer, int thickness, int pen_count) ! { ! int i; ! for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp && hp->adjust_layer) ! hp->adjust_layer (layer, thickness, pen_count); ! } ! } + void roadmap_plugin_format_messages (void) + { int i; for (i=1; i<=PluginCount; i++) { + RoadMapPluginHooks *hp = get_hooks (i); + if (hp && hp->format_messages) + hp->format_messages (); + } + } ! void roadmap_plugin_after_refresh (void) ! { ! int i; ! for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp && hp->adjust_layer) ! hp->after_refresh (); ! } ! } ! ! int roadmap_plugin_get_closest ! (const RoadMapPosition *position, ! int *categories, int categories_count, ! RoadMapNeighbour *neighbours, int count, ! int max) ! { ! int i; ! ! for (i=1; i<=PluginCount; i++) { ! RoadMapPluginHooks *hp = get_hooks (i); ! if (hp == NULL) continue; ! ! if (hp->get_closest != NULL) { ! ! count = hp->get_closest ! (position, categories, categories_count, ! neighbours, count, max); ! } } + + return count; + } + + /** + * @brief call the "factory" handler to register actions and menu items + * Note that this function avoids using get_hooks() so it can work before plugin initialize. + * + * @param handler the handler function from roadmap_factory. + */ + void roadmap_plugin_actions_menu(roadmap_plugin_action_menu_handler handler) + { + int i; + + for (i=1; i<=PluginCount; i++) { + RoadMapPluginHooks *hp = hooks[i].plugin; + if (hp == NULL) + continue; + /* + * Only call this if both actions and menu are supplied. + * This matches the current implementation of roadmap_factory.c where + * plugin menus can only use their own actions. + */ + if (hp->actions == NULL || hp->menu == NULL) + continue; + (*handler)(hp->actions, hp->menu); + } } + void roadmap_plugin_initialize_all_plugins(void) + { + int id; + RoadMapPluginHooks *p; + + for (id=1; id<= PluginCount; id++) { + p = hooks[id].plugin; + if (!p) + continue; + roadmap_log(ROADMAP_DEBUG, "roadmap_plugin_initialize(%s)", p->name); + if (p->initialize) + p->initialize(); + hooks[id].initialized = 1; + } + } |