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-08-15 16:47:42
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10317 Modified Files: roadmap_start.c Log Message: roadmap_spawn_initialize() needs to come before roadmap_driver_activate() Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_start.c,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** roadmap_start.c 5 Jul 2006 14:29:33 -0000 1.100 --- roadmap_start.c 15 Aug 2006 16:47:36 -0000 1.101 *************** *** 1049,1058 **** roadmap_landmark_load (); #endif roadmap_driver_activate (); roadmap_gps_open (); - roadmap_spawn_initialize (argv[0]); - roadmap_help_initialize (); --- 1049,1058 ---- roadmap_landmark_load (); #endif + + roadmap_spawn_initialize (argv[0]); roadmap_driver_activate (); roadmap_gps_open (); roadmap_help_initialize (); |
From: Paul F. <pg...@us...> - 2006-08-15 01:34:17
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8603 Modified Files: roadmap_screen.c roadmap_screen.h Log Message: initial setting for dynamic orientation is now a preference setting Index: roadmap_screen.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_screen.h 26 Jun 2006 19:59:53 -0000 1.10 --- roadmap_screen.h 15 Aug 2006 01:34:13 -0000 1.11 *************** *** 32,39 **** }; - enum { ORIENTATION_DYNAMIC = 0, - ORIENTATION_FIXED - }; - void roadmap_screen_initialize (void); --- 32,35 ---- Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** roadmap_screen.c 11 Aug 2006 03:35:37 -0000 1.69 --- roadmap_screen.c 15 Aug 2006 01:34:13 -0000 1.70 *************** *** 98,101 **** --- 98,104 ---- ROADMAP_CONFIG_ITEM("Map", "Labels"); + static RoadMapConfigDescriptor RoadMapConfigMapDynamicOrientation = + ROADMAP_CONFIG_ITEM("Map", "DynamicOrientation"); + static int RoadMapScreenInitialized = 0; static int RoadMapScreenFrozen = 0; *************** *** 106,110 **** static int RoadMapScreenViewMode = VIEW_MODE_2D; ! static int RoadMapScreenOrientationMode = ORIENTATION_DYNAMIC; static int RoadMapScreen3dHorizon; static int RoadMapScreenLabels; --- 109,113 ---- static int RoadMapScreenViewMode = VIEW_MODE_2D; ! static int RoadMapScreenOrientationDynamic = 1; static int RoadMapScreen3dHorizon; static int RoadMapScreenLabels; *************** *** 1071,1074 **** --- 1074,1081 ---- RoadMapScreenLabels = ! roadmap_config_match(&RoadMapConfigMapLabels, "off"); + + RoadMapScreenOrientationDynamic = + roadmap_config_match(&RoadMapConfigMapDynamicOrientation, "on"); + roadmap_log (ROADMAP_WARNING, "init dyn %d", RoadMapScreenOrientationDynamic); roadmap_math_set_size (RoadMapScreenWidth, RoadMapScreenHeight); *************** *** 1188,1192 **** static int roadmap_screen_get_orientation_mode (void) { ! return RoadMapScreenOrientationMode; } --- 1195,1199 ---- static int roadmap_screen_get_orientation_mode (void) { ! return RoadMapScreenOrientationDynamic; } *************** *** 1213,1217 **** refresh = 1; ! if (RoadMapScreenOrientationMode != ORIENTATION_FIXED) { roadmap_math_set_orientation (roadmap_trip_get_orientation()); } --- 1220,1224 ---- refresh = 1; ! if (RoadMapScreenOrientationDynamic) { roadmap_math_set_orientation (roadmap_trip_get_orientation()); } *************** *** 1222,1226 **** roadmap_math_set_center (&RoadMapScreenCenter); ! if (RoadMapScreenOrientationMode != ORIENTATION_FIXED) { refresh |= roadmap_math_set_orientation --- 1229,1233 ---- roadmap_math_set_center (&RoadMapScreenCenter); ! if (RoadMapScreenOrientationDynamic) { refresh |= roadmap_math_set_orientation *************** *** 1298,1302 **** } ! if (RoadMapScreenOrientationMode == ORIENTATION_DYNAMIC) { calculated_rotation = roadmap_trip_get_orientation() + rotation; } else { --- 1305,1309 ---- } ! if (RoadMapScreenOrientationDynamic) { calculated_rotation = roadmap_trip_get_orientation() + rotation; } else { *************** *** 1334,1344 **** void roadmap_screen_toggle_orientation_mode (void) { ! if (RoadMapScreenOrientationMode == ORIENTATION_DYNAMIC) { ! ! RoadMapScreenOrientationMode = ORIENTATION_FIXED; ! ! } else { ! RoadMapScreenOrientationMode = ORIENTATION_DYNAMIC; ! } RoadMapScreenRotation = 0; --- 1341,1346 ---- void roadmap_screen_toggle_orientation_mode (void) { ! RoadMapScreenOrientationDynamic = ! RoadMapScreenOrientationDynamic; ! roadmap_log (ROADMAP_WARNING, "dyn now %d", RoadMapScreenOrientationDynamic); RoadMapScreenRotation = 0; *************** *** 1457,1460 **** --- 1459,1467 ---- ("preferences", &RoadMapConfigMapLabels, "on", "off", NULL); + roadmap_config_declare_enumeration + ("preferences", &RoadMapConfigMapDynamicOrientation, "on", "off", NULL); + + + roadmap_pointer_register_short_click (&roadmap_screen_short_click); roadmap_pointer_register_drag_start (&roadmap_screen_drag_start); |
From: Paul F. <pg...@us...> - 2006-08-14 15:57:02
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10036/gpx Modified Files: gpx.c Log Message: remove old ifdefed code Index: gpx.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/gpx.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gpx.c 17 Jul 2006 20:57:21 -0000 1.5 --- gpx.c 14 Aug 2006 15:56:55 -0000 1.6 *************** *** 1466,1480 **** { waypt_add_to_bounds(&all_bounds, waypointp); - #if 0 - bounds *bounds = &all_bounds; - if (waypointp->pos.latitude > bounds->max_lat) - bounds->max_lat = waypointp->pos.latitude; - if (waypointp->pos.longitude > bounds->max_lon) - bounds->max_lon = waypointp->pos.longitude; - if (waypointp->pos.latitude < bounds->min_lat) - bounds->min_lat = waypointp->pos.latitude; - if (waypointp->pos.longitude < bounds->min_lon) - bounds->min_lon = waypointp->pos.longitude; - #endif } --- 1466,1469 ---- *************** *** 1482,1494 **** gpx_write_bounds(FILE *ofd, queue_head *wq, queue_head *rq, queue_head *tq) { - #if 0 - bounds *bounds = &all_bounds; - - /* Set data out of bounds so that even one waypoint will reset */ - bounds->max_lat = -500000000; - bounds->max_lon = -500000000; - bounds->min_lat = 500000000; - bounds->min_lon = 500000000; - #endif waypt_init_bounds(&all_bounds); --- 1471,1474 ---- *************** *** 1497,1501 **** if (tq) route_iterator(tq, NULL, NULL, gpx_waypt_bound_calc); if (waypt_bounds_valid(&all_bounds)) { - // if (bounds->max_lat > -360) { fprintf(ofd, "<bounds minlat=\"" FLT_FMT "\" minlon =\"" FLT_FMT "\" " --- 1477,1480 ---- |
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22960 Modified Files: roadmap_label.c roadmap_label.h roadmap_landmark.c roadmap_landmark.h roadmap_linefont.c roadmap_linefont.h roadmap_trip.c Log Message: implement labels on user landmarks, both "trip" and "personal" landmarks. the color is configurable ("Landmarks.Color"), but the size of the text is not. (currently 18. street labels are 16.) Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_landmark.c 17 Jul 2006 20:57:21 -0000 1.6 --- roadmap_landmark.c 13 Aug 2006 15:24:17 -0000 1.7 *************** *** 33,53 **** #include "roadmap_gpx.h" #include "roadmap_landmark.h" RoadMapList RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; static RoadMapConfigDescriptor RoadMapConfigLandmarkName = ROADMAP_CONFIG_ITEM ("Landmarks", "Name"); ! static void roadmap_landmark_draw(const waypoint *waypointp) ! { RoadMapGuiPoint guipoint; ! const char *sprite; ! if (waypointp->icon_descr == NULL) { ! sprite = "PersonalLandmark"; ! } else { sprite = waypointp->icon_descr; } --- 33,59 ---- #include "roadmap_gpx.h" #include "roadmap_landmark.h" + #include "roadmap_label.h" RoadMapList RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; + static RoadMapPen RoadMapLandMarksPen; static RoadMapConfigDescriptor RoadMapConfigLandmarkName = ROADMAP_CONFIG_ITEM ("Landmarks", "Name"); + static RoadMapConfigDescriptor RoadMapConfigLandmarksColor = + ROADMAP_CONFIG_ITEM("Landmarks", "Color"); ! ! #define ROADMAP_LANDMARK_LABEL_SIZE 18 ! ! void roadmap_landmark_draw_waypoint ! (const waypoint *waypointp, const char *sprite) { ! RoadMapGuiPoint guipoint; ! ! if (waypointp->icon_descr) { sprite = waypointp->icon_descr; } *************** *** 58,64 **** --- 64,87 ---- roadmap_math_rotate_coordinates (1, &guipoint); roadmap_sprite_draw (sprite, &guipoint, 0); + + roadmap_canvas_select_pen (RoadMapLandMarksPen); + guipoint.y += 15; /* space for sprite */ + + /* FIXME -- We should do label collision detection, which + * means joining in the fun in roadmap_label_add() and + * roadmap_label_draw_cache(). Landmark labels should + * probably take priority, and be positioned first. They + * should probably be drawn last, however, so that their + * labels come out on "top" of other map features. + */ + roadmap_label_draw_text(waypointp->shortname, + &guipoint, &guipoint, 0, 0, ROADMAP_LANDMARK_LABEL_SIZE); } } + static void roadmap_landmark_draw(const waypoint *waypointp) { + roadmap_landmark_draw_waypoint(waypointp, "PersonalLandmark"); + } + void roadmap_landmark_display (void) { *************** *** 198,201 **** --- 221,230 ---- int defaulted, ret; + RoadMapLandMarksPen = roadmap_canvas_create_pen ("landmarks.labels"); + roadmap_canvas_set_foreground + (roadmap_config_get (&RoadMapConfigLandmarksColor)); + + roadmap_canvas_set_thickness (2); + name = roadmap_landmark_filename (&defaulted); *************** *** 230,233 **** --- 259,266 ---- ("preferences", &RoadMapConfigLandmarkName, ""); + roadmap_config_declare + ("preferences", &RoadMapConfigLandmarksColor, "darkred"); + + ROADMAP_LIST_INIT(&RoadMapLandmarkHead); Index: roadmap_linefont.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_linefont.c 20 Jul 2006 03:14:39 -0000 1.4 --- roadmap_linefont.c 13 Aug 2006 15:24:17 -0000 1.5 *************** *** 283,287 **** xp -= len / 2; ! if (where & ROADMAP_LINEFONT_LOWER) yp -= height; else if (where & ROADMAP_LINEFONT_CENTER_Y) --- 283,287 ---- xp -= len / 2; ! if (where & ROADMAP_LINEFONT_BOTTOM) yp -= height; else if (where & ROADMAP_LINEFONT_CENTER_Y) Index: roadmap_landmark.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_landmark.h 17 Jul 2006 20:57:21 -0000 1.3 --- roadmap_landmark.h 13 Aug 2006 15:24:17 -0000 1.4 *************** *** 29,33 **** void roadmap_landmark_save (void); void roadmap_landmark_load (void); - void roadmap_landmark_load(void); void roadmap_landmark_merge(void); int roadmap_landmark_count(); --- 29,32 ---- *************** *** 36,39 **** --- 35,40 ---- RoadMapList * roadmap_landmark_list(void); int roadmap_landmark_is_refresh_needed (void); + void roadmap_landmark_draw_waypoint + (const waypoint *waypointp, const char *sprite); #endif // INCLUDE__ROADMAP_LANDMARK__H Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** roadmap_trip.c 18 Jul 2006 11:49:38 -0000 1.53 --- roadmap_trip.c 13 Aug 2006 15:24:17 -0000 1.54 *************** *** 1725,1742 **** static void roadmap_trip_standalone_waypoint_draw(const waypoint *waypointp) { ! RoadMapGuiPoint guipoint; ! const char *sprite; ! if (waypointp->icon_descr == NULL) { ! sprite = "TripLandmark"; ! } else { ! sprite = waypointp->icon_descr; ! } ! ! if (roadmap_math_point_is_visible (&waypointp->pos)) { ! ! roadmap_math_coordinate (&waypointp->pos, &guipoint); ! roadmap_math_rotate_coordinates (1, &guipoint); ! roadmap_sprite_draw (sprite, &guipoint, 0); ! } } --- 1725,1729 ---- static void roadmap_trip_standalone_waypoint_draw(const waypoint *waypointp) { ! roadmap_landmark_draw_waypoint(waypointp, "TripLandmark"); } Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** roadmap_label.c 11 Aug 2006 19:22:54 -0000 1.15 --- roadmap_label.c 13 Aug 2006 15:24:17 -0000 1.16 *************** *** 65,68 **** --- 65,69 ---- /* this is fairly arbitrary */ #define MAX_LABELS 2048 + #define ROADMAP_LABEL_STREETLABEL_SIZE 16 typedef struct { *************** *** 223,226 **** --- 224,271 ---- } + void roadmap_label_text_extents(const char *text, int size, + int *width, int *ascent, int *descent, + int *can_tilt, int *easy_reading) + { + #ifdef ROADMAP_USE_LINEFONT + + roadmap_linefont_extents + (text, ROADMAP_LABEL_STREETLABEL_SIZE, width, ascent, descent); + + /* 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. + */ + *easy_reading = 0; + if (can_tilt) *can_tilt = 1; + + #else + + roadmap_canvas_get_text_extents + (text, -1, width, ascent, descent, can_tilt); + + *easy_reading = 1; + + #endif + } + + void roadmap_label_draw_text(const char *text, + RoadMapGuiPoint *start, RoadMapGuiPoint *center, + int doing_angles, int angle, int size) + { + + #ifdef ROADMAP_USE_LINEFONT + roadmap_linefont_text + (text, doing_angles ? ROADMAP_CANVAS_CENTER_BOTTOM : + ROADMAP_CANVAS_CENTER, center, size, angle); + #else + if (doing_angles) { + roadmap_canvas_draw_string_angle (start, center, angle, text); + } else { + roadmap_canvas_draw_string (center, ROADMAP_CANVAS_CENTER, text); + } + #endif + } + /* called when a screen repaint is complete. keeping track of * label "generations" involves keeping track of full refreshes, *************** *** 437,463 **** if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! ! #ifdef ROADMAP_USE_LINEFONT ! ! roadmap_linefont_extents(cPtr->text, 16, &width, &ascent, &descent); ! ! /* 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. */ ! label_center_y = 0; ! ! #else ! int i; ! ! roadmap_canvas_get_text_extents ! (cPtr->text, -1, &width, &ascent, &descent, &i); ! ! angles = angles && i; ! ! label_center_y = 1; ! #endif /* text is too long for this feature */ ! /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { /* Keep this one in the cache as the feature size may change --- 482,493 ---- if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! int can_tilt; ! roadmap_label_text_extents ! (cPtr->text, ROADMAP_LABEL_STREETLABEL_SIZE , ! &width, &ascent, &descent, &can_tilt, &label_center_y); ! angles = angles && can_tilt; /* text is too long for this feature */ ! /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { /* Keep this one in the cache as the feature size may change *************** *** 584,601 **** } ! #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (cPtr->text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->center_point, 16, cPtr->angle); ! #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&cPtr->text_point, &cPtr->center_point, cPtr->angle, ! cPtr->text); ! } else { ! roadmap_canvas_draw_string ! (&cPtr->center_point, ROADMAP_CANVAS_CENTER, cPtr->text); ! } ! #endif if (whichlist == NEWLIST) { /* move the rendered label to the cache */ --- 614,622 ---- } ! roadmap_label_draw_text ! (cPtr->text, &cPtr->text_point, &cPtr->center_point, ! angles, angles ? cPtr->angle : 0, ! ROADMAP_LABEL_STREETLABEL_SIZE ); ! if (whichlist == NEWLIST) { /* move the rendered label to the cache */ *************** *** 614,622 **** int roadmap_label_activate (void) { RoadMapLabelPen = roadmap_canvas_create_pen ("labels.main"); roadmap_canvas_set_foreground (roadmap_config_get (&RoadMapConfigLabelsColor)); - /* assume this will only affect our internal line fonts */ roadmap_canvas_set_thickness (2); --- 635,643 ---- int roadmap_label_activate (void) { + RoadMapLabelPen = roadmap_canvas_create_pen ("labels.main"); roadmap_canvas_set_foreground (roadmap_config_get (&RoadMapConfigLabelsColor)); roadmap_canvas_set_thickness (2); *************** *** 624,628 **** RoadMapLabelMinFeatSizeSq *= RoadMapLabelMinFeatSizeSq; - return 0; } --- 645,648 ---- *************** *** 636,639 **** --- 656,660 ---- roadmap_config_declare ("preferences", &RoadMapConfigLabelsColor, "#000000"); + ROADMAP_LIST_INIT(&RoadMapLabelCache); Index: roadmap_linefont.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_linefont.h 13 Jul 2006 13:30:33 -0000 1.1 --- roadmap_linefont.h 13 Aug 2006 15:24:17 -0000 1.2 *************** *** 30,47 **** void roadmap_linefont_text ! (const char *text, int allign, RoadMapGuiPoint *center, ! int size, int theta); ! #define ROADMAP_LINEFONT_LEFT 0 ! #define ROADMAP_LINEFONT_RIGHT 1 ! #define ROADMAP_LINEFONT_CENTER_X 2 ! #define ROADMAP_LINEFONT_UPPER 0 ! #define ROADMAP_LINEFONT_LOWER 4 ! #define ROADMAP_LINEFONT_CENTER_Y 8 #define ROADMAP_LINEFONT_CENTERED \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_CENTER_Y) #define ROADMAP_LINEFONT_CENTERED_ABOVE \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_LOWER) #endif --- 30,49 ---- void roadmap_linefont_text ! (const char *text, int allign, RoadMapGuiPoint *center, ! int size, int theta); ! /* reuse roadmap canvas values, so callers won't care which text functions ! * are actually eventually called */ ! #define ROADMAP_LINEFONT_LEFT ROADMAP_CANVAS_LEFT ! #define ROADMAP_LINEFONT_RIGHT ROADMAP_CANVAS_RIGHT ! #define ROADMAP_LINEFONT_TOP ROADMAP_CANVAS_TOP ! #define ROADMAP_LINEFONT_BOTTOM ROADMAP_CANVAS_BOTTOM ! #define ROADMAP_LINEFONT_CENTER_X ROADMAP_CANVAS_CENTER_X ! #define ROADMAP_LINEFONT_CENTER_Y ROADMAP_CANVAS_CENTER_Y #define ROADMAP_LINEFONT_CENTERED \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_CENTER_Y) #define ROADMAP_LINEFONT_CENTERED_ABOVE \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_BOTTOM) #endif Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_label.h 20 Jul 2006 03:22:01 -0000 1.4 --- roadmap_label.h 13 Aug 2006 15:24:17 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- #include "roadmap.h" #include "roadmap_gui.h" + #include "roadmap_plugin.h" *************** *** 41,43 **** --- 42,52 ---- void roadmap_label_start (void); + void roadmap_label_text_extents(const char *text, int size, + int *width, int *ascent, int *descent, + int *can_tilt, int *easy_reading); + + void roadmap_label_draw_text(const char *text, + RoadMapGuiPoint *start, RoadMapGuiPoint *center, + int doing_angles, int angle, int size); + #endif // __ROADMAP_LABEL__H |
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22960 Modified Files: roadmap_label.c roadmap_label.h roadmap_landmark.c roadmap_landmark.h roadmap_linefont.c roadmap_linefont.h roadmap_trip.c Log Message: implement labels on user landmarks, both "trip" and "personal" landmarks. the color is configurable ("Landmarks.Color"), but the size of the text is not. (currently 18. street labels are 16.) Index: roadmap_landmark.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_landmark.c 17 Jul 2006 20:57:21 -0000 1.6 --- roadmap_landmark.c 13 Aug 2006 15:24:17 -0000 1.7 *************** *** 33,53 **** #include "roadmap_gpx.h" #include "roadmap_landmark.h" RoadMapList RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; static RoadMapConfigDescriptor RoadMapConfigLandmarkName = ROADMAP_CONFIG_ITEM ("Landmarks", "Name"); ! static void roadmap_landmark_draw(const waypoint *waypointp) ! { RoadMapGuiPoint guipoint; ! const char *sprite; ! if (waypointp->icon_descr == NULL) { ! sprite = "PersonalLandmark"; ! } else { sprite = waypointp->icon_descr; } --- 33,59 ---- #include "roadmap_gpx.h" #include "roadmap_landmark.h" + #include "roadmap_label.h" RoadMapList RoadMapLandmarkHead; static int RoadMapLandmarkModified; static int RoadMapLandmarkRefresh; + static RoadMapPen RoadMapLandMarksPen; static RoadMapConfigDescriptor RoadMapConfigLandmarkName = ROADMAP_CONFIG_ITEM ("Landmarks", "Name"); + static RoadMapConfigDescriptor RoadMapConfigLandmarksColor = + ROADMAP_CONFIG_ITEM("Landmarks", "Color"); ! ! #define ROADMAP_LANDMARK_LABEL_SIZE 18 ! ! void roadmap_landmark_draw_waypoint ! (const waypoint *waypointp, const char *sprite) { ! RoadMapGuiPoint guipoint; ! ! if (waypointp->icon_descr) { sprite = waypointp->icon_descr; } *************** *** 58,64 **** --- 64,87 ---- roadmap_math_rotate_coordinates (1, &guipoint); roadmap_sprite_draw (sprite, &guipoint, 0); + + roadmap_canvas_select_pen (RoadMapLandMarksPen); + guipoint.y += 15; /* space for sprite */ + + /* FIXME -- We should do label collision detection, which + * means joining in the fun in roadmap_label_add() and + * roadmap_label_draw_cache(). Landmark labels should + * probably take priority, and be positioned first. They + * should probably be drawn last, however, so that their + * labels come out on "top" of other map features. + */ + roadmap_label_draw_text(waypointp->shortname, + &guipoint, &guipoint, 0, 0, ROADMAP_LANDMARK_LABEL_SIZE); } } + static void roadmap_landmark_draw(const waypoint *waypointp) { + roadmap_landmark_draw_waypoint(waypointp, "PersonalLandmark"); + } + void roadmap_landmark_display (void) { *************** *** 198,201 **** --- 221,230 ---- int defaulted, ret; + RoadMapLandMarksPen = roadmap_canvas_create_pen ("landmarks.labels"); + roadmap_canvas_set_foreground + (roadmap_config_get (&RoadMapConfigLandmarksColor)); + + roadmap_canvas_set_thickness (2); + name = roadmap_landmark_filename (&defaulted); *************** *** 230,233 **** --- 259,266 ---- ("preferences", &RoadMapConfigLandmarkName, ""); + roadmap_config_declare + ("preferences", &RoadMapConfigLandmarksColor, "darkred"); + + ROADMAP_LIST_INIT(&RoadMapLandmarkHead); Index: roadmap_linefont.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_linefont.c 20 Jul 2006 03:14:39 -0000 1.4 --- roadmap_linefont.c 13 Aug 2006 15:24:17 -0000 1.5 *************** *** 283,287 **** xp -= len / 2; ! if (where & ROADMAP_LINEFONT_LOWER) yp -= height; else if (where & ROADMAP_LINEFONT_CENTER_Y) --- 283,287 ---- xp -= len / 2; ! if (where & ROADMAP_LINEFONT_BOTTOM) yp -= height; else if (where & ROADMAP_LINEFONT_CENTER_Y) Index: roadmap_landmark.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_landmark.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_landmark.h 17 Jul 2006 20:57:21 -0000 1.3 --- roadmap_landmark.h 13 Aug 2006 15:24:17 -0000 1.4 *************** *** 29,33 **** void roadmap_landmark_save (void); void roadmap_landmark_load (void); - void roadmap_landmark_load(void); void roadmap_landmark_merge(void); int roadmap_landmark_count(); --- 29,32 ---- *************** *** 36,39 **** --- 35,40 ---- RoadMapList * roadmap_landmark_list(void); int roadmap_landmark_is_refresh_needed (void); + void roadmap_landmark_draw_waypoint + (const waypoint *waypointp, const char *sprite); #endif // INCLUDE__ROADMAP_LANDMARK__H Index: roadmap_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** roadmap_trip.c 18 Jul 2006 11:49:38 -0000 1.53 --- roadmap_trip.c 13 Aug 2006 15:24:17 -0000 1.54 *************** *** 1725,1742 **** static void roadmap_trip_standalone_waypoint_draw(const waypoint *waypointp) { ! RoadMapGuiPoint guipoint; ! const char *sprite; ! if (waypointp->icon_descr == NULL) { ! sprite = "TripLandmark"; ! } else { ! sprite = waypointp->icon_descr; ! } ! ! if (roadmap_math_point_is_visible (&waypointp->pos)) { ! ! roadmap_math_coordinate (&waypointp->pos, &guipoint); ! roadmap_math_rotate_coordinates (1, &guipoint); ! roadmap_sprite_draw (sprite, &guipoint, 0); ! } } --- 1725,1729 ---- static void roadmap_trip_standalone_waypoint_draw(const waypoint *waypointp) { ! roadmap_landmark_draw_waypoint(waypointp, "TripLandmark"); } Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** roadmap_label.c 11 Aug 2006 19:22:54 -0000 1.15 --- roadmap_label.c 13 Aug 2006 15:24:17 -0000 1.16 *************** *** 65,68 **** --- 65,69 ---- /* this is fairly arbitrary */ #define MAX_LABELS 2048 + #define ROADMAP_LABEL_STREETLABEL_SIZE 16 typedef struct { *************** *** 223,226 **** --- 224,271 ---- } + void roadmap_label_text_extents(const char *text, int size, + int *width, int *ascent, int *descent, + int *can_tilt, int *easy_reading) + { + #ifdef ROADMAP_USE_LINEFONT + + roadmap_linefont_extents + (text, ROADMAP_LABEL_STREETLABEL_SIZE, width, ascent, descent); + + /* 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. + */ + *easy_reading = 0; + if (can_tilt) *can_tilt = 1; + + #else + + roadmap_canvas_get_text_extents + (text, -1, width, ascent, descent, can_tilt); + + *easy_reading = 1; + + #endif + } + + void roadmap_label_draw_text(const char *text, + RoadMapGuiPoint *start, RoadMapGuiPoint *center, + int doing_angles, int angle, int size) + { + + #ifdef ROADMAP_USE_LINEFONT + roadmap_linefont_text + (text, doing_angles ? ROADMAP_CANVAS_CENTER_BOTTOM : + ROADMAP_CANVAS_CENTER, center, size, angle); + #else + if (doing_angles) { + roadmap_canvas_draw_string_angle (start, center, angle, text); + } else { + roadmap_canvas_draw_string (center, ROADMAP_CANVAS_CENTER, text); + } + #endif + } + /* called when a screen repaint is complete. keeping track of * label "generations" involves keeping track of full refreshes, *************** *** 437,463 **** if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! ! #ifdef ROADMAP_USE_LINEFONT ! ! roadmap_linefont_extents(cPtr->text, 16, &width, &ascent, &descent); ! ! /* 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. */ ! label_center_y = 0; ! ! #else ! int i; ! ! roadmap_canvas_get_text_extents ! (cPtr->text, -1, &width, &ascent, &descent, &i); ! ! angles = angles && i; ! ! label_center_y = 1; ! #endif /* text is too long for this feature */ ! /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { /* Keep this one in the cache as the feature size may change --- 482,493 ---- if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! int can_tilt; ! roadmap_label_text_extents ! (cPtr->text, ROADMAP_LABEL_STREETLABEL_SIZE , ! &width, &ascent, &descent, &can_tilt, &label_center_y); ! angles = angles && can_tilt; /* text is too long for this feature */ ! /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { /* Keep this one in the cache as the feature size may change *************** *** 584,601 **** } ! #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (cPtr->text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->center_point, 16, cPtr->angle); ! #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&cPtr->text_point, &cPtr->center_point, cPtr->angle, ! cPtr->text); ! } else { ! roadmap_canvas_draw_string ! (&cPtr->center_point, ROADMAP_CANVAS_CENTER, cPtr->text); ! } ! #endif if (whichlist == NEWLIST) { /* move the rendered label to the cache */ --- 614,622 ---- } ! roadmap_label_draw_text ! (cPtr->text, &cPtr->text_point, &cPtr->center_point, ! angles, angles ? cPtr->angle : 0, ! ROADMAP_LABEL_STREETLABEL_SIZE ); ! if (whichlist == NEWLIST) { /* move the rendered label to the cache */ *************** *** 614,622 **** int roadmap_label_activate (void) { RoadMapLabelPen = roadmap_canvas_create_pen ("labels.main"); roadmap_canvas_set_foreground (roadmap_config_get (&RoadMapConfigLabelsColor)); - /* assume this will only affect our internal line fonts */ roadmap_canvas_set_thickness (2); --- 635,643 ---- int roadmap_label_activate (void) { + RoadMapLabelPen = roadmap_canvas_create_pen ("labels.main"); roadmap_canvas_set_foreground (roadmap_config_get (&RoadMapConfigLabelsColor)); roadmap_canvas_set_thickness (2); *************** *** 624,628 **** RoadMapLabelMinFeatSizeSq *= RoadMapLabelMinFeatSizeSq; - return 0; } --- 645,648 ---- *************** *** 636,639 **** --- 656,660 ---- roadmap_config_declare ("preferences", &RoadMapConfigLabelsColor, "#000000"); + ROADMAP_LIST_INIT(&RoadMapLabelCache); Index: roadmap_linefont.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_linefont.h 13 Jul 2006 13:30:33 -0000 1.1 --- roadmap_linefont.h 13 Aug 2006 15:24:17 -0000 1.2 *************** *** 30,47 **** void roadmap_linefont_text ! (const char *text, int allign, RoadMapGuiPoint *center, ! int size, int theta); ! #define ROADMAP_LINEFONT_LEFT 0 ! #define ROADMAP_LINEFONT_RIGHT 1 ! #define ROADMAP_LINEFONT_CENTER_X 2 ! #define ROADMAP_LINEFONT_UPPER 0 ! #define ROADMAP_LINEFONT_LOWER 4 ! #define ROADMAP_LINEFONT_CENTER_Y 8 #define ROADMAP_LINEFONT_CENTERED \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_CENTER_Y) #define ROADMAP_LINEFONT_CENTERED_ABOVE \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_LOWER) #endif --- 30,49 ---- void roadmap_linefont_text ! (const char *text, int allign, RoadMapGuiPoint *center, ! int size, int theta); ! /* reuse roadmap canvas values, so callers won't care which text functions ! * are actually eventually called */ ! #define ROADMAP_LINEFONT_LEFT ROADMAP_CANVAS_LEFT ! #define ROADMAP_LINEFONT_RIGHT ROADMAP_CANVAS_RIGHT ! #define ROADMAP_LINEFONT_TOP ROADMAP_CANVAS_TOP ! #define ROADMAP_LINEFONT_BOTTOM ROADMAP_CANVAS_BOTTOM ! #define ROADMAP_LINEFONT_CENTER_X ROADMAP_CANVAS_CENTER_X ! #define ROADMAP_LINEFONT_CENTER_Y ROADMAP_CANVAS_CENTER_Y #define ROADMAP_LINEFONT_CENTERED \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_CENTER_Y) #define ROADMAP_LINEFONT_CENTERED_ABOVE \ ! (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_BOTTOM) #endif Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_label.h 20 Jul 2006 03:22:01 -0000 1.4 --- roadmap_label.h 13 Aug 2006 15:24:17 -0000 1.5 *************** *** 29,32 **** --- 29,33 ---- #include "roadmap.h" #include "roadmap_gui.h" + #include "roadmap_plugin.h" *************** *** 41,43 **** --- 42,52 ---- void roadmap_label_start (void); + void roadmap_label_text_extents(const char *text, int size, + int *width, int *ascent, int *descent, + int *can_tilt, int *easy_reading); + + void roadmap_label_draw_text(const char *text, + RoadMapGuiPoint *start, RoadMapGuiPoint *center, + int doing_angles, int angle, int size); + #endif // __ROADMAP_LABEL__H |
From: Paul F. <pg...@us...> - 2006-08-12 17:16:02
|
Update of /cvsroot/roadmap/roadmap/src/agg_support In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12987 Modified Files: roadmap_canvas.cpp Log Message: apply ehud's optimization for text which is near-horizontal Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/agg_support/roadmap_canvas.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_canvas.cpp 12 Aug 2006 01:48:48 -0000 1.4 --- roadmap_canvas.cpp 12 Aug 2006 17:15:59 -0000 1.5 *************** *** 593,596 **** --- 593,627 ---- double y = 0; + if ((angle > -5) && (angle < 5)) { + + int size = 15; + + /* Use faster drawing for text with no angle */ + x = position->x; + y = position->y; + + // ren_solid.color(agg::rgba8(0, 0, 0)); + + m_image_feng.height(size); + m_image_feng.width(size); + + while(*p) { + const agg::glyph_cache* glyph = m_image_fman.glyph(*p); + + if(glyph) { + m_image_fman.init_embedded_adaptors(glyph, x, y); + + agg::render_scanlines(m_image_fman.gray8_adaptor(), + m_image_fman.gray8_scanline(), + ren_solid); + + // increment pen position + x += glyph->advance_x; + y += glyph->advance_y; + } + ++p; + } + } + dbg_time_end(DBG_TIME_TEXT_LOAD); while(*p) { |
From: Ehud S. <esh...@us...> - 2006-08-12 16:58:56
|
Update of /cvsroot/roadmap/roadmap_editor/src/agg In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6460 Modified Files: roadmap_canvas.cpp Log Message: Fix angle check for fast label drawing. Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/agg/roadmap_canvas.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_canvas.cpp 9 Aug 2006 07:24:47 -0000 1.6 --- roadmap_canvas.cpp 12 Aug 2006 16:58:52 -0000 1.7 *************** *** 600,604 **** double y = 0; ! if ((angle >= 85) && (angle <= 95)) { int size = 15; --- 600,604 ---- double y = 0; ! if ((angle > -5) && (angle < 5)) { int size = 15; *************** *** 608,612 **** y = position->y; ! ren_solid.color(agg::rgba8(0, 0, 0)); m_image_feng.height(size); --- 608,612 ---- y = position->y; ! // ren_solid.color(agg::rgba8(0, 0, 0)); m_image_feng.height(size); |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193/qt Modified Files: qt_canvas.cc Log Message: allow text to be centered independently in x and y Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** qt_canvas.cc 13 Jul 2006 15:47:53 -0000 1.12 --- qt_canvas.cc 12 Aug 2006 01:48:48 -0000 1.13 *************** *** 140,173 **** getTextExtents(text, &text_width, &text_ascent, &text_descent, NULL); ! switch (corner) { ! ! case ROADMAP_CANVAS_TOPLEFT: ! y = position->y + text_ascent; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_TOPRIGHT: ! y = position->y + text_ascent; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMRIGHT: ! y = position->y - text_descent; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMLEFT: ! y = position->y - text_descent; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_CENTER: ! y = position->y + (text_ascent / 2); ! x = position->x - (text_width / 2); ! break; ! ! default: ! return; ! } p.drawText(x, y, QString::fromUtf8(text)); --- 140,156 ---- getTextExtents(text, &text_width, &text_ascent, &text_descent, NULL); ! x = position->x; ! y = position->y; ! if (corner & ROADMAP_CANVAS_RIGHT) ! x -= text_width; ! else if (corner & ROADMAP_CANVAS_CENTER_X) ! x -= text_width / 2; ! ! if (corner & ROADMAP_CANVAS_BOTTOM) ! y -= text_descent; ! else if (corner & ROADMAP_CANVAS_CENTER_Y) ! y += (text_ascent / 2); ! else /* TOP */ ! y += text_ascent; p.drawText(x, y, QString::fromUtf8(text)); |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193 Modified Files: roadmap_canvas.h Log Message: allow text to be centered independently in x and y Index: roadmap_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_canvas.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_canvas.h 13 Jul 2006 15:47:53 -0000 1.8 --- roadmap_canvas.h 12 Aug 2006 01:48:47 -0000 1.9 *************** *** 110,114 **** #define ROADMAP_CANVAS_TOP 0 #define ROADMAP_CANVAS_BOTTOM 2 ! #define ROADMAP_CANVAS_CENTER 4 #define ROADMAP_CANVAS_TOPLEFT (ROADMAP_CANVAS_TOP|ROADMAP_CANVAS_LEFT) --- 110,118 ---- #define ROADMAP_CANVAS_TOP 0 #define ROADMAP_CANVAS_BOTTOM 2 ! #define ROADMAP_CANVAS_CENTER_X 4 ! #define ROADMAP_CANVAS_CENTER_Y 8 ! #define ROADMAP_CANVAS_CENTER (ROADMAP_CANVAS_CENTER_X|ROADMAP_CANVAS_CENTER_Y) ! #define ROADMAP_CANVAS_CENTER_BOTTOM (ROADMAP_CANVAS_CENTER_X|ROADMAP_CANVAS_BOTTOM) ! #define ROADMAP_CANVAS_CENTER_TOP (ROADMAP_CANVAS_CENTER_X|ROADMAP_CANVAS_TOP) #define ROADMAP_CANVAS_TOPLEFT (ROADMAP_CANVAS_TOP|ROADMAP_CANVAS_LEFT) |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193/gtk Modified Files: roadmap_canvas.c Log Message: allow text to be centered independently in x and y Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk/roadmap_canvas.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.10 --- roadmap_canvas.c 12 Aug 2006 01:48:48 -0000 1.11 *************** *** 210,243 **** (text, -1, &text_width, &text_ascent, &text_descent, NULL); ! switch (corner) { ! ! case ROADMAP_CANVAS_TOPLEFT: ! y = position->y + text_ascent; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_TOPRIGHT: ! y = position->y + text_ascent; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMRIGHT: ! y = position->y - text_descent; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMLEFT: ! y = position->y - text_descent; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_CENTER: ! y = position->y + (text_ascent / 2); ! x = position->x - (text_width / 2); ! break; ! default: ! return; ! } gdk_draw_string (RoadMapDrawingBuffer, --- 210,226 ---- (text, -1, &text_width, &text_ascent, &text_descent, NULL); ! x = position->x; ! y = position->y; ! if (corner & ROADMAP_CANVAS_RIGHT) ! x -= text_width; ! else if (corner & ROADMAP_CANVAS_CENTER_X) ! x -= text_width / 2; ! if (corner & ROADMAP_CANVAS_BOTTOM) ! y -= text_descent; ! else if (corner & ROADMAP_CANVAS_CENTER_Y) ! y += (text_ascent / 2); ! else /* TOP */ ! y += text_ascent; gdk_draw_string (RoadMapDrawingBuffer, |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src/agg_support In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193/agg_support Modified Files: roadmap_canvas.cpp Log Message: allow text to be centered independently in x and y Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/agg_support/roadmap_canvas.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_canvas.cpp 13 Jul 2006 15:47:53 -0000 1.3 --- roadmap_canvas.cpp 12 Aug 2006 01:48:48 -0000 1.4 *************** *** 280,313 **** text_height = text_ascent + text_descent; ! switch (corner) { ! ! case ROADMAP_CANVAS_TOPLEFT: ! y = position->y; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_TOPRIGHT: ! y = position->y; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMRIGHT: ! y = position->y - text_height; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMLEFT: ! y = position->y - text_height; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_CENTER: ! y = position->y - (text_height / 2); ! x = position->x - (text_width / 2); ! break; ! ! default: ! return; ! } RoadMapGuiPoint start = {x, y+text_height}; --- 280,294 ---- text_height = text_ascent + text_descent; ! x = position->x; ! y = position->y; ! if (corner & ROADMAP_CANVAS_RIGHT) ! x -= text_width; ! else if (corner & ROADMAP_CANVAS_CENTER_X) ! x -= text_width / 2; ! ! if (corner & ROADMAP_CANVAS_BOTTOM) ! y -= text_height; ! else if (corner & ROADMAP_CANVAS_CENTER_Y) ! y -= (text_height / 2); RoadMapGuiPoint start = {x, y+text_height}; |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193/gtk2 Modified Files: roadmap_canvas.c Log Message: allow text to be centered independently in x and y Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/roadmap_canvas.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.13 --- roadmap_canvas.c 12 Aug 2006 01:48:48 -0000 1.14 *************** *** 214,247 **** text_height = text_ascent + text_descent; ! switch (corner) { ! ! case ROADMAP_CANVAS_TOPLEFT: ! y = position->y; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_TOPRIGHT: ! y = position->y; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMRIGHT: ! y = position->y - text_height; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMLEFT: ! y = position->y - text_height; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_CENTER: ! y = position->y - (text_height / 2); ! x = position->x - (text_width / 2); ! break; ! default: ! return; ! } gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc, x, y, RoadMapLayout); --- 214,228 ---- text_height = text_ascent + text_descent; ! x = position->x; ! y = position->y; ! if (corner & ROADMAP_CANVAS_RIGHT) ! x -= text_width; ! else if (corner & ROADMAP_CANVAS_CENTER_X) ! x -= text_width / 2; ! if (corner & ROADMAP_CANVAS_BOTTOM) ! y -= text_height; ! else if (corner & ROADMAP_CANVAS_CENTER_Y) ! y -= (text_height / 2); gdk_draw_layout (RoadMapDrawingBuffer, RoadMapGc, x, y, RoadMapLayout); |
From: Paul F. <pg...@us...> - 2006-08-12 01:48:51
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15193/win32 Modified Files: roadmap_canvas.c Log Message: allow text to be centered independently in x and y Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_canvas.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.7 --- roadmap_canvas.c 12 Aug 2006 01:48:48 -0000 1.8 *************** *** 214,247 **** text_height = text_ascent + text_descent; ! switch (corner) { ! ! case ROADMAP_CANVAS_TOPLEFT: ! y = position->y; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_TOPRIGHT: ! y = position->y; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMRIGHT: ! y = position->y - text_height; ! x = position->x - text_width; ! break; ! ! case ROADMAP_CANVAS_BOTTOMLEFT: ! y = position->y - text_height; ! x = position->x; ! break; ! ! case ROADMAP_CANVAS_CENTER: ! y = position->y - (text_height / 2); ! x = position->x - (text_width / 2); ! break; ! ! default: ! return; ! } rect.left = x; --- 214,228 ---- text_height = text_ascent + text_descent; ! x = position->x; ! y = position->y; ! if (corner & ROADMAP_CANVAS_RIGHT) ! x -= text_width; ! else if (corner & ROADMAP_CANVAS_CENTER_X) ! x -= text_width / 2; ! ! if (corner & ROADMAP_CANVAS_BOTTOM) ! y -= text_height; ! else if (corner & ROADMAP_CANVAS_CENTER_Y) ! y -= (text_height / 2); rect.left = x; |
From: Paul F. <pg...@us...> - 2006-08-11 19:47:56
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6180 Modified Files: README Log Message: forgot to commit this with the other canadian map changes Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** README 13 Jul 2006 13:30:32 -0000 1.96 --- README 11 Aug 2006 19:47:07 -0000 1.97 *************** *** 17,25 **** Most of the maps are provided by the US Census Bureau, which only cover ! the US. RoadMap now includes a preliminary support for the Digital Charts ! of the Words (DCW), a set of world-wide maps produced by the US Department of ! Defense. The DCW contains only major highways and freeways, for some parts ! or the world (mostly Europe and japan) and their accuracy does not allow ! any reliable car navigation. RoadMap is released under the GPL (see the COPYING file). The US Census --- 17,28 ---- Most of the maps are provided by the US Census Bureau, which only cover ! the US. RoadMap now includes a preliminary support for two other ! formats: the Digital Charts of the Words (DCW), a set of world-wide ! maps produced by the US Department of Defense, and the Canadian RNF ! (Road Network File) maps. The DCW contains only major highways and ! freeways, for some parts or the world (mostly Europe and japan) and ! their accuracy does not allow any reliable car navigation. The RNF ! files contain road data, but currently no water features or municipality ! information. RoadMap is released under the GPL (see the COPYING file). The US Census *************** *** 445,450 **** cp rdmdownload rdmgetall rdmcompare /usr/local/bin (cd /usr/local/bin ; chmod a+rx rdmdownload rdmgetall rdmcompare) ! cp rdmgenmaps rdmgendcwmaps /usr/local/bin ! (cd /usr/local/bin ; chmod a+rx rdmgenmaps rdmgendcwmaps) cp rdmkismet rdmghost rdmfriends rdmtrace /usr/local/bin (cd /usr/local/bin ; chmod a+rx rdmkismet rdmghost rdmfriends rdmtrace) --- 448,453 ---- cp rdmdownload rdmgetall rdmcompare /usr/local/bin (cd /usr/local/bin ; chmod a+rx rdmdownload rdmgetall rdmcompare) ! cp rdmgenmaps rdmgendcwmaps rdmgenshpmaps /usr/local/bin ! (cd /usr/local/bin ; chmod a+rx rdmgenmaps rdmgendcwmaps rdmgenshpmaps) cp rdmkismet rdmghost rdmfriends rdmtrace /usr/local/bin (cd /usr/local/bin ; chmod a+rx rdmkismet rdmghost rdmfriends rdmtrace) *************** *** 763,767 **** If only the US maps are required, or if the pre-built maps will be used, it is possible to build RoadMap without the shapelib, using the option ! "-SHAPEFILES=NO" in the make command. * After RoadMap has been installed, the display only shows the message --- 766,770 ---- If only the US maps are required, or if the pre-built maps will be used, it is possible to build RoadMap without the shapelib, using the option ! "SHAPEFILES=NO" in config.mk. * After RoadMap has been installed, the display only shows the message *************** *** 2968,2972 **** coordinates (WGS 84 datum). This means the coordinates describe the position of the point on a reference elipsoid (as close to the Earth's ! potatoe-like shape as scientifically possible). On the other side the Computer (or PDA) screen is still a plane. Converting a longitude and latitude coordinate into a plane X/Y coordinate is traditionally called --- 2971,2975 ---- coordinates (WGS 84 datum). This means the coordinates describe the position of the point on a reference elipsoid (as close to the Earth's ! potato-like shape as scientifically possible). On the other side the Computer (or PDA) screen is still a plane. Converting a longitude and latitude coordinate into a plane X/Y coordinate is traditionally called *************** *** 3168,3172 **** features that belong to one (and only one) class. ! An example of class would be roads. Roads would be organized is layers like freeways, highways, streets and trails. All map files describing roads will contain features organized using these same layers. --- 3171,3175 ---- features that belong to one (and only one) class. ! An example of class would be roads. Roads would be organized in layers like freeways, highways, streets and trails. All map files describing roads will contain features organized using these same layers. |
From: Paul F. <pg...@us...> - 2006-08-11 19:22:58
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29259 Modified Files: roadmap_label.c Log Message: merge back ehud's cache improvements Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_label.c 11 Aug 2006 03:35:37 -0000 1.14 --- roadmap_label.c 11 Aug 2006 19:22:54 -0000 1.15 *************** *** 4,7 **** --- 4,8 ---- * * Copyright 2006 Ehud Shabtai + * Label cache 2006, Paul Fox * * This code was mostly taken from UMN Mapserver *************** *** 23,26 **** --- 24,37 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * TODO: + * - As the cache holds labels which are not drawn, we need a way to clean + * the cache by throwing out old entries. The age mechanism will keep + * the cache clean, but that may not be enough if we get many labels. + * + * - New lables consume space from the label cache. It would be better if + * we could scan the old labels list when a label is added and just + * update its age. This will save us labels cache entries. It may + * require the usage of a hash table for doing the scan efficiently. + * * SYNOPSYS: * *************** *** 35,38 **** --- 46,50 ---- #include "roadmap_plugin.h" #include "roadmap_canvas.h" + #include "roadmap_linefont.h" *************** *** 40,43 **** --- 52,57 ---- #include "roadmap_label.h" + #define POLY_OUTLINE 0 + #define MIN(a, b) (a) < (b) ? (a) : (b) #define MAX(a, b) (a) > (b) ? (a) : (b) *************** *** 59,70 **** PluginLine line; PluginStreet street; ! RoadMapGuiPoint point; /* label point */ RoadMapGuiRect bbox; /* label bounding box */ RoadMapGuiPoint poly[4]; short angle; /* degrees */ short gen; /* combination "drawn" flag and generation marker */ } roadmap_label; --- 73,89 ---- PluginLine line; PluginStreet street; + char *text; ! RoadMapGuiPoint text_point; /* label point */ ! RoadMapGuiPoint center_point; /* label point */ RoadMapGuiRect bbox; /* label bounding box */ RoadMapGuiPoint poly[4]; + unsigned short zoom; short angle; /* degrees */ short gen; /* combination "drawn" flag and generation marker */ + unsigned char invalid; + } roadmap_label; *************** *** 77,81 **** static int RoadMapLabelGeneration = 1; ! static int RoadMapLabelGenerationFloor; static RoadMapPen RoadMapLabelPen; --- 96,101 ---- static int RoadMapLabelGeneration = 1; ! static int RoadMapLabelGenerationMaxAge = 36; ! static int RoadMapLabelCurrentZoom; static RoadMapPen RoadMapLabelPen; *************** *** 150,154 **** int w, h; int angle = c->angle; ! RoadMapGuiPoint *p = &c->point; w = rect->maxx - rect->minx; --- 170,174 ---- int w, h; int angle = c->angle; ! RoadMapGuiPoint *p = &c->center_point; w = rect->maxx - rect->minx; *************** *** 181,185 **** 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); } --- 201,204 ---- *************** *** 210,220 **** void roadmap_label_start (void) { - static int last_generation = -100; - int last_zoom; static RoadMapPosition last_center; - RoadMapLabelGenerationFloor = last_generation; - last_generation = RoadMapLabelGeneration; - /* Cheap cache invalidation: if the previous center of screen * is still visible, assume that the cache is still more useful --- 229,234 ---- *************** *** 225,229 **** } ! roadmap_math_get_context (&last_center, &last_zoom); } --- 239,243 ---- } ! roadmap_math_get_context (&last_center, &RoadMapLabelCurrentZoom); } *************** *** 242,245 **** --- 256,262 ---- cPtr = (roadmap_label *)roadmap_list_remove (ROADMAP_LIST_FIRST(&RoadMapLabelSpares)); + if (cPtr->text && *cPtr->text) { + free(cPtr->text); + } } else { if (RoadMapLabelCacheFull) return -1; *************** *** 255,258 **** --- 272,278 ---- } + cPtr->invalid = 0; + cPtr->text = NULL; + cPtr->bbox.minx = 1; cPtr->bbox.maxx = -1; *************** *** 262,269 **** cPtr->angle = normalize_angle(angle); ! cPtr->point = *point; /* The stored point is not screen oriented, rotate is needed */ ! roadmap_math_rotate_coordinates (1, &cPtr->point); --- 282,289 ---- cPtr->angle = normalize_angle(angle); ! cPtr->center_point = *point; /* The stored point is not screen oriented, rotate is needed */ ! roadmap_math_rotate_coordinates (1, &cPtr->center_point); *************** *** 274,277 **** --- 294,299 ---- cPtr->gen = RoadMapLabelGeneration; + cPtr->zoom = RoadMapLabelCurrentZoom; + roadmap_list_append(&RoadMapLabelNew, &cPtr->link); *************** *** 284,292 **** RoadMapListItem *item2, *tmp2; RoadMapListItem *end; int width, ascent, descent; - RoadMapGuiPoint p; RoadMapGuiRect r; RoadMapGuiPoint midpt; - const char *text; short aang; roadmap_label *cPtr, *ocPtr, *ncPtr; --- 306,313 ---- RoadMapListItem *item2, *tmp2; RoadMapListItem *end; + RoadMapList unused_labels; int width, ascent, descent; RoadMapGuiRect r; RoadMapGuiPoint midpt; short aang; roadmap_label *cPtr, *ocPtr, *ncPtr; *************** *** 296,299 **** --- 317,321 ---- int label_center_y; + ROADMAP_LIST_INIT(&unused_labels); roadmap_canvas_select_pen (RoadMapLabelPen); *************** *** 313,317 **** cPtr = (roadmap_label *)item; ! if (cPtr->gen < RoadMapLabelGenerationFloor) { roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 335,340 ---- cPtr = (roadmap_label *)item; ! if ((RoadMapLabelGeneration - cPtr->gen) > ! RoadMapLabelGenerationMaxAge) { roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); *************** *** 328,339 **** continue; } - if (cPtr->line.plugin_id == ncPtr->line.plugin_id && - cPtr->line.line_id == ncPtr->line.line_id && - cPtr->line.layer == ncPtr->line.layer && - cPtr->line.fips == ncPtr->line.fips) { /* Found a new version of this existing line */ ! if (cPtr->angle != ncPtr->angle) { cPtr->bbox.minx = 1; cPtr->bbox.maxx = -1; --- 351,370 ---- continue; } + if (roadmap_plugin_same_line (&cPtr->line, &ncPtr->line)) { /* Found a new version of this existing line */ ! if (cPtr->invalid) { ! cPtr->gen = ncPtr->gen; ! ! roadmap_list_insert ! (&RoadMapLabelSpares, ! roadmap_list_remove(&ncPtr->link)); ! ! break; ! } ! ! if ((cPtr->angle != ncPtr->angle) || ! (cPtr->zoom != ncPtr->zoom)) { cPtr->bbox.minx = 1; cPtr->bbox.maxx = -1; *************** *** 343,351 **** int dx, dy; ! dx = ncPtr->point.x - cPtr->point.x; ! dy = ncPtr->point.y - cPtr->point.y; if (dx != 0 || dy != 0) { int i; for (i = 0; i < 4; i++) { cPtr->poly[i].x += dx; --- 374,383 ---- int dx, dy; ! dx = ncPtr->center_point.x - cPtr->center_point.x; ! dy = ncPtr->center_point.y - cPtr->center_point.y; if (dx != 0 || dy != 0) { int i; + for (i = 0; i < 4; i++) { cPtr->poly[i].x += dx; *************** *** 357,364 **** cPtr->bbox.maxy += dy; } } ! cPtr->point = ncPtr->point; cPtr->featuresize_sq = ncPtr->featuresize_sq; --- 389,398 ---- cPtr->bbox.maxy += dy; + cPtr->text_point.x += dx; + cPtr->text_point.y += dy; } } ! cPtr->center_point = ncPtr->center_point; cPtr->featuresize_sq = ncPtr->featuresize_sq; *************** *** 367,371 **** roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&ncPtr->link)); - break; } --- 401,404 ---- *************** *** 373,392 **** } ! if (cPtr->gen != RoadMapLabelGeneration) { continue; } ! roadmap_plugin_get_street_properties (&cPtr->line, &properties); ! if (!properties.street || !*properties.street) { ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; } ! text = properties.street; - cPtr->street = properties.plugin_street; if (cPtr->bbox.minx > cPtr->bbox.maxx) { --- 406,438 ---- } ! if ((cPtr->gen != RoadMapLabelGeneration) || cPtr->invalid) { ! roadmap_list_insert ! (&unused_labels, roadmap_list_remove(&cPtr->link)); continue; } ! if (!cPtr->text) { ! roadmap_plugin_get_street_properties (&cPtr->line, &properties); ! ! if (!properties.street || !*properties.street) { ! cPtr->text = ""; ! } else { ! cPtr->text = strdup(properties.street); ! } ! cPtr->street = properties.plugin_street; } ! if (!*cPtr->text) { ! cPtr->invalid = 1; + /* We keep the invalid lines in the cache to avoid repeating + * all these tests just to find that it's invalid, again! + */ + roadmap_list_append + (&unused_labels, roadmap_list_remove(&cPtr->link)); + continue; + } if (cPtr->bbox.minx > cPtr->bbox.maxx) { *************** *** 394,398 **** #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); /* The linefont font isn't pretty. Reading it is hard with --- 440,444 ---- #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_extents(cPtr->text, 16, &width, &ascent, &descent); /* The linefont font isn't pretty. Reading it is hard with *************** *** 405,409 **** roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); angles = angles && i; --- 451,455 ---- roadmap_canvas_get_text_extents ! (cPtr->text, -1, &width, &ascent, &descent, &i); angles = angles && i; *************** *** 415,420 **** /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); continue; } --- 461,469 ---- /* (4 times longer than feature) */ if ((width * width / 16) > cPtr->featuresize_sq) { ! /* Keep this one in the cache as the feature size may change ! * in the next run. ! */ ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); continue; } *************** *** 427,431 **** if (angles) { ! p = get_metrics (cPtr, &r, label_center_y); } else { --- 476,480 ---- if (angles) { ! cPtr->text_point = get_metrics (cPtr, &r, label_center_y); } else { *************** *** 433,443 **** * (and compensate for eventual centering of text.) */ ! p = cPtr->point; ! cPtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; } } --- 482,502 ---- * (and compensate for eventual centering of text.) */ ! cPtr->text_point = cPtr->center_point; ! cPtr->bbox.minx = ! r.minx + cPtr->text_point.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = ! r.maxx + cPtr->text_point.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = ! r.miny + cPtr->text_point.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = ! r.maxy + cPtr->text_point.y - (r.maxy - r.miny)/2; } } + #if POLY_OUTLINE + else { + int lines = 4; + roadmap_canvas_draw_multiple_lines(1, &lines, cPtr->poly, 1); + } + #endif *************** *** 450,455 **** midpt.x > roadmap_canvas_width() || midpt.y > roadmap_canvas_height()) { ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); continue; } --- 509,518 ---- midpt.x > roadmap_canvas_width() || midpt.y > roadmap_canvas_height()) { ! ! /* Keep this one in the cache as the feature size may change ! * in the next run. ! */ ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); continue; } *************** *** 496,499 **** --- 559,563 ---- break; } + aang = abs(ocPtr->angle); if (aang < 4 || aang > 86) { *************** *** 511,530 **** if(cPtr->gen == 0) { ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); continue; /* next label */ } #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (text, angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->point, 16, cPtr->angle); #else if (angles) { roadmap_canvas_draw_string_angle ! (&p, &cPtr->point, cPtr->angle, text); } else { roadmap_canvas_draw_string ! (&cPtr->point, ROADMAP_CANVAS_CENTER, text); } #endif --- 575,599 ---- if(cPtr->gen == 0) { ! /* Keep this one in the cache as we may need it for the next ! * run. ! */ ! cPtr->gen = RoadMapLabelGeneration; ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); continue; /* next label */ } #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (cPtr->text, angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->center_point, 16, cPtr->angle); #else if (angles) { roadmap_canvas_draw_string_angle ! (&cPtr->text_point, &cPtr->center_point, cPtr->angle, ! cPtr->text); } else { roadmap_canvas_draw_string ! (&cPtr->center_point, ROADMAP_CANVAS_CENTER, cPtr->text); } #endif *************** *** 538,541 **** --- 607,611 ---- } /* next list */ + ROADMAP_LIST_SPLICE (&RoadMapLabelCache, &unused_labels); RoadMapLabelGeneration++; return 0; |
From: Ehud S. <esh...@us...> - 2006-08-11 18:16:23
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3669 Modified Files: roadmap_spawn.c roadmap_win32.h Log Message: Paul's list modifications. Index: roadmap_win32.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_win32.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_win32.h 16 Jul 2006 12:28:50 -0000 1.6 --- roadmap_win32.h 11 Aug 2006 18:16:20 -0000 1.7 *************** *** 3,7 **** #include <windows.h> ! #define MENU_ID_START WM_USER #define MAX_MENU_ITEMS 100 --- 3,8 ---- #include <windows.h> ! ! #define inline _inline #define MENU_ID_START WM_USER #define MAX_MENU_ITEMS 100 Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_spawn.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_spawn.c 27 Jul 2006 14:26:09 -0000 1.7 --- roadmap_spawn.c 11 Aug 2006 18:16:20 -0000 1.8 *************** *** 45,49 **** static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; DWORD WINAPI FliteThread(LPVOID lpParam) { --- 45,49 ---- static char *RoadMapSpawnPath = NULL; ! static RoadMapList RoadMapSpawnActive; DWORD WINAPI FliteThread(LPVOID lpParam) { *************** *** 60,64 **** text = strdup(flite_text); SetEvent(flite_inuse_event); ! flite_t2s(text); free(text); --- 60,64 ---- text = strdup(flite_text); SetEvent(flite_inuse_event); ! flite_t2s(text); free(text); *************** *** 132,146 **** static int roadmap_spawn_child (const char *name, const char *command_line, ! RoadMapPipe pipes[2], int feedback) { ! 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)); --- 132,146 ---- static int roadmap_spawn_child (const char *name, const char *command_line, ! RoadMapPipe pipes[2], int feedback) { ! 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)); *************** *** 157,162 **** command_line_unicode = NULL; } ! ! si.cb = sizeof(STARTUPINFO); if (!CreateProcess(full_path_unicode, command_line_unicode, NULL, --- 157,162 ---- command_line_unicode = NULL; } ! ! si.cb = sizeof(STARTUPINFO); if (!CreateProcess(full_path_unicode, command_line_unicode, NULL, *************** *** 174,182 **** free(command_line_unicode); } ! ! CloseHandle(pi.hThread); ! if (!feedback) { ! CloseHandle(pi.hProcess); ! } --- 174,182 ---- free(command_line_unicode); } ! ! CloseHandle(pi.hThread); ! if (!feedback) { ! CloseHandle(pi.hProcess); ! } *************** *** 204,207 **** --- 204,208 ---- } RoadMapSpawnPath = path; + ROADMAP_LIST_INIT(&RoadMapSpawnActive); } *************** *** 247,261 **** 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); ! } } } --- 248,263 ---- 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-08-11 18:16:01
|
Update of /cvsroot/roadmap/roadmap_editor/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3306 Modified Files: roadmap_spawn.c Log Message: Paul's list modifications. Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/unix/roadmap_spawn.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_spawn.c 15 Oct 2005 22:19:09 -0000 1.1.1.1 --- roadmap_spawn.c 11 Aug 2006 18:15:58 -0000 1.2 *************** *** 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); } } *************** *** 343,347 **** int roadmap_spawn_write_pipe (RoadMapPipe pipe, const void *data, int length) { ! return write ((int)pipe, data, length); } --- 347,351 ---- int roadmap_spawn_write_pipe (RoadMapPipe pipe, const void *data, int length) { ! return write ((int)pipe, data, (size_t)length); } *************** *** 349,353 **** int roadmap_spawn_read_pipe (RoadMapPipe pipe, void *data, int size) { ! return read ((int)pipe, data, size); } --- 353,357 ---- int roadmap_spawn_read_pipe (RoadMapPipe pipe, void *data, int size) { ! return read ((int)pipe, data, (size_t)size); } |
From: Ehud S. <esh...@us...> - 2006-08-11 18:14:51
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2876 Modified Files: roadmap_start.c Log Message: Reorder driver initialization. Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** roadmap_start.c 10 Aug 2006 20:50:36 -0000 1.26 --- roadmap_start.c 11 Aug 2006 18:14:47 -0000 1.27 *************** *** 1144,1152 **** roadmap_history_load (); roadmap_driver_activate (); roadmap_gps_open (); - roadmap_spawn_initialize (argv[0]); - roadmap_help_initialize (); --- 1144,1152 ---- roadmap_history_load (); + roadmap_spawn_initialize (argv[0]); + roadmap_driver_activate (); roadmap_gps_open (); roadmap_help_initialize (); |
From: Ehud S. <esh...@us...> - 2006-08-11 18:14:16
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2849 Modified Files: roadmap_math.c Log Message: Debug fix. Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_math.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_math.c 17 Jul 2006 06:29:37 -0000 1.9 --- roadmap_math.c 11 Aug 2006 18:14:13 -0000 1.10 *************** *** 1071,1075 **** RoadMapContext.current_screen.south, RoadMapContext.current_screen.east, ! RoadMapContext.current_screen.east); #endif return status; --- 1071,1075 ---- RoadMapContext.current_screen.south, RoadMapContext.current_screen.east, ! RoadMapContext.current_screen.west); #endif return status; |
From: Ehud S. <esh...@us...> - 2006-08-11 18:13:09
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2412 Modified Files: roadmap_list.c roadmap_list.h roadmap_trip.c Log Message: Paul's list modifications. Index: roadmap_list.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_list.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_list.c 15 Oct 2005 22:18:50 -0000 1.1.1.1 --- roadmap_list.c 11 Aug 2006 18:13:06 -0000 1.2 *************** *** 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,87 **** */ - #include <stdlib.h> - - #include "roadmap.h" #include "roadmap_list.h" ! ! void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item) { ! ! item->previous = NULL; ! ! if (list->first == NULL) { ! list->first = item; ! list->last = item; ! } else { ! list->first->previous = item; ! } ! item->next = list->first; ! 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; ! } ! void 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; ! } } ! 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_trip.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_trip.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_trip.c 11 Jun 2006 10:58:58 -0000 1.8 --- roadmap_trip.c 11 Aug 2006 18:13:06 -0000 1.9 *************** *** 125,129 **** static RoadMapTripPoint *RoadMapTripNextWaypoint = NULL; ! static RoadMapList RoadMapTripWaypoints = ROADMAP_LIST_EMPTY; static RoadMapPosition RoadMapTripLastPosition; --- 125,129 ---- static RoadMapTripPoint *RoadMapTripNextWaypoint = NULL; ! static RoadMapList RoadMapTripWaypoints; static RoadMapPosition RoadMapTripLastPosition; *************** *** 144,156 **** static RoadMapTripPoint *roadmap_trip_search (const char *name) { ! RoadMapTripPoint *item; ! for (item = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! item != NULL; ! item = (RoadMapTripPoint *)item->link.next) { ! if (strcmp (item->id, name) == 0) { ! return item; ! } } return NULL; --- 144,157 ---- static RoadMapTripPoint *roadmap_trip_search (const char *name) { ! RoadMapListItem *item, *tmp; ! RoadMapTripPoint *trip; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! trip = (RoadMapTripPoint *)item; ! ! if (strcmp (trip->id, name) == 0) { ! return trip; ! } } return NULL; *************** *** 384,388 **** int i; ! RoadMapListItem *item; RoadMapTripPoint *point; --- 385,389 ---- int i; ! RoadMapListItem *item, *tmp; RoadMapTripPoint *point; *************** *** 393,397 **** roadmap_check_allocated(Names); ! for (i = 0, item = RoadMapTripWaypoints.first; item != NULL; item = item->next) { point = (RoadMapTripPoint *)item; if (! point->predefined) { --- 394,399 ---- roadmap_check_allocated(Names); ! i=0; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { point = (RoadMapTripPoint *)item; if (! point->predefined) { *************** *** 494,498 **** RoadMapTripPoint *destination; RoadMapTripPoint *waypoint; ! destination = RoadMapTripDestination; --- 496,500 ---- RoadMapTripPoint *destination; RoadMapTripPoint *waypoint; ! RoadMapListItem *item, *tmp; destination = RoadMapTripDestination; *************** *** 501,519 **** /* Compute the distances to the destination. */ ! for (waypoint = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! waypoint != NULL; ! waypoint = (RoadMapTripPoint *)waypoint->link.next) { ! if (! waypoint->predefined) { ! ! waypoint->distance = ! roadmap_math_distance (&destination->map, &waypoint->map); ! ! roadmap_log (ROADMAP_DEBUG, ! "Waypoint %s: distance to destination = %d %s", ! waypoint->id, ! waypoint->distance, ! roadmap_math_distance_unit()); ! } } destination->distance = 0; --- 503,520 ---- /* Compute the distances to the destination. */ ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! waypoint = (RoadMapTripPoint *)item; ! if (! waypoint->predefined) { ! ! waypoint->distance = ! roadmap_math_distance (&destination->map, &waypoint->map); ! ! roadmap_log (ROADMAP_DEBUG, ! "Waypoint %s: distance to destination = %d %s", ! waypoint->id, ! waypoint->distance, ! roadmap_math_distance_unit()); ! } } destination->distance = 0; *************** *** 527,537 **** RoadMapTripPoint *point; ! RoadMapTripPoint *next; ! for (point = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! point != NULL; ! point = next) { ! next = (RoadMapTripPoint *)point->link.next; if (! point->predefined) { --- 528,536 ---- RoadMapTripPoint *point; ! RoadMapListItem *item, *tmp; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! point = (RoadMapTripPoint *)item; if (! point->predefined) { *************** *** 543,547 **** RoadMapTripRefresh = 1; } ! roadmap_list_remove (&RoadMapTripWaypoints, &point->link); free (point->id); free (point->sprite); --- 542,546 ---- RoadMapTripRefresh = 1; } ! roadmap_list_remove (item); free (point->id); free (point->sprite); *************** *** 567,570 **** --- 566,570 ---- RoadMapTripPoint *gps = RoadMapTripGps; RoadMapTripPoint *waypoint; + RoadMapListItem *item, *tmp; *************** *** 602,608 **** RoadMapTripNextWaypoint = RoadMapTripDestination; ! for (waypoint = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! waypoint != NULL; ! waypoint = (RoadMapTripPoint *)waypoint->link.next) { if (waypoint->in_trip && waypoint != RoadMapTripDeparture) { --- 602,608 ---- RoadMapTripNextWaypoint = RoadMapTripDestination; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! ! waypoint = (RoadMapTripPoint *)item; if (waypoint->in_trip && waypoint != RoadMapTripDeparture) { *************** *** 769,773 **** } ! roadmap_list_remove (&RoadMapTripWaypoints, &result->link); free (result->id); free (result->sprite); --- 769,773 ---- } ! roadmap_list_remove (&result->link); free (result->id); free (result->sprite); *************** *** 976,984 **** RoadMapTripPoint *gps = RoadMapTripGps; RoadMapTripPoint *waypoint; ! for (waypoint = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! waypoint != NULL; ! waypoint = (RoadMapTripPoint *)waypoint->link.next) { if (waypoint->sprite == NULL) continue; --- 976,984 ---- RoadMapTripPoint *gps = RoadMapTripGps; RoadMapTripPoint *waypoint; + RoadMapListItem *item, *tmp; ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! waypoint = (RoadMapTripPoint *)item; if (waypoint->sprite == NULL) continue; *************** *** 1024,1027 **** --- 1024,1029 ---- int i; + ROADMAP_LIST_INIT (&RoadMapTripWaypoints); + for (i = 0; RoadMapTripPredefined[i].id != NULL; ++i) { *************** *** 1131,1134 **** --- 1133,1138 ---- RoadMapTripPoint *point; + RoadMapListItem *item, *tmp; + /* Save all existing points, if the list was ever modified, or if *************** *** 1149,1155 **** } ! for (point = (RoadMapTripPoint *)RoadMapTripWaypoints.first; ! point != NULL; ! point = (RoadMapTripPoint *)point->link.next) { if (point->in_trip && point->has_value && (! point->mobile)) { --- 1153,1159 ---- } ! ! ROADMAP_LIST_FOR_EACH (&RoadMapTripWaypoints, item, tmp) { ! point = (RoadMapTripPoint *)item; if (point->in_trip && point->has_value && (! point->mobile)) { Index: roadmap_list.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_list.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_list.h 15 Oct 2005 22:18:50 -0000 1.1.1.1 --- roadmap_list.h 11 Aug 2006 18:13:06 -0000 1.2 *************** *** 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); - void roadmap_list_remove (RoadMapList *list, RoadMapListItem *item); - int roadmap_list_count (const RoadMapList *list); #endif // INCLUDE__ROADMAP_LIST__H --- 30,201 ---- #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 ] + */ + + #include "roadmap.h" + 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. + * oldhead will be cleared, and anything previously 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 |
From: Ehud S. <esh...@us...> - 2006-08-11 18:12:43
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2067 Modified Files: roadmap_screen.c Log Message: Merge Pauls cache enhancments, fix and enhance it again to avoid the street_properties call as much as possible. Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_screen.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_screen.c 10 Aug 2006 20:50:06 -0000 1.19 --- roadmap_screen.c 11 Aug 2006 18:12:40 -0000 1.20 *************** *** 200,204 **** RoadMapShapeItr shape_itr, RoadMapPen pen, ! int *total_length, RoadMapGuiPoint *middle, int *angle) { --- 200,204 ---- RoadMapShapeItr shape_itr, RoadMapPen pen, ! int *total_length_ptr, RoadMapGuiPoint *middle, int *angle) { *************** *** 215,223 **** int last_point_visible = 0; ! int longest_segent = -1; dbg_time_start(DBG_TIME_DRAW_ONE_LINE); ! if (total_length) *total_length = 0; /* if the pen has changed, we need to flush the previous lines and points --- 215,223 ---- int last_point_visible = 0; ! int longest = -1; dbg_time_start(DBG_TIME_DRAW_ONE_LINE); ! if (total_length_ptr) *total_length_ptr = 0; /* if the pen has changed, we need to flush the previous lines and points *************** *** 272,297 **** (&last_midposition, &midposition, &point0, &point1)) { ! if ((point0.x == point1.x) && ! (point0.y == point1.y) && ! last_point_visible) { ! /* This segment is very short, we can skip it */ ! last_midposition = midposition; ! continue; ! } ! if (total_length) { ! int length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! *total_length += length; ! 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; } } --- 272,303 ---- (&last_midposition, &midposition, &point0, &point1)) { ! if ((point0.x == point1.x) && (point0.y == point1.y)) { ! if (last_point_visible) { ! /* This segment is very short, we can skip it */ ! last_midposition = midposition; ! continue; ! } ! } else { ! if (total_length_ptr) { ! ! int length_sq = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! ! /* bad math, but it's for a labelling heuristic anyway */ ! *total_length_ptr += length_sq; ! ! if (length_sq > longest) { ! longest = length_sq; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, &midposition); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } } *************** *** 333,348 **** (&last_midposition, to, &point0, &point1)) { ! if (total_length) { ! int length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! *total_length += length; ! 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; } } --- 339,358 ---- (&last_midposition, to, &point0, &point1)) { ! if (total_length_ptr) { ! int length_sq = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! if (length_sq) { ! /* bad math, but it's for a labelling heuristic anyway */ ! *total_length_ptr += length_sq; ! if (length_sq > longest) { ! longest = length_sq; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, to); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } } *************** *** 398,412 **** dbg_time_end(DBG_TIME_DRAW_ONE_LINE); return; ! } ! if (total_length) { ! *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; } --- 408,425 ---- dbg_time_end(DBG_TIME_DRAW_ONE_LINE); return; ! ! } else { ! if (total_length_ptr) { ! *total_length_ptr = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! if (angle) { ! *angle = roadmap_math_azymuth(from, to); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } *************** *** 420,424 **** *RoadMapScreenObjects.cursor = 2; ! RoadMapScreenLinePoints.cursor += 2; RoadMapScreenObjects.cursor += 1; --- 433,437 ---- *RoadMapScreenObjects.cursor = 2; ! RoadMapScreenLinePoints.cursor += 2; RoadMapScreenObjects.cursor += 1; *************** *** 617,621 **** int total_length; int *total_length_ptr = 0; ! int angle = 0; int *angle_ptr = 0; RoadMapGuiPoint seg_middle; --- 630,634 ---- int total_length; int *total_length_ptr = 0; ! int angle = 90; int *angle_ptr = 0; RoadMapGuiPoint seg_middle; *************** *** 638,650 **** 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 { --- 651,663 ---- 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 { *************** *** 700,706 **** &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); --- 713,719 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && total_length && (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); *************** *** 812,818 **** &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); --- 825,831 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && total_length && (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); *************** *** 1115,1118 **** --- 1128,1133 ---- } + roadmap_label_start(); + /* - For each candidate county: */ |
From: Ehud S. <esh...@us...> - 2006-08-11 18:12:24
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2042 Modified Files: roadmap_label.c roadmap_label.h Log Message: Merge Pauls cache enhancments, fix and enhance it again to avoid the street_properties call as much as possible. Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_label.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_label.c 17 Jul 2006 06:29:37 -0000 1.5 --- roadmap_label.c 11 Aug 2006 18:12:20 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- * * Copyright 2006 Ehud Shabtai + * Label cache 2006, Paul Fox * * This code was mostly taken from UMN Mapserver *************** *** 23,26 **** --- 24,37 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * TODO: + * - As the cache holds labels which are not drawn, we need a way to clean + * the cache by throwing out old entries. The age mechanism will keep + * the cache clean, but that may not be enough if we get many labels. + * + * - New lables consume space from the label cache. It would be better if + * we could scan the old labels list when a label is added and just + * update its age. This will save us labels cache entries. It may + * require the usage of a hash table for doing the scan efficiently. + * * SYNOPSYS: * *************** *** 36,41 **** --- 47,59 ---- #include "roadmap_canvas.h" + #ifdef ROADMAP_USE_LINEFONT + #include "roadmap_linefont.h" + #endif + + #include "roadmap_list.h" #include "roadmap_label.h" + #define POLY_OUTLINE 0 + #define MIN(a, b) (a) < (b) ? (a) : (b) #define MAX(a, b) (a) > (b) ? (a) : (b) *************** *** 47,54 **** ROADMAP_CONFIG_ITEM("Labels", "Color"); ! static labelCacheObj RoadMapLabelCache; ! static int RoadMapLabelCacheFull = 0; static RoadMapPen RoadMapLabelPen; static int rect_overlap (RoadMapGuiRect *a, RoadMapGuiRect *b) { --- 65,108 ---- ROADMAP_CONFIG_ITEM("Labels", "Color"); ! /* this is fairly arbitrary */ ! #define MAX_LABELS 2048 ! ! typedef struct { ! RoadMapListItem link; ! ! int featuresize_sq; ! ! PluginLine line; ! PluginStreet street; ! char *text; ! ! RoadMapGuiPoint text_point; /* label point */ ! RoadMapGuiPoint center_point; /* label point */ ! RoadMapGuiRect bbox; /* label bounding box */ ! RoadMapGuiPoint poly[4]; ! ! unsigned short zoom; ! short angle; /* degrees */ ! short gen; /* combination "drawn" flag and generation marker */ ! ! unsigned char invalid; ! ! } roadmap_label; ! ! static RoadMapList RoadMapLabelCache; ! static RoadMapList RoadMapLabelSpares; ! static RoadMapList RoadMapLabelNew; ! ! static int RoadMapLabelCacheFull; ! static int RoadMapLabelCacheAlloced; ! ! static int RoadMapLabelGeneration = 1; ! static int RoadMapLabelGenerationMaxAge = 36; ! static int RoadMapLabelCurrentZoom; ! static RoadMapPen RoadMapLabelPen; + static int RoadMapLabelMinFeatSizeSq; + static int rect_overlap (RoadMapGuiRect *a, RoadMapGuiRect *b) { *************** *** 71,75 **** /* doesn't check for one completely inside the other -- just intersection */ ! static int poly_overlap (labelCacheMemberObj *c1, labelCacheMemberObj *c2) { RoadMapGuiPoint *a = c1->poly; --- 125,129 ---- /* doesn't check for one completely inside the other -- just intersection */ ! static int poly_overlap (roadmap_label *c1, roadmap_label *c2) { RoadMapGuiPoint *a = c1->poly; *************** *** 85,89 **** point_in_bbox(&isect, &c2->bbox)) { return 1; ! } } } --- 139,143 ---- point_in_bbox(&isect, &c2->bbox)) { return 1; ! } } } *************** *** 110,115 **** ! static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; --- 164,169 ---- ! static RoadMapGuiPoint get_metrics(roadmap_label *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; *************** *** 118,122 **** int w, h; int angle = c->angle; ! RoadMapGuiPoint *p = &c->point; w = rect->maxx - rect->minx; --- 172,176 ---- int w, h; int angle = c->angle; ! RoadMapGuiPoint *p = &c->center_point; w = rect->maxx - rect->minx; *************** *** 149,153 **** 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); } --- 203,206 ---- *************** *** 159,387 **** } ! 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, - int featuresize, const PluginLine *line) { ! labelCacheMemberObj *cachePtr; ! if (RoadMapLabelCacheFull) return -1; ! 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; ! cachePtr->line = *line; ! cachePtr->angle = angle; ! cachePtr->point = *point; ! cachePtr->status = 0; ! RoadMapLabelCache.numlabels++; return 0; } - int roadmap_label_draw_cache (int angles) { ! int l; ! int i; ! int width; ! int ascent; ! int descent; ! RoadMapGuiPoint p; RoadMapGuiRect r; ! const char *text; short aang; ! labelCacheMemberObj *cachePtr=NULL; ! roadmap_canvas_select_pen (RoadMapLabelPen); ! for(l=0; l<RoadMapLabelCache.numlabels; l++) { ! PluginStreetProperties properties; ! cachePtr = RoadMapLabelCache.labels[l]; ! roadmap_plugin_get_street_properties (&cachePtr->line, &properties); ! if (!properties.street || !*properties.street) { ! goto recycle; ! } ! text = properties.street; ! 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; } } - } ! if(!cachePtr->status) { ! recycle: ! /* move us out of the "under consideration" group */ ! if (l < RoadMapLabelCache.numlabels - 1) { ! labelCacheMemberObj * tmpPtr = cachePtr; ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1]; ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1] = tmpPtr;; ! RoadMapLabelCache.labels[l--] = cachePtr; ! RoadMapLabelCache.numlabels--; } - continue; /* next label */ - } ! #if ROADMAP_USE_LINEFONT ! roadmap_linefont_text (text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cachePtr->point, 16, cachePtr->angle); #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&p, &cachePtr->point, cachePtr->angle, text); ! } else { ! roadmap_canvas_draw_string ! (&cachePtr->point, ROADMAP_CANVAS_CENTER, text); ! } #endif ! } /* next label */ ! RoadMapLabelCache.numlabels = 0; ! RoadMapLabelCacheFull = 0; return 0; } - int roadmap_label_activate (void) { --- 212,617 ---- } ! static int normalize_angle(int angle) { ! angle += roadmap_math_get_orientation (); ! while (angle > 360) angle -= 360; ! while (angle < 0) angle += 360; ! if (angle >= 180) angle -= 180; ! angle -= 90; ! return angle; ! } ! /* called when a screen repaint is complete. keeping track of ! * label "generations" involves keeping track of full refreshes, ! * not individual calls to roadmap_label_draw_cache(). ! */ ! void roadmap_label_start (void) { ! static RoadMapPosition last_center; + /* Cheap cache invalidation: if the previous center of screen + * is still visible, assume that the cache is still more useful + * than not. + */ + if ( !roadmap_math_point_is_visible (&last_center) ) { + ROADMAP_LIST_SPLICE (&RoadMapLabelSpares, &RoadMapLabelCache); } ! roadmap_math_get_context (&last_center, &RoadMapLabelCurrentZoom); ! } ! int roadmap_label_add (const RoadMapGuiPoint *point, int angle, ! int featuresize_sq, const PluginLine *line) { ! roadmap_label *cPtr = 0; ! if (featuresize_sq < RoadMapLabelMinFeatSizeSq) { return -1; } ! if (!ROADMAP_LIST_EMPTY(&RoadMapLabelSpares)) { ! cPtr = (roadmap_label *)roadmap_list_remove ! (ROADMAP_LIST_FIRST(&RoadMapLabelSpares)); ! if (cPtr->text && *cPtr->text) { ! free(cPtr->text); ! } ! } else { ! if (RoadMapLabelCacheFull) return -1; ! if (RoadMapLabelCacheAlloced == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); ! RoadMapLabelCacheFull = 1; ! return -1; ! } ! cPtr = malloc (sizeof (*cPtr)); ! roadmap_check_allocated (cPtr); ! RoadMapLabelCacheAlloced++; } ! cPtr->invalid = 0; ! cPtr->text = NULL; ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! ! cPtr->line = *line; ! cPtr->featuresize_sq = featuresize_sq; ! cPtr->angle = normalize_angle(angle); ! ! cPtr->center_point = *point; ! ! /* The stored point is not screen oriented, rotate is needed */ ! roadmap_math_rotate_coordinates (1, &cPtr->center_point); ! ! ! /* the "generation" of a label is refreshed when it is re-added. ! * later, labels cache entries more than a generation old will ! * be discarded. ! */ ! cPtr->gen = RoadMapLabelGeneration; ! ! cPtr->zoom = RoadMapLabelCurrentZoom; ! ! roadmap_list_append(&RoadMapLabelNew, &cPtr->link); return 0; } int roadmap_label_draw_cache (int angles) { ! RoadMapListItem *item, *tmp; ! RoadMapListItem *item2, *tmp2; ! RoadMapListItem *end; ! RoadMapList unused_labels; ! int width, ascent, descent; RoadMapGuiRect r; ! RoadMapGuiPoint midpt; short aang; + roadmap_label *cPtr, *ocPtr, *ncPtr; + int whichlist; + #define OLDLIST 0 + #define NEWLIST 1 + int label_center_y; ! ROADMAP_LIST_INIT(&unused_labels); roadmap_canvas_select_pen (RoadMapLabelPen); ! /* We want to process the cache first, in order to render previously ! * rendered labels again. Only after doing so (checking for updates ! * in the new list as we go), we'll process what's left of the new ! * list -- those are the truly new labels for this repaint. ! */ ! for (whichlist = OLDLIST; whichlist <= NEWLIST; whichlist++) { ! ROADMAP_LIST_FOR_EACH ! (whichlist == OLDLIST ? &RoadMapLabelCache : &RoadMapLabelNew, ! item, tmp) { ! PluginStreetProperties properties; ! cPtr = (roadmap_label *)item; ! if ((RoadMapLabelGeneration - cPtr->gen) > ! RoadMapLabelGenerationMaxAge) { ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! /* If still working through previously rendered labels, ! * check for updates ! */ ! if (whichlist == OLDLIST) { ! ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { ! ncPtr = (roadmap_label *)item2; ! if (ncPtr->gen == 0) { ! continue; ! } ! ! if (roadmap_plugin_same_line (&cPtr->line, &ncPtr->line)) { ! /* Found a new version of this existing line */ ! ! if (cPtr->invalid) { ! cPtr->gen = ncPtr->gen; ! ! roadmap_list_insert ! (&RoadMapLabelSpares, ! roadmap_list_remove(&ncPtr->link)); ! ! break; ! } ! ! if ((cPtr->angle != ncPtr->angle) || ! (cPtr->zoom != ncPtr->zoom)) { ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! cPtr->angle = ncPtr->angle; ! } else { ! /* Angle is unchanged -- simple movement only */ ! int dx, dy; ! ! dx = ncPtr->center_point.x - cPtr->center_point.x; ! dy = ncPtr->center_point.y - cPtr->center_point.y; ! ! if (dx != 0 || dy != 0) { ! int i; ! ! for (i = 0; i < 4; i++) { ! cPtr->poly[i].x += dx; ! cPtr->poly[i].y += dy; ! } ! cPtr->bbox.minx += dx; ! cPtr->bbox.maxx += dx; ! cPtr->bbox.miny += dy; ! cPtr->bbox.maxy += dy; ! ! cPtr->text_point.x += dx; ! cPtr->text_point.y += dy; ! } ! } ! ! cPtr->center_point = ncPtr->center_point; ! ! cPtr->featuresize_sq = ncPtr->featuresize_sq; ! cPtr->gen = ncPtr->gen; ! ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&ncPtr->link)); ! break; ! } ! } ! } ! ! if ((cPtr->gen != RoadMapLabelGeneration) || cPtr->invalid) { ! roadmap_list_insert ! (&unused_labels, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! ! if (!cPtr->text) { ! ! roadmap_plugin_get_street_properties (&cPtr->line, &properties); ! ! if (!properties.street || !*properties.street) { ! cPtr->text = ""; ! } else { ! cPtr->text = strdup(properties.street); ! } ! cPtr->street = properties.plugin_street; ! } ! ! if (!*cPtr->text) { ! cPtr->invalid = 1; ! ! /* We keep the invalid lines in the cache to avoid repeating ! * all these tests just to find that it's invalid, again! ! */ ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! ! ! if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! ! #ifdef ROADMAP_USE_LINEFONT ! ! roadmap_linefont_extents(cPtr->text, 16, &width, &ascent, &descent); ! ! /* 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. */ ! label_center_y = 0; #else ! int i; ! ! roadmap_canvas_get_text_extents ! (cPtr->text, -1, &width, &ascent, &descent, &i); ! ! angles = angles && i; ! ! label_center_y = 1; #endif ! /* text is too long for this feature */ ! /* (4 times longer than feature) */ ! if ((width * width / 16) > cPtr->featuresize_sq) { ! /* Keep this one in the cache as the feature size may change ! * in the next run. ! */ ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! r.minx = 0; ! r.maxx = width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; ! if (angles) { ! cPtr->text_point = get_metrics (cPtr, &r, label_center_y); ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) ! */ ! cPtr->text_point = cPtr->center_point; ! cPtr->bbox.minx = ! r.minx + cPtr->text_point.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = ! r.maxx + cPtr->text_point.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = ! r.miny + cPtr->text_point.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = ! r.maxy + cPtr->text_point.y - (r.maxy - r.miny)/2; ! } ! } ! #if POLY_OUTLINE ! else { ! int lines = 4; ! roadmap_canvas_draw_multiple_lines(1, &lines, cPtr->poly, 1); ! } ! #endif ! /* Bounding box midpoint */ ! midpt.x = ( cPtr->bbox.maxx + cPtr->bbox.minx) / 2; ! midpt.y = ( cPtr->bbox.maxy + cPtr->bbox.miny) / 2; ! /* Too far over the edge of the screen? */ ! if (midpt.x < 0 || midpt.y < 0 || ! midpt.x > roadmap_canvas_width() || ! midpt.y > roadmap_canvas_height()) { ! /* Keep this one in the cache as the feature size may change ! * in the next run. ! */ ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); ! continue; } ! /* compare against already rendered labels */ ! if (whichlist == NEWLIST) ! end = (RoadMapListItem *)&RoadMapLabelCache; ! else ! end = item; ! ROADMAP_LIST_FOR_EACH_FROM_TO ! ( RoadMapLabelCache.list_first, end, item2, tmp2) { ! ! ocPtr = (roadmap_label *)item2; ! ! if (ocPtr->gen != RoadMapLabelGeneration) { ! continue; ! } ! ! /* street already labelled */ ! if(roadmap_plugin_same_street(&cPtr->street, &ocPtr->street)) { ! cPtr->gen = 0; /* label is a duplicate */ break; } ! /* if bounding boxes don't overlap, we're clear */ ! if (rect_overlap (&ocPtr->bbox, &cPtr->bbox)) { ! ! /* if labels are horizontal, bbox check is sufficient */ ! if(!angles) { ! cPtr->gen = 0; ! break; ! } ! ! /* if labels are "almost" horizontal, the bbox check is ! * close enough. (in addition, the line intersector ! * has trouble with flat or steep lines.) ! */ ! aang = abs(cPtr->angle); ! if (aang < 4 || aang > 86) { ! cPtr->gen = 0; ! break; ! } ! ! aang = abs(ocPtr->angle); ! if (aang < 4 || aang > 86) { ! cPtr->gen = 0; ! break; ! } ! ! /* otherwise we do the full poly check */ ! if (poly_overlap (ocPtr, cPtr)) { ! cPtr->gen = 0; ! break; ! } } } ! if(cPtr->gen == 0) { ! /* Keep this one in the cache as we may need it for the next ! * run. ! */ ! cPtr->gen = RoadMapLabelGeneration; ! roadmap_list_append ! (&unused_labels, roadmap_list_remove(&cPtr->link)); ! continue; /* next label */ } ! #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (cPtr->text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->center_point, 16, cPtr->angle); #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&cPtr->text_point, &cPtr->center_point, cPtr->angle, ! cPtr->text); ! } else { ! roadmap_canvas_draw_string ! (&cPtr->center_point, ROADMAP_CANVAS_CENTER, cPtr->text); ! } #endif + if (whichlist == NEWLIST) { + /* move the rendered label to the cache */ + roadmap_list_append + (&RoadMapLabelCache, roadmap_list_remove(&cPtr->link)); + } ! } /* next label */ ! } /* next list */ ! ROADMAP_LIST_SPLICE (&RoadMapLabelCache, &unused_labels); ! RoadMapLabelGeneration++; return 0; } int roadmap_label_activate (void) { *************** *** 392,395 **** --- 622,629 ---- /* assume this will only affect our internal line fonts */ roadmap_canvas_set_thickness (2); + + RoadMapLabelMinFeatSizeSq = roadmap_config_get_integer (&RoadMapConfigMinFeatureSize); + RoadMapLabelMinFeatSizeSq *= RoadMapLabelMinFeatSizeSq; + return 0; *************** *** 405,408 **** --- 639,646 ---- ("preferences", &RoadMapConfigLabelsColor, "#000000"); + ROADMAP_LIST_INIT(&RoadMapLabelCache); + ROADMAP_LIST_INIT(&RoadMapLabelSpares); + ROADMAP_LIST_INIT(&RoadMapLabelNew); + return 0; } Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_label.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_label.h 17 Jul 2006 06:29:37 -0000 1.3 --- roadmap_label.h 11 Aug 2006 18:12:20 -0000 1.4 *************** *** 30,59 **** #include "roadmap_gui.h" - /* should be related by a power of 2 */ - #define MIN_LABELS 256 - #define MAX_LABELS 2048 - - typedef struct { - - int featuresize; - - PluginLine line; - PluginStreet street; - - RoadMapGuiPoint point; /* label point */ - RoadMapGuiRect bbox; /* label bounding box */ - RoadMapGuiPoint poly[4]; - - short angle; /* degrees */ - short status; /* has this label been drawn or not */ - - } labelCacheMemberObj; - - typedef struct { - labelCacheMemberObj **labels; - int numlabels; - int maxlabels; - } labelCacheObj; - int roadmap_label_add (const RoadMapGuiPoint *point, int angle, --- 30,33 ---- *************** *** 65,67 **** --- 39,43 ---- int roadmap_label_draw_cache (int angles); + void roadmap_label_start (void); + #endif // __ROADMAP_LABEL__H |
From: Paul F. <pg...@us...> - 2006-08-11 03:35:40
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15678 Modified Files: roadmap_label.c roadmap_screen.c Log Message: minor speedup: don't calculate label azymuth for very tiny lines, and keep track of line length vs. label length as a squared value. not as accurate, but probably close enough and no sqrt needed. Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_label.c 20 Jul 2006 03:44:57 -0000 1.13 --- roadmap_label.c 11 Aug 2006 03:35:37 -0000 1.14 *************** *** 55,59 **** RoadMapListItem link; ! int featuresize; PluginLine line; --- 55,59 ---- RoadMapListItem link; ! int featuresize_sq; PluginLine line; *************** *** 81,84 **** --- 81,86 ---- static RoadMapPen RoadMapLabelPen; + static int RoadMapLabelMinFeatSizeSq; + static int rect_overlap (RoadMapGuiRect *a, RoadMapGuiRect *b) { *************** *** 229,238 **** int roadmap_label_add (const RoadMapGuiPoint *point, int angle, ! int featuresize, const PluginLine *line) { roadmap_label *cPtr = 0; ! if (featuresize < ! roadmap_config_get_integer (&RoadMapConfigMinFeatureSize)) { return -1; } --- 231,239 ---- int roadmap_label_add (const RoadMapGuiPoint *point, int angle, ! int featuresize_sq, const PluginLine *line) { roadmap_label *cPtr = 0; ! if (featuresize_sq < RoadMapLabelMinFeatSizeSq) { return -1; } *************** *** 258,262 **** cPtr->line = *line; ! cPtr->featuresize = featuresize; cPtr->angle = normalize_angle(angle); --- 259,263 ---- cPtr->line = *line; ! cPtr->featuresize_sq = featuresize_sq; cPtr->angle = normalize_angle(angle); *************** *** 361,365 **** cPtr->point = ncPtr->point; ! cPtr->featuresize = ncPtr->featuresize; cPtr->gen = ncPtr->gen; --- 362,366 ---- cPtr->point = ncPtr->point; ! cPtr->featuresize_sq = ncPtr->featuresize_sq; cPtr->gen = ncPtr->gen; *************** *** 412,416 **** /* text is too long for this feature */ ! if ((width / 4) > cPtr->featuresize) { roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 413,418 ---- /* text is too long for this feature */ ! /* (4 times longer than feature) */ ! if ((width * width / 16) > cPtr->featuresize_sq) { roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); *************** *** 548,551 **** --- 550,557 ---- /* assume this will only affect our internal line fonts */ roadmap_canvas_set_thickness (2); + + RoadMapLabelMinFeatSizeSq = roadmap_config_get_integer (&RoadMapConfigMinFeatureSize); + RoadMapLabelMinFeatSizeSq *= RoadMapLabelMinFeatSizeSq; + return 0; Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** roadmap_screen.c 20 Jul 2006 03:22:01 -0000 1.68 --- roadmap_screen.c 11 Aug 2006 03:35:37 -0000 1.69 *************** *** 206,210 **** RoadMapShapeIterator shape_next, RoadMapPen pen, ! int *total_length, RoadMapGuiPoint *middle, int *angle) { --- 206,210 ---- RoadMapShapeIterator shape_next, RoadMapPen pen, ! int *total_length_ptr, RoadMapGuiPoint *middle, int *angle) { *************** *** 221,229 **** int last_point_visible = 0; ! int longest_segent = -1; dbg_time_start(DBG_TIME_DRAW_ONE_LINE); ! if (total_length) *total_length = 0; /* if the pen has changed, we need to flush the previous lines and points --- 221,229 ---- int last_point_visible = 0; ! int longest = -1; dbg_time_start(DBG_TIME_DRAW_ONE_LINE); ! if (total_length_ptr) *total_length_ptr = 0; /* if the pen has changed, we need to flush the previous lines and points *************** *** 278,303 **** (&last_midposition, &midposition, &point0, &point1)) { ! if ((point0.x == point1.x) && ! (point0.y == point1.y) && ! last_point_visible) { ! /* This segment is very short, we can skip it */ ! last_midposition = midposition; ! continue; ! } ! if (total_length) { ! int length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! *total_length += length; ! 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; } } --- 278,309 ---- (&last_midposition, &midposition, &point0, &point1)) { ! if ((point0.x == point1.x) && (point0.y == point1.y)) { ! if (last_point_visible) { ! /* This segment is very short, we can skip it */ ! last_midposition = midposition; ! continue; ! } ! } else { ! if (total_length_ptr) { ! ! int length_sq = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! ! /* bad math, but it's for a labelling heuristic anyway */ ! *total_length_ptr += length_sq; ! ! if (length_sq > longest) { ! longest = length_sq; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, &midposition); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } } *************** *** 339,354 **** (&last_midposition, to, &point0, &point1)) { ! if (total_length) { ! int length = (int)(sqrt(pow(point1.x - point0.x,2) + pow(point1.y - point0.y,2))); ! *total_length += length; ! 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; } } --- 345,364 ---- (&last_midposition, to, &point0, &point1)) { ! if (total_length_ptr) { ! int length_sq = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! if (length_sq) { ! /* bad math, but it's for a labelling heuristic anyway */ ! *total_length_ptr += length_sq; ! if (length_sq > longest) { ! longest = length_sq; ! if (angle) { ! *angle = roadmap_math_azymuth(&last_midposition, to); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } } *************** *** 404,418 **** dbg_time_end(DBG_TIME_DRAW_ONE_LINE); return; ! } ! if (total_length) { ! *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; } --- 414,431 ---- dbg_time_end(DBG_TIME_DRAW_ONE_LINE); return; ! ! } else { ! if (total_length_ptr) { ! *total_length_ptr = roadmap_math_screen_distance ! (&point1, &point0, MATH_DIST_SQUARED); ! if (angle) { ! *angle = roadmap_math_azymuth(from, to); ! } ! middle->x = (point1.x + point0.x) / 2; ! middle->y = (point1.y + point0.y) / 2; } } *************** *** 426,430 **** *RoadMapScreenObjects.cursor = 2; ! RoadMapScreenLinePoints.cursor += 2; RoadMapScreenObjects.cursor += 1; --- 439,443 ---- *RoadMapScreenObjects.cursor = 2; ! RoadMapScreenLinePoints.cursor += 2; RoadMapScreenObjects.cursor += 1; *************** *** 643,655 **** 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 { --- 656,668 ---- 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 { *************** *** 704,710 **** &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, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 717,723 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && total_length && (cutoff_dist == 0 || ! cutoff_dist > roadmap_math_screen_distance ! (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 816,822 **** &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, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); --- 829,835 ---- &seg_middle, angle_ptr); ! if (total_length_ptr && total_length && (cutoff_dist == 0 || ! cutoff_dist > roadmap_math_screen_distance ! (&seg_middle, &loweredge, MATH_DIST_SQUARED)) ) { PluginLine l = {ROADMAP_PLUGIN_ID, real_line, layer, fips}; roadmap_label_add (&seg_middle, angle, total_length, &l); *************** *** 968,972 **** if (count == 0) { ! roadmap_display_text("Info", "No map available"); } --- 981,988 ---- if (count == 0) { ! RoadMapPosition pos; ! int zoom; ! roadmap_math_get_context (&pos, &zoom); ! roadmap_display_text("Info", "No map available: %d %d", pos.longitude, pos.latitude); } |
From: Ehud S. <esh...@us...> - 2006-08-10 20:55:40
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19512/libroadmap Modified Files: libroadmap.vcp Log Message: Update evc environment. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libroadmap.vcp 9 Aug 2006 07:39:54 -0000 1.15 --- libroadmap.vcp 10 Aug 2006 20:55:35 -0000 1.16 *************** *** 350,353 **** --- 350,534 ---- # Begin Source File + SOURCE=..\..\..\editor\static\edit_marker.c + + !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" + + DEP_CPP_EDIT_=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\editor\static\edit_marker.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_layer.h"\ + "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_net.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_trip.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_EDIT_=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\editor\static\edit_marker.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_layer.h"\ + "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_net.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_trip.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_EDIT_=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\editor\static\edit_marker.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_layer.h"\ + "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_net.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_trip.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_EDIT_=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\editor\static\edit_marker.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_layer.h"\ + "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_net.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_trip.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_EDIT_=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\editor\static\edit_marker.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_layer.h"\ + "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_net.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_trip.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\editor\db\editor_db.c *************** *** 425,428 **** --- 606,610 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_override.h"\ "..\..\..\editor\db\editor_point.h"\ *************** *** 460,463 **** --- 642,646 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_override.h"\ "..\..\..\editor\db\editor_point.h"\ *************** *** 669,672 **** --- 852,856 ---- "..\..\..\roadmap_locator.h"\ "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_preferences.h"\ "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_shape.h"\ *************** *** 875,878 **** --- 1059,1064 ---- "..\..\..\editor\export\editor_download.h"\ "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ + "..\..\..\navigate\navigate_main.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_canvas.h"\ *************** *** 1055,1058 **** --- 1241,1245 ---- "..\..\..\editor\editor_main.h"\ "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ "..\..\..\editor\export\editor_upload.h"\ "..\..\..\editor\track\editor_track_main.h"\ *************** *** 1064,1067 **** --- 1251,1255 ---- "..\..\..\roadmap_dbread.h"\ "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_download.h"\ "..\..\..\roadmap_file.h"\ "..\..\..\roadmap_fileselection.h"\ *************** *** 1423,1426 **** --- 1611,1615 ---- "..\..\..\editor\export\editor_sync.h"\ "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\editor\static\update_range.h"\ "..\..\..\editor\track\editor_track_main.h"\ "..\..\..\roadmap.h"\ *************** *** 1457,1464 **** --- 1646,1659 ---- "..\..\..\editor\editor_screen.h"\ "..\..\..\editor\export\editor_export.h"\ + "..\..\..\editor\export\editor_sync.h"\ "..\..\..\editor\export\editor_upload.h"\ + "..\..\..\editor\static\update_range.h"\ "..\..\..\editor\track\editor_track_main.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_download.h"\ "..\..\..\roadmap_file.h"\ "..\..\..\roadmap_gps.h"\ *************** *** 1467,1470 **** --- 1662,1668 ---- "..\..\..\roadmap_layer.h"\ "..\..\..\roadmap_list.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_metadata.h"\ "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_plugin.h"\ *************** *** 1508,1511 **** --- 1706,1790 ---- # Begin Source File + SOURCE=..\..\..\editor\db\editor_marker.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_MA=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_EDITOR_MA=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_EDITOR_MA=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_EDITOR_MA=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_EDITOR_MA=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_dictionary.h"\ + "..\..\..\editor\db\editor_marker.h"\ + "..\..\..\editor\editor_log.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\editor\db\editor_override.c *************** *** 2068,2071 **** --- 2347,2351 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_override.h"\ "..\..\..\editor\db\editor_point.h"\ *************** *** 2109,2112 **** --- 2389,2393 ---- "..\..\..\roadmap_shape.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_square.h"\ "..\..\..\roadmap_street.h"\ *************** *** 2124,2127 **** --- 2405,2409 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_override.h"\ "..\..\..\editor\db\editor_point.h"\ *************** *** 2148,2151 **** --- 2430,2434 ---- "..\..\..\roadmap_hash.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_layer.h"\ "..\..\..\roadmap_line.h"\ *************** *** 2164,2167 **** --- 2447,2451 ---- "..\..\..\roadmap_shape.h"\ "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_sprite.h"\ "..\..\..\roadmap_square.h"\ "..\..\..\roadmap_street.h"\ *************** *** 2654,2665 **** --- 2938,2960 ---- "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dialog.h"\ "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_download.h"\ "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_main.h"\ "..\..\..\roadmap_messagebox.h"\ "..\..\..\roadmap_metadata.h"\ + "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ *************** *** 4427,4430 **** --- 4722,4726 ---- "..\..\..\navigate\navigate_plugin.h"\ "..\..\..\roadmap.h"\ + "..\..\..\roadmap_adjust.h"\ "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_db.h"\ *************** *** 4438,4441 **** --- 4734,4738 ---- "..\..\..\roadmap_gui.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_layer.h"\ "..\..\..\roadmap_line.h"\ *************** *** 7375,7378 **** --- 7672,7676 ---- "..\..\..\roadmap_line_route.h"\ "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_math.h"\ "..\..\..\roadmap_plugin.h"\ "..\..\..\roadmap_screen.h"\ *************** *** 8517,8520 **** --- 8815,8819 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_square.h"\ "..\..\..\editor\db\editor_street.h"\ *************** *** 8523,8527 **** --- 8822,8828 ---- "..\..\..\editor\static\update_range.h"\ "..\..\..\roadmap.h"\ + "..\..\..\roadmap_adjust.h"\ "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_county.h"\ "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_db_line_route.h"\ *************** *** 8559,8562 **** --- 8860,8864 ---- "..\..\..\editor\db\editor_dictionary.h"\ "..\..\..\editor\db\editor_line.h"\ + "..\..\..\editor\db\editor_marker.h"\ "..\..\..\editor\db\editor_square.h"\ "..\..\..\editor\db\editor_street.h"\ *************** *** 8565,8569 **** --- 8867,8873 ---- "..\..\..\editor\static\update_range.h"\ "..\..\..\roadmap.h"\ + "..\..\..\roadmap_adjust.h"\ "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_county.h"\ "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_db_line_route.h"\ |
From: Ehud S. <esh...@us...> - 2006-08-10 20:55:05
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19130 Modified Files: roadmap_dialog.c Log Message: Multiple lines entry widget. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_dialog.c 9 Aug 2006 07:39:17 -0000 1.12 --- roadmap_dialog.c 10 Aug 2006 20:55:02 -0000 1.13 *************** *** 37,43 **** #include "../roadmap.h" #include "../roadmap_types.h" ! #include "../roadmap_start.h" ! #include "../roadmap_lang.h" ! #define ROADMAP_DIALOG_NO_LANG #include "../roadmap_dialog.h" --- 37,43 ---- #include "../roadmap.h" #include "../roadmap_types.h" [...1653 lines suppressed...] case WM_COMMAND: if ((HIWORD(wParam) == BN_CLICKED) || ! (HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == CBN_SELCHANGE)) { --- 1539,1543 ---- case WM_COMMAND: if ((HIWORD(wParam) == BN_CLICKED) || ! (HIWORD(wParam) == LBN_SELCHANGE) || (HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == CBN_SELCHANGE)) { *************** *** 1463,1468 **** } - int dialog_test (int i) { - UpdateWindow(RoadMapDialogCurrent->w); - return 0; - } --- 1574,1575 ---- |