You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Paul F. <pg...@us...> - 2006-07-20 03:14:43
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3745 Modified Files: roadmap_linefont.c Log Message: ensure font is loaded before printing. oops. Index: roadmap_linefont.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_linefont.c 13 Jul 2006 18:09:35 -0000 1.3 --- roadmap_linefont.c 20 Jul 2006 03:14:39 -0000 1.4 *************** *** 253,256 **** --- 253,260 ---- const char *t; + if (fontp == 0) { + roadmap_load_hershey_font(); + } + /* scale factor ... */ scale = 1024 * size / (hf->maxy - hf->miny); |
From: Paul F. <pg...@us...> - 2006-07-20 03:13:30
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3308 Modified Files: config.mk Log Message: typo fix Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** config.mk 13 Jul 2006 15:47:53 -0000 1.8 --- config.mk 20 Jul 2006 03:13:25 -0000 1.9 *************** *** 40,44 **** # some Familiar builds), set QT_NO_ROTATE. RoadMap will then use # its internal labeling font. Unfortunately, QT's line drawing ! # makes the internal font is particularly hard to read. You may # also wish to add "CFLAGS += -DROADMAP_NO_LINEFONT" to force # horizionatl labels. --- 40,44 ---- # some Familiar builds), set QT_NO_ROTATE. RoadMap will then use # its internal labeling font. Unfortunately, QT's line drawing ! # makes the internal font particularly hard to read. You may # also wish to add "CFLAGS += -DROADMAP_NO_LINEFONT" to force # horizionatl labels. |
From: Paul F. <pg...@us...> - 2006-07-19 18:30:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv21439 Modified Files: roadmap_math.c Log Message: fix debug message error Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** roadmap_math.c 13 Jul 2006 13:30:33 -0000 1.36 --- roadmap_math.c 19 Jul 2006 18:30:23 -0000 1.37 *************** *** 1079,1083 **** RoadMapContext.current_screen.south, RoadMapContext.current_screen.east, ! RoadMapContext.current_screen.east); #endif return status; --- 1079,1083 ---- RoadMapContext.current_screen.south, RoadMapContext.current_screen.east, ! RoadMapContext.current_screen.west); #endif return status; |
From: Paul F. <pg...@us...> - 2006-07-18 11:49:42
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1401 Modified Files: roadmap_trip.c Log Message: make "backtrack" routes go the right direction: i.e., back from current location to start of track. Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** roadmap_trip.c 17 Jul 2006 20:57:21 -0000 1.52 --- roadmap_trip.c 18 Jul 2006 11:49:38 -0000 1.53 *************** *** 2184,2188 **** static void roadmap_trip_route_convert_worker ! (route_head *orig_route, char *new_name, int simplify, int wanttrack) { int dropped = 0; --- 2184,2189 ---- static void roadmap_trip_route_convert_worker ! (route_head *orig_route, char *new_name, ! int simplify, int wanttrack, int reverse) { int dropped = 0; *************** *** 2203,2206 **** --- 2204,2210 ---- } + if (reverse) { + route_reverse(new_route); + } if (wanttrack) { *************** *** 2243,2247 **** } ! roadmap_trip_route_convert_worker (RoadMapCurrentRoute, namep, 0, 0); } --- 2247,2251 ---- } ! roadmap_trip_route_convert_worker (RoadMapCurrentRoute, namep, 0, 0, 0); } *************** *** 2261,2265 **** } ! roadmap_trip_route_convert_worker (RoadMapCurrentRoute, namep, 1, 0); } --- 2265,2269 ---- } ! roadmap_trip_route_convert_worker (RoadMapCurrentRoute, namep, 1, 0, 0); } *************** *** 2275,2279 **** localtime(&now)); ! roadmap_trip_route_convert_worker (RoadMapTrack, name, 0, 0); } --- 2279,2283 ---- localtime(&now)); ! roadmap_trip_route_convert_worker (RoadMapTrack, name, 0, 0, 1); } *************** *** 2289,2293 **** localtime(&now)); ! roadmap_trip_route_convert_worker (RoadMapTrack, name, 0, 1); } --- 2293,2297 ---- localtime(&now)); ! roadmap_trip_route_convert_worker (RoadMapTrack, name, 0, 1, 0); } |
From: Paul F. <pg...@us...> - 2006-07-18 11:22:27
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23313 Modified Files: roadmap_list.h Log Message: comment fix Index: roadmap_list.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_list.h 17 Jul 2006 20:57:21 -0000 1.5 --- roadmap_list.h 18 Jul 2006 11:22:21 -0000 1.6 *************** *** 120,124 **** /* Anything attached to oldhead will be re-anchord at newhead. ! * newhead will be cleared, and anything at newhead will be lost. */ #define ROADMAP_LIST_MOVE(newhead,oldhead) \ --- 120,125 ---- /* Anything attached to oldhead will be re-anchord at newhead. ! * oldhead will be cleared, and anything previously at newhead ! * will be lost. */ #define ROADMAP_LIST_MOVE(newhead,oldhead) \ |
From: Paul F. <pg...@us...> - 2006-07-17 20:57:28
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30284 Modified Files: options.mk roadmap_gpx.c roadmap_gpx.h roadmap_landmark.c roadmap_landmark.h roadmap_list.c roadmap_list.h roadmap_track.c roadmap_trip.c Log Message: merge the linked list implementations from the gpx subdir and from roadmap_list.h. preserve the "fully-linked" nature of the gpx lists, as well as the type safety of the roadmap_list.h lists. Index: roadmap_list.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_list.c 15 Jul 2006 16:56:12 -0000 1.3 --- roadmap_list.c 17 Jul 2006 20:57:21 -0000 1.4 *************** *** 3,10 **** * LICENSE: * - * Copyright 2002 Pascal F. Martin * * 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 --- 3,18 ---- * LICENSE: * * * This file is part of RoadMap. * + * Current linked list implementation borrowed from gpsbabel's + * queue.c, which is: + * Copyright (C) 2002 Robert Lipe, rob...@us... + * + * Previous implementation, and API spec, + * Copyright 2002 Pascal F. Martin + * + * Merge done by Paul Fox, 2006 + * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by *************** *** 26,88 **** */ - #include <stdlib.h> - - #include "roadmap.h" #include "roadmap_list.h" ! ! void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item) { ! ! item->next = list->first; ! ! if (list->first == NULL) { ! list->last = item; ! list->first = item; ! } else { ! list->first->previous = item; ! } ! item->previous = NULL; ! list->first = item; } ! void roadmap_list_append (RoadMapList *list, RoadMapListItem *item) { ! ! item->previous = list->last; ! ! if (list->last == NULL) { ! list->first = item; ! list->last = item; ! } else { ! list->last->next = item; ! } ! item->next = NULL; ! list->last = item; ! } ! RoadMapListItem *roadmap_list_remove (RoadMapList *list, RoadMapListItem *item) { ! ! if (item->previous == NULL) { ! list->first = item->next; ! } else { ! item->previous->next = item->next; ! } ! if (item->next == NULL) { ! list->last = item->previous; ! } else { ! item->next->previous = item->previous; ! } ! return item; } ! int roadmap_list_count (const RoadMapList *list) { ! ! int count = 0; ! RoadMapListItem *item; ! ! for (item = list->first; item != NULL; item = item->next) { ! count +=1; ! } ! return count; } --- 34,69 ---- */ #include "roadmap_list.h" ! /* places "new" after "existing" */ ! void roadmap_list_enqueue(RoadMapListItem *new, RoadMapListItem *existing) ! { ! new->next = existing->next; ! new->prev = (RoadMapListItem *)existing; ! existing->next->prev = new; ! existing->next = new; } + RoadMapListItem * roadmap_list_remove(RoadMapListItem *element) + { + queue *prev = element->prev; + queue *next = element->next; ! next->prev = prev; ! prev->next = next; + element->prev = element->next = element; ! return element; } ! int roadmap_list_count(const RoadMapList *qh) ! { ! RoadMapListItem *e; ! int i = 0; ! ! for (e = QUEUE_FIRST(qh); e != (queue *)qh; e = QUEUE_NEXT(e)) ! i++; ! ! return i; } Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_landmark.c 3 Jul 2006 17:10:35 -0000 1.5 --- roadmap_landmark.c 17 Jul 2006 20:57:21 -0000 1.6 *************** *** 34,38 **** #include "roadmap_landmark.h" ! queue RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; --- 34,38 ---- #include "roadmap_landmark.h" ! RoadMapList RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; *************** *** 69,73 **** int roadmap_landmark_count() { ! return queue_count(&RoadMapLandmarkHead); } --- 69,73 ---- int roadmap_landmark_count() { ! return roadmap_list_count(&RoadMapLandmarkHead); } *************** *** 92,96 **** ! queue * roadmap_landmark_list(void) { // hack -- if roadmap_trip asked for the list, it's possible // someone is doing an edit. we don't get informed of the actual --- 92,96 ---- ! RoadMapList * roadmap_landmark_list(void) { // hack -- if roadmap_trip asked for the list, it's possible // someone is doing an edit. we don't get informed of the actual *************** *** 147,151 **** const char *trip_path = NULL; ! queue tmp_waypoint_list; int ret; --- 147,151 ---- const char *trip_path = NULL; ! RoadMapList tmp_waypoint_list; int ret; *************** *** 156,160 **** ! QUEUE_INIT(&tmp_waypoint_list); ret = roadmap_gpx_read_waypoints(trip_path, name, &tmp_waypoint_list); --- 156,160 ---- ! ROADMAP_LIST_INIT(&tmp_waypoint_list); ret = roadmap_gpx_read_waypoints(trip_path, name, &tmp_waypoint_list); *************** *** 165,169 **** } ! QUEUE_SPLICE(&RoadMapLandmarkHead, &tmp_waypoint_list); RoadMapLandmarkModified = 1; --- 165,169 ---- } ! ROADMAP_LIST_SPLICE(&RoadMapLandmarkHead, &tmp_waypoint_list); RoadMapLandmarkModified = 1; *************** *** 195,199 **** const char *name; const char *path = roadmap_path_user(); ! queue tmp_waypoint_list; int defaulted, ret; --- 195,199 ---- const char *name; const char *path = roadmap_path_user(); ! RoadMapList tmp_waypoint_list; int defaulted, ret; *************** *** 202,206 **** if ( ! roadmap_file_exists (path, name) && defaulted) return; ! QUEUE_INIT(&tmp_waypoint_list); ret = roadmap_gpx_read_waypoints(path, name, &tmp_waypoint_list); --- 202,206 ---- if ( ! roadmap_file_exists (path, name) && defaulted) return; ! ROADMAP_LIST_INIT(&tmp_waypoint_list); ret = roadmap_gpx_read_waypoints(path, name, &tmp_waypoint_list); *************** *** 217,221 **** waypt_flush_queue (&RoadMapLandmarkHead); ! QUEUE_MOVE(&RoadMapLandmarkHead, &tmp_waypoint_list); RoadMapLandmarkModified = 0; --- 217,221 ---- waypt_flush_queue (&RoadMapLandmarkHead); ! ROADMAP_LIST_MOVE(&RoadMapLandmarkHead, &tmp_waypoint_list); RoadMapLandmarkModified = 0; *************** *** 230,234 **** ("preferences", &RoadMapConfigLandmarkName, ""); ! QUEUE_INIT(&RoadMapLandmarkHead); } --- 230,234 ---- ("preferences", &RoadMapConfigLandmarkName, ""); ! ROADMAP_LIST_INIT(&RoadMapLandmarkHead); } Index: roadmap_landmark.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_landmark.h 8 Dec 2005 21:13:55 -0000 1.2 --- roadmap_landmark.h 17 Jul 2006 20:57:21 -0000 1.3 *************** *** 34,38 **** void roadmap_landmark_add(waypoint *waypointp); void roadmap_landmark_remove(waypoint *waypointp); ! queue * roadmap_landmark_list(void); int roadmap_landmark_is_refresh_needed (void); --- 34,38 ---- void roadmap_landmark_add(waypoint *waypointp); void roadmap_landmark_remove(waypoint *waypointp); ! RoadMapList * roadmap_landmark_list(void); int roadmap_landmark_is_refresh_needed (void); Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** options.mk 13 Jul 2006 13:30:33 -0000 1.5 --- options.mk 17 Jul 2006 20:57:21 -0000 1.6 *************** *** 55,59 **** # variable MALLOC_TRACE, then use the mtrace tool to # analyze the output. ! CFLAGS += -g -DROADMAP_DEBUG_HEAP else ifeq ($(strip $(MODE)),PROFILE) --- 55,59 ---- # variable MALLOC_TRACE, then use the mtrace tool to # analyze the output. ! CFLAGS += -g -DROADMAP_DEBUG_HEAP -DROADMAP_LISTS_TYPESAFE else ifeq ($(strip $(MODE)),PROFILE) Index: roadmap_list.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_list.h 15 Jul 2006 16:56:12 -0000 1.4 --- roadmap_list.h 17 Jul 2006 20:57:21 -0000 1.5 *************** *** 5,8 **** --- 5,12 ---- * Copyright 2002 Pascal F. Martin * + * Merged with queue.h, from the gpsbabel program, which is + * Copyright (C) 2002-2005 Robert Lipe, rob...@us... + * by Paul Fox, 2006. + * * This file is part of RoadMap. * *************** *** 26,53 **** #define INCLUDE__ROADMAP_LIST__H struct roadmap_list_link { struct roadmap_list_link *next; ! struct roadmap_list_link *previous; }; typedef struct roadmap_list_link RoadMapListItem; ! struct roadmap_list_head { ! struct roadmap_list_link *first; ! struct roadmap_list_link *last; }; typedef struct roadmap_list_head RoadMapList; - - #define ROADMAP_LIST_EMPTY {NULL, NULL} ! #define ROADMAP_LIST_IS_EMPTY(l) ((l)->first == NULL) - void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item); - void roadmap_list_append (RoadMapList *list, RoadMapListItem *item); - RoadMapListItem *roadmap_list_remove (RoadMapList *list, RoadMapListItem *item); - int roadmap_list_count (const RoadMapList *list); #endif // INCLUDE__ROADMAP_LIST__H --- 30,199 ---- #define INCLUDE__ROADMAP_LIST__H + /* Linked lists are fully circular -- no pointer is ever NULL. + * When empty, a list head's "list_first" and "list_last" + * pointers point at the list head itself. + * + * The head of a list is identical to any element in the list. + * To aid in debugging, the head is given a different type -- + * this helps reduce confusion when calling the insert/remove + * routines, by letting the compiler enforce type safety. + * + * However, the gcc optimizer complains about some of the casts + * ("dereferencing type-punned pointer will break strict-aliasing + * rules") when the list head and the items have separate + * typedefs. So, when optimizing, we simply declare them both as + * the same thing. + * + * [ Neither Pascal's nor Robert Lipe's original code had this + * problem. The former was always typesafe, and the latter + * always unsafe. So the current situation is my fault. -pgf ] + */ + + struct roadmap_list_link { struct roadmap_list_link *next; ! struct roadmap_list_link *prev; }; typedef struct roadmap_list_link RoadMapListItem; ! ! #if ROADMAP_LISTS_TYPESAFE ! ! /* Separate list-head structure. */ struct roadmap_list_head { ! struct roadmap_list_link *list_first; ! struct roadmap_list_link *list_last; }; typedef struct roadmap_list_head RoadMapList; ! #else ! ! /* Use the same struct for both the list head and the items. */ ! #define list_first next ! #define list_last prev ! typedef struct roadmap_list_link RoadMapList; + #endif + + /* List heads must be initialized before first use. This + * initialization could be done with a declaration like: + * RoadMapList MyListHead = + * { (RoadMapListItem *)&MyListHead, (RoadMapListItem *)&MyListHead }; + * but the runtime macro seems cleaner: + */ + #define ROADMAP_LIST_INIT(head) (head)->list_first = \ + ((head)->list_last = (queue *)head) + + /* The enqueue routine works on both list heads and list items. The + * assumption is that the two are isomorphic. + */ + void roadmap_list_enqueue(RoadMapListItem *before, RoadMapListItem *after); + + /* Removes an item from whatever list it's part of */ + RoadMapListItem *roadmap_list_remove(RoadMapListItem *item); + + /* Returns the number of elements in a list */ + int roadmap_list_count(const RoadMapList *list); + + /* Inline functions (not macros) to help enforce type safety. */ + static inline void roadmap_list_append(RoadMapList *lh, RoadMapListItem *e) { + roadmap_list_enqueue(e, (RoadMapListItem *)lh->list_last); + } + static inline void roadmap_list_insert(RoadMapList *lh, RoadMapListItem *e) { + roadmap_list_enqueue(e, (RoadMapListItem *)lh); + } + static inline void roadmap_list_put_before + (RoadMapListItem *olde, RoadMapListItem *newe) { + roadmap_list_enqueue(newe, olde->prev); + } + static inline void roadmap_list_put_after + (RoadMapListItem *olde, RoadMapListItem *newe) { + roadmap_list_enqueue(newe, olde); + } + + #define ROADMAP_LIST_FIRST(head) ((head)->list_first) + #define ROADMAP_LIST_LAST(head) ((head)->list_last) + #define ROADMAP_LIST_NEXT(element) ((element)->next) + #define ROADMAP_LIST_PREV(element) ((element)->prev) + #define ROADMAP_LIST_EMPTY(head) ((head)->list_first == (RoadMapListItem *)(head)) + + /* Anything attached to oldhead will be re-anchord at newhead. + * newhead will be cleared, and anything at newhead will be lost. + */ + #define ROADMAP_LIST_MOVE(newhead,oldhead) \ + if ( ROADMAP_LIST_EMPTY(oldhead) ) {\ + ROADMAP_LIST_INIT(newhead); \ + } \ + else { \ + (newhead)->list_first = (oldhead)->list_first; \ + (newhead)->list_last = (oldhead)->list_last; \ + (newhead)->list_first->prev = (RoadMapListItem *)(newhead); \ + (newhead)->list_last->next = (RoadMapListItem *)(newhead); \ + } \ + ROADMAP_LIST_INIT(oldhead) + + /* Anything attached to fromhead will be appended at the end of tohead. + * fromhead is emptied. + */ + #define ROADMAP_LIST_SPLICE(tohead,fromhead) \ + if ( !ROADMAP_LIST_EMPTY(fromhead) ) {\ + (tohead)->list_last->next = (RoadMapListItem *)(fromhead)->list_first; \ + (fromhead)->list_first->prev = (RoadMapListItem *)(tohead)->list_last; \ + (fromhead)->list_last->next = (RoadMapListItem *)(tohead); \ + (tohead)->list_last = (fromhead)->list_last; \ + } \ + ROADMAP_LIST_INIT(fromhead) + + #define ROADMAP_LIST_FOR_EACH(listhead, element, tmp) \ + for ((element) = ROADMAP_LIST_FIRST(listhead); \ + (tmp) = ROADMAP_LIST_NEXT(element), \ + (element) != (RoadMapListItem *)(listhead); \ + (element) = (tmp)) + + #define ROADMAP_LIST_FOR_EACH_FROM_TO(from, to, element, tmp) \ + for ((element) = (from); \ + (tmp) = ROADMAP_LIST_NEXT(element), \ + (element) != (RoadMapListItem *)(to); \ + (element) = (tmp)) + + + /* The rest of the definitions below are to retain source + * compatibility for the GPX files, which came originally from + * gpsbabel + */ + + typedef struct roadmap_list_link queue; + #if ROADMAP_LISTS_TYPESAFE + typedef struct roadmap_list_head queue_head; + #else + typedef struct roadmap_list_link queue_head; + #endif + + #define QUEUE_INIT(head) ROADMAP_LIST_INIT(head) + #define QUEUE_FIRST(head) ROADMAP_LIST_FIRST(head) + #define QUEUE_LAST(head) ROADMAP_LIST_LAST(head) + #define QUEUE_EMPTY(head) ROADMAP_LIST_EMPTY(head) + #define QUEUE_NEXT(element) ROADMAP_LIST_NEXT(element) + #define QUEUE_PREV(element) ROADMAP_LIST_PREV(element) + + #define ENQUEUE_TAIL(listhead, newelement) \ + roadmap_list_append(listhead, newelement) + #define ENQUEUE_HEAD(listhead, newelement) \ + roadmap_list_insert(listhead, newelement) + #define ENQUEUE_AFTER(element, newelement) \ + roadmap_list_put_after(element, newelement) + #define ENQUEUE_BEFORE(element, newelement) \ + roadmap_list_put_before(element, newelement) + + #define QUEUE_MOVE(newhead,oldhead) ROADMAP_LIST_MOVE(newhead,oldhead) + #define QUEUE_SPLICE(tohead,fromhead) ROADMAP_LIST_SPLICE(tohead,fromhead) + + #define QUEUE_FOR_EACH(listhead, element, tmp) \ + ROADMAP_LIST_FOR_EACH(listhead, element, tmp) + #define QUEUE_FOR_EACH_FROM_TO(from, to, element, tmp) \ + ROADMAP_LIST_FOR_EACH_FROM_TO(from, to, element, tmp) #endif // INCLUDE__ROADMAP_LIST__H Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** roadmap_trip.c 11 Jul 2006 02:03:33 -0000 1.51 --- roadmap_trip.c 17 Jul 2006 20:57:21 -0000 1.52 *************** *** 162,168 **** static time_t RoadMapTripGPSTime = 0; ! static queue RoadMapTripWaypointHead; ! static queue RoadMapTripRouteHead; ! static queue RoadMapTripTrackHead; static route_head RoadMapTripQuickRoute = { --- 162,168 ---- static time_t RoadMapTripGPSTime = 0; ! static RoadMapList RoadMapTripWaypointHead; ! static RoadMapList RoadMapTripRouteHead; ! static RoadMapList RoadMapTripTrackHead; static route_head RoadMapTripQuickRoute = { *************** *** 185,191 **** if (RoadMapRouteIsReversed) ! return (waypoint *) QUEUE_LAST (&RoadMapCurrentRoute->waypoint_list); else ! return (waypoint *) QUEUE_FIRST (&RoadMapCurrentRoute->waypoint_list); } --- 185,191 ---- if (RoadMapRouteIsReversed) ! return (waypoint *) ROADMAP_LIST_LAST (&RoadMapCurrentRoute->waypoint_list); else ! return (waypoint *) ROADMAP_LIST_FIRST (&RoadMapCurrentRoute->waypoint_list); } *************** *** 193,199 **** if (RoadMapRouteIsReversed) ! return (waypoint *) QUEUE_FIRST (&RoadMapCurrentRoute->waypoint_list); else ! return (waypoint *) QUEUE_LAST (&RoadMapCurrentRoute->waypoint_list); } --- 193,199 ---- if (RoadMapRouteIsReversed) ! return (waypoint *) ROADMAP_LIST_FIRST (&RoadMapCurrentRoute->waypoint_list); else ! return (waypoint *) ROADMAP_LIST_LAST (&RoadMapCurrentRoute->waypoint_list); } *************** *** 201,207 **** if (RoadMapRouteIsReversed) ! return (waypoint *)QUEUE_LAST(&waypointp->Q); else ! return (waypoint *)QUEUE_NEXT(&waypointp->Q); } --- 201,207 ---- if (RoadMapRouteIsReversed) ! return (waypoint *)ROADMAP_LIST_PREV(&waypointp->Q); else ! return (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); } *************** *** 209,215 **** if (RoadMapRouteIsReversed) ! return (waypoint *)QUEUE_NEXT(&waypointp->Q); else ! return (waypoint *)QUEUE_LAST(&waypointp->Q); } --- 209,215 ---- if (RoadMapRouteIsReversed) ! return (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); else ! return (waypoint *)ROADMAP_LIST_PREV(&waypointp->Q); } *************** *** 584,590 **** if (waypointp == RoadMapTripStart) return; ! neighbor = (waypoint *)QUEUE_LAST(&waypointp->Q); waypt_del (waypointp); ! ENQUEUE_BEFORE(&neighbor->Q, &waypointp->Q); break; --- 584,590 ---- if (waypointp == RoadMapTripStart) return; ! neighbor = (waypoint *)ROADMAP_LIST_PREV(&waypointp->Q); waypt_del (waypointp); ! roadmap_list_put_before(&neighbor->Q, &waypointp->Q); break; *************** *** 592,598 **** if (waypointp == RoadMapTripDest) return; ! neighbor = (waypoint *)QUEUE_NEXT(&waypointp->Q); waypt_del (waypointp); ! ENQUEUE_AFTER(&neighbor->Q, &waypointp->Q); break; --- 592,598 ---- if (waypointp == RoadMapTripDest) return; ! neighbor = (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); waypt_del (waypointp); ! roadmap_list_put_after(&neighbor->Q, &waypointp->Q); break; *************** *** 643,647 **** count = RoadMapCurrentRoute->rte_waypt_ct; } else if (data == TRIP_WAYPOINTS) { ! count = queue_count(&RoadMapTripWaypointHead); } else { count = roadmap_landmark_count(); --- 643,647 ---- count = RoadMapCurrentRoute->rte_waypt_ct; } else if (data == TRIP_WAYPOINTS) { ! count = roadmap_list_count(&RoadMapTripWaypointHead); } else { count = roadmap_landmark_count(); *************** *** 711,718 **** static char **Names = NULL; static waypoint **Waypoints; ! queue *list = NULL; /* warning suppression */ int i; ! queue *elem, *tmp; waypoint *waypointp; --- 711,718 ---- static char **Names = NULL; static waypoint **Waypoints; ! RoadMapList *list = NULL; /* warning suppression */ int i; ! RoadMapListItem *elem, *tmp; waypoint *waypointp; *************** *** 738,742 **** i = 0; ! QUEUE_FOR_EACH (list, elem, tmp) { waypointp = (waypoint *) elem; Names[i] = waypointp->shortname; --- 738,742 ---- i = 0; ! ROADMAP_LIST_FOR_EACH (list, elem, tmp) { waypointp = (waypoint *) elem; Names[i] = waypointp->shortname; *************** *** 756,760 **** if (which == TRIP_WAYPOINTS) { ! count = queue_count(&RoadMapTripWaypointHead); name = "Trip Landmarks"; } else if (which == PERSONAL_WAYPOINTS) { --- 756,760 ---- if (which == TRIP_WAYPOINTS) { ! count = roadmap_list_count(&RoadMapTripWaypointHead); name = "Trip Landmarks"; } else if (which == PERSONAL_WAYPOINTS) { *************** *** 838,843 **** } ! count = queue_count (&RoadMapTripRouteHead) + ! queue_count (&RoadMapTripTrackHead); if (count > 0) { roadmap_trip_route_manage_dialog_populate (count); --- 838,843 ---- } ! count = roadmap_list_count (&RoadMapTripRouteHead) + ! roadmap_list_count (&RoadMapTripTrackHead); if (count > 0) { roadmap_trip_route_manage_dialog_populate (count); *************** *** 893,897 **** static char **Names = NULL; static route_head **Routes = NULL; ! queue *elem, *tmp; int i; --- 893,897 ---- static char **Names = NULL; static route_head **Routes = NULL; ! RoadMapListItem *elem, *tmp; int i; *************** *** 909,913 **** i = 0; ! QUEUE_FOR_EACH (&RoadMapTripRouteHead, elem, tmp) { route_head *rh = (route_head *) elem; Names[i] = (rh->rte_name && rh->rte_name[0]) ? --- 909,913 ---- i = 0; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripRouteHead, elem, tmp) { route_head *rh = (route_head *) elem; Names[i] = (rh->rte_name && rh->rte_name[0]) ? *************** *** 916,920 **** } ! QUEUE_FOR_EACH (&RoadMapTripTrackHead, elem, tmp) { route_head *th = (route_head *) elem; Names[i] = (th->rte_name && th->rte_name[0]) ? --- 916,920 ---- } ! ROADMAP_LIST_FOR_EACH (&RoadMapTripTrackHead, elem, tmp) { route_head *th = (route_head *) elem; Names[i] = (th->rte_name && th->rte_name[0]) ? *************** *** 932,937 **** int count; ! if (QUEUE_EMPTY(&RoadMapTripRouteHead) && ! QUEUE_EMPTY(&RoadMapTripTrackHead)) { return; /* Nothing to manage. */ } --- 932,937 ---- int count; ! if (ROADMAP_LIST_EMPTY(&RoadMapTripRouteHead) && ! ROADMAP_LIST_EMPTY(&RoadMapTripTrackHead)) { return; /* Nothing to manage. */ } *************** *** 953,958 **** } ! count = queue_count (&RoadMapTripRouteHead) + ! queue_count (&RoadMapTripTrackHead); roadmap_trip_route_manage_dialog_populate (count); } --- 953,958 ---- } ! count = roadmap_list_count (&RoadMapTripRouteHead) + ! roadmap_list_count (&RoadMapTripTrackHead); roadmap_trip_route_manage_dialog_populate (count); } *************** *** 1346,1350 **** static waypoint * roadmap_trip_choose_best_next (const RoadMapPosition *pos) { ! queue *elem, *tmp; waypoint *nextpoint; int dist, distmin; --- 1346,1350 ---- static waypoint * roadmap_trip_choose_best_next (const RoadMapPosition *pos) { ! RoadMapListItem *elem, *tmp; waypoint *nextpoint; int dist, distmin; *************** *** 1356,1372 **** distmin = 500000000; ! nextpoint = (waypoint *)QUEUE_FIRST(&RoadMapCurrentRoute->waypoint_list); /* Find the closest segment to our current position. */ ! QUEUE_FOR_EACH (&RoadMapCurrentRoute->waypoint_list, elem, tmp) { waypoint *waypointp = (waypoint *) elem; if (waypointp == ! (waypoint *)QUEUE_LAST( &RoadMapCurrentRoute->waypoint_list)) break; dist = roadmap_math_get_distance_from_segment (pos, &waypointp->pos, ! &((waypoint *)QUEUE_NEXT(&waypointp->Q))->pos, NULL, &which); --- 1356,1372 ---- distmin = 500000000; ! nextpoint = (waypoint *)ROADMAP_LIST_FIRST(&RoadMapCurrentRoute->waypoint_list); /* Find the closest segment to our current position. */ ! ROADMAP_LIST_FOR_EACH (&RoadMapCurrentRoute->waypoint_list, elem, tmp) { waypoint *waypointp = (waypoint *) elem; if (waypointp == ! (waypoint *)ROADMAP_LIST_LAST( &RoadMapCurrentRoute->waypoint_list)) break; dist = roadmap_math_get_distance_from_segment (pos, &waypointp->pos, ! &((waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q))->pos, NULL, &which); *************** *** 1379,1383 **** } else if (which == 2) { /* waypointp->next is closer */ ! nextpoint = (waypoint *)QUEUE_NEXT(&waypointp->Q); } else { --- 1379,1383 ---- } else if (which == 2) { /* waypointp->next is closer */ ! nextpoint = (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); } else { *************** *** 1386,1390 **** nextpoint = waypointp; } else { ! nextpoint = (waypoint *)QUEUE_NEXT(&waypointp->Q); } } --- 1386,1390 ---- nextpoint = waypointp; } else { ! nextpoint = (waypoint *)ROADMAP_LIST_NEXT(&waypointp->Q); } } *************** *** 1841,1853 **** i = 1; while (roadmap_file_exists(path, name) && i < 1000) { ! sprintf(name, "NewTrip-%d", i++); } if (i == 1000) { ! roadmap_log (ROADMAP_WARNING, "over 1000 new trips!"); ! strcpy (name, "NewTrip"); } if (RoadMapTripModified) { ! roadmap_trip_save (0); } --- 1841,1853 ---- i = 1; while (roadmap_file_exists(path, name) && i < 1000) { ! sprintf(name, "NewTrip-%d", i++); } if (i == 1000) { ! roadmap_log (ROADMAP_WARNING, "over 1000 new trips!"); ! strcpy (name, "NewTrip"); } if (RoadMapTripModified) { ! roadmap_trip_save (0); } *************** *** 1866,1874 **** RoadMapTripFocal *focal; ! QUEUE_INIT(&RoadMapTripWaypointHead); ! QUEUE_INIT(&RoadMapTripRouteHead); ! QUEUE_INIT(&RoadMapTripTrackHead); ! QUEUE_INIT(&RoadMapTripQuickRoute.waypoint_list); for (focal = RoadMapTripFocalPoints; --- 1866,1874 ---- RoadMapTripFocal *focal; ! ROADMAP_LIST_INIT(&RoadMapTripWaypointHead); ! ROADMAP_LIST_INIT(&RoadMapTripRouteHead); ! ROADMAP_LIST_INIT(&RoadMapTripTrackHead); ! ROADMAP_LIST_INIT(&RoadMapTripQuickRoute.waypoint_list); for (focal = RoadMapTripFocalPoints; *************** *** 1940,1944 **** int ret; const char *path = NULL; ! queue tmp_waypoint_list, tmp_route_list, tmp_track_list; if (! roadmap_path_is_full_path (name)) --- 1940,1944 ---- int ret; const char *path = NULL; ! RoadMapList tmp_waypoint_list, tmp_route_list, tmp_track_list; if (! roadmap_path_is_full_path (name)) *************** *** 1947,1953 **** roadmap_log (ROADMAP_DEBUG, "roadmap_trip_load_file '%s'", name); ! QUEUE_INIT(&tmp_waypoint_list); ! QUEUE_INIT(&tmp_route_list); ! QUEUE_INIT(&tmp_track_list); ret = roadmap_gpx_read_file (path, name, &tmp_waypoint_list, --- 1947,1953 ---- roadmap_log (ROADMAP_DEBUG, "roadmap_trip_load_file '%s'", name); ! ROADMAP_LIST_INIT(&tmp_waypoint_list); ! ROADMAP_LIST_INIT(&tmp_route_list); ! ROADMAP_LIST_INIT(&tmp_track_list); ret = roadmap_gpx_read_file (path, name, &tmp_waypoint_list, *************** *** 1972,1996 **** if (merge) { ! QUEUE_SPLICE(&RoadMapTripWaypointHead, &tmp_waypoint_list); ! QUEUE_SPLICE(&RoadMapTripRouteHead, &tmp_route_list); ! QUEUE_SPLICE(&RoadMapTripTrackHead, &tmp_track_list); roadmap_trip_set_modified(1); } else { ! // FIXME if we happen to be loading the file we're about ! // to save to, then we'll either a) clobber what we want ! // to load, or b) potentially lose data we wanted to save. ! // we default to saving, but this means if you load a trip, ! // delete some stuff, and reload to get it back, that won't ! // work. ! if (RoadMapTripModified) { ! roadmap_trip_save (0); ! } roadmap_trip_clear(); ! QUEUE_MOVE(&RoadMapTripWaypointHead, &tmp_waypoint_list); ! QUEUE_MOVE(&RoadMapTripRouteHead, &tmp_route_list); ! QUEUE_MOVE(&RoadMapTripTrackHead, &tmp_track_list); roadmap_config_set (&RoadMapConfigTripName, --- 1972,1996 ---- if (merge) { ! ROADMAP_LIST_SPLICE(&RoadMapTripWaypointHead, &tmp_waypoint_list); ! ROADMAP_LIST_SPLICE(&RoadMapTripRouteHead, &tmp_route_list); ! ROADMAP_LIST_SPLICE(&RoadMapTripTrackHead, &tmp_track_list); roadmap_trip_set_modified(1); } else { ! // FIXME if we happen to be loading the file we're about ! // to save to, then we'll either a) clobber what we want ! // to load, or b) potentially lose data we wanted to save. ! // we default to saving, but this means if you load a trip, ! // delete some stuff, and reload to get it back, that won't ! // work. ! if (RoadMapTripModified) { ! roadmap_trip_save (0); ! } roadmap_trip_clear(); ! ROADMAP_LIST_MOVE(&RoadMapTripWaypointHead, &tmp_waypoint_list); ! ROADMAP_LIST_MOVE(&RoadMapTripRouteHead, &tmp_route_list); ! ROADMAP_LIST_MOVE(&RoadMapTripTrackHead, &tmp_track_list); roadmap_config_set (&RoadMapConfigTripName, *************** *** 2002,2016 **** RoadMapCurrentRoute = NULL; ! if (queue_count (&RoadMapTripRouteHead) + ! queue_count (&RoadMapTripTrackHead) > 1) { /* Multiple choices? Present a dialog. */ roadmap_trip_route_manage_dialog (); } else { /* If there's only one route (or track), use it. */ ! if (!QUEUE_EMPTY(&RoadMapTripRouteHead)) { RoadMapCurrentRoute = ! (route_head *)QUEUE_FIRST(&RoadMapTripRouteHead); ! } else if (!QUEUE_EMPTY(&RoadMapTripTrackHead)) { RoadMapCurrentRoute = ! (route_head *)QUEUE_FIRST(&RoadMapTripTrackHead); } else { RoadMapCurrentRoute = NULL; --- 2002,2016 ---- RoadMapCurrentRoute = NULL; ! if (roadmap_list_count (&RoadMapTripRouteHead) + ! roadmap_list_count (&RoadMapTripTrackHead) > 1) { /* Multiple choices? Present a dialog. */ roadmap_trip_route_manage_dialog (); } else { /* If there's only one route (or track), use it. */ ! if (!ROADMAP_LIST_EMPTY(&RoadMapTripRouteHead)) { RoadMapCurrentRoute = ! (route_head *)ROADMAP_LIST_FIRST(&RoadMapTripRouteHead); ! } else if (!ROADMAP_LIST_EMPTY(&RoadMapTripTrackHead)) { RoadMapCurrentRoute = ! (route_head *)ROADMAP_LIST_FIRST(&RoadMapTripTrackHead); } else { RoadMapCurrentRoute = NULL; *************** *** 2134,2142 **** waypoint *wa = NULL, *wb = NULL, *wc = NULL; ! queue *elem, *tmp; int dropped = 0; int ac_dist = -1, ab_dist = -1, bc_dist = -1; ! QUEUE_FOR_EACH (&orig_route->waypoint_list, elem, tmp) { wa = (waypoint *) elem; --- 2134,2142 ---- waypoint *wa = NULL, *wb = NULL, *wc = NULL; ! RoadMapListItem *elem, *tmp; int dropped = 0; int ac_dist = -1, ab_dist = -1, bc_dist = -1; ! ROADMAP_LIST_FOR_EACH (&orig_route->waypoint_list, elem, tmp) { wa = (waypoint *) elem; *************** *** 2175,2182 **** void roadmap_trip_copy_route (const route_head *orig_route, route_head *new_route) { ! queue *elem, *tmp; ! QUEUE_FOR_EACH (&orig_route->waypoint_list, elem, tmp) { ! waypt_add(&new_route->waypoint_list, waypt_dupe( (waypoint *)elem )); } --- 2175,2182 ---- void roadmap_trip_copy_route (const route_head *orig_route, route_head *new_route) { ! RoadMapListItem *elem, *tmp; ! ROADMAP_LIST_FOR_EACH (&orig_route->waypoint_list, elem, tmp) { ! waypt_add(&new_route->waypoint_list, waypt_dupe( (waypoint *)elem )); } *************** *** 2192,2198 **** if (simplify) { ! dropped = roadmap_trip_simplify_route (orig_route, new_route); } else { ! roadmap_trip_copy_route (orig_route, new_route); } --- 2192,2198 ---- if (simplify) { ! dropped = roadmap_trip_simplify_route (orig_route, new_route); } else { ! roadmap_trip_copy_route (orig_route, new_route); } *************** *** 2204,2213 **** ! if (wanttrack) { ! new_route->rte_is_track = 1; route_add(&RoadMapTripTrackHead, new_route); ! } else { route_add(&RoadMapTripRouteHead, new_route); ! } RoadMapCurrentRoute = new_route; --- 2204,2213 ---- ! if (wanttrack) { ! new_route->rte_is_track = 1; route_add(&RoadMapTripTrackHead, new_route); ! } else { route_add(&RoadMapTripRouteHead, new_route); ! } RoadMapCurrentRoute = new_route; *************** *** 2231,2239 **** if (RoadMapCurrentRoute == NULL) { ! return; } if (! RoadMapCurrentRoute->rte_is_track) { ! return; } --- 2231,2239 ---- if (RoadMapCurrentRoute == NULL) { ! return; } if (! RoadMapCurrentRoute->rte_is_track) { ! return; } *************** *** 2253,2257 **** if (RoadMapCurrentRoute == NULL) { ! return; } --- 2253,2257 ---- if (RoadMapCurrentRoute == NULL) { ! return; } Index: roadmap_gpx.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpx.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_gpx.h 5 Jul 2006 15:33:59 -0000 1.2 --- roadmap_gpx.h 17 Jul 2006 20:57:21 -0000 1.3 *************** *** 30,36 **** int roadmap_gpx_read_file ! (const char *path, const char *name, queue *w, queue *r, queue *t); int roadmap_gpx_read_waypoints ! (const char *path, const char *name, queue *waypoints); int roadmap_gpx_read_one_track ( const char *path, const char *name, route_head **track); --- 30,36 ---- int roadmap_gpx_read_file ! (const char *path, const char *name, RoadMapList *w, RoadMapList *r, RoadMapList *t); int roadmap_gpx_read_waypoints ! (const char *path, const char *name, RoadMapList *waypoints); int roadmap_gpx_read_one_track ( const char *path, const char *name, route_head **track); *************** *** 38,44 **** ( const char *path, const char *name, route_head **route); int roadmap_gpx_write_file ! (const char *path, const char *name, queue *w, queue *r, queue *t); int roadmap_gpx_write_waypoints ! (const char *path, const char *name, queue *waypoints); int roadmap_gpx_write_track (const char *path, const char *name, route_head *track); --- 38,44 ---- ( const char *path, const char *name, route_head **route); int roadmap_gpx_write_file ! (const char *path, const char *name, RoadMapList *w, RoadMapList *r, RoadMapList *t); int roadmap_gpx_write_waypoints ! (const char *path, const char *name, RoadMapList *waypoints); int roadmap_gpx_write_track (const char *path, const char *name, route_head *track); Index: roadmap_track.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_track.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_track.c 3 Jul 2006 17:10:35 -0000 1.8 --- roadmap_track.c 17 Jul 2006 20:57:21 -0000 1.9 *************** *** 90,94 **** maxtrack = roadmap_config_get_integer (&RoadMapConfigLength); while (RoadMapTrack->rte_waypt_ct > maxtrack) { ! w = (waypoint *) QUEUE_NEXT (&RoadMapTrack->waypoint_list); route_del_wpt ( RoadMapTrack, w); } --- 90,94 ---- maxtrack = roadmap_config_get_integer (&RoadMapConfigLength); while (RoadMapTrack->rte_waypt_ct > maxtrack) { ! w = (waypoint *) ROADMAP_LIST_FIRST (&RoadMapTrack->waypoint_list); route_del_wpt ( RoadMapTrack, w); } *************** *** 142,146 **** if (policy == RoadMapTrackPolicyOff) return; ! if ( QUEUE_EMPTY(&RoadMapTrack->waypoint_list) ) { roadmap_track_add_trackpoint(gps_time, gps_position); return; --- 142,146 ---- if (policy == RoadMapTrackPolicyOff) return; ! if ( ROADMAP_LIST_EMPTY(&RoadMapTrack->waypoint_list) ) { roadmap_track_add_trackpoint(gps_time, gps_position); return; *************** *** 151,155 **** pos[0].latitude = gps_position->latitude; pos[0].longitude = gps_position->longitude; ! w = (waypoint *)QUEUE_LAST (&RoadMapTrack->waypoint_list); pos[1].latitude = w->pos.latitude; pos[1].longitude = w->pos.longitude; --- 151,155 ---- pos[0].latitude = gps_position->latitude; pos[0].longitude = gps_position->longitude; ! w = (waypoint *)ROADMAP_LIST_LAST (&RoadMapTrack->waypoint_list); pos[1].latitude = w->pos.latitude; pos[1].longitude = w->pos.longitude; *************** *** 182,186 **** case RoadMapTrackPolicyDeviation: if (RoadMapTrack->rte_waypt_ct > 2) { ! w = (waypoint *)QUEUE_LAST(&w->Q); pos[2].latitude = w->pos.latitude; pos[2].longitude = w->pos.longitude; --- 182,186 ---- case RoadMapTrackPolicyDeviation: if (RoadMapTrack->rte_waypt_ct > 2) { ! w = (waypoint *)ROADMAP_LIST_PREV(&w->Q); pos[2].latitude = w->pos.latitude; pos[2].longitude = w->pos.longitude; *************** *** 194,198 **** if (abs (ab_dist + bc_dist - ac_dist) < 10) { ! w = (waypoint *) QUEUE_LAST (&RoadMapTrack->waypoint_list); route_del_wpt ( RoadMapTrack, w); } --- 194,198 ---- if (abs (ab_dist + bc_dist - ac_dist) < 10) { ! w = (waypoint *) ROADMAP_LIST_LAST (&RoadMapTrack->waypoint_list); route_del_wpt ( RoadMapTrack, w); } Index: roadmap_gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_gpx.c 26 Jun 2006 19:51:14 -0000 1.4 --- roadmap_gpx.c 17 Jul 2006 20:57:21 -0000 1.5 *************** *** 58,62 **** int roadmap_gpx_read_file(const char *path, ! const char *name, queue *w, queue *r, queue *t) { --- 58,62 ---- int roadmap_gpx_read_file(const char *path, ! const char *name, queue_head *w, queue_head *r, queue_head *t) { *************** *** 84,88 **** int roadmap_gpx_read_waypoints ! (const char *path, const char *name, queue *waypoints) { int ret; --- 84,88 ---- int roadmap_gpx_read_waypoints ! (const char *path, const char *name, queue_head *waypoints) { int ret; *************** *** 99,104 **** { int ret; ! queue tracklist; route_head *trk; QUEUE_INIT(&tracklist); --- 99,105 ---- { int ret; ! queue_head tracklist; route_head *trk; + QUEUE_INIT(&tracklist); *************** *** 111,116 **** trk = (route_head *)QUEUE_FIRST(&tracklist); ! dequeue(&trk->Q); ! QUEUE_INIT(&trk->Q); /* In case we read more than one track from the file. */ --- 112,117 ---- trk = (route_head *)QUEUE_FIRST(&tracklist); ! roadmap_list_remove(&trk->Q); ! QUEUE_INIT((queue_head *)&trk->Q); /* safety -- no dangling links */ /* In case we read more than one track from the file. */ *************** *** 129,133 **** { int ret; ! queue routelist; route_head *rte; --- 130,134 ---- { int ret; ! queue_head routelist; route_head *rte; *************** *** 140,145 **** rte = (route_head *)QUEUE_FIRST(&routelist); ! dequeue(&rte->Q); ! QUEUE_INIT(&rte->Q); /* In case we read more than one route from the file. */ --- 141,146 ---- rte = (route_head *)QUEUE_FIRST(&routelist); ! roadmap_list_remove(&rte->Q); ! QUEUE_INIT((queue_head *)&rte->Q); /* safety -- no dangling links */ /* In case we read more than one route from the file. */ *************** *** 154,158 **** int roadmap_gpx_write_file(const char *path, const char *name, ! queue *w, queue *r, queue *t) { FILE *fp; --- 155,159 ---- int roadmap_gpx_write_file(const char *path, const char *name, ! queue_head *w, queue_head *r, queue_head *t) { FILE *fp; *************** *** 171,175 **** int roadmap_gpx_write_waypoints(const char *path, const char *name, ! queue *waypoints) { FILE *fp; --- 172,176 ---- int roadmap_gpx_write_waypoints(const char *path, const char *name, ! queue_head *waypoints) { FILE *fp; *************** *** 192,196 **** FILE *fp; int ret; ! queue route_head; QUEUE_INIT(&route_head); --- 193,197 ---- FILE *fp; int ret; ! queue_head route_head; QUEUE_INIT(&route_head); *************** *** 213,217 **** FILE *fp; int ret; ! queue track_head; QUEUE_INIT(&track_head); --- 214,218 ---- FILE *fp; int ret; ! queue_head track_head; QUEUE_INIT(&track_head); |
From: Paul F. <pg...@us...> - 2006-07-17 20:57:26
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30284/gpx Modified Files: Makefile defs.h gpx.c mkshort.c route.c waypt.c Removed Files: queue.c queue.h Log Message: merge the linked list implementations from the gpx subdir and from roadmap_list.h. preserve the "fully-linked" nature of the gpx lists, as well as the type safety of the roadmap_list.h lists. Index: gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/gpx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gpx.c 5 Jul 2006 15:33:59 -0000 1.4 --- gpx.c 17 Jul 2006 20:57:21 -0000 1.5 *************** *** 74,80 **** static char *urlbase = NULL; // "Base URL for link tag in output" ! static queue *cur_waypoint_list; ! static queue *cur_route_list; ! static queue *cur_track_list; static int doing_no_waypoints, doing_no_routes, doing_no_tracks; --- 74,80 ---- static char *urlbase = NULL; // "Base URL for link tag in output" ! static queue_head *cur_waypoint_list; ! static queue_head *cur_route_list; ! static queue_head *cur_track_list; static int doing_no_waypoints, doing_no_routes, doing_no_tracks; *************** *** 1022,1026 **** int ! gpx_read(FILE *ifile, queue *wq, queue *rq, queue *tq) { int len; --- 1022,1026 ---- int ! gpx_read(FILE *ifile, queue_head *wq, queue_head *rq, queue_head *tq) { int len; *************** *** 1480,1484 **** static void ! gpx_write_bounds(FILE *ofd, queue *wq, queue *rq, queue *tq) { #if 0 --- 1480,1484 ---- static void ! gpx_write_bounds(FILE *ofd, queue_head *wq, queue_head *rq, queue_head *tq) { #if 0 *************** *** 1508,1512 **** static void ! gpx_write_preamble( FILE *ofd, queue *wq, queue *rq, queue *tq) { time_t now = 0; --- 1508,1512 ---- static void ! gpx_write_preamble( FILE *ofd, queue_head *wq, queue_head *rq, queue_head *tq) { time_t now = 0; *************** *** 1572,1576 **** int ! gpx_write( FILE *ofd, queue *wq, queue *rq, queue *tq) { --- 1572,1576 ---- int ! gpx_write( FILE *ofd, queue_head *wq, queue_head *rq, queue_head *tq) { Index: defs.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/defs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** defs.h 7 Dec 2005 14:21:09 -0000 1.1 --- defs.h 17 Jul 2006 20:57:21 -0000 1.2 *************** *** 28,32 **** #include <stdarg.h> #include <stddef.h> ! #include "queue.h" #include "gbtypes.h" --- 28,32 ---- #include <stdarg.h> #include <stddef.h> ! #include "roadmap_list.h" #include "gbtypes.h" *************** *** 283,287 **** typedef struct { queue Q; /* Link onto parent list. */ ! queue waypoint_list; /* List of child waypoints */ char *rte_name; char *rte_desc; --- 283,287 ---- typedef struct { queue Q; /* Link onto parent list. */ ! queue_head waypoint_list; /* List of child waypoints */ char *rte_name; char *rte_desc; *************** *** 305,319 **** typedef void (*route_hdr)(const route_head *); typedef void (*route_trl)(const route_head *); ! void waypt_add (queue *q, waypoint *); waypoint * waypt_dupe (const waypoint *); waypoint * waypt_new(void); void waypt_del (waypoint *); void waypt_free (waypoint *); ! void waypt_iterator(queue *, waypt_cb); void waypt_init_bounds(bounds *bounds); int waypt_bounds_valid(bounds *bounds); void waypt_add_to_bounds(bounds *bounds, const waypoint *waypointp); ! void waypt_compute_bounds(queue *q, bounds *); ! void waypt_flush_queue(queue *); unsigned int waypt_count(void); void set_waypt_count(unsigned int nc); --- 305,319 ---- typedef void (*route_hdr)(const route_head *); typedef void (*route_trl)(const route_head *); ! void waypt_add (queue_head *q, waypoint *); waypoint * waypt_dupe (const waypoint *); waypoint * waypt_new(void); void waypt_del (waypoint *); void waypt_free (waypoint *); ! void waypt_iterator(queue_head *, waypt_cb); void waypt_init_bounds(bounds *bounds); int waypt_bounds_valid(bounds *bounds); void waypt_add_to_bounds(bounds *bounds, const waypoint *waypointp); ! void waypt_compute_bounds(queue_head *qh, bounds *); ! void waypt_flush_queue(queue_head *); unsigned int waypt_count(void); void set_waypt_count(unsigned int nc); *************** *** 322,326 **** void xcsv_setup_internal_style(const char *style_buf); void xcsv_read_internal_style(const char *style_buf); ! waypoint * waypt_find_waypt_by_name(queue *q, const char *name); void waypt_backup(unsigned int *count, queue **head_bak); void waypt_restore(unsigned int count, queue *head_bak); --- 322,326 ---- void xcsv_setup_internal_style(const char *style_buf); void xcsv_read_internal_style(const char *style_buf); ! waypoint * waypt_find_waypt_by_name(queue_head *qh, const char *name); void waypt_backup(unsigned int *count, queue **head_bak); void waypt_restore(unsigned int count, queue *head_bak); *************** *** 330,342 **** void route_add_wpt_tail(route_head *rte, waypoint *wpt); void route_del_wpt(route_head *rte, waypoint *wpt); ! void route_add(queue *q, route_head *rte); void route_del(route_head *rte); void route_reverse(const route_head *rte_hd); waypoint * route_find_waypt_by_name(route_head *rh, const char *name); void route_waypt_iterator(const route_head *rte, waypt_cb); ! void route_iterator(queue *qh, route_hdr rh, route_trl rt, waypt_cb wc); void route_free (route_head *); ! void route_flush_queue( queue *); ! route_head * route_find_route_by_name(queue *routes, const char *name); unsigned int route_count(void); unsigned int track_count(void); --- 330,342 ---- void route_add_wpt_tail(route_head *rte, waypoint *wpt); void route_del_wpt(route_head *rte, waypoint *wpt); ! void route_add(queue_head *q, route_head *rte); void route_del(route_head *rte); void route_reverse(const route_head *rte_hd); waypoint * route_find_waypt_by_name(route_head *rh, const char *name); void route_waypt_iterator(const route_head *rte, waypt_cb); ! void route_iterator(queue_head *qh, route_hdr rh, route_trl rt, waypt_cb wc); void route_free (route_head *); ! void route_flush_queue( queue_head *); ! route_head * route_find_route_by_name(queue_head *routes, const char *name); unsigned int route_count(void); unsigned int track_count(void); *************** *** 432,437 **** void warning(const char *, ...) PRINTFLIKE(1, 2); ! int gpx_write( FILE *ofd, queue *w, queue *r, queue *t); ! int gpx_read(FILE *ifile, queue *w, queue *r, queue *t); time_t xml_parse_time( const char *cdatastr ); --- 432,437 ---- void warning(const char *, ...) PRINTFLIKE(1, 2); ! int gpx_write( FILE *ofd, queue_head *w, queue_head *r, queue_head *t); ! int gpx_read(FILE *ifile, queue_head *w, queue_head *r, queue_head *t); time_t xml_parse_time( const char *cdatastr ); Index: waypt.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/waypt.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** waypt.c 7 Dec 2005 14:21:09 -0000 1.1 --- waypt.c 17 Jul 2006 20:57:21 -0000 1.2 *************** *** 77,84 **** void ! waypt_add(queue *q, waypoint *wpt) { static int waypt_index; ! ENQUEUE_TAIL(q, &wpt->Q); waypt_index++; --- 77,84 ---- void ! waypt_add(queue_head *qh, waypoint *wpt) { static int waypt_index; ! ENQUEUE_TAIL(qh, &wpt->Q); waypt_index++; *************** *** 113,117 **** waypt_del(waypoint *wpt) { ! dequeue(&wpt->Q); } --- 113,117 ---- waypt_del(waypoint *wpt) { ! roadmap_list_remove(&wpt->Q); } *************** *** 135,144 **** void ! waypt_iterator(queue *q, waypt_cb cb) { queue *elem, *tmp; waypoint *waypointp; ! QUEUE_FOR_EACH(q, elem, tmp) { waypointp = (waypoint *) elem; (*cb) (waypointp); --- 135,144 ---- void ! waypt_iterator(queue_head *qh, waypt_cb cb) { queue *elem, *tmp; waypoint *waypointp; ! QUEUE_FOR_EACH(qh, elem, tmp) { waypointp = (waypoint *) elem; (*cb) (waypointp); *************** *** 187,191 **** void ! waypt_compute_bounds(queue *q, bounds *bounds) { queue *elem, *tmp; --- 187,191 ---- void ! waypt_compute_bounds(queue_head *qh, bounds *bounds) { queue *elem, *tmp; *************** *** 198,202 **** bounds->min_lon = 9999; ! QUEUE_FOR_EACH(q, elem, tmp) { waypointp = (waypoint *) elem; if (waypointp->pos.latitude > bounds->max_lat) --- 198,202 ---- bounds->min_lon = 9999; ! QUEUE_FOR_EACH(qh, elem, tmp) { waypointp = (waypoint *) elem; if (waypointp->pos.latitude > bounds->max_lat) *************** *** 212,221 **** waypoint * ! waypt_find_waypt_by_name(queue *q, const char *name) { queue *elem, *tmp; waypoint *waypointp; ! QUEUE_FOR_EACH(q, elem, tmp) { waypointp = (waypoint *) elem; if (0 == strcmp(waypointp->shortname, name)) { --- 212,221 ---- waypoint * ! waypt_find_waypt_by_name(queue_head *qh, const char *name) { queue *elem, *tmp; waypoint *waypointp; ! QUEUE_FOR_EACH(qh, elem, tmp) { waypointp = (waypoint *) elem; if (0 == strcmp(waypointp->shortname, name)) { *************** *** 268,277 **** void ! waypt_flush_queue( queue *head ) { queue *elem, *tmp; ! QUEUE_FOR_EACH(head, elem, tmp) { ! waypoint *q = (waypoint *) dequeue(elem); waypt_free(q); } --- 268,277 ---- void ! waypt_flush_queue( queue_head *qh ) { queue *elem, *tmp; ! QUEUE_FOR_EACH(qh, elem, tmp) { ! waypoint *q = (waypoint *) roadmap_list_remove(elem); waypt_free(q); } Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 26 Jun 2006 19:47:49 -0000 1.2 --- Makefile 17 Jul 2006 20:57:21 -0000 1.3 *************** *** 13,17 **** route.c \ util.c \ - queue.c \ mkshort.c \ formspec.c \ --- 13,16 ---- Index: route.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/route.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** route.c 7 Dec 2005 14:21:09 -0000 1.1 --- route.c 17 Jul 2006 20:57:21 -0000 1.2 *************** *** 29,33 **** route_head *rte_head; rte_head = (route_head *) xcalloc(sizeof (*rte_head), 1); ! QUEUE_INIT(&rte_head->Q); QUEUE_INIT(&rte_head->waypoint_list); return rte_head; --- 29,33 ---- route_head *rte_head; rte_head = (route_head *) xcalloc(sizeof (*rte_head), 1); ! QUEUE_INIT((queue_head *)&rte_head->Q); /* safety */ QUEUE_INIT(&rte_head->waypoint_list); return rte_head; *************** *** 36,40 **** void ! route_add(queue *rq, route_head *rte) { ENQUEUE_TAIL(rq, &rte->Q); --- 36,40 ---- void ! route_add(queue_head *rq, route_head *rte) { ENQUEUE_TAIL(rq, &rte->Q); *************** *** 44,53 **** route_del(route_head *rte) { ! dequeue( &rte->Q ); route_free( rte ); } route_head * ! route_find_route_by_name(queue *routes, const char *name) { queue *elem, *tmp; --- 44,53 ---- route_del(route_head *rte) { ! roadmap_list_remove( &rte->Q ); route_free( rte ); } route_head * ! route_find_route_by_name(queue_head *routes, const char *name) { queue *elem, *tmp; *************** *** 105,109 **** route_del_wpt( route_head *rte, waypoint *wpt) { ! dequeue( &wpt->Q ); waypt_free( wpt ); rte->rte_waypt_ct--; --- 105,109 ---- route_del_wpt( route_head *rte, waypoint *wpt) { ! roadmap_list_remove( &wpt->Q ); waypt_free( wpt ); rte->rte_waypt_ct--; *************** *** 148,157 **** queue *elem, *tmp; QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) { ! ENQUEUE_HEAD(&rh->waypoint_list, dequeue(elem)); } } void ! route_iterator(queue *qh, route_hdr rh, route_trl rt, waypt_cb wc) { queue *elem, *tmp; --- 148,157 ---- queue *elem, *tmp; QUEUE_FOR_EACH(&rh->waypoint_list, elem, tmp) { ! ENQUEUE_HEAD(&rh->waypoint_list, roadmap_list_remove(elem)); } } void ! route_iterator(queue_head *qh, route_hdr rh, route_trl rt, waypt_cb wc) { queue *elem, *tmp; *************** *** 167,171 **** void ! route_flush_queue(queue *head) { queue *elem, *tmp; --- 167,171 ---- void ! route_flush_queue(queue_head *head) { queue *elem, *tmp; *************** *** 173,177 **** QUEUE_FOR_EACH(head, elem, tmp) { ! q = dequeue(elem); route_free((route_head *) q); } --- 173,177 ---- QUEUE_FOR_EACH(head, elem, tmp) { ! q = roadmap_list_remove(elem); route_free((route_head *) q); } --- queue.c DELETED --- Index: mkshort.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/mkshort.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mkshort.c 7 Dec 2005 14:21:09 -0000 1.1 --- mkshort.c 17 Jul 2006 20:57:21 -0000 1.2 *************** *** 46,50 **** char *goodchars; char *defname; ! queue namelist[PRIME]; /* Various internal flags at end to allow alignment flexibility. */ --- 46,50 ---- char *goodchars; char *defname; ! queue_head namelist[PRIME]; /* Various internal flags at end to allow alignment flexibility. */ *************** *** 132,136 **** size_t l = strlen(name); int hash = hash_string(name); ! uniq_shortname *s = (uniq_shortname *) h->namelist[hash].next; s->conflictctr++; --- 132,138 ---- size_t l = strlen(name); int hash = hash_string(name); ! uniq_shortname *s; ! ! s = (uniq_shortname *) QUEUE_FIRST(&h->namelist[hash]); s->conflictctr++; *************** *** 164,168 **** QUEUE_FOR_EACH(&hdr->namelist[i], e, t) { uniq_shortname *s = (uniq_shortname *) e; ! dequeue(e); xfree(s->orig_shortname); xfree(s); --- 166,170 ---- QUEUE_FOR_EACH(&hdr->namelist[i], e, t) { uniq_shortname *s = (uniq_shortname *) e; ! roadmap_list_remove(e); xfree(s->orig_shortname); xfree(s); --- queue.h DELETED --- |
From: Paul F. <pg...@us...> - 2006-07-17 20:57:25
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30284/unix Modified Files: roadmap_spawn.c Log Message: merge the linked list implementations from the gpx subdir and from roadmap_list.h. preserve the "fully-linked" nature of the gpx lists, as well as the type safety of the roadmap_list.h lists. Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_spawn.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** roadmap_spawn.c 13 Nov 2005 23:49:07 -0000 1.16 --- roadmap_spawn.c 17 Jul 2006 20:57:21 -0000 1.17 *************** *** 45,49 **** static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; /* The GPE environment on the iPAQ does not seem to setup --- 45,49 ---- static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive; /* The GPE environment on the iPAQ does not seem to setup *************** *** 108,112 **** int pid; ! RoadMapFeedback *item; --- 108,113 ---- int pid; ! RoadMapListItem *item, *tmp; ! RoadMapFeedback *feedback; *************** *** 117,129 **** roadmap_log (ROADMAP_DEBUG, "child %d exited", pid); ! for (item = (RoadMapFeedback *)RoadMapSpawnActive.first; ! item != NULL; ! item = (RoadMapFeedback *)item->link.next) { ! if (pid == item->child) { ! roadmap_list_remove (&RoadMapSpawnActive, &item->link); ! item->handler (item->data); break; } --- 118,130 ---- roadmap_log (ROADMAP_DEBUG, "child %d exited", pid); ! ROADMAP_LIST_FOR_EACH (&RoadMapSpawnActive, item, tmp) { ! feedback = (RoadMapFeedback *)item; ! if (pid == feedback->child) { ! roadmap_list_remove (&feedback->link); ! ! feedback->handler (feedback->data); break; } *************** *** 133,137 **** } ! if ((pid < 0) && (RoadMapSpawnActive.first != NULL)) { /* We have at least one child, but waitpid() does not --- 134,138 ---- } ! if ((pid < 0) && ! ROADMAP_LIST_EMPTY(&RoadMapSpawnActive)) { /* We have at least one child, but waitpid() does not *************** *** 273,276 **** --- 274,279 ---- last_slash[1] = 0; /* remove the current's program name. */ } + + ROADMAP_LIST_INIT(&RoadMapSpawnActive); } *************** *** 310,314 **** void roadmap_spawn_check (void) { ! RoadMapFeedback *item; --- 313,318 ---- void roadmap_spawn_check (void) { ! RoadMapListItem *item, *tmp; ! RoadMapFeedback *feedback; *************** *** 319,331 **** if (RoadMapSpawnDubiousWait) { ! for (item = (RoadMapFeedback *)RoadMapSpawnActive.first; ! item != NULL; ! item = (RoadMapFeedback *)item->link.next) { ! if (kill (item->child, 0) < 0) { ! roadmap_list_remove (&RoadMapSpawnActive, &item->link); ! item->handler (item->data); } } --- 323,335 ---- if (RoadMapSpawnDubiousWait) { ! ROADMAP_LIST_FOR_EACH (&RoadMapSpawnActive, item, tmp) { ! feedback = (RoadMapFeedback *)item; ! if (kill (feedback->child, 0) < 0) { ! roadmap_list_remove (&feedback->link); ! ! feedback->handler (feedback->data); } } |
From: Paul F. <pg...@us...> - 2006-07-17 20:57:25
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30284/win32 Modified Files: roadmap_spawn.c Log Message: merge the linked list implementations from the gpx subdir and from roadmap_list.h. preserve the "fully-linked" nature of the gpx lists, as well as the type safety of the roadmap_list.h lists. Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_spawn.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_spawn.c 6 Sep 2005 09:11:29 -0000 1.3 --- roadmap_spawn.c 17 Jul 2006 20:57:21 -0000 1.4 *************** *** 35,39 **** static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; --- 35,39 ---- static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive; *************** *** 102,105 **** --- 102,106 ---- } RoadMapSpawnPath = path; + ROADMAP_LIST_INIT(&RoadMapSpawnActive); } *************** *** 137,151 **** void roadmap_spawn_check (void) { ! RoadMapFeedback *item; ! for (item = (RoadMapFeedback *)RoadMapSpawnActive.first; ! item != NULL; ! item = (RoadMapFeedback *)item->link.next) { ! if (WaitForSingleObject((HANDLE)item->child, 0) == WAIT_OBJECT_0) { ! CloseHandle((HANDLE)item->child); ! roadmap_list_remove (&RoadMapSpawnActive, &item->link); ! item->handler (item->data); ! } } } --- 138,153 ---- void roadmap_spawn_check (void) { ! RoadMapListItem *item, *tmp; ! RoadMapFeedback *feedback; ! ROADMAP_LIST_FOR_EACH (&RoadMapSpawnActive, item, tmp) { ! feedback = (RoadMapFeedback *)item; ! ! if (WaitForSingleObject((HANDLE)feedback->child, 0) == WAIT_OBJECT_0) { ! CloseHandle((HANDLE)feedback->child); ! roadmap_list_remove (&feedback->link); ! feedback->handler (feedback->data); ! } } } |
From: Ehud S. <esh...@us...> - 2006-07-17 06:36:15
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12279 Modified Files: preferences Log Message: Download .gz maps by default. Index: preferences =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/preferences,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** preferences 29 Apr 2006 14:55:38 -0000 1.7 --- preferences 17 Jul 2006 06:36:11 -0000 1.8 *************** *** 20,24 **** Map.GPS map offset longitude: 0 Map.GPS map offset latitude: 0 ! Download.Source: http://www.freemap.co.il/roadmap/maps/usc%05d.rdm History.Depth: 100 GPS.Timeout: 10 --- 20,24 ---- Map.GPS map offset longitude: 0 Map.GPS map offset latitude: 0 ! Download.Source: http://www.freemap.co.il/roadmap/maps/usc%05d.rdm.gz History.Depth: 100 GPS.Timeout: 10 |
From: Ehud S. <esh...@us...> - 2006-07-17 06:35:48
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11901 Modified Files: install.inf roadmap_main.cpp Log Message: FreeMap auto sync. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_main.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_main.cpp 16 Jul 2006 12:29:21 -0000 1.13 --- roadmap_main.cpp 17 Jul 2006 06:35:45 -0000 1.14 *************** *** 54,58 **** #include "../roadmap_serial.h" #include "../roadmap_messagebox.h" ! #include "../roadmap_screen.h" #include "wince_input_mon.h" #include "win32_serial.h" --- 54,59 ---- #include "../roadmap_serial.h" #include "../roadmap_messagebox.h" ! #include "../roadmap_screen.h" ! #include "../roadmap_download.h" #include "wince_input_mon.h" #include "win32_serial.h" *************** *** 95,99 **** static bool RoadMapMainFullScreen = false; static HANDLE VirtualSerialHandle = 0; ! static const char *RoadMapMainVirtualSerial; --- 96,101 ---- static bool RoadMapMainFullScreen = false; static HANDLE VirtualSerialHandle = 0; ! static const char *RoadMapMainVirtualSerial; ! static bool RoadMapMainSync = false; *************** *** 122,125 **** --- 124,128 ---- ROADMAP_CONFIG_ITEM("GPS", "Virtual"); + #ifndef _ROADGPS static void roadmap_main_start_sync (void) { *************** *** 127,130 **** --- 130,137 ---- int i; + if (RoadMapMainSync) return; + + RoadMapMainSync = true; + Sleep(1000); *************** *** 136,141 **** Sleep(1000); } - } static void setup_virtual_serial (void) { --- 143,150 ---- Sleep(1000); } + RoadMapMainSync = false; + } + #endif static void setup_virtual_serial (void) { *************** *** 278,287 **** #ifdef UNDER_CE SHInitExtraControls(); - #endif if (!wcscmp(lpCmdLine, APP_RUN_AT_RS232_DETECT)) { do_sync = true; } ! //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); --- 287,297 ---- #ifdef UNDER_CE SHInitExtraControls(); if (!wcscmp(lpCmdLine, APP_RUN_AT_RS232_DETECT)) { do_sync = true; } ! ! #endif ! //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); *************** *** 312,322 **** char *args[1] = {0}; ! if (do_sync) { ! roadmap_main_start_sync (); ! roadmap_config_initialize (); editor_main_initialize (); roadmap_main_start_sync (); return 0; } roadmap_start(0, args); --- 322,334 ---- char *args[1] = {0}; ! #ifndef _ROADGPS ! if (do_sync) { ! roadmap_config_initialize (); ! roadmap_download_initialize (); editor_main_initialize (); roadmap_main_start_sync (); return 0; } + #endif roadmap_start(0, args); *************** *** 573,579 **** --- 585,593 ---- #endif + #ifndef _ROADGPS case WM_USER_SYNC: roadmap_main_start_sync (); break; + #endif case WM_USER_READ: Index: install.inf =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/install.inf,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** install.inf 16 Jul 2006 12:29:21 -0000 1.8 --- install.inf 17 Jul 2006 06:35:45 -0000 1.9 *************** *** 4,8 **** [Strings] ! CompanyName = "RoadMap" [Version] --- 4,8 ---- [Strings] ! CompanyName = "FreeMap" [Version] *************** *** 87,91 **** [Shortcuts.All] %AppName%,0,Roadmap.exe ! RoadGPS,0,RoadGPS.exe [Files.Config] --- 87,91 ---- [Shortcuts.All] %AppName%,0,Roadmap.exe ! ; RoadGPS,0,RoadGPS.exe [Files.Config] |
From: Ehud S. <esh...@us...> - 2006-07-17 06:35:22
|
Update of /cvsroot/roadmap/roadmap_editor/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11877 Modified Files: roadmap_file.c Log Message: Create a file if it does not exist. Index: roadmap_file.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/unix/roadmap_file.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_file.c 2 May 2006 12:55:05 -0000 1.3 --- roadmap_file.c 17 Jul 2006 06:35:19 -0000 1.4 *************** *** 362,366 **** unix_mode = O_RDONLY; } else if (strchr (mode, 'w') != NULL) { ! unix_mode = O_RDWR; } else { roadmap_log (ROADMAP_ERROR, --- 362,366 ---- unix_mode = O_RDONLY; } else if (strchr (mode, 'w') != NULL) { ! unix_mode = O_RDWR|O_CREAT; } else { roadmap_log (ROADMAP_ERROR, *************** *** 369,373 **** } ! return (RoadMapFile) open (name, unix_mode); } --- 369,373 ---- } ! return (RoadMapFile) open (name, unix_mode, 0644); } |
From: Ehud S. <esh...@us...> - 2006-07-17 06:34:30
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11473 Modified Files: navigate_bar.c navigate_instr.c Log Message: Merge Paul's 3D labels. Index: navigate_bar.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_bar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navigate_bar.c 11 Jun 2006 11:00:32 -0000 1.2 --- navigate_bar.c 17 Jul 2006 06:34:27 -0000 1.3 *************** *** 118,122 **** roadmap_canvas_get_text_extents ! (text, size, &width, &ascent, &descent); if (width >= 2 * NavigatePanel->street_width) return -1; --- 118,122 ---- roadmap_canvas_get_text_extents ! (text, size, &width, &ascent, &descent, NULL); if (width >= 2 * NavigatePanel->street_width) return -1; *************** *** 157,166 **** roadmap_canvas_get_text_extents ! (text_line, size, &width, &ascent, &descent); if (width < NavigatePanel->street_width) { roadmap_canvas_get_text_extents ! (text_line, size, &width, &ascent, &descent); if (width < NavigatePanel->street_width) { --- 157,166 ---- roadmap_canvas_get_text_extents ! (text_line, size, &width, &ascent, &descent, NULL); if (width < NavigatePanel->street_width) { roadmap_canvas_get_text_extents ! (text_line, size, &width, &ascent, &descent, NULL); if (width < NavigatePanel->street_width) { *************** *** 363,367 **** roadmap_canvas_get_text_extents ! (line, size, &width, &ascent, &descent); position.x = NavigatePanel->street_width - width + NavigatePanel->street_start; --- 363,367 ---- roadmap_canvas_get_text_extents ! (line, size, &width, &ascent, &descent, NULL); position.x = NavigatePanel->street_width - width + NavigatePanel->street_start; *************** *** 396,400 **** roadmap_canvas_draw_image (NavigateBarImage, &NavigateBarLocation, 0, ! IMAGE_NORAML); } --- 396,400 ---- roadmap_canvas_draw_image (NavigateBarImage, &NavigateBarLocation, 0, ! IMAGE_NORMAL); } Index: navigate_instr.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_instr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** navigate_instr.c 11 Jun 2006 11:20:59 -0000 1.3 --- navigate_instr.c 17 Jul 2006 06:34:27 -0000 1.4 *************** *** 26,29 **** --- 26,30 ---- */ + #include <stdlib.h> #include "roadmap.h" #include "roadmap_line.h" *************** *** 114,118 **** distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection); if (distance < smallest_distance) { --- 115,119 ---- distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { *************** *** 140,144 **** distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection); if (distance < smallest_distance) { --- 141,145 ---- distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { *************** *** 394,398 **** distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection); if (distance < smallest_distance) { --- 395,399 ---- distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { *************** *** 411,415 **** distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection); if (distance < smallest_distance) { --- 412,416 ---- distance = roadmap_math_get_distance_from_segment ! (position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { |
From: Ehud S. <esh...@us...> - 2006-07-17 06:33:51
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11091 Modified Files: editor_main.c Log Message: Version bump. Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** editor_main.c 13 Jul 2006 06:37:43 -0000 1.11 --- editor_main.c 17 Jul 2006 06:33:48 -0000 1.12 *************** *** 41,45 **** int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.7.1"; int editor_is_enabled (void) { --- 41,45 ---- int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.8.0 pre1"; int editor_is_enabled (void) { |
From: Ehud S. <esh...@us...> - 2006-07-17 06:33:01
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10684 Modified Files: editor_export.c Log Message: Fix win32 gz export. Index: editor_export.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** editor_export.c 16 Jul 2006 12:25:08 -0000 1.13 --- editor_export.c 17 Jul 2006 06:32:58 -0000 1.14 *************** *** 175,179 **** } else { ! gz_file = gzopen(name, "w"); if (gz_file == NULL) { editor_log (ROADMAP_ERROR, "Can't create file: %s", name); --- 175,179 ---- } else { ! gz_file = gzopen(name, "wb"); if (gz_file == NULL) { editor_log (ROADMAP_ERROR, "Can't create file: %s", name); |
From: Ehud S. <esh...@us...> - 2006-07-17 06:31:52
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/track In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10266 Modified Files: editor_track_unknown.c editor_track_util.c Log Message: Merge Paul's 3D labels. Index: editor_track_util.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** editor_track_util.c 11 Jun 2006 10:59:36 -0000 1.11 --- editor_track_util.c 17 Jul 2006 06:31:49 -0000 1.12 *************** *** 348,352 **** track_point_pos (i), track_point_pos (i-1), ! &intersection); if (distance >= min_distance) break; --- 348,352 ---- track_point_pos (i), track_point_pos (i-1), ! &intersection, NULL); if (distance >= min_distance) break; Index: editor_track_unknown.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/track/editor_track_unknown.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editor_track_unknown.c 11 Jun 2006 11:20:46 -0000 1.6 --- editor_track_unknown.c 17 Jul 2006 06:31:49 -0000 1.7 *************** *** 70,74 **** track_point_pos (i), track_point_pos (i+1), ! &intersection); if (distance < smallest_distance) { --- 70,74 ---- track_point_pos (i), track_point_pos (i+1), ! &intersection, NULL); if (distance < smallest_distance) { |
From: Ehud S. <esh...@us...> - 2006-07-17 06:31:36
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/db In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10229 Modified Files: editor_street.c editor_trkseg.c Log Message: Merge Paul's 3D labels. Index: editor_trkseg.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_trkseg.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editor_trkseg.c 21 May 2006 12:43:18 -0000 1.6 --- editor_trkseg.c 17 Jul 2006 06:31:33 -0000 1.7 *************** *** 303,307 **** distance = roadmap_math_get_distance_from_segment ! (split_position, &from, &to, &intersection); if (distance < smallest_distance) { --- 303,307 ---- distance = roadmap_math_get_distance_from_segment ! (split_position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { *************** *** 327,331 **** distance = roadmap_math_get_distance_from_segment ! (split_position, &from, &to, &intersection); if (distance < smallest_distance) { --- 327,331 ---- distance = roadmap_math_get_distance_from_segment ! (split_position, &from, &to, &intersection, NULL); if (distance < smallest_distance) { Index: editor_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/db/editor_street.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor_street.c 11 Jun 2006 11:20:31 -0000 1.5 --- editor_street.c 17 Jul 2006 06:31:33 -0000 1.6 *************** *** 210,214 **** current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.from, ¤t.to, ¤t.intersection); if (current.distance < smallest_distance) { --- 210,215 ---- current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.from, ! ¤t.to, ¤t.intersection, NULL); if (current.distance < smallest_distance) { *************** *** 226,230 **** current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.to, ¤t.from, ¤t.intersection); if (current.distance < smallest_distance) { --- 227,231 ---- current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.to, ¤t.from, ¤t.intersection, NULL); if (current.distance < smallest_distance) { |
From: Ehud S. <esh...@us...> - 2006-07-17 06:31:13
|
Update of /cvsroot/roadmap/roadmap_editor/src/agg In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10193 Modified Files: roadmap_canvas.cpp Log Message: Merge Paul's 3D labels. Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/agg/roadmap_canvas.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_canvas.cpp 5 Jun 2006 09:18:13 -0000 1.4 --- roadmap_canvas.cpp 17 Jul 2006 06:31:10 -0000 1.5 *************** *** 130,137 **** void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent) { *ascent = 0; *descent = 0; wchar_t wstr[255]; --- 130,139 ---- void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt) { *ascent = 0; *descent = 0; + if (can_tilt) *can_tilt = 1; wchar_t wstr[255]; *************** *** 270,274 **** roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent; --- 272,276 ---- roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent; *************** *** 331,335 **** ResumeCAPAll(); #endif ! raso.round_cap(true); if (!fast_draw) { --- 333,337 ---- ResumeCAPAll(); #endif ! raso.round_cap(true); if (!fast_draw) { |
From: Ehud S. <esh...@us...> - 2006-07-17 06:30:54
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9813 Modified Files: roadmap_screen_obj.c Log Message: Merge Paul's 3D labels. Index: roadmap_screen_obj.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen_obj.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_screen_obj.c 11 Jun 2006 10:58:58 -0000 1.4 --- roadmap_screen_obj.c 17 Jul 2006 06:30:51 -0000 1.5 *************** *** 506,510 **** for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) { int state = 0; ! int image_mode = IMAGE_NORAML; RoadMapGuiPoint pos; --- 506,510 ---- for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) { int state = 0; ! int image_mode = IMAGE_NORMAL; RoadMapGuiPoint pos; |
From: Ehud S. <esh...@us...> - 2006-07-17 06:29:41
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9327 Modified Files: roadgps_screen.c roadmap_canvas.h roadmap_display.c roadmap_label.c roadmap_label.h roadmap_math.c roadmap_math.h roadmap_screen.c roadmap_start.c roadmap_street.c Log Message: Merge Paul's 3D labels. Index: roadmap_street.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_street.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_street.c 5 Jun 2006 09:16:24 -0000 1.9 --- roadmap_street.c 17 Jul 2006 06:29:37 -0000 1.10 *************** *** 858,862 **** current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.from, ¤t.to, ¤t.intersection); if (current.distance < smallest_distance) { --- 858,863 ---- current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.from, ¤t.to, ! ¤t.intersection, NULL); if (current.distance < smallest_distance) { *************** *** 875,879 **** current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.to, ¤t.from, ¤t.intersection); if (current.distance < smallest_distance) { --- 876,880 ---- current.distance = roadmap_math_get_distance_from_segment ! (position, ¤t.to, ¤t.from, ¤t.intersection, NULL); if (current.distance < smallest_distance) { *************** *** 899,903 **** roadmap_math_get_distance_from_segment (position, &neighbour->from, &neighbour->to, ! &neighbour->intersection); roadmap_plugin_set_line --- 900,904 ---- roadmap_math_get_distance_from_segment (position, &neighbour->from, &neighbour->to, ! &neighbour->intersection, NULL); roadmap_plugin_set_line Index: roadmap_math.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_math.h 22 May 2006 09:08:06 -0000 1.7 --- roadmap_math.h 17 Jul 2006 06:29:37 -0000 1.8 *************** *** 22,27 **** */ ! #ifndef _ROADMAP_MATH__H_ ! #define _ROADMAP_MATH__H_ --- 22,27 ---- */ ! #ifndef INCLUDED__ROADMAP_MATH__H ! #define INCLUDED__ROADMAP_MATH__H *************** *** 33,36 **** --- 33,40 ---- }; + enum { MATH_DIST_ACTUAL = 0, + MATH_DIST_SQUARED = 1 + }; + void roadmap_math_initialize (void); *************** *** 68,71 **** --- 72,76 ---- RoadMapGuiPoint *point1); + void roadmap_math_coordinate (const RoadMapPosition *position, RoadMapGuiPoint *point); *************** *** 88,91 **** --- 93,99 ---- int roadmap_math_angle (const RoadMapGuiPoint *point1, const RoadMapGuiPoint *point2); + long roadmap_math_screen_distance + (const RoadMapGuiPoint *point1, const RoadMapGuiPoint *point2, + int squared); char *roadmap_math_distance_unit (void); *************** *** 96,104 **** --- 104,116 ---- (const RoadMapPosition *position1, const RoadMapPosition *position2); + int roadmap_math_distance_convert (const char *string, int *was_explicit); int roadmap_math_to_trip_distance (int distance); + int roadmap_math_to_trip_distance_tenths (int distance); int roadmap_math_to_speed_unit (int knots); + int roadmap_math_to_current_unit (int value, const char *unit); + int roadmap_math_to_cm (int value); int roadmap_math_get_distance_from_segment *************** *** 106,116 **** const RoadMapPosition *position1, const RoadMapPosition *position2, ! RoadMapPosition *intersection); int roadmap_math_intersection (RoadMapPosition *from1, ! RoadMapPosition *to1, ! RoadMapPosition *from2, ! RoadMapPosition *to2, ! RoadMapPosition *intersection); void roadmap_math_screen_edges (RoadMapArea *area); --- 118,133 ---- const RoadMapPosition *position1, const RoadMapPosition *position2, ! RoadMapPosition *intersection, ! int *which); int roadmap_math_intersection (RoadMapPosition *from1, ! RoadMapPosition *to1, ! RoadMapPosition *from2, ! RoadMapPosition *to2, ! RoadMapPosition *intersection); ! ! int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, ! RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, ! RoadMapGuiPoint *isect); void roadmap_math_screen_edges (RoadMapArea *area); *************** *** 119,131 **** int roadmap_math_compare_points (const RoadMapPosition *p1, ! const RoadMapPosition *p2); int roadmap_math_delta_direction (int direction1, int direction2); - int roadmap_math_distance_convert(const char *string, int *_explicit); - void roadmap_math_set_context (RoadMapPosition *position, int zoom); void roadmap_math_get_context (RoadMapPosition *position, int *zoom); ! #endif // _ROADMAP_MATH__H_ --- 136,147 ---- int roadmap_math_compare_points (const RoadMapPosition *p1, ! const RoadMapPosition *p2); int roadmap_math_delta_direction (int direction1, int direction2); void roadmap_math_set_context (RoadMapPosition *position, int zoom); void roadmap_math_get_context (RoadMapPosition *position, int *zoom); ! #endif // INCLUDED__ROADMAP_MATH__H ! Index: roadgps_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadgps_screen.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadgps_screen.c 11 Jun 2006 11:18:05 -0000 1.5 --- roadgps_screen.c 17 Jul 2006 06:29:36 -0000 1.6 *************** *** 337,341 **** roadmap_canvas_get_text_extents ! ("09", -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent + 2; --- 337,341 ---- roadmap_canvas_get_text_extents ! ("09", -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent + 2; Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_math.c 22 May 2006 09:08:06 -0000 1.8 --- roadmap_math.c 17 Jul 2006 06:29:37 -0000 1.9 *************** *** 4,8 **** * * Copyright 2002 Pascal F. Martin ! * Copyright 2006 Ehud Shabtai * * 3D perspective support was integrated from the RoadNav project --- 4,8 ---- * * Copyright 2002 Pascal F. Martin ! * Copyright 2005,2006 Ehud Shabtai * * 3D perspective support was integrated from the RoadNav project *************** *** 30,34 **** * * These functions are used to compute the position of points on the map, ! * or the distance between two points, given their Tiger position. */ --- 30,34 ---- * * These functions are used to compute the position of points on the map, ! * or the distance between two points, given their position. */ *************** *** 50,53 **** --- 50,56 ---- #define ROADMAP_BASE_METRIC 1 + #define MIN_ZOOM_IN 2 + #define MAX_ZOOM_OUT 0x10000 + static RoadMapConfigDescriptor RoadMapConfigGeneralDefaultZoom = *************** *** 57,60 **** --- 60,64 ---- ROADMAP_CONFIG_ITEM("General", "Zoom"); + #define ROADMAP_REFERENCE_ZOOM 20 *************** *** 135,139 **** int _3D_horizon; ! } RoadMapContext; --- 139,143 ---- int _3D_horizon; ! } RoadMapContext; *************** *** 146,152 **** int cosine; ! while (i < 0) { ! i += 90; ! } if (i <= 45) { --- 150,154 ---- int cosine; ! while (i < 0) i += 90; if (i <= 45) { *************** *** 159,165 **** } ! while (angle < 0) { ! angle += 360; ! } i = (angle / 90) % 4; if (i < 0) { --- 161,166 ---- } ! while (angle < 0) angle += 360; ! i = (angle / 90) % 4; if (i < 0) { *************** *** 441,458 **** static void roadmap_math_project (RoadMapGuiPoint *point) { ! double fDistFromCenterY = RoadMapContext.height - point->y; // how far away is this point along the Y axis ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; // how far from the bottom of the screen is the horizon double fDistFromCenterX; double fDistFromHorizon; ! point->y = (int) (RoadMapContext.height - fDistFromCenterY / ( fabs(fDistFromCenterY / fVisibleRange) + 1 )); // make the Y coordinate converge on the horizon as the distance from the center goes to infinity ! fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of the screen ! fDistFromHorizon = point->y - RoadMapContext._3D_horizon; // distance from the horizon after adjusting for perspective ! point->x = (int) (fDistFromCenterX * ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); // squeeze the X axis, make it a point at the horizon and normal sized at the bottom of the screen } --- 442,572 ---- + #if USE_FLOAT /* for reference, until we're sure integer version works */ static void roadmap_math_project (RoadMapGuiPoint *point) { ! /* how far away is this point along the Y axis */ ! double fDistFromCenterY = RoadMapContext.height - point->y; ! ! /* how far from the bottom of the screen is the horizon */ ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! double fDistFromCenterX; double fDistFromHorizon; ! /* make the Y coordinate converge on the horizon as the ! * distance from the center goes to infinity */ ! point->y = (int) (RoadMapContext.height - fDistFromCenterY / ! ( fabs(fDistFromCenterY / fVisibleRange) + 1 )); ! /* X distance from center of the screen */ ! fDistFromCenterX = point->x - RoadMapContext.width / 2; ! /* distance from the horizon after adjusting for perspective */ ! fDistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* squeeze the X axis, make it a point at the horizon and ! * normal sized at the bottom of the screen */ ! point->x = (int) (fDistFromCenterX * ( fDistFromHorizon / fVisibleRange ) ! + RoadMapContext.width / 2); ! } ! ! void roadmap_math_unproject (RoadMapGuiPoint *point) { ! ! RoadMapGuiPoint point2; ! ! /* X distance from center of screen */ ! double fDistFromCenterX = point->x - RoadMapContext.width / 2; ! ! /* Y distance from horizon */ ! double fDistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* distance from bottom of screen to horizon */ ! double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! double fDistFromBottom; ! double fD; ! ! if (RoadMapContext._3D_horizon == 0) { ! return; ! } ! ! /* unsqueeze the X axis */ ! point2.x = (int) (fDistFromCenterX / ! ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); ! ! /* distance from bottom of screen */ ! fDistFromBottom = RoadMapContext.height - point->y; ! /* inverse Y squeezing formula */ ! fD = fDistFromBottom / ( 1.0 - fDistFromBottom / fVisibleRange); ! ! /* center on screen */ ! point2.y = (int) (RoadMapContext.height - fD); ! ! *point = point2; ! } ! #else ! static void roadmap_math_project (RoadMapGuiPoint *point) { ! ! /* how far away is this point along the Y axis */ ! long DistFromCenterY = RoadMapContext.height - point->y; ! ! /* how far from the bottom of the screen is the horizon */ ! long VisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! ! long DistFromCenterX; ! long DistFromHorizon; ! ! /* make the Y coordinate converge on the horizon as the ! * distance from the center goes to infinity */ ! point->y = RoadMapContext.height - ! (DistFromCenterY * VisibleRange) / ! (abs(DistFromCenterY) + VisibleRange) ; ! ! /* X distance from center of the screen */ ! DistFromCenterX = point->x - RoadMapContext.width / 2; ! ! /* distance from the horizon after adjusting for perspective */ ! DistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* squeeze the X axis, make it a point at the horizon and ! * normal sized at the bottom of the screen */ ! point->x = (DistFromCenterX * DistFromHorizon) / VisibleRange ! + (RoadMapContext.width / 2); ! } ! ! void roadmap_math_unproject (RoadMapGuiPoint *point) { ! ! RoadMapGuiPoint point2; ! ! /* X distance from center of screen */ ! long DistFromCenterX = point->x - RoadMapContext.width / 2; ! ! /* Y distance from horizon */ ! long DistFromHorizon = point->y - RoadMapContext._3D_horizon; ! ! /* distance from bottom of screen to horizon */ ! long VisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; ! long DistFromBottom; ! long D; ! ! if (RoadMapContext._3D_horizon == 0) { ! return; ! } ! ! /* unsqueeze the X axis */ ! point2.x = DistFromCenterX * VisibleRange / DistFromHorizon + ! RoadMapContext.width / 2; ! ! /* distance from bottom of screen */ ! DistFromBottom = RoadMapContext.height - point->y; ! ! /* inverse Y squeezing formula */ ! D = (DistFromBottom * VisibleRange) / ( (VisibleRange - DistFromBottom) ); ! ! /* center on screen */ ! point2.y = RoadMapContext.height - D; ! ! *point = point2; } + #endif *************** *** 504,508 **** roadmap_math_project (points); } ! points += 1; } --- 618,622 ---- roadmap_math_project (points); } ! points += 1; } *************** *** 513,517 **** * rotate the coordinates of a point to an arbitrary angle */ ! void roadmap_math_rotate_point (RoadMapGuiPoint *points, RoadMapGuiPoint *center, int angle) { --- 627,631 ---- * rotate the coordinates of a point to an arbitrary angle */ ! void roadmap_math_rotate_point (RoadMapGuiPoint *point, RoadMapGuiPoint *center, int angle) { *************** *** 523,528 **** int y; - if (angle == 0) return; - if (angle != cached_angle) { cached_angle = angle; --- 637,640 ---- *************** *** 532,550 **** } ! x = points->x; ! y = points->y; ! points->x = center->x + (((x * cos_orientation) + (y * sin_orientation) + 16383) / 32768); ! points->y = center->y - (((y * cos_orientation) - (x * sin_orientation) + 16383) / 32768); if (RoadMapContext._3D_horizon) { ! roadmap_math_project (points); } } --- 644,664 ---- } ! x = point->x; ! y = point->y; ! point->x = center->x + (((x * cos_orientation) + (y * sin_orientation) + 16383) / 32768); ! point->y = center->y - (((y * cos_orientation) - (x * sin_orientation) + 16383) / 32768); + if (angle == 0) return; + if (RoadMapContext._3D_horizon) { ! roadmap_math_project (point); } } *************** *** 604,607 **** --- 718,722 ---- } + void roadmap_math_use_metric (void) { *************** *** 760,763 **** --- 875,879 ---- } + void roadmap_math_restore_zoom (void) { *************** *** 779,783 **** zoom = (3 * RoadMapContext.zoom) / 2; ! if (zoom < 0x10000) { RoadMapContext.zoom = (unsigned short) zoom; } --- 895,899 ---- zoom = (3 * RoadMapContext.zoom) / 2; ! if (zoom < MAX_ZOOM_OUT) { RoadMapContext.zoom = (unsigned short) zoom; } *************** *** 790,796 **** RoadMapContext.zoom = (2 * RoadMapContext.zoom) / 3; ! if (RoadMapContext.zoom <= 1) { ! RoadMapContext.zoom = 2; } roadmap_config_set_integer (&RoadMapConfigGeneralZoom, RoadMapContext.zoom); roadmap_math_compute_scale (); --- 906,913 ---- RoadMapContext.zoom = (2 * RoadMapContext.zoom) / 3; ! if (RoadMapContext.zoom < MIN_ZOOM_IN) { ! RoadMapContext.zoom = MIN_ZOOM_IN; } + roadmap_config_set_integer (&RoadMapConfigGeneralZoom, RoadMapContext.zoom); roadmap_math_compute_scale (); *************** *** 883,889 **** direction = direction % 360; ! while (direction < 0) { ! direction += 360; ! } if (direction == RoadMapContext.orientation) { --- 1000,1004 ---- direction = direction % 360; ! while (direction < 0) direction += 360; if (direction == RoadMapContext.orientation) { *************** *** 968,994 **** - void roadmap_math_unproject (RoadMapGuiPoint *point) { - - if (RoadMapContext._3D_horizon) { - - RoadMapGuiPoint point2; - - double fDistFromCenterX = point->x - RoadMapContext.width / 2; // X distance from center of screen - double fDistFromHorizon = point->y - RoadMapContext._3D_horizon; // Y distance from horizon - double fVisibleRange = RoadMapContext.height - RoadMapContext._3D_horizon; // distance from bottom of screen to horizon - double fDistFromBottom; - double fD; - - point2.x = (int) (fDistFromCenterX / ( fDistFromHorizon / fVisibleRange ) + RoadMapContext.width / 2); // unsqueeze the X axis - - fDistFromBottom = RoadMapContext.height - point->y; // distance from bottom of screen - fD = fDistFromBottom / ( 1.0 - fDistFromBottom / fVisibleRange); // inverse Y squeezing formula - - point2.y = (int) (RoadMapContext.height - fD); // center on screen - - *point = point2; - } - } - void roadmap_math_to_position (const RoadMapGuiPoint *point, --- 1083,1086 ---- *************** *** 1007,1011 **** if (RoadMapContext.orientation) { ! if (!projected || !RoadMapContext._3D_horizon) { point2 = *point; --- 1099,1103 ---- if (RoadMapContext.orientation) { ! if (!projected || !RoadMapContext._3D_horizon) { point2 = *point; *************** *** 1029,1033 **** RoadMapGuiPoint *point) { - int scale = 1; --- 1121,1124 ---- *************** *** 1095,1098 **** --- 1186,1210 ---- } + long roadmap_math_screen_distance + (const RoadMapGuiPoint *pt1, const RoadMapGuiPoint *pt2, int squared) { + + long dx; + long dy; + long ret; + + + dx = pt1->x - pt2->x; + dy = pt1->y - pt2->y; + + + ret = (dx * dx) + (dy * dy); + + if (squared == MATH_DIST_ACTUAL) { + ret = (long) sqrt ((double)ret); + } + + return ret; + } + int roadmap_math_distance *************** *** 1112,1115 **** --- 1224,1273 ---- + /* Take a number followed by ft/mi/m/km, and converts it to current units. */ + int roadmap_math_distance_convert(const char *string, int *was_explicit) + { + char *suffix; + double distance; + RoadMapUnits *my_units, *other_units; + int had_units = 1; + + my_units = RoadMapContext.units; + if (my_units == &RoadMapMetricSystem) { + other_units = &RoadMapImperialSystem; + } else { + other_units = &RoadMapMetricSystem; + } + + distance = strtol (string, &suffix, 10); + + while (*suffix && isspace(*suffix)) suffix++; + + if (*suffix) { + if (0 == strcasecmp(suffix, my_units->length)) { + /* Nothing to do, hopefully this is the usual case. */ + } else if (0 == strcasecmp(suffix, my_units->trip_distance)) { + distance *= my_units->to_trip_unit; + } else if (0 == strcasecmp(suffix, other_units->length)) { + distance /= other_units->cm_to_unit; + distance *= my_units->cm_to_unit; + } else if (0 == strcasecmp(suffix, other_units->trip_distance)) { + distance *= other_units->to_trip_unit; + distance /= other_units->cm_to_unit; + distance *= my_units->cm_to_unit; + } else { + roadmap_log (ROADMAP_WARNING, + "dropping unknown units '%s' from '%s'", suffix, string); + had_units = 0; + } + } else { + had_units = 0; + } + + if (was_explicit) *was_explicit = had_units; + + return (int)distance; + } + + char *roadmap_math_distance_unit (void) { *************** *** 1135,1138 **** --- 1293,1301 ---- } + int roadmap_math_to_trip_distance_tenths (int distance) { + + return (10 * distance) / RoadMapContext.units->to_trip_unit; + } + int roadmap_math_get_distance_from_segment *************** *** 1140,1144 **** const RoadMapPosition *position1, const RoadMapPosition *position2, ! RoadMapPosition *intersection) { int distance; --- 1303,1308 ---- const RoadMapPosition *position1, const RoadMapPosition *position2, ! RoadMapPosition *intersection, ! int *which) { int distance; *************** *** 1176,1181 **** y3 = 0.0; ! intersection->longitude = ! (position1->longitude + position2->longitude) / 2; } else { --- 1340,1347 ---- y3 = 0.0; ! if (intersection != NULL) { ! intersection->longitude = ! (position1->longitude + position2->longitude) / 2; ! } } else { *************** *** 1191,1198 **** y3 = b / ((a * a) + 1.0); ! intersection->longitude = ! position1->longitude ! + (int)(((x1 - x3) ! * (position2->longitude - position1->longitude)) / (x1 - x2)); } --- 1357,1366 ---- y3 = b / ((a * a) + 1.0); ! if (intersection != NULL) { ! intersection->longitude = ! position1->longitude + (int)(((x1 - x3) ! * (position2->longitude - position1->longitude)) ! / (x1 - x2)); ! } } *************** *** 1203,1219 **** /* The intersection point is in the segment. */ ! if ((y1 - y2 > -1.0) && (y1 - y2 < 1.0)) { ! intersection->latitude = ! (position1->latitude + position2->latitude) / 2; ! } else { ! intersection->latitude = ! position1->latitude ! + (int)(((y1 - y3) ! * (position2->latitude - position1->latitude)) / (y1 - y2)); } return (int) sqrt ((x3 * x3) + (y3 * y3)); } --- 1371,1391 ---- /* The intersection point is in the segment. */ ! if (intersection != NULL) { ! if ((y1 - y2 > -1.0) && (y1 - y2 < 1.0)) { ! intersection->latitude = ! (position1->latitude + position2->latitude) / 2; ! } else { ! intersection->latitude = ! position1->latitude + (int)(((y1 - y3) ! * (position2->latitude - position1->latitude)) ! / (y1 - y2)); ! } } + if (which != NULL) *which = 0; /* neither endpoint is closest */ + return (int) sqrt ((x3 * x3) + (y3 * y3)); } *************** *** 1226,1234 **** if (distance < minimum) { ! *intersection = *position2; return distance; } ! *intersection = *position1; return minimum; } --- 1398,1413 ---- if (distance < minimum) { ! ! if (intersection != NULL) *intersection = *position2; ! ! if (which != NULL) *which = 2; /* endpoint 2 is closest */ ! return distance; } ! if (intersection != NULL) *intersection = *position1; ! ! if (which != NULL) *which = 1; /* endpoint 1 is closest */ ! return minimum; } *************** *** 1260,1263 **** --- 1439,1456 ---- + int roadmap_math_to_cm (int value) { + + static int PreviousValue = 0; + static int PreviousResult = 0; + + if (value != PreviousValue) { + PreviousResult = (int) (value / RoadMapContext.units->cm_to_unit); + PreviousValue = value; + } + + return PreviousResult; + } + + void roadmap_math_screen_edges (RoadMapArea *area) { *************** *** 1298,1302 **** if (image[i] < '0' || image[i] > '9') { roadmap_log ! (ROADMAP_ERROR, "bad numerical character %c", image[i]); } part1 = (part1 * 10) + (image[i] - '0'); --- 1491,1495 ---- if (image[i] < '0' || image[i] > '9') { roadmap_log ! (ROADMAP_WARNING, "bad numerical character %c", image[i]); } part1 = (part1 * 10) + (image[i] - '0'); *************** *** 1378,1381 **** --- 1571,1648 ---- } + /* this routine isn't accurate for segments that are either very flat + * or very steep (i.e. within a few degrees of 0 or 90). + */ + int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, + RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, + RoadMapGuiPoint *isect) { + + #if USE_FLOAT /* for reference, until we're sure integer version works */ + double a1,b1; + double a2,b2; + double x; + + if (f1->x == t1->x) { + + a1 = 0; + b1 = f1->y; + } else { + a1 = 1.0 * (f1->y - t1->y) / (f1->x - t1->x); + b1 = f1->y - 1.0 * a1 * f1->x; + } + + if ((f2->x - t2->x) == 0) { + a2 = 0; + b2 = f2->y; + } else { + a2 = 1.0 * (f2->y - t2->y) / (f2->x - t2->x); + b2 = f2->y - 1.0 * a2 * f2->x; + } + + if (a1 == a2) return 0; + + x = (b1 - b2) / (a2 - a1); + if (fabs(a1) < fabs(a2)) { + isect->y = (int) (b1 + x * a1); + } else { + isect->y = (int) (b2 + x * a2); + } + isect->x = (int)x; + #else + long a1,b1; + long a2,b2; + long x; + + if (f1->x == t1->x) { + a1 = 0; + b1 = 1024 * f1->y; + } else { + a1 = 1024 * (f1->y - t1->y) / (f1->x - t1->x); + b1 = 1024 * f1->y - a1 * f1->x; + } + + if (f2->x == t2->x) { + a2 = 0; + b2 = 1024 * f2->y; + } else { + a2 = 1024 * (f2->y - t2->y) / (f2->x - t2->x); + b2 = 1024 * f2->y - a2 * f2->x; + } + + if (a1 == a2) return 0; + + x = (b1 - b2) / (a2 - a1); + if (abs(a1) < abs(a2)) { + isect->y = (b1 + x * a1) / 1024; + } else { + isect->y = (b2 + x * a2) / 1024; + } + isect->x = x; + #endif + + return 1; + } + + int roadmap_math_compare_points (const RoadMapPosition *p1, *************** *** 1412,1461 **** - /* Take a number followed by ft/mi/m/km, and converts it to current units. */ - int roadmap_math_distance_convert(const char *string, int *explicit) - { - char *suffix; - double distance; - RoadMapUnits *my_units, *other_units; - int had_units = 1; - - my_units = RoadMapContext.units; - if (my_units == &RoadMapMetricSystem) { - other_units = &RoadMapImperialSystem; - } else { - other_units = &RoadMapMetricSystem; - } - - distance = strtol (string, &suffix, 10); - - while (*suffix && isspace(*suffix)) suffix++; - - if (*suffix) { - if (0 == strcasecmp(suffix, my_units->length)) { - /* Nothing to do, hopefully this is the usual case. */ - } else if (0 == strcasecmp(suffix, my_units->trip_distance)) { - distance *= my_units->to_trip_unit; - } else if (0 == strcasecmp(suffix, other_units->length)) { - distance /= other_units->cm_to_unit; - distance *= my_units->cm_to_unit; - } else if (0 == strcasecmp(suffix, other_units->trip_distance)) { - distance *= other_units->to_trip_unit; - distance /= other_units->cm_to_unit; - distance *= my_units->cm_to_unit; - } else { - roadmap_log (ROADMAP_WARNING, - "dropping unknown units '%s' from '%s'", suffix, string); - had_units = 0; - } - } else { - had_units = 0; - } - - if (explicit) *explicit = had_units; - - return (int)distance; - } - - void roadmap_math_set_context (RoadMapPosition *position, int zoom) { --- 1679,1682 ---- Index: roadmap_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_canvas.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_canvas.h 5 Jun 2006 09:17:28 -0000 1.7 --- roadmap_canvas.h 17 Jul 2006 06:29:37 -0000 1.8 *************** *** 33,37 **** #include "roadmap_gui.h" ! enum { IMAGE_NORAML, IMAGE_SELECTED }; --- 33,37 ---- #include "roadmap_gui.h" ! enum { IMAGE_NORMAL, IMAGE_SELECTED }; *************** *** 65,69 **** */ void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent); --- 65,70 ---- */ void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt); *************** *** 123,126 **** --- 124,130 ---- const char *text); + void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *position, + RoadMapGuiPoint *center, int angle, + const char *text); void roadmap_canvas_draw_multiple_points (int count, RoadMapGuiPoint *points); *************** *** 130,137 **** void roadmap_canvas_draw_multiple_polygons ! (int count, int *polygons, RoadMapGuiPoint *points, int filled, int fast_draw); void roadmap_canvas_draw_multiple_circles ! (int count, RoadMapGuiPoint *centers, int *radius, int filled, int fast_draw); --- 134,143 ---- void roadmap_canvas_draw_multiple_polygons ! (int count, int *polygons, RoadMapGuiPoint *points, int filled, ! int fast_draw); void roadmap_canvas_draw_multiple_circles ! (int count, RoadMapGuiPoint *centers, int *radius, int filled, ! int fast_draw); *************** *** 146,153 **** void roadmap_canvas_save_screenshot (const char* filename); - void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *position, - RoadMapGuiPoint *center, int angle, - const char *text); - int roadmap_canvas_image_width (const RoadMapImage image); int roadmap_canvas_image_height (const RoadMapImage image); --- 152,155 ---- Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_display.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_display.c 11 Jun 2006 10:58:58 -0000 1.9 --- roadmap_display.c 17 Jul 2006 06:29:37 -0000 1.10 *************** *** 285,289 **** roadmap_canvas_get_text_extents ! (sign->content, -1, &width, &ascent, &descent); width += 8; /* Keep some room around the text. */ --- 285,289 ---- roadmap_canvas_get_text_extents ! (sign->content, -1, &width, &ascent, &descent, NULL); width += 8; /* Keep some room around the text. */ *************** *** 604,608 **** } ! roadmap_canvas_get_text_extents (text, -1, &width, &ascent, &descent); if (corner & ROADMAP_CANVAS_RIGHT) { --- 604,608 ---- } ! roadmap_canvas_get_text_extents (text, -1, &width, &ascent, &descent, NULL); if (corner & ROADMAP_CANVAS_RIGHT) { Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** roadmap_screen.c 13 Jul 2006 06:36:08 -0000 1.17 --- roadmap_screen.c 17 Jul 2006 06:29:37 -0000 1.18 *************** *** 48,52 **** #include "roadmap_sprite.h" #include "roadmap_object.h" ! #include "roadmap_trip.h" #include "roadmap_message.h" #include "roadmap_canvas.h" --- 48,52 ---- #include "roadmap_sprite.h" #include "roadmap_object.h" ! #include "roadmap_trip.h" #include "roadmap_message.h" #include "roadmap_canvas.h" *************** *** 88,91 **** --- 88,93 ---- ROADMAP_CONFIG_ITEM("Style", "Show Objects when Dragging"); + static RoadMapConfigDescriptor RoadMapConfigMapLabels = + ROADMAP_CONFIG_ITEM("Map", "Labels"); static int RoadMapScreenInitialized = 0; *************** *** 99,102 **** --- 101,105 ---- static int RoadMapScreenOrientationMode = ORIENTATION_DYNAMIC; static int RoadMapScreen3dHorizon; + static int RoadMapScreenLabels; static int RoadMapScreenRotation; static int RoadMapScreenWidth; *************** *** 111,114 **** --- 114,118 ---- static RoadMapPen RoadMapScreenLastPen = NULL; + static void roadmap_screen_after_refresh (void) {} *************** *** 155,160 **** static void roadmap_screen_flush_points (void) { ! if (RoadMapScreenPoints.cursor == RoadMapScreenPoints.data) ! return; roadmap_math_rotate_coordinates --- 159,163 ---- static void roadmap_screen_flush_points (void) { ! if (RoadMapScreenPoints.cursor == RoadMapScreenPoints.data) return; roadmap_math_rotate_coordinates *************** *** 172,177 **** static void roadmap_screen_flush_lines (void) { ! if (RoadMapScreenObjects.cursor == RoadMapScreenObjects.data) ! return; roadmap_math_rotate_coordinates --- 175,179 ---- static void roadmap_screen_flush_lines (void) { ! if (RoadMapScreenObjects.cursor == RoadMapScreenObjects.data) return; roadmap_math_rotate_coordinates *************** *** 200,203 **** --- 202,206 ---- RoadMapGuiPoint *middle, int *angle) { + RoadMapGuiPoint point0; RoadMapGuiPoint point1; *************** *** 217,221 **** if (total_length) *total_length = 0; ! /* if the pen has changed, we need to flush the prevoius lines and points */ --- 220,224 ---- if (total_length) *total_length = 0; ! /* if the pen has changed, we need to flush the previous lines and points */ *************** *** 285,289 **** if (length > longest_segent) { longest_segent = length; ! *angle = roadmap_math_azymuth(&last_midposition, &midposition); middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 288,294 ---- if (length > longest_segent) { longest_segent = length; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, &midposition); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 304,311 **** if (!last_point_visible) { ! /* Show the previous segment as the end ! * of a complete line. The remaining part of the ! * shaped line, if any, will be drawn as a new ! * complete line. */ *RoadMapScreenObjects.cursor = --- 309,315 ---- if (!last_point_visible) { ! /* Show the previous segment as the end of a complete line. ! * The remaining part of the shaped line, if any, will be ! * drawn as a new complete line. */ *RoadMapScreenObjects.cursor = *************** *** 335,339 **** if (length > longest_segent) { longest_segent = length; ! *angle = roadmap_math_azymuth(&last_midposition, to); middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 339,345 ---- if (length > longest_segent) { longest_segent = length; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 397,401 **** *total_length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! *angle = roadmap_math_azymuth(from, to); middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; --- 403,409 ---- *total_length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! if (angle) { ! *angle = roadmap_math_azymuth(from, to); ! } middle->x = (point1.x + point0.x) / 2; middle->y = (point1.y + point0.y) / 2; *************** *** 420,423 **** --- 428,432 ---- + static void roadmap_screen_flush_polygons (void) { *************** *** 469,473 **** category = roadmap_polygon_category (i); pen = roadmap_layer_get_pen (category, 0); ! if (RoadMapScreenLastPen != pen) { roadmap_screen_flush_polygons (); --- 478,484 ---- category = roadmap_polygon_category (i); pen = roadmap_layer_get_pen (category, 0); ! ! if (pen == NULL) continue; ! if (RoadMapScreenLastPen != pen) { roadmap_screen_flush_polygons (); *************** *** 604,610 **** int fips = roadmap_locator_active (); int total_length; ! int *total_length_ptr; ! int angle; RoadMapGuiPoint seg_middle; int drawn = 0; --- 615,624 ---- int fips = roadmap_locator_active (); int total_length; ! int *total_length_ptr = 0; ! int angle = 0; ! int *angle_ptr = 0; RoadMapGuiPoint seg_middle; + RoadMapGuiPoint loweredge; + int cutoff_dist = 0; int drawn = 0; *************** *** 614,623 **** layer_pen = roadmap_layer_get_pen (cfcc, pen_type); ! if (RoadMapScreen3dHorizon || (pen_type != 0) || RoadMapScreenDragging) { ! /* we do labels only for the first pen */ ! total_length_ptr = 0; ! } else { total_length_ptr = &total_length; } --- 628,653 ---- layer_pen = roadmap_layer_get_pen (cfcc, pen_type); + + if (layer_pen == NULL) return 0; ! ! if ((pen_type == 0) && /* we do labels only for the first pen */ ! !RoadMapScreenDragging && ! RoadMapScreenLabels) { total_length_ptr = &total_length; + if (RoadMapScreen3dHorizon != 0) { + /* arrange to not do labels further than 3/4 up the screen */ + RoadMapGuiPoint label_cutoff; + label_cutoff.y = roadmap_canvas_height() / 4; + label_cutoff.x = roadmap_canvas_width() / 2; + loweredge.x = roadmap_canvas_width() / 2; + loweredge.y = roadmap_canvas_height(); + roadmap_math_unproject(&label_cutoff); + roadmap_math_unproject(&loweredge); + cutoff_dist = roadmap_math_screen_distance + (&label_cutoff, &loweredge, MATH_DIST_SQUARED); + } else { + angle_ptr = ∠ + } } *************** *** 634,639 **** for (line = first_line; line <= last_line; ++line) { ! /* a plugin may override a line: ! * It can change the pen or decide not to draw the line. */ --- 664,669 ---- for (line = first_line; line <= last_line; ++line) { ! /* A plugin may override a line: it can change the pen or ! * decide not to draw the line. */ *************** *** 653,658 **** } ! /* Check if a plugin wants to override the pen */ ! if (!roadmap_plugin_override_pen (line, cfcc, fips, pen_type, &pen)) { pen = layer_pen; } --- 683,689 ---- } ! /* Check if the plugin wants to override the pen. */ ! if (! roadmap_plugin_override_pen ! (line, cfcc, fips, pen_type, &pen)) { pen = layer_pen; } *************** *** 664,671 **** roadmap_screen_draw_one_line ! (&from, &to, fully_visible, &from, first_shape, last_shape, ! roadmap_shape_get_position, pen, total_length_ptr, &seg_middle, &angle); ! ! if (total_length_ptr) { PluginLine l = {ROADMAP_PLUGIN_ID, line, cfcc, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 695,705 ---- roadmap_screen_draw_one_line ! (&from, &to, fully_visible, &from, first_shape, last_shape, ! roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); ! ! if (total_length_ptr && (cutoff_dist == 0 || ! cutoff_dist > roadmap_math_screen_distance ! (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, line, cfcc, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 773,781 **** roadmap_screen_draw_one_line ! (&from, &to, fully_visible, &from, first_shape, last_shape, ! roadmap_shape_get_position, pen, total_length_ptr, &seg_middle, &angle); ! ! if (total_length_ptr) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, cfcc, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 807,817 ---- roadmap_screen_draw_one_line ! (&from, &to, fully_visible, &from, first_shape, last_shape, ! roadmap_shape_get_position, pen, total_length_ptr, ! &seg_middle, angle_ptr); + if (total_length_ptr && (cutoff_dist == 0 || + cutoff_dist > roadmap_math_screen_distance + (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, cfcc, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 1118,1123 **** roadmap_screen_flush_points (); ! if ((RoadMapScreen3dHorizon == 0) && !RoadMapScreenDragging) { ! roadmap_label_draw_cache (); } } --- 1154,1159 ---- roadmap_screen_flush_points (); ! if (!RoadMapScreenDragging) { ! roadmap_label_draw_cache (RoadMapScreen3dHorizon == 0); } } *************** *** 1153,1156 **** --- 1189,1194 ---- RoadMapScreenHeight = roadmap_canvas_height(); + RoadMapScreenLabels = ! roadmap_config_match(&RoadMapConfigMapLabels, "off"); + roadmap_math_set_size (RoadMapScreenWidth, RoadMapScreenHeight); if (RoadMapScreenInitialized) { *************** *** 1163,1172 **** static void roadmap_screen_short_click (RoadMapGuiPoint *point) { ! PluginLine line; ! int distance; ! RoadMapPosition position; ! roadmap_math_to_position (point, &position, 1); if (roadmap_navigate_retrieve_line --- 1201,1210 ---- static void roadmap_screen_short_click (RoadMapGuiPoint *point) { ! PluginLine line; ! int distance; ! RoadMapPosition position; ! roadmap_math_to_position (point, &position, 1); if (roadmap_navigate_retrieve_line *************** *** 1177,1186 **** LAYER_ALL_ROADS) != -1) { ! PluginStreet street; ! roadmap_trip_set_point ("Selection", &position); ! roadmap_display_activate ("Selected Street", &line, &position, &street); ! roadmap_screen_repaint (); ! } } --- 1215,1224 ---- LAYER_ALL_ROADS) != -1) { ! PluginStreet street; ! roadmap_trip_set_point ("Selection", &position); ! roadmap_display_activate ("Selected Street", &line, &position, &street); ! roadmap_screen_repaint (); ! } } *************** *** 1225,1228 **** --- 1263,1270 ---- static void roadmap_screen_drag_end (RoadMapGuiPoint *point) { + roadmap_screen_record_move + (RoadMapScreenPointerLocation.x - point->x, + RoadMapScreenPointerLocation.y - point->y); + RoadMapScreenDragging = 0; RoadMapScreenPointerLocation = *point; *************** *** 1240,1245 **** roadmap_math_unproject (&p2); ! roadmap_screen_record_move ! (p2.x - p.x, p2.y - p.y); } else { --- 1282,1286 ---- roadmap_math_unproject (&p2); ! roadmap_screen_record_move (p2.x - p.x, p2.y - p.y); } else { *************** *** 1254,1258 **** } - static int roadmap_screen_get_view_mode (void) { --- 1295,1298 ---- *************** *** 1260,1264 **** } - static int roadmap_screen_get_orientation_mode (void) { --- 1300,1303 ---- *************** *** 1379,1383 **** if (RoadMapScreenViewMode == VIEW_MODE_2D) { - RoadMapScreenViewMode = VIEW_MODE_3D; RoadMapScreen3dHorizon = -100; --- 1418,1421 ---- *************** *** 1391,1394 **** --- 1429,1437 ---- } + void roadmap_screen_toggle_labels (void) { + + RoadMapScreenLabels = ! RoadMapScreenLabels; + roadmap_screen_repaint(); + } void roadmap_screen_toggle_orientation_mode (void) { *************** *** 1429,1436 **** } void roadmap_screen_move_up (void) { ! roadmap_screen_record_move (0, 0 - (RoadMapScreenHeight / 4)); roadmap_screen_repaint (); } --- 1472,1480 ---- } + #define FRACMOVE 4 void roadmap_screen_move_up (void) { ! roadmap_screen_record_move (0, 0 - (RoadMapScreenHeight / FRACMOVE)); roadmap_screen_repaint (); } *************** *** 1439,1443 **** void roadmap_screen_move_down (void) { ! roadmap_screen_record_move (0, RoadMapScreenHeight / 4); roadmap_screen_repaint (); } --- 1483,1487 ---- void roadmap_screen_move_down (void) { ! roadmap_screen_record_move (0, RoadMapScreenHeight / FRACMOVE); roadmap_screen_repaint (); } *************** *** 1446,1450 **** void roadmap_screen_move_right (void) { ! roadmap_screen_record_move (RoadMapScreenHeight / 4, 0); roadmap_screen_repaint (); } --- 1490,1494 ---- void roadmap_screen_move_right (void) { ! roadmap_screen_record_move (RoadMapScreenHeight / FRACMOVE, 0); roadmap_screen_repaint (); } *************** *** 1453,1457 **** void roadmap_screen_move_left (void) { ! roadmap_screen_record_move (0 - (RoadMapScreenHeight / 4), 0); roadmap_screen_repaint (); } --- 1497,1501 ---- void roadmap_screen_move_left (void) { ! roadmap_screen_record_move (0 - (RoadMapScreenHeight / FRACMOVE), 0); roadmap_screen_repaint (); } *************** *** 1509,1512 **** --- 1553,1559 ---- ("preferences", &RoadMapConfigStyleObjects, "yes", "no", NULL); + roadmap_config_declare_enumeration + ("preferences", &RoadMapConfigMapLabels, "on", "off", NULL); + roadmap_pointer_register_short_click (&roadmap_screen_short_click); roadmap_pointer_register_drag_start (&roadmap_screen_drag_start); *************** *** 1524,1528 **** RoadMapScreenPoints.cursor = RoadMapScreenPoints.data; RoadMapScreenPoints.end = RoadMapScreenPoints.data + ROADMAP_SCREEN_BULK; ! RoadMapScreen3dHorizon = 0; --- 1571,1575 ---- RoadMapScreenPoints.cursor = RoadMapScreenPoints.data; RoadMapScreenPoints.end = RoadMapScreenPoints.data + ROADMAP_SCREEN_BULK; ! RoadMapScreen3dHorizon = 0; Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_label.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_label.c 5 Jun 2006 09:17:28 -0000 1.4 --- roadmap_label.c 17 Jul 2006 06:29:37 -0000 1.5 *************** *** 28,31 **** --- 28,34 ---- */ + #include <stdlib.h> + #include <string.h> + #include "roadmap_config.h" #include "roadmap_math.h" *************** *** 58,61 **** --- 61,96 ---- } + static int point_in_bbox( RoadMapGuiPoint *p, RoadMapGuiRect *bb) { + + if ((p->x <= bb->minx) || (p->x >= bb->maxx) || + (p->y >= bb->maxy) || (p->y <= bb->miny)) + return 0; + + return 1; + } + + /* doesn't check for one completely inside the other -- just intersection */ + static int poly_overlap (labelCacheMemberObj *c1, labelCacheMemberObj *c2) { + + RoadMapGuiPoint *a = c1->poly; + RoadMapGuiPoint *b = c2->poly; + RoadMapGuiPoint isect; + int ai, bi; + + for (ai = 0; ai < 4; ai++) { + for (bi = 0; bi < 4; bi++) { + if (roadmap_math_screen_intersect( &a[ai], &a[(ai+1)%4], + &b[bi], &b[(bi+1)%4], &isect)) { + if (point_in_bbox(&isect, &c1->bbox) && + point_in_bbox(&isect, &c2->bbox)) { + return 1; + } + } + } + } + + return 0; + } + static void compute_bbox(RoadMapGuiPoint *poly, RoadMapGuiRect *bbox) { *************** *** 75,87 **** ! static RoadMapGuiPoint get_metrics(RoadMapGuiPoint *p, RoadMapGuiRect *rect, ! int ox, int oy, int angle, ! RoadMapGuiRect *bbox) { RoadMapGuiPoint q; int x1=0, y1=0; ! RoadMapGuiPoint poly[4]; int w, h; ! int buffer = 0; ! int lines = 2; w = rect->maxx - rect->minx; --- 110,122 ---- ! static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; ! RoadMapGuiPoint *poly = c->poly; ! int buffer = 1; int w, h; ! int angle = c->angle; ! RoadMapGuiPoint *p = &c->point; w = rect->maxx - rect->minx; *************** *** 89,94 **** /* position CC */ ! x1 = -(int)(w/2.0) + ox; ! y1 = (int)(h/2.0) + oy; q.x = x1 - rect->minx; --- 124,130 ---- /* position CC */ ! x1 = -(w/2); ! ! y1 = centered_y ? (h/2) : 0; q.x = x1 - rect->minx; *************** *** 106,110 **** poly[2].x = x1 + w + buffer; /* ur */ ! poly[2].y = -(y1 -h - buffer); roadmap_math_rotate_point (&poly[2], p, angle); --- 142,146 ---- poly[2].x = x1 + w + buffer; /* ur */ ! poly[2].y = -(y1 - h - buffer); roadmap_math_rotate_point (&poly[2], p, angle); *************** *** 113,125 **** roadmap_math_rotate_point (&poly[3], p, angle); ! lines = 4; ! ! /* roadmap_canvas_draw_multiple_lines(1, &lines, poly); */ ! compute_bbox(poly, bbox); return q; } int roadmap_label_add (const RoadMapGuiPoint *point, int angle, --- 149,195 ---- roadmap_math_rotate_point (&poly[3], p, angle); ! #define POLY_OUTLINE 0 ! #if POLY_OUTLINE ! { int lines = 4; roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); } ! #endif ! compute_bbox(poly, &c->bbox); return q; } + static int roadmap_label_check_allocations(void) { + + if (!RoadMapLabelCache.labels) { + + RoadMapLabelCache.maxlabels = MIN_LABELS; + + RoadMapLabelCache.labels = malloc(MIN_LABELS * sizeof(labelCacheObj)); + roadmap_check_allocated (RoadMapLabelCache.labels ); + + memset (RoadMapLabelCache.labels, + 0, MIN_LABELS * sizeof(labelCacheObj)); + + } else if (RoadMapLabelCache.numlabels == RoadMapLabelCache.maxlabels) { + + if (RoadMapLabelCache.maxlabels == MAX_LABELS) { + roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); + RoadMapLabelCacheFull = 1; + return -1; + } + + RoadMapLabelCache.maxlabels *= 2; + + RoadMapLabelCache.labels = realloc( RoadMapLabelCache.labels, + RoadMapLabelCache.maxlabels * sizeof(labelCacheObj)); + roadmap_check_allocated (RoadMapLabelCache.labels ); + + memset (&RoadMapLabelCache.labels[RoadMapLabelCache.numlabels], + 0, RoadMapLabelCache.numlabels * sizeof(labelCacheObj)); + + } + + return 0; + } int roadmap_label_add (const RoadMapGuiPoint *point, int angle, *************** *** 132,146 **** if (featuresize < roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { - return -1; } ! if(RoadMapLabelCache.numlabels == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many lables on screen."); ! RoadMapLabelCacheFull = 1; return -1; } ! cachePtr = &(RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]); cachePtr->featuresize = featuresize; --- 202,218 ---- if (featuresize < roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { return -1; } ! if (roadmap_label_check_allocations() != 0) { return -1; } ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]; ! if (!cachePtr) { ! cachePtr = malloc (sizeof (*cachePtr)); ! roadmap_check_allocated (cachePtr); ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels] = cachePtr; ! } cachePtr->featuresize = featuresize; *************** *** 156,160 **** ! int roadmap_label_draw_cache (void) { int l; --- 228,232 ---- ! int roadmap_label_draw_cache (int angles) { int l; *************** *** 165,171 **** RoadMapGuiPoint p; RoadMapGuiRect r; - int label_offsetx = 0; - int label_offsety = 0; const char *text; labelCacheMemberObj *cachePtr=NULL; --- 237,242 ---- RoadMapGuiPoint p; RoadMapGuiRect r; const char *text; + short aang; labelCacheMemberObj *cachePtr=NULL; *************** *** 177,186 **** PluginStreetProperties properties; ! cachePtr = &(RoadMapLabelCache.labels[l]); roadmap_plugin_get_street_properties (&cachePtr->line, &properties); if (!properties.street || !*properties.street) { ! continue; } --- 248,257 ---- PluginStreetProperties properties; ! cachePtr = RoadMapLabelCache.labels[l]; roadmap_plugin_get_street_properties (&cachePtr->line, &properties); if (!properties.street || !*properties.street) { ! goto recycle; } *************** *** 188,244 **** cachePtr->street = properties.plugin_street; ! roadmap_canvas_get_text_extents(text, -1, &width, &ascent, &descent); r.minx = 0; r.maxx=width+1; ! r.miny = ascent; ! r.maxy = descent+1; ! ! /* ! label_offsety += MS_NINT(((bbox[5] + bbox[1]) + size) / 2); ! label_offsetx += MS_NINT(bbox[0] / 2); ! */ /* text is too long for this feature */ ! if ((width >> 2)> cachePtr->featuresize) { ! continue; } cachePtr->status = 1; /* assume label *can* be drawn */ ! /* The stored point is not screen orieneted, rotate is needed */ roadmap_math_rotate_coordinates (1, &cachePtr->point); - cachePtr->angle += roadmap_math_get_orientation (); ! while (cachePtr->angle > 360) cachePtr->angle -= 360; ! while (cachePtr->angle < 0) cachePtr->angle += 360; ! if (cachePtr->angle >= 180) cachePtr->angle -= 180; ! cachePtr->angle -= 90; ! //cachePtr->angle = (int)(cachePtr->angle / 18) * 18; ! p = get_metrics (&(cachePtr->point), &r, label_offsetx, label_offsety, ! cachePtr->angle, &cachePtr->bbox); ! /* ! if(!labelPtr->partials) { ! if(labelInImage(img->sx, img->sy, cachePtr->poly, labelPtr->buffer+map_edge_buffer) == 0) ! cachePtr->status = 0; } - */ - if(!cachePtr->status) - continue; /* next label */ ! for(i=0; i<l; i++) { /* compare against rendered label */ ! if(RoadMapLabelCache.labels[i].status == 1) { /* compare bounding polygons and check for duplicates */ ! /* MIN_DISTANCE */ ! if(roadmap_plugin_same_street(&cachePtr->street, &RoadMapLabelCache.labels[i].street)) { /* label is a duplicate */ cachePtr->status = 0; break; } ! if(rect_overlap (&RoadMapLabelCache.labels[i].bbox, &cachePtr->bbox)) { cachePtr->status = 0; break; --- 259,346 ---- cachePtr->street = properties.plugin_street; ! #if ROADMAP_USE_LINEFONT ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ ! #define CENTER_Y 0 ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); ! #else ! #define CENTER_Y 1 ! roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); ! angles = angles && i; ! #endif r.minx = 0; r.maxx=width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; /* text is too long for this feature */ ! if ((width >> 2) > cachePtr->featuresize) { ! goto recycle; } cachePtr->status = 1; /* assume label *can* be drawn */ ! /* The stored point is not screen oriented, rotate is needed */ roadmap_math_rotate_coordinates (1, &cachePtr->point); ! if (angles) { ! cachePtr->angle += roadmap_math_get_orientation (); ! while (cachePtr->angle > 360) cachePtr->angle -= 360; ! while (cachePtr->angle < 0) cachePtr->angle += 360; ! if (cachePtr->angle >= 180) cachePtr->angle -= 180; ! cachePtr->angle -= 90; ! p = get_metrics (cachePtr, &r, CENTER_Y); ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) */ ! p = cachePtr->point; ! cachePtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cachePtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cachePtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cachePtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; ! } ! for(i=0; i<l; i++) { /* compare against rendered label */ ! /* compare bounding polygons and check for duplicates */ ! ! if(roadmap_plugin_same_street(&cachePtr->street, ! &RoadMapLabelCache.labels[i]->street)) { ! /* label is a duplicate */ ! cachePtr->status = 0; ! break; } ! if (rect_overlap (&RoadMapLabelCache.labels[i]->bbox, ! &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient */ ! if(!angles) { cachePtr->status = 0; break; } ! /* if labels are almost horizontal, the bbox check is ! * sufficient. (in addition, the line intersector ! * has trouble with flat or steep lines) ! */ ! aang = abs(cachePtr->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; ! } ! aang = abs(RoadMapLabelCache.labels[i]->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; ! } ! ! /* otherwise we do the full poly check */ ! if ( poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; *************** *** 247,256 **** } ! /* im... [truncated message content] |
From: Ehud S. <esh...@us...> - 2006-07-16 12:31:02
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24837/libroadmap Modified Files: libroadmap.vcp Log Message: Update evc files. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libroadmap.vcp 13 Jul 2006 06:46:26 -0000 1.12 --- libroadmap.vcp 16 Jul 2006 12:30:55 -0000 1.13 *************** *** 1027,1030 **** --- 1027,1032 ---- "..\..\roadmap_win32.h"\ "..\..\win32_serial.h"\ + "C:\Projects\zlib-1.2.3\zconf.h"\ + "C:\Projects\zlib-1.2.3\zlib.h"\ # ADD CPP /I "c:\projects\zlib-1.2.3" *************** *** 2549,2552 **** --- 2551,2665 ---- # Begin Source File + SOURCE=..\..\..\editor\export\editor_sync.c + + !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" + + DEP_CPP_EDITOR_SY=\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_EDITOR_SY=\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_EDITOR_SY=\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_EDITOR_SY=\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_EDITOR_SY=\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\editor\track\editor_track_filter.c *************** *** 3660,3663 **** --- 3773,3777 ---- DEP_CPP_EDITOR_U=\ "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\md5.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_config.h"\ *************** *** 3685,3688 **** --- 3799,3803 ---- DEP_CPP_EDITOR_U=\ "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\md5.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_config.h"\ |
From: Ehud S. <esh...@us...> - 2006-07-16 12:30:59
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libguiroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24837/libguiroadmap Modified Files: libguiroadmap.vcp Log Message: Update evc files. Index: libguiroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libguiroadmap/libguiroadmap.vcp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libguiroadmap.vcp 29 Apr 2006 10:53:08 -0000 1.4 --- libguiroadmap.vcp 16 Jul 2006 12:30:55 -0000 1.5 *************** *** 358,362 **** --- 358,366 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_county.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 368,371 **** --- 372,376 ---- "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_main.h"\ "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_messagebox.h"\ *************** *** 376,379 **** --- 381,385 ---- "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_trip.h"\ "..\..\..\roadmap_types.h"\ *************** *** 389,393 **** --- 395,403 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_county.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 399,402 **** --- 409,413 ---- "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_main.h"\ "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_messagebox.h"\ *************** *** 407,410 **** --- 418,422 ---- "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_trip.h"\ "..\..\..\roadmap_types.h"\ *************** *** 590,593 **** --- 602,606 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 624,627 **** --- 637,641 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 911,914 **** --- 925,929 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 945,948 **** --- 960,964 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 1097,1100 **** --- 1113,1117 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_gui.h"\ *************** *** 1103,1106 **** --- 1120,1124 ---- "..\..\..\roadmap_message.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_street.h"\ *************** *** 1118,1121 **** --- 1136,1140 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_gui.h"\ *************** *** 1124,1127 **** --- 1143,1147 ---- "..\..\..\roadmap_message.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_street.h"\ *************** *** 1245,1248 **** --- 1265,1269 ---- "..\..\roadmap_win32.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libguiroadmap - Win32 (WCE x86) Debug" *************** *** 1274,1277 **** --- 1295,1299 ---- "..\..\roadmap_win32.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libguiroadmap - Win32 (WCE ARMV4) Debug" *************** *** 1285,1288 **** --- 1307,1311 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_download.h"\ "..\..\..\roadmap_factory.h"\ *************** *** 1305,1309 **** --- 1328,1335 ---- "..\..\roadmap_win32.h"\ "..\..\win32_serial.h"\ + "C:\Projects\zlib-1.2.3\zconf.h"\ + "C:\Projects\zlib-1.2.3\zlib.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libguiroadmap - Win32 (WCE ARMV4) Release" *************** *** 1317,1321 **** --- 1343,1349 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_factory.h"\ "..\..\..\roadmap_file.h"\ "..\..\..\roadmap_gui.h"\ *************** *** 1336,1340 **** --- 1364,1371 ---- "..\..\roadmap_win32.h"\ "..\..\win32_serial.h"\ + "C:\Projects\zlib-1.2.3\zconf.h"\ + "C:\Projects\zlib-1.2.3\zlib.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libguiroadmap - Win32 (WCE ARMV4) Profiler" *************** *** 1368,1371 **** --- 1399,1403 ---- "..\..\win32_serial.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ENDIF *************** *** 1600,1609 **** --- 1632,1645 ---- "..\..\..\roadmap_config.h"\ "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_fuzzy.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_line.h"\ + "..\..\..\roadmap_line_route.h"\ "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_types.h"\ *************** *** 1618,1627 **** --- 1654,1667 ---- "..\..\..\roadmap_config.h"\ "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_fuzzy.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_line.h"\ + "..\..\..\roadmap_line_route.h"\ "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_types.h"\ *************** *** 1892,1895 **** --- 1932,1936 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 1906,1909 **** --- 1947,1951 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 1993,1996 **** --- 2035,2039 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 2007,2010 **** --- 2050,2054 ---- "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 2166,2169 **** --- 2210,2214 ---- "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 2182,2185 **** --- 2227,2231 ---- "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ *************** *** 2201,2204 **** --- 2247,2251 ---- "..\..\..\roadmap_db_line_route.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 2217,2220 **** --- 2264,2268 ---- "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ *************** *** 2455,2458 **** --- 2503,2507 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_io.h"\ *************** *** 2461,2466 **** --- 2510,2517 ---- "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_pointer.h"\ + "..\..\..\roadmap_screen_obj.h"\ "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_string.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 2474,2477 **** --- 2525,2529 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_io.h"\ *************** *** 2480,2485 **** --- 2532,2539 ---- "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_pointer.h"\ + "..\..\..\roadmap_screen_obj.h"\ "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_string.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ *************** *** 2752,2755 **** --- 2806,2810 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 2764,2767 **** --- 2819,2823 ---- "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_message.h"\ "..\..\..\roadmap_navigate.h"\ "..\..\..\roadmap_net.h"\ *************** *** 2778,2781 **** --- 2834,2838 ---- "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_square.h"\ + "..\..\..\roadmap_state.h"\ "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_string.h"\ *************** *** 2794,2797 **** --- 2851,2855 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_file.h"\ *************** *** 2806,2809 **** --- 2864,2868 ---- "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_message.h"\ "..\..\..\roadmap_navigate.h"\ "..\..\..\roadmap_net.h"\ *************** *** 2820,2823 **** --- 2879,2883 ---- "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_square.h"\ + "..\..\..\roadmap_state.h"\ "..\..\..\roadmap_street.h"\ "..\..\..\roadmap_string.h"\ *************** *** 2966,2969 **** --- 3026,3030 ---- "..\..\..\roadmap.h"\ "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_factory.h"\ "..\..\..\roadmap_file.h"\ "..\..\..\roadmap_gps.h"\ *************** *** 2971,2974 **** --- 3032,3037 ---- "..\..\..\roadmap_io.h"\ "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_main.h"\ + "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_path.h"\ *************** *** 2976,2979 **** --- 3039,3045 ---- "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_sprite.h"\ + "..\..\..\roadmap_start.h"\ + "..\..\..\roadmap_state.h"\ "..\..\..\roadmap_string.h"\ "..\..\..\roadmap_types.h"\ *************** *** 3311,3315 **** --- 3377,3384 ---- "..\..\..\editor\db\editor_db.h"\ "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ "..\..\..\navigate\navigate_main.h"\ "..\..\..\roadmap.h"\ *************** *** 3324,3327 **** --- 3393,3397 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_download.h"\ *************** *** 3368,3372 **** --- 3438,3445 ---- "..\..\..\editor\db\editor_db.h"\ "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\editor\export\editor_upload.h"\ "..\..\..\navigate\navigate_main.h"\ "..\..\..\roadmap.h"\ *************** *** 3381,3384 **** --- 3454,3458 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_display.h"\ "..\..\..\roadmap_download.h"\ *************** *** 3672,3675 **** --- 3746,3750 ---- "..\..\..\roadmap_spawn.h"\ "..\..\..\roadmap_sprite.h"\ + "..\..\..\roadmap_state.h"\ "..\..\..\roadmap_sunrise.h"\ "..\..\..\roadmap_time.h"\ |
From: Ehud S. <esh...@us...> - 2006-07-16 12:30:59
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24837 Modified Files: Roadmap.vcw Log Message: Update evc files. Index: Roadmap.vcw =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/Roadmap.vcw,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Roadmap.vcw 13 Jul 2006 06:46:26 -0000 1.7 --- Roadmap.vcw 16 Jul 2006 12:30:55 -0000 1.8 *************** *** 273,276 **** --- 273,288 ---- ############################################################################### + Project: "setupdll"=.\setupdll\setupdll.vcp - Package Owner=<4> + + Package=<5> + {{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### + Project: "zlib"="C:\Projects\zlib-1.2.3\zlib.vcp" - Package Owner=<4> |
From: Ehud S. <esh...@us...> - 2006-07-16 12:29:24
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24387 Modified Files: install.inf roadmap_main.cpp roadmap_net.c Log Message: FreeMap auto sync. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_main.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_main.cpp 5 Jun 2006 18:52:00 -0000 1.12 --- roadmap_main.cpp 16 Jul 2006 12:29:21 -0000 1.13 *************** *** 28,38 **** #include <windows.h> #include <commctrl.h> - #include <aygshell.h> #include "resource.h" ! #include <Winsock.h> ! #ifdef WIN32_PROFILE ! #include <C:\Program Files\Windows CE Tools\Common\Platman\sdk\wce500\include\cecap.h> ! #endif extern "C" { --- 28,45 ---- #include <windows.h> #include <commctrl.h> #include "resource.h" ! #include <winsock.h> ! #ifdef UNDER_CE ! #include <aygshell.h> ! #include <notify.h> ! #endif ! ! #ifndef I_IMAGENONE ! #define I_IMAGENONE (-2) ! #endif ! #ifdef WIN32_PROFILE ! #include <C:\Program Files\Windows CE Tools\Common\Platman\sdk\wce500\include\cecap.h> ! #endif extern "C" { *************** *** 45,54 **** #include "../roadmap_io.h" #include "../roadmap_main.h" ! #include "../roadmap_serial.h" ! #include "../roadmap_messagebox.h" #include "../roadmap_screen.h" ! #include "wince_input_mon.h" #include "win32_serial.h" #include "roadmap_wincecanvas.h" } --- 52,63 ---- #include "../roadmap_io.h" #include "../roadmap_main.h" ! #include "../roadmap_serial.h" ! #include "../roadmap_messagebox.h" #include "../roadmap_screen.h" ! #include "wince_input_mon.h" #include "win32_serial.h" #include "roadmap_wincecanvas.h" + #include "../editor/editor_main.h" + #include "../editor/export/editor_sync.h" } *************** *** 77,87 **** // varibles used across this module static RoadMapKeyInput RoadMapMainInput = NULL; ! static HWND RoadMapMainMenuBar = NULL; static HMENU RoadMapCurrentSubMenu = NULL; ! static HWND RoadMapMainToolbar = NULL; static bool RoadMapMainFullScreen = false; ! static HANDLE VirtualSerialHandle = 0; ! static const char *RoadMapMainVirtualSerial; ! // Global Variables: --- 86,100 ---- // varibles used across this module static RoadMapKeyInput RoadMapMainInput = NULL; ! #ifdef UNDER_CE ! static HWND RoadMapMainMenuBar = NULL; ! #else ! static HMENU RoadMapMainMenuBar = NULL; ! #endif static HMENU RoadMapCurrentSubMenu = NULL; ! static HWND RoadMapMainToolbar = NULL; static bool RoadMapMainFullScreen = false; ! static HANDLE VirtualSerialHandle = 0; ! static const char *RoadMapMainVirtualSerial; ! // Global Variables: *************** *** 90,95 **** // Forward declarations of functions included in this code module: ! static ATOM MyRegisterClass(HINSTANCE, LPTSTR); ! static BOOL InitInstance(HINSTANCE); static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); static INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); --- 103,108 ---- // Forward declarations of functions included in this code module: ! static ATOM MyRegisterClass(HINSTANCE, LPTSTR); ! static BOOL InitInstance(HINSTANCE, LPTSTR); static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); static INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); *************** *** 99,176 **** // class name definition #ifdef _ROADGPS ! static TCHAR szWindowClass[] = _T("RoadGPSClass"); ! static TCHAR szOtherWindowClass[] = _T("RoadMapClass"); #else ! static TCHAR szWindowClass[] = _T("RoadMapClass"); ! static TCHAR szOtherWindowClass[] = _T("RoadGPSClass"); #endif ! static RoadMapConfigDescriptor RoadMapConfigGPSVirtual = ! ROADMAP_CONFIG_ITEM("GPS", "Virtual"); ! ! ! static void setup_virtual_serial (void) { ! ! DWORD index; ! DWORD resp; ! HKEY key; ! ! const char *virtual_port = roadmap_config_get (&RoadMapConfigGPSVirtual); ! ! if (strlen(virtual_port) < 5) return; ! if (strncmp(virtual_port, "COM", 3)) return; ! ! index = atoi (virtual_port + 3); ! ! if ((index < 0) || (index > 9)) return; ! ! #ifdef _ROADGPS ! if (FindWindow(szOtherWindowClass, NULL) != NULL) { ! /* RoadMap or RoadGPS is already running */ ! RoadMapMainVirtualSerial = virtual_port; ! return; ! } ! #endif ! RegCreateKeyEx(HKEY_LOCAL_MACHINE, _T("Drivers\\RoadMap"), ! 0, NULL, REG_OPTION_NON_VOLATILE, 0, NULL, &key, &resp); ! RegSetValueEx(key, _T("Dll"), 0, REG_SZ, (unsigned char*)_T("ComSplit.dll"), 26); ! RegSetValueEx(key, _T("Prefix"), 0, REG_SZ, (unsigned char*)_T("COM"), 8); ! RegSetValueEx(key, _T("Index"), 0, REG_DWORD, (unsigned char*)&index, sizeof(DWORD)); ! RegCloseKey(key); ! ! //res = RegisterDevice(_T("COM"), 4, _T("ComSplit.dll"), 0); ! VirtualSerialHandle = ActivateDevice(_T("Drivers\\RoadMap"), NULL); ! if (VirtualSerialHandle == 0) { ! roadmap_messagebox ("Virtual comm Error!", "Can't setup virtual serial port."); } } ! ! const char *roadmap_main_get_virtual_serial (void) { ! return RoadMapMainVirtualSerial; ! } // our main function int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { ! MSG msg; ! // Perform application initialization: ! if (!InitInstance(hInstance)) { return FALSE; } ! ! #ifdef WIN32_PROFILE ! SuspendCAPAll(); ! #endif ! ! setup_virtual_serial (); ShowWindow(RoadMapMainWindow, nCmdShow); --- 112,219 ---- // class name definition #ifdef _ROADGPS ! static WCHAR szWindowClass[] = L"RoadGPSClass"; ! static WCHAR szOtherWindowClass[] = L"RoadMapClass"; #else ! static WCHAR szWindowClass[] = L"RoadMapClass"; ! static WCHAR szOtherWindowClass[] = L"RoadGPSClass"; #endif + + static RoadMapConfigDescriptor RoadMapConfigGPSVirtual = + ROADMAP_CONFIG_ITEM("GPS", "Virtual"); ! static void roadmap_main_start_sync (void) { ! struct hostent *h; ! int i; ! Sleep(1000); ! for (i=0; i<5; i++) { ! if ((h = gethostbyname ("ppp_peer")) != NULL) { ! export_sync (); ! break; ! } ! Sleep(1000); } } ! ! static void setup_virtual_serial (void) { ! ! #ifdef UNDER_CE ! DWORD index; ! DWORD resp; ! HKEY key; ! ! const char *virtual_port = roadmap_config_get (&RoadMapConfigGPSVirtual); ! ! if (strlen(virtual_port) < 5) return; ! if (strncmp(virtual_port, "COM", 3)) return; ! ! index = atoi (virtual_port + 3); ! ! if ((index < 0) || (index > 9)) return; ! ! #ifdef _ROADGPS ! if (FindWindow(szOtherWindowClass, NULL) != NULL) { ! /* RoadMap or RoadGPS is already running */ ! RoadMapMainVirtualSerial = virtual_port; ! return; ! } ! #endif ! ! RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Drivers\\RoadMap", ! 0, NULL, REG_OPTION_NON_VOLATILE, 0, NULL, &key, &resp); ! RegSetValueEx(key, L"Dll", 0, REG_SZ, (unsigned char*)L"ComSplit.dll", 26); ! RegSetValueEx(key, L"Prefix", 0, REG_SZ, (unsigned char*)L"COM", 8); ! RegSetValueEx(key, L"Index", 0, REG_DWORD, (unsigned char*)&index, sizeof(DWORD)); ! ! RegCloseKey(key); ! ! //res = RegisterDevice(L"COM", 4, L"ComSplit.dll", 0); ! VirtualSerialHandle = ActivateDevice(L"Drivers\\RoadMap", NULL); ! ! if (VirtualSerialHandle == 0) { ! roadmap_messagebox ("Virtual comm Error!", "Can't setup virtual serial port."); ! } ! #endif ! } ! ! ! const char *roadmap_main_get_virtual_serial (void) { ! return RoadMapMainVirtualSerial; ! } // our main function + #ifdef UNDER_CE int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) + #else + int WINAPI WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) + #endif { ! MSG msg; ! LPTSTR cmd_line = L""; ! ! #ifdef UNDER_CE ! cmd_line = lpCmdLine; ! #endif ! // Perform application initialization: ! if (!InitInstance(hInstance, cmd_line)) { return FALSE; } ! ! #ifdef WIN32_PROFILE ! //SuspendCAPAll(); ! #endif ! ! setup_virtual_serial (); ShowWindow(RoadMapMainWindow, nCmdShow); *************** *** 189,197 **** } } ! ! if (VirtualSerialHandle != 0) { ! DeactivateDevice (VirtualSerialHandle); ! } ! WSACleanup(); --- 232,242 ---- } } ! ! #ifdef UNDER_CE ! if (VirtualSerialHandle != 0) { ! DeactivateDevice (VirtualSerialHandle); ! } ! #endif ! WSACleanup(); *************** *** 223,244 **** ! BOOL InitInstance(HINSTANCE hInstance) { HWND hWnd; ! WSADATA wsaData; g_hInst = hInstance; // Store instance handle in our global variable SHInitExtraControls(); //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); if (hWnd) ! { ! // set focus to foremost child window ! // The "| 0x00000001" is used to bring any owned windows to the ! // foreground and activate them. ! SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); ! return 0; } --- 268,301 ---- ! BOOL InitInstance(HINSTANCE hInstance, LPTSTR lpCmdLine) { HWND hWnd; ! WSADATA wsaData; ! BOOL do_sync = false; g_hInst = hInstance; // Store instance handle in our global variable + #ifdef UNDER_CE SHInitExtraControls(); + #endif + + if (!wcscmp(lpCmdLine, APP_RUN_AT_RS232_DETECT)) { + do_sync = true; + } //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); if (hWnd) ! { ! if (do_sync) { ! PostMessage(hWnd, WM_USER_SYNC, 0, 0); ! return 0; ! } else { ! // set focus to foremost child window ! // The "| 0x00000001" is used to bring any owned windows to the ! // foreground and activate them. ! SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); ! return 0; ! } } *************** *** 254,257 **** --- 311,322 ---- char *args[1] = {0}; + + if (do_sync) { + roadmap_main_start_sync (); + roadmap_config_initialize (); + editor_main_initialize (); + roadmap_main_start_sync (); + return 0; + } roadmap_start(0, args); *************** *** 277,286 **** return 0; } ! ! ! static void CALLBACK AvoidSuspend (HWND hwnd, UINT uMsg, UINT idEvent, ! DWORD dwTime) { ! SystemIdleTimerReset (); ! } --- 342,353 ---- return 0; } ! ! ! static void CALLBACK AvoidSuspend (HWND hwnd, UINT uMsg, UINT idEvent, ! DWORD dwTime) { ! #ifdef UNDER_CE ! SystemIdleTimerReset (); ! #endif ! } *************** *** 320,324 **** --- 387,393 ---- HDC hdc; + #ifdef UNDER_CE static SHACTIVATEINFO s_sai; + #endif switch (message) *************** *** 357,360 **** --- 426,430 ---- case WM_CREATE: + #ifdef UNDER_CE SHMENUBARINFO mbi; *************** *** 382,392 **** SendMessage(RoadMapMainMenuBar, (UINT) TB_DELETEBUTTON, 0, 0); } ! } // Initialize the shell activate info structure memset(&s_sai, 0, sizeof (s_sai)); ! s_sai.cbSize = sizeof (s_sai); ! SetTimer (NULL, 0, 50000, AvoidSuspend); break; --- 452,471 ---- SendMessage(RoadMapMainMenuBar, (UINT) TB_DELETEBUTTON, 0, 0); } ! } ! #else ! RoadMapMainMenuBar = CreateMenu (); ! { ! DWORD res = SetMenu(hWnd, RoadMapMainMenuBar); ! res = res; ! } ! #endif + #ifdef UNDER_CE // Initialize the shell activate info structure memset(&s_sai, 0, sizeof (s_sai)); ! s_sai.cbSize = sizeof (s_sai); ! SetTimer (NULL, 0, 50000, AvoidSuspend); + #endif break; *************** *** 403,412 **** case WM_DESTROY: if (RoadMapMainMenuBar != NULL) { ! DestroyWindow(RoadMapMainMenuBar); } if (RoadMapMainToolbar != NULL) { CommandBar_Destroy(RoadMapMainToolbar); } PostQuitMessage(0); break; --- 482,497 ---- case WM_DESTROY: if (RoadMapMainMenuBar != NULL) { ! #ifdef UNDER_CE ! DestroyWindow(RoadMapMainMenuBar); ! #else ! DestroyMenu(RoadMapMainMenuBar); ! #endif } + #ifdef UNDER_CE if (RoadMapMainToolbar != NULL) { CommandBar_Destroy(RoadMapMainToolbar); } + #endif PostQuitMessage(0); break; *************** *** 458,470 **** break; ! case WM_ACTIVATE: ! if ((LOWORD(wParam)!=WA_INACTIVE) && ! RoadMapMainFullScreen) { ! SHFullScreen(RoadMapMainWindow, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON); ! ! } else { ! ! // Notify shell of our activate message ! SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); } break; --- 543,556 ---- break; ! #ifdef UNDER_CE ! case WM_ACTIVATE: ! if ((LOWORD(wParam)!=WA_INACTIVE) && ! RoadMapMainFullScreen) { ! SHFullScreen(RoadMapMainWindow, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON); ! ! } else { ! ! // Notify shell of our activate message ! SHHandleWMActivate(hWnd, wParam, lParam, &s_sai, FALSE); } break; *************** *** 472,499 **** case WM_SETTINGCHANGE: SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); ! break; ! #ifndef _ROADGPS ! case WM_KILLFOCUS: ! roadmap_screen_freeze (); ! break; ! case WM_SETFOCUS: ! roadmap_screen_unfreeze (); break; ! #endif case WM_USER_READ: { ! roadmap_main_io *context = (roadmap_main_io *) wParam; ! if (!context->is_valid) break; ! ! if (lParam != 1) { Win32SerialConn *conn = (Win32SerialConn *) lParam; if (!ROADMAP_SERIAL_IS_VALID (conn)) { ! /* An old input which was removed */ ! break; ! } ! } (*context->callback) (context->io); --- 558,593 ---- case WM_SETTINGCHANGE: SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai); ! break; ! #endif ! ! #ifdef UNDER_CE #ifndef _ROADGPS ! case WM_KILLFOCUS: ! roadmap_screen_freeze (); ! break; ! ! case WM_SETFOCUS: ! roadmap_screen_unfreeze (); ! break; ! #endif ! #endif ! case WM_USER_SYNC: ! roadmap_main_start_sync (); break; ! case WM_USER_READ: { ! roadmap_main_io *context = (roadmap_main_io *) wParam; ! if (!context->is_valid) break; ! ! if (lParam != 1) { Win32SerialConn *conn = (Win32SerialConn *) lParam; if (!ROADMAP_SERIAL_IS_VALID (conn)) { ! /* An old input which was removed */ ! break; ! } ! } (*context->callback) (context->io); *************** *** 550,587 **** void roadmap_main_toggle_full_screen (void) ! { ! #define MENU_HEIGHT 26 ! RECT rc; ! ! //get window size ! GetWindowRect(RoadMapMainWindow, &rc); ! ! if (!RoadMapMainFullScreen) { ! SHFullScreen(RoadMapMainWindow, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON); ! ShowWindow(RoadMapMainMenuBar, SW_HIDE); ! ! MoveWindow(RoadMapMainWindow, ! rc.left, ! rc.top-MENU_HEIGHT, ! rc.right, ! rc.bottom+MENU_HEIGHT, ! TRUE); ! ! RoadMapMainFullScreen = true; ! ! } else { ! ! SHFullScreen(RoadMapMainWindow, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON); ! ShowWindow(RoadMapMainMenuBar, SW_SHOW); ! MoveWindow(RoadMapMainWindow, ! rc.left, ! rc.top+MENU_HEIGHT, ! rc.right, ! rc.bottom-(2*MENU_HEIGHT), ! TRUE); ! ! RoadMapMainFullScreen = false; ! } } --- 644,683 ---- void roadmap_main_toggle_full_screen (void) ! { ! #ifdef UNDER_CE ! #define MENU_HEIGHT 26 ! RECT rc; ! ! //get window size ! GetWindowRect(RoadMapMainWindow, &rc); ! ! if (!RoadMapMainFullScreen) { ! SHFullScreen(RoadMapMainWindow, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON); ! ShowWindow(RoadMapMainMenuBar, SW_HIDE); ! ! MoveWindow(RoadMapMainWindow, ! rc.left, ! rc.top-MENU_HEIGHT, ! rc.right, ! rc.bottom+MENU_HEIGHT, ! TRUE); ! ! RoadMapMainFullScreen = true; ! ! } else { ! ! SHFullScreen(RoadMapMainWindow, SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON); ! ShowWindow(RoadMapMainMenuBar, SW_SHOW); ! MoveWindow(RoadMapMainWindow, ! rc.left, ! rc.top+MENU_HEIGHT, ! rc.right, ! rc.bottom-(2*MENU_HEIGHT), ! TRUE); ! ! RoadMapMainFullScreen = false; ! } + #endif } *************** *** 589,596 **** void roadmap_main_new (const char *title, int width, int height) { ! LPWSTR szTitle = ConvertToWideChar(title, CP_UTF8); ! RoadMapMainWindow = CreateWindow(szWindowClass, szTitle, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, ! NULL, g_hInst, NULL); free(szTitle); --- 685,699 ---- void roadmap_main_new (const char *title, int width, int height) { ! LPWSTR szTitle = ConvertToWideChar(title, CP_UTF8); ! DWORD style = WS_VISIBLE; ! ! #ifndef UNDER_CE ! style |= WS_OVERLAPPEDWINDOW; ! #endif ! ! RoadMapMainWindow = CreateWindow(szWindowClass, szTitle, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, ! NULL, g_hInst, NULL); ! free(szTitle); *************** *** 600,604 **** return; } ! if (RoadMapMainMenuBar) { --- 703,708 ---- return; } ! ! #ifdef UNDER_CE if (RoadMapMainMenuBar) { *************** *** 612,616 **** MoveWindow(RoadMapMainWindow, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); ! } } --- 716,721 ---- MoveWindow(RoadMapMainWindow, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, FALSE); ! } ! #endif } *************** *** 633,637 **** if (RoadMapMainMenuBar == NULL) return; ! LPWSTR label_unicode = ConvertToWideChar(label, CP_UTF8); TBBUTTON button; SendMessage(RoadMapMainMenuBar, TB_BUTTONSTRUCTSIZE, sizeof(button), --- 738,744 ---- if (RoadMapMainMenuBar == NULL) return; ! LPWSTR label_unicode = ConvertToWideChar(label, CP_UTF8); ! ! #ifdef UNDER_CE TBBUTTON button; SendMessage(RoadMapMainMenuBar, TB_BUTTONSTRUCTSIZE, sizeof(button), *************** *** 649,653 **** SendMessage(RoadMapMainMenuBar, (UINT) TB_ADDBUTTONS, (WPARAM) 1, ! (LPARAM) (LPTBBUTTON) &button); free(label_unicode); } --- 756,764 ---- SendMessage(RoadMapMainMenuBar, (UINT) TB_ADDBUTTONS, (WPARAM) 1, ! (LPARAM) (LPTBBUTTON) &button); ! #else ! DWORD res = AppendMenu(RoadMapMainMenuBar, MF_POPUP, (UINT)menu, label_unicode); ! SetMenu (RoadMapMainWindow, RoadMapMainMenuBar); ! #endif free(label_unicode); } *************** *** 672,676 **** menu_id++; } else { ! AppendMenu((HMENU)menu, MF_SEPARATOR, 0, _T("")); } --- 783,787 ---- menu_id++; } else { ! AppendMenu((HMENU)menu, MF_SEPARATOR, 0, L""); } *************** *** 697,703 **** static int tool_id = 0; ! if (RoadMapMainToolbar == NULL) { RoadMapMainToolbar = CommandBar_Create (g_hInst, ! RoadMapMainWindow, 1); LONG style = GetWindowLong (RoadMapMainToolbar, GWL_STYLE); } --- 808,840 ---- static int tool_id = 0; ! if (RoadMapMainToolbar == NULL) { ! ! #ifdef UNDER_CE RoadMapMainToolbar = CommandBar_Create (g_hInst, ! RoadMapMainWindow, 1); ! #else ! INITCOMMONCONTROLSEX InitCtrlEx; ! ! InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX); ! InitCtrlEx.dwICC = ICC_BAR_CLASSES; ! InitCommonControlsEx(&InitCtrlEx); ! ! RoadMapMainToolbar = CreateWindowEx ( ! 0, ! TOOLBARCLASSNAME, // Class name ! L"toolbar", // Window name ! WS_CHILD|WS_VISIBLE, // Window style ! 0, // x-coordinate of the upper-left corner ! 0, // y-coordinate of the upper-left corner ! CW_USEDEFAULT, // The width of the tree-view control window ! CW_USEDEFAULT, // The height of the tree-view control window ! RoadMapMainWindow, // Window handle to the parent window ! (HMENU) NULL, // The tree-view control identifier ! g_hInst, // The instance handle ! NULL); // Specify NULL for this parameter when you ! ! SendMessage(RoadMapMainToolbar, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); ! ! #endif LONG style = GetWindowLong (RoadMapMainToolbar, GWL_STYLE); } *************** *** 705,711 **** int icon_res_id = roadmap_main_toolbar_icon(icon); if (icon_res_id == -1) return; ! ! int icon_tb_id = CommandBar_AddBitmap(RoadMapMainToolbar, g_hInst, ! icon_res_id, 1, 16, 16); TBBUTTON but; --- 842,863 ---- int icon_res_id = roadmap_main_toolbar_icon(icon); if (icon_res_id == -1) return; ! ! int icon_tb_id = 0; ! int res; ! ! #ifdef UNDER_CE ! icon_tb_id = CommandBar_AddBitmap(RoadMapMainToolbar, g_hInst, ! icon_res_id, 1, 16, 16); ! #else ! TBADDBITMAP tbb; ! ! tbb.hInst = NULL; ! tbb.nID = (DWORD)LoadBitmap(g_hInst, MAKEINTRESOURCE(icon_res_id)); ! ! icon_tb_id = SendMessage(RoadMapMainToolbar, ! (UINT) TB_ADDBITMAP, ! (WPARAM) 1, ! (LPARAM) &tbb); ! #endif TBBUTTON but; *************** *** 716,721 **** but.dwData = 0; but.iString = 0; ! ! int res = CommandBar_AddButtons(RoadMapMainToolbar, 1, &but); if (res != FALSE) { tool_callbacks[tool_id] = callback; --- 868,880 ---- but.dwData = 0; but.iString = 0; ! ! #ifdef UNDER_CE ! res = CommandBar_AddButtons(RoadMapMainToolbar, 1, &but); ! #else ! res = SendMessage(RoadMapMainToolbar, ! (UINT) TB_ADDBUTTONS, ! (WPARAM) 1, ! (LPARAM) &but); ! #endif if (res != FALSE) { tool_callbacks[tool_id] = callback; *************** *** 739,745 **** but.dwData = 0; but.iString = 0; ! ! int res = CommandBar_AddButtons(RoadMapMainToolbar, 1, &but); ! } --- 898,910 ---- but.dwData = 0; but.iString = 0; ! ! #ifdef UNDER_CE ! CommandBar_AddButtons(RoadMapMainToolbar, 1, &but); ! #else ! SendMessage(RoadMapMainToolbar, ! (UINT) TB_ADDBUTTONS, ! (WPARAM) 1, ! (LPARAM) &but); ! #endif } *************** *** 770,777 **** for (i = 0; i < ROADMAP_MAX_IO; ++i) { ! if (RoadMapMainIo[i] == NULL) { RoadMapMainIo[i] = (roadmap_main_io *) malloc (sizeof(roadmap_main_io)); RoadMapMainIo[i]->io = io; ! RoadMapMainIo[i]->callback = callback; RoadMapMainIo[i]->is_valid = 1; break; --- 935,942 ---- for (i = 0; i < ROADMAP_MAX_IO; ++i) { ! if (RoadMapMainIo[i] == NULL) { RoadMapMainIo[i] = (roadmap_main_io *) malloc (sizeof(roadmap_main_io)); RoadMapMainIo[i]->io = io; ! RoadMapMainIo[i]->callback = callback; RoadMapMainIo[i]->is_valid = 1; break; *************** *** 818,828 **** for (i = 0; i < ROADMAP_MAX_IO; ++i) { ! if (RoadMapMainIo[i] && RoadMapMainIo[i]->io == io) { ! ! if (RoadMapMainIo[i]->is_valid) { ! RoadMapMainIo[i]->is_valid = 0; ! } else { ! free (RoadMapMainIo[i]); ! } RoadMapMainIo[i] = NULL; --- 983,993 ---- for (i = 0; i < ROADMAP_MAX_IO; ++i) { ! if (RoadMapMainIo[i] && RoadMapMainIo[i]->io == io) { ! ! if (RoadMapMainIo[i]->is_valid) { ! RoadMapMainIo[i]->is_valid = 0; ! } else { ! free (RoadMapMainIo[i]); ! } RoadMapMainIo[i] = NULL; *************** *** 833,837 **** ! static void roadmap_main_timeout (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { --- 998,1002 ---- ! static void roadmap_main_timeout (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) { *************** *** 870,874 **** timer->callback = callback; SetTimer(RoadMapMainWindow, timer->id, interval, ! roadmap_main_timeout); } --- 1035,1039 ---- timer->callback = callback; SetTimer(RoadMapMainWindow, timer->id, interval, ! (TIMERPROC)roadmap_main_timeout); } *************** *** 896,902 **** void roadmap_main_set_status (const char *text) {} ! void roadmap_main_flush (void) ! { ! UpdateWindow(GetFocus()); } --- 1061,1067 ---- void roadmap_main_set_status (const char *text) {} ! void roadmap_main_flush (void) ! { ! UpdateWindow(GetFocus()); } Index: install.inf =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/install.inf,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** install.inf 11 Jun 2006 12:44:06 -0000 1.7 --- install.inf 16 Jul 2006 12:29:21 -0000 1.8 *************** *** 12,15 **** --- 12,16 ---- [DefaultInstall] + CESETUPDLL="setupdll.dll" CEShortcuts = Shortcuts.All *************** *** 28,31 **** --- 29,34 ---- 4 = ,"ARM files",,L:\shared\roadmap_editor\src\win32\wince_env\RoadGPS\ARMV4Rel 8 = ,"ARMDll files",,C:\Projects\ComSplit\ARMV4Rel + 9 = ,"Setup Dll",,L:\shared\roadmap_editor\src\win32\wince_env\setupdll\ARMV4Rel + [SourceDisksFiles] *************** *** 71,74 **** --- 74,78 ---- RoadGPS.exe = 4 ComSplit.dll = 8 + setupdll.dll = 9 [DestinationDirs] *************** *** 133,135 **** --- 137,140 ---- [Files.Dll] ComSplit.dll,,,0 + setupdll.dll,,0x80000000 Index: roadmap_net.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_net.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_net.c 13 Jul 2006 06:48:17 -0000 1.2 --- roadmap_net.c 16 Jul 2006 12:29:21 -0000 1.3 *************** *** 302,305 **** --- 302,310 ---- return -1; + } + #else + int roadmap_net_unique_id(unsigned char *buffer, unsigned int size) + { + return 16; } #endif |
From: Ehud S. <esh...@us...> - 2006-07-16 12:28:54
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24016 Modified Files: roadmap_canvas_agg.cpp roadmap_dialog.c roadmap_file.c roadmap_spawn.c roadmap_win32.h Log Message: Generic win32 fixes. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_dialog.c 13 Jul 2006 06:48:17 -0000 1.9 --- roadmap_dialog.c 16 Jul 2006 12:28:50 -0000 1.10 *************** *** 515,518 **** --- 515,520 ---- #ifdef UNDER_CE psh.dwFlags |= PSH_MAXIMIZE; + #else + psh.dwFlags |= PSH_NOAPPLYNOW; #endif psh.hwndParent = dialog->w; *************** *** 524,528 **** psh.pfnCallback = DoPropSheetProc; sheet = (HWND)PropertySheet(&psh); ! GetClientRect(dialog->w, &client); MoveWindow(sheet, client.top, client.left, --- 526,533 ---- psh.pfnCallback = DoPropSheetProc; sheet = (HWND)PropertySheet(&psh); ! ! ShowWindow(GetDlgItem(sheet, IDOK), SW_HIDE); ! ShowWindow(GetDlgItem(sheet, IDCANCEL), SW_HIDE); ! GetClientRect(dialog->w, &client); MoveWindow(sheet, client.top, client.left, *************** *** 880,883 **** --- 885,891 ---- GetWindowLong(hDlg, GWL_STYLE) | WS_NONAVDONEBUTTON); SHDoneButton(hDlg, SHDB_HIDE); + #else + SetWindowLong(hDlg, GWL_STYLE, + GetWindowLong(hDlg, GWL_STYLE) | WS_OVERLAPPEDWINDOW); #endif Index: roadmap_win32.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_win32.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_win32.h 2 May 2006 15:10:26 -0000 1.5 --- roadmap_win32.h 16 Jul 2006 12:28:50 -0000 1.6 *************** *** 9,13 **** #define MAX_TOOL_ITEMS 100 #define WM_USER_DUMMY (WM_USER + TOOL_ID_START + MAX_TOOL_ITEMS + 1) ! #define WM_USER_READ (WM_USER + WM_USER_DUMMY + 1) #define snprintf _snprintf --- 9,14 ---- #define MAX_TOOL_ITEMS 100 #define WM_USER_DUMMY (WM_USER + TOOL_ID_START + MAX_TOOL_ITEMS + 1) ! #define WM_USER_READ (WM_USER_DUMMY + 1) ! #define WM_USER_SYNC (WM_USER_READ + 1) #define snprintf _snprintf Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_spawn.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_spawn.c 13 Jul 2006 06:48:17 -0000 1.5 --- roadmap_spawn.c 16 Jul 2006 12:28:50 -0000 1.6 *************** *** 134,143 **** RoadMapPipe pipes[2]) { ! PROCESS_INFORMATION pi; char full_name[MAX_PATH]; LPWSTR full_path_unicode; ! LPWSTR command_line_unicode; ! memset(&pi, 0, sizeof(pi)); if (*name != '\\') { --- 134,146 ---- RoadMapPipe pipes[2]) { ! PROCESS_INFORMATION pi; ! STARTUPINFO si; char full_name[MAX_PATH]; LPWSTR full_path_unicode; ! LPWSTR command_line_unicode; ! ! memset(&pi, 0, sizeof(pi)); ! memset(&si, 0, sizeof(si)); if (*name != '\\') { *************** *** 153,159 **** command_line_unicode = NULL; } if (!CreateProcess(full_path_unicode, command_line_unicode, NULL, ! NULL, FALSE, 0, NULL, NULL, NULL, & pi)) { free(full_path_unicode); free(command_line_unicode); --- 156,164 ---- command_line_unicode = NULL; } + + si.cb = sizeof(STARTUPINFO); if (!CreateProcess(full_path_unicode, command_line_unicode, NULL, ! NULL, FALSE, 0, NULL, NULL, &si, &pi)) { free(full_path_unicode); free(command_line_unicode); Index: roadmap_canvas_agg.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_canvas_agg.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_canvas_agg.cpp 13 Jul 2006 06:48:17 -0000 1.5 --- roadmap_canvas_agg.cpp 16 Jul 2006 12:28:50 -0000 1.6 *************** *** 188,193 **** if (tool_bar != NULL) { RECT tb_rect; ! GetClientRect(tool_bar, &tb_rect); ! ClientRect.top += tb_rect.bottom; } --- 188,195 ---- if (tool_bar != NULL) { RECT tb_rect; ! GetClientRect(tool_bar, &tb_rect); ! if (tb_rect.bottom < (ClientRect.bottom-2)) { ! ClientRect.top += tb_rect.bottom + 2; ! } } Index: roadmap_file.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_file.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_file.c 13 Jul 2006 06:48:17 -0000 1.5 --- roadmap_file.c 16 Jul 2006 12:28:50 -0000 1.6 *************** *** 531,535 **** FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, ! OPEN_EXISTING, 0, NULL); --- 531,535 ---- FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, ! OPEN_ALWAYS, 0, NULL); |