You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
| 2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
| 2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
| 2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
| 2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: Danny B. <dan...@us...> - 2008-10-31 04:58:03
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10056/win32 Modified Files: roadmap_main.cpp Log Message: Remove use of _T Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_main.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** roadmap_main.cpp 28 Oct 2008 22:41:51 -0000 1.25 --- roadmap_main.cpp 31 Oct 2008 04:57:50 -0000 1.26 *************** *** 68,76 **** } - #ifndef _T - #define _T(x) (wchar_t *)(L ## x) - #endif - - // Menu & toolbar defines #define MENU_ID_START WM_USER --- 68,71 ---- *************** *** 131,135 **** int handleException(EXCEPTION_POINTERS *exceptionPointers) { #ifdef UNDER_CE ! CEException::writeException(_T("\\roadmapCrash"), exceptionPointers); #endif exit(0); --- 126,130 ---- int handleException(EXCEPTION_POINTERS *exceptionPointers) { #ifdef UNDER_CE ! CEException::writeException((wchar_t *)L"\\roadmapCrash", exceptionPointers); #endif exit(0); *************** *** 830,834 **** menu_id++; } else { ! AppendMenu((HMENU)menu, MF_SEPARATOR, 0, _T("")); } --- 825,829 ---- menu_id++; } else { ! AppendMenu((HMENU)menu, MF_SEPARATOR, 0, (wchar_t *)L""); } |
|
From: Danny B. <dan...@us...> - 2008-10-31 04:43:27
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9593/win32 Modified Files: roadmap.rc Log Message: Make RoadMap on CE "dpi aware" meaning that CE will return the real screen dimensions when asked, not just the old fashioned ones. Index: roadmap.rc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap.rc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap.rc 12 May 2008 07:33:09 -0000 1.4 --- roadmap.rc 31 Oct 2008 04:43:15 -0000 1.5 *************** *** 207,208 **** --- 207,214 ---- EDITTEXT ROADMAP_DIALOG_TEXT, 5, 5, 120, 30, WS_TABSTOP | ES_MULTILINE END + + /* + * With this setting, Windows CE will return the real screen dimensions when asked, + * not just the ones compatible with earlier versions of CE. + */ + HI_RES_AWARE CEUX {1} |
|
From: Danny B. <dan...@us...> - 2008-10-28 22:41:59
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9309/win32 Modified Files: CEException.cpp roadmap_main.cpp Log Message: Remove the "deprecated conversion from string constant to 'char*'" warnings. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_main.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** roadmap_main.cpp 22 Oct 2008 20:16:18 -0000 1.24 --- roadmap_main.cpp 28 Oct 2008 22:41:51 -0000 1.25 *************** *** 69,73 **** #ifndef _T ! #define _T(x) L ## x #endif --- 69,73 ---- #ifndef _T ! #define _T(x) (wchar_t *)(L ## x) #endif *************** *** 131,135 **** int handleException(EXCEPTION_POINTERS *exceptionPointers) { #ifdef UNDER_CE ! CEException::writeException(TEXT("\\roadmapCrash"), exceptionPointers); #endif exit(0); --- 131,135 ---- int handleException(EXCEPTION_POINTERS *exceptionPointers) { #ifdef UNDER_CE ! CEException::writeException(_T("\\roadmapCrash"), exceptionPointers); #endif exit(0); *************** *** 292,299 **** switch (wParam) { ! case VK_APP1: key = "Button-App1"; break; ! case VK_APP2: key = "Button-App2"; break; ! case VK_APP3: key = "Button-App3"; break; ! case VK_APP4: key = "Button-App4"; break; } #endif --- 292,299 ---- switch (wParam) { ! case VK_APP1: key = (char *)"Button-App1"; break; ! case VK_APP2: key = (char *)"Button-App2"; break; ! case VK_APP3: key = (char *)"Button-App3"; break; ! case VK_APP4: key = (char *)"Button-App4"; break; } #endif *************** *** 320,332 **** switch (wParam) { ! case VK_LEFT: key = "Button-Left"; break; ! case VK_RIGHT: key = "Button-Right"; break; ! case VK_UP: key = "Button-Up"; break; ! case VK_DOWN: key = "Button-Down"; break; #ifdef UNDER_CE ! case VK_APP1: key = "Button-App1"; break; ! case VK_APP2: key = "Button-App2"; break; ! case VK_APP3: key = "Button-App3"; break; ! case VK_APP4: key = "Button-App4"; break; #endif #if 0 --- 320,332 ---- switch (wParam) { ! case VK_LEFT: key = (char *)"Button-Left"; break; ! case VK_RIGHT: key = (char *)"Button-Right"; break; ! case VK_UP: key = (char *)"Button-Up"; break; ! case VK_DOWN: key = (char *)"Button-Down"; break; #ifdef UNDER_CE ! case VK_APP1: key = (char *)"Button-App1"; break; ! case VK_APP2: key = (char *)"Button-App2"; break; ! case VK_APP3: key = (char *)"Button-App3"; break; ! case VK_APP4: key = (char *)"Button-App4"; break; #endif #if 0 *************** *** 641,661 **** static struct tb_icon RoadMapIcons[] = { ! {"destination", IDB_RM_DESTINATION}, ! {"location", IDB_RM_LOCATION}, ! {"gps", IDB_RM_GPS}, ! {"hold", IDB_RM_HOLD}, ! {"counterclockwise", IDB_RM_COUNTERCLOCKWISE}, ! {"clockwise", IDB_RM_CLOCKWISE}, ! {"zoomin", IDB_RM_ZOOMIN}, ! {"zoomout", IDB_RM_ZOOMOUT}, ! {"zoom1", IDB_RM_ZOOM1}, ! {"full", IDB_RM_FULL}, ! {"record", IDB_RM_RECORD}, ! {"stop", IDB_RM_STOP}, ! {"quit", IDB_RM_QUIT}, ! {"down", IDB_RM_DOWN}, ! {"up", IDB_RM_UP}, ! {"right", IDB_RM_RIGHT}, ! {"left", IDB_RM_LEFT}, {NULL, 0} }; --- 641,661 ---- static struct tb_icon RoadMapIcons[] = { ! {(char *)"destination", IDB_RM_DESTINATION}, ! {(char *)"location", IDB_RM_LOCATION}, ! {(char *)"gps", IDB_RM_GPS}, ! {(char *)"hold", IDB_RM_HOLD}, ! {(char *)"counterclockwise", IDB_RM_COUNTERCLOCKWISE}, ! {(char *)"clockwise", IDB_RM_CLOCKWISE}, ! {(char *)"zoomin", IDB_RM_ZOOMIN}, ! {(char *)"zoomout", IDB_RM_ZOOMOUT}, ! {(char *)"zoom1", IDB_RM_ZOOM1}, ! {(char *)"full", IDB_RM_FULL}, ! {(char *)"record", IDB_RM_RECORD}, ! {(char *)"stop", IDB_RM_STOP}, ! {(char *)"quit", IDB_RM_QUIT}, ! {(char *)"down", IDB_RM_DOWN}, ! {(char *)"up", IDB_RM_UP}, ! {(char *)"right", IDB_RM_RIGHT}, ! {(char *)"left", IDB_RM_LEFT}, {NULL, 0} }; *************** *** 1218,1222 **** static RoadMapCallback idle_callback; - static int idle_handler_id; static int roadmap_main_set_idle_function_helper (void *data) { --- 1218,1221 ---- Index: CEException.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/CEException.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CEException.cpp 7 May 2008 19:47:55 -0000 1.2 --- CEException.cpp 28 Oct 2008 22:41:51 -0000 1.3 *************** *** 46,50 **** #ifdef ARM writeBreak(file); ! writeString(file, "Context dump"); sprintf(tempo, "R0=%.8lx R1=%.8lx R2=%.8lx R3=%.8lx R4=%.8lx", context->R0, context->R1, context->R2, context->R3, context->R4); --- 46,50 ---- #ifdef ARM writeBreak(file); ! writeString(file, (char *)"Context dump"); sprintf(tempo, "R0=%.8lx R1=%.8lx R2=%.8lx R3=%.8lx R4=%.8lx", context->R0, context->R1, context->R2, context->R3, context->R4); |
|
From: Danny B. <dan...@us...> - 2008-10-26 17:51:12
|
Update of /cvsroot/roadmap/roadmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32753 Modified Files: README Log Message: Had to merge this, my earlier patch from today was relative to an older version of README. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** README 7 Oct 2008 19:45:58 -0000 1.158 --- README 26 Oct 2008 17:51:05 -0000 1.159 *************** *** 3,12 **** --------- --------- ! October 2007 INTRODUCTION ! RoadMap is an open source program for UNIX that displays street maps. When a GPS receiver is available RoadMap can track the current location of the vehicle on the screen, continuously adjusting the position of the --- 3,12 ---- --------- --------- ! October 2008 INTRODUCTION ! RoadMap is an open source program that displays street maps. When a GPS receiver is available RoadMap can track the current location of the vehicle on the screen, continuously adjusting the position of the *************** *** 15,18 **** --- 15,21 ---- as a static map viewer and address finder. + Roadmap runs on various UNIX and Linux systems, but it's also ported to + Windows CE, and other efforts are underway. + RoadMap is released under the GPL (see the COPYING file). *************** *** 183,206 **** * WINDOWS-SPECIFIC DEPENDENCIES AND LIMITATIONS ! The port of RoadMap on Windows is recent, not fully complete and has ! not been tested thoroughly, so problems are to be expected. Thank you ! for your understanding. ! ! The port to Windows was implemented by Ehud Shabtai (esh...@gm...). ! RoadMap is only available for PocketPC 2002 and later at that time. ! There is no support yet for Windows XP, 2000 or 2003. This is because ! the WIN32 API is not the same on all Windows platforms: to the extend ! of our knowledge, RoadMap might not compile, and should not run, on ! Windows XP. ! RoadMap use the WIN32 API exclusively, and no specific graphic library is required. There is UNIX Makefile support for building the WinCE version of ! RoadMap using the arm-wince-mingw32ce cross-compiler toolchain, ! available from http://cegcc.sourceforge.net, but support in the ! code for the toolchain is incomplete. Working versions have all ! come from real Microsoft tools. Maps cannot be built under Windows (buildmap and buildus have not been --- 186,201 ---- * WINDOWS-SPECIFIC DEPENDENCIES AND LIMITATIONS ! The initial port to Windows was implemented by Ehud Shabtai. ! RoadMap is only available for Windows CE (PocketPC, Windows Mobile). ! There is no support for desktop Windows (XP, Vista, ..) - the WIN32 API ! is not the same on all Windows platforms. ! RoadMap use the WIN32 API exclusively, no specific graphic library is required. There is UNIX Makefile support for building the WinCE version of ! RoadMap using the arm-mingw32ce cross-compiler toolchain, ! available from http://cegcc.sourceforge.net. Maps cannot be built under Windows (buildmap and buildus have not been *************** *** 218,236 **** Instead of a local gpsd, RoadMap can uses a Windows serial port and the GPS source should then be specified as "COM1:", "COM2":, etc... - The roadmap and roadgps programs cannot run simultaneously when configured - for the serial port. The "GPS Console" menu item of roadmap does not work - in that configuration. The GPS console built into RoadMap doesn't have - this restriction, of course. - Only NMEA-capable GPS devices are supported, unless a remote gpsd is used. ! Downloading maps on the fly is not available on Windows, due to the lack ! of gzip and tar tools on PocketPC. ! ! The screenshots feature of RoadMap is not available on Windows or GTK ! ! The full-screen mode of RoadMap is not available on Windows or GTK. ! * {DIRECTORIES} --- 213,224 ---- Instead of a local gpsd, RoadMap can uses a Windows serial port and the GPS source should then be specified as "COM1:", "COM2":, etc... + Bluetooth devices are also known to work (over a virtual serial port). Only NMEA-capable GPS devices are supported, unless a remote gpsd is used. ! Features not available on Windows : ! - Downloading maps on the fly ! - The screenshots feature ! - The full-screen mode of RoadMap * {DIRECTORIES} *************** *** 407,410 **** --- 395,403 ---- will automatically add to the list the directory where its executable stands. + The default name of a memory card on your Windows CE device is extracted and + automatically supported by RoadMap. In that case, replace \storage card\.. + in the example above by e.g. \SD Card\.. . + + ** ICON FILES |
|
From: Danny B. <dan...@us...> - 2008-10-26 17:45:02
|
Update of /cvsroot/roadmap/roadmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32527 Modified Files: README.osm Log Message: Updates published on the list Index: README.osm =================================================================== RCS file: /cvsroot/roadmap/roadmap/README.osm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README.osm 12 Dec 2007 17:40:09 -0000 1.1 --- README.osm 26 Oct 2008 17:44:57 -0000 1.2 *************** *** 11,27 **** * OpenStreetMap ! * QuadTiles, RoadMap tileid values, and filenames ! The maps that RoadMap has rendered in the past (i.e., TIGER, various ! shapefile formats) have all needed to be indexed before RoadMap could use ! them. One reason for this is because there's no direct mapping between a ! the coordinates on the screen where RoadMap is trying to display a map, ! and the name of the map file(s) that contain(s) information for that ! region. The maps are named based on the source of the data that they ! represent (e.g., "usc25027.rdm" contains data from county 27 in state 25). ! The file contains some information that RoadMap can use to figure out ! where it is -- in index is made using this information so that RoadMap ! doesn't need to continually look in all the files. That index is ! (currently) called "usdir.rdm". If the name of the file holding the map data encoded its position and size --- 11,38 ---- * OpenStreetMap ! * Indexed maps ! The maps that RoadMap renders come from several sources (TIGER, various ! shapefile formats, OpenStreetMap). They all need to be indexed for use ! by RoadMap for several reasons. First, we don't want to overload RoadMap ! to be with several ways to interpret the same data. Second, there's not ! always a direct mapping between the coordinates on the screen where ! RoadMap is trying to displaya map, and the name of the map file(s) that ! contain(s) information for that region. ! ! * File name formats ! ! The map files are named in a way that depends on how the data was obtained ! and therefore, how the data is organised. ! A map file called "usc25027.rdm" contains contains data from county 27 in ! state 25). A map file called iso-be.rdm contains the whole country "be". ! A third map file format is based on QuadTiles. ! ! The files contain some information that RoadMap can use to figure out where ! it is -- an index is made using this information so that RoadMap doesn't ! need to continually look in all the files. ! That index is currently called "usdir.rdm". ! ! * QuadTiles, RoadMap tileid values, and filenames If the name of the file holding the map data encoded its position and size *************** *** 64,68 **** 251833, would be 0x3d7b9007. (251833 is 0x3d7b9 in hex). ! * Fetching OpenStreetMap data OSM map data is available from servers on the web, using a simple API. As --- 75,79 ---- 251833, would be 0x3d7b9007. (251833 is 0x3d7b9 in hex). ! * Fetching OpenStreetMap data by QuadTile OSM map data is available from servers on the web, using a simple API. As *************** *** 106,109 **** --- 117,143 ---- ---- + * Fetching OpenStreetMap data in large chunks + + The OpenStreetMap servers only allow obtaining a limited amount of map + info per query. Access via the OSM Mobile Binary Protocol is subject to + such limitations. + + Other services (e.g. http://download.geofabrik.de/osm/europe/) provide + access to large chunks of OSM data in a single file, e.g. a file per + country, like the maps used in many commercial GPS devices. + + The buildmap_osm command was extended to be able to process those files. + A sample command looks like + + buildmap_osm -i iso-be.osm -o iso-be.rdm + + which will convert one file into the other. + + The file name format is twofold : iso-xx.rdm or iso-xx-yyy.rdm . The former + is a file per country (xx is the ISO two-character code for the country). + The latter format allows for country subdivisions (yyy is a subdivision of + country xx). The codes xx and yyy are defined in the ISO-3166-1 (country) + and ISO-3166-2 (country subdivision). Note that the latter is incomplete. + * Limitations |
|
From: Danny B. <dan...@us...> - 2008-10-26 17:43:53
|
Update of /cvsroot/roadmap/roadmap/web In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32460/web Modified Files: index.html Log Message: Updates published on the list Index: index.html =================================================================== RCS file: /cvsroot/roadmap/roadmap/web/index.html,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** index.html 18 Oct 2007 15:07:25 -0000 1.31 --- index.html 26 Oct 2008 17:43:47 -0000 1.32 *************** *** 23,27 **** <P>RoadMap is an open source (GPL) program that provides a car navigation for Linux, UNIX and now Windows CE (a.k.a. PocketPC). ! It displays a map of the streets, tracks the position provided by a NMEA-compliant GPS receiver, identifies the street matching this GPS position and announces the name of the crossing street at the next intersection. A --- 23,29 ---- <P>RoadMap is an open source (GPL) program that provides a car navigation for Linux, UNIX and now Windows CE (a.k.a. PocketPC). ! ??? Something about iPhone ? ! ! <P> RoadMap displays a map of the streets, tracks the position provided by a NMEA-compliant GPS receiver, identifies the street matching this GPS position and announces the name of the crossing street at the next intersection. A *************** *** 41,44 **** --- 43,47 ---- including postgis and other shapefile-based formats, but this work is either not on the main development branch, or very experimental. + Also there are two ways of using OpenStreetMap (http://www.openstreetmap.org) maps. <P>RoadMap has been designed to be usable on both a desktop or laptop PC, *************** *** 49,52 **** --- 52,59 ---- site. + <P>The Windows CE (Windows Mobile, Pocket PC, ..) port is a native one + and has been tested on several devices. + ??? Something about iPhone ? + <P>The on-screen user interface is very customizable. All command actions can be bound to arbitrary menu entries, toolbar buttons, or *************** *** 66,72 **** US Census Bureau database (for example one-way street are not indicated). The US Census Bureau has clearly indicated that it does not plan to add ! these information in the future (the USCB does not need them). The RoadMap ! "editor" project, maintained by Ehud Shabtai, does support navigation -- ! the data used in that project supports the feature. <P>RoadMap usually uses --- 73,77 ---- US Census Bureau database (for example one-way street are not indicated). The US Census Bureau has clearly indicated that it does not plan to add ! these information in the future (the USCB does not need them). <P>RoadMap usually uses *************** *** 87,93 **** For example, the map of Los Angeles county takes about 10 Mbytes of flash space. RoadMap comes with a set of tools to convert the US Census bureau data ! (both the 2000 and 2002 versions) into its own map format. Future versions of ! the US Census bureau data will be supported as well (usually a 1 or 2 months ! after the data has been released). <P>When RoadMap starts, it displays a map of the same area that was displayed --- 92,96 ---- For example, the map of Los Angeles county takes about 10 Mbytes of flash space. RoadMap comes with a set of tools to convert the US Census bureau data ! (both the 2000 and 2002 versions) into its own map format. <P>When RoadMap starts, it displays a map of the same area that was displayed *************** *** 99,112 **** <H2>Credits</H2> <P> ! The original RoadMap was (and still is) developed by Pascal ! Martin. As of 2007, Paul Fox has taken over as "maintainer of ! the moment". A version of RoadMap for the Sharp Zaurus was ! developed by Latchesar Ionkov (who wrote the original QT ! support). The support for the Digital Charts of the World was ! contributed by Stephen Woodbridge. The version of RoadMap for ! Windows (PocketPC) is developed and supported by Ehud Shabtai ! (eshabtai at gmail dot com). Paul Fox has added GPX data ! interchange support for trips, routes, landmark, and ! points-of-interest. Ehud and Paul have added street labeling and other features as well. Alex Briosi and Oleg Gusev contributed the QT4 desktop port. --- 102,114 ---- <H2>Credits</H2> <P> ! The original RoadMap was developed by Pascal Martin. ! As of 2007, Paul Fox has taken over as "maintainer of the moment". ! A version of RoadMap for the Sharp Zaurus was developed by Latchesar Ionkov ! (who wrote the original QT support). The support for the Digital Charts ! of the World was contributed by Stephen Woodbridge. The version of RoadMap ! for Windows (PocketPC) was developed by Ehud Shabtai but is now supported ! by Danny Backx. ! Paul Fox has added GPX data interchange support for trips, routes, landmark, ! and points-of-interest. Ehud and Paul have added street labeling and other features as well. Alex Briosi and Oleg Gusev contributed the QT4 desktop port. *************** *** 114,118 **** <BR> <CENTER> ! (c) Copyright Pascal Martin, 2003, 2005 (pascal dot martin at iname dot com) <BR> (c) Copyright Latchesar Ionkov, 2003 --- 116,120 ---- <BR> <CENTER> ! (c) Copyright Pascal Martin, 2003, 2005 <BR> (c) Copyright Latchesar Ionkov, 2003 *************** *** 120,126 **** (c) Copyright Stephen Woodbridge, 2004 <BR> ! (c) Copyright Ehud Shabtai, 2005 (eshabtai at gmail dot com) <BR> ! (c) Copyright Paul Fox, 2006, 2007 </CENTER> <!-- INCLUDE_SITE_SPONSOR_HERE --> --- 122,130 ---- (c) Copyright Stephen Woodbridge, 2004 <BR> ! (c) Copyright Ehud Shabtai, 2005 <BR> ! (c) Copyright Paul Fox, 2006, 2007, 2008 ! <BR> ! (c) Copyright Danny Backx, 2007, 2008 </CENTER> <!-- INCLUDE_SITE_SPONSOR_HERE --> |
|
From: Paul F. <pg...@us...> - 2008-10-26 00:51:23
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16829 Modified Files: roadmap_layer.c Log Message: alessandro pointed out that the thickness value will be set before use in the pen loop, so we don't need properly set it beforehand. Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_layer.c 24 Oct 2008 15:32:27 -0000 1.19 --- roadmap_layer.c 26 Oct 2008 00:51:16 -0000 1.20 *************** *** 755,759 **** int other_pen_length = strlen(layers[i]) + 64; static char *other_pen; ! int thickness; other_pen = realloc(other_pen, other_pen_length); --- 755,759 ---- int other_pen_length = strlen(layers[i]) + 64; static char *other_pen; ! int thickness = 1; /* suppress warning: will set again before use */ other_pen = realloc(other_pen, other_pen_length); *************** *** 769,774 **** roadmap_config_declare (class_config, &layer->thickness, "1"); - thickness = roadmap_config_get_integer (&layer->thickness); - layer->declutter.category = layers[i]; layer->declutter.name = "Declutter"; --- 769,772 ---- |
|
From: Paul F. <pg...@us...> - 2008-10-26 00:43:39
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16477/qt Modified Files: qt_main.cc roadmap_messagebox.cc Log Message: compilation warning fixes, courtesy alessandro briosi Index: roadmap_messagebox.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/roadmap_messagebox.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_messagebox.cc 19 Sep 2008 16:21:41 -0000 1.8 --- roadmap_messagebox.cc 26 Oct 2008 00:43:28 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- #define __ROADMAP_MESSAGEBOX_NO_LANG #include "roadmap_messagebox.h" + #include <stdlib.h> } Index: qt_main.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_main.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** qt_main.cc 12 Jul 2008 09:24:16 -0000 1.16 --- qt_main.cc 26 Oct 2008 00:43:27 -0000 1.17 *************** *** 268,274 **** case Key_Left: if (spacePressed) { ! key = "Button-Calendar"; } else { ! key = "Button-Left"; } break; --- 268,274 ---- case Key_Left: if (spacePressed) { ! key = (char*)"Special-Calendar"; } else { ! key = (char*)"LeftArrow"; } break; *************** *** 276,291 **** case Key_Right: if (spacePressed) { ! key = "Button-Contact"; } else { ! key = "Button-Right"; } break; case Key_Up: ! key = "Button-Up"; break; case Key_Down: ! key = "Button-Down"; break; --- 276,296 ---- case Key_Right: if (spacePressed) { ! key = (char*)"Special-Contact"; } else { ! key = (char*)"RightArrow"; } break; case Key_Up: ! key = (char*)"UpArrow"; break; case Key_Down: ! key = (char*)"DownArrow"; ! break; ! ! case Key_Return: ! case Key_Enter: ! key = (char*)"Enter"; break; |
|
From: Paul F. <pg...@us...> - 2008-10-26 00:43:39
|
Update of /cvsroot/roadmap/roadmap/src/qt4 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16477/qt4 Modified Files: qt_main.cc Log Message: compilation warning fixes, courtesy alessandro briosi Index: qt_main.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt4/qt_main.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** qt_main.cc 12 Jul 2008 09:24:16 -0000 1.9 --- qt_main.cc 26 Oct 2008 00:43:28 -0000 1.10 *************** *** 281,287 **** case Qt::Key_Left: if (spacePressed) { ! key = "Button-Calendar"; } else { ! key = "Button-Left"; } break; --- 281,287 ---- case Qt::Key_Left: if (spacePressed) { ! key = (char*)"Special-Calendar"; } else { ! key = (char*)"LeftArrow"; } break; *************** *** 289,304 **** case Qt::Key_Right: if (spacePressed) { ! key = "Button-Contact"; } else { ! key = "Button-Right"; } break; case Qt::Key_Up: ! key = "Button-Up"; break; case Qt::Key_Down: ! key = "Button-Down"; break; --- 289,309 ---- case Qt::Key_Right: if (spacePressed) { ! key = (char*)"Special-Contact"; } else { ! key = (char*)"RightArrow"; } break; case Qt::Key_Up: ! key = (char*)"UpArrow"; break; case Qt::Key_Down: ! key = (char*)"DownArrow"; ! break; ! ! case Qt::Key_Return: ! case Qt::Key_Enter: ! key = (char*)"Enter"; break; |
|
From: Danny B. <dan...@us...> - 2008-10-24 15:50:12
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6138/unix Modified Files: roadmap_path.c Log Message: Avoid issues with double file names : discard files whose name ends with a tilde. Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_path.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** roadmap_path.c 11 Jun 2008 14:03:55 -0000 1.27 --- roadmap_path.c 24 Oct 2008 15:50:01 -0000 1.28 *************** *** 596,599 **** --- 596,604 ---- if (entry->d_name[0] == '.') continue; + /* Don't allow file names ending in ~, they're likely to be backup files */ + int l = strlen(entry->d_name); + if (entry->d_name[l-1] == '~') + continue; + if (length > 0) { |
|
From: Danny B. <dan...@us...> - 2008-10-24 15:32:34
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4741 Modified Files: roadmap_layer.c Log Message: I guess this was inadvertently changed by a recent patch. Putting the line back in as it was before. Index: roadmap_layer.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_layer.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** roadmap_layer.c 7 Oct 2008 00:42:20 -0000 1.18 --- roadmap_layer.c 24 Oct 2008 15:32:27 -0000 1.19 *************** *** 769,774 **** roadmap_config_declare (class_config, &layer->thickness, "1"); ! /* this value is not used here */ ! /* thickness = roadmap_config_get_integer (&layer->thickness); */ layer->declutter.category = layers[i]; --- 769,773 ---- roadmap_config_declare (class_config, &layer->thickness, "1"); ! thickness = roadmap_config_get_integer (&layer->thickness); layer->declutter.category = layers[i]; |
|
From: Danny B. <dan...@us...> - 2008-10-24 15:26:55
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4543 Modified Files: buildmap_osm_main.c Log Message: Remove warnings. Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** buildmap_osm_main.c 16 Oct 2008 19:38:45 -0000 1.11 --- buildmap_osm_main.c 24 Oct 2008 15:26:45 -0000 1.12 *************** *** 239,243 **** FILE *f; char country[6], division[6]; ! int fips, country_num, division_num; f = fopen(fn, "r"); --- 239,243 ---- FILE *f; char country[6], division[6]; ! int fips, country_num = 0, division_num = 0; f = fopen(fn, "r"); *************** *** 260,263 **** --- 260,266 ---- buildmap_metadata_add_attribute ("Territory", "Parent", fn); buildmap_metadata_add_value ("Territory", "Parent", fn); + + country_num = fips / 1000; + division_num = fips % 1000; } else { buildmap_fatal(0, "Invalid file name \"%s\" should be ISO or USC shape", fn); |
|
From: Paul F. <pg...@us...> - 2008-10-24 13:41:07
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30158 Modified Files: roadmap_iso.h roadmap_locator.c Log Message: add extern, add header include, to suppress warning Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_locator.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** roadmap_locator.c 16 Oct 2008 19:38:45 -0000 1.29 --- roadmap_locator.c 24 Oct 2008 13:41:00 -0000 1.30 *************** *** 52,55 **** --- 52,56 ---- #include "roadmap_county.h" #include "roadmap_config.h" + #include "roadmap_iso.h" #include "roadmap_locator.h" Index: roadmap_iso.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_iso.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_iso.h 16 Oct 2008 19:38:45 -0000 1.1 --- roadmap_iso.h 24 Oct 2008 13:41:00 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- int roadmap_iso_alpha_to_num(char *alpha); void roadmap_iso_create_all_countries(void); + void roadmap_iso_mapfile_from_fips(char *buf, int fips); int buildmap_osm_filename_iso(char *fn, char *country, char *division, char *suffix); int roadmap_iso_division_to_num(char *country, char *division); |
|
From: Danny B. <dan...@us...> - 2008-10-22 20:16:37
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2516/win32 Modified Files: roadmap_main.cpp Log Message: Oops, I forgot to recompile after the last small edit. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_main.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** roadmap_main.cpp 22 Oct 2008 19:09:52 -0000 1.23 --- roadmap_main.cpp 22 Oct 2008 20:16:18 -0000 1.24 *************** *** 259,262 **** --- 259,263 ---- */ return 0; + } } |
|
From: Danny B. <dan...@us...> - 2008-10-22 19:10:02
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv30712/win32 Modified Files: roadmap_main.cpp Log Message: Add a call to terminate the power management stuff at application exit. This was present in Ehud's implementation, but somehow it got forgotten in the initial port. Also add a couple of additional checks to see whether our application is already running in another process, it turns out that CE sometimes returns strange results here. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_main.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** roadmap_main.cpp 12 Jul 2008 09:24:16 -0000 1.22 --- roadmap_main.cpp 22 Oct 2008 19:09:52 -0000 1.23 *************** *** 219,227 **** } ! BOOL InitInstance(HINSTANCE hInstance, LPTSTR lpCmdLine) { ! HWND hWnd; WSADATA wsaData; g_hInst = hInstance; // Store instance handle in our global variable --- 219,234 ---- } ! /** ! * @brief do the normal startup for PocketPC : check whether we're already running, quit if we are ! * and let the old process take over. ! * @param hInstance useless parameter on Windows CE ! * @param lpCmdLine command line passed in, also rather useless on CE ! * @return TRUE(0) if application should continue to start up ! */ BOOL InitInstance(HINSTANCE hInstance, LPTSTR lpCmdLine) { ! HWND hWnd; WSADATA wsaData; + DWORD e; g_hInst = hInstance; // Store instance handle in our global variable *************** *** 231,243 **** #endif ! //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); ! if (hWnd) { ! // set focus to foremost child window ! // The "| 0x00000001" is used to bring any owned windows to the ! // foreground and activate them. ! SetForegroundWindow((HWND)((ULONG) hWnd | 0x00000001)); ! return 0; } --- 238,262 ---- #endif ! SetLastError(0); ! /* ! * If it is already running, then focus on the window, and exit. ! * In addition to the usual stuff, also cope with strange returns from FindWindow. ! */ hWnd = FindWindow(szWindowClass, NULL); ! e = GetLastError(); ! if (hWnd && e != ERROR_CLASS_DOES_NOT_EXIST) { ! /* ! * Set focus to foremost child window ! * The "| 0x01" is used to bring any owned windows to the ! * foreground and activate them. ! */ ! if (SetForegroundWindow((HWND)((ULONG) hWnd | 0x01)) != 0) { ! /* ! * This is the normal case if another process from this application ! * is still running. We've succeeded in popping it up so it should ! * be visible, so this new process should quit. ! */ ! return 0; } *************** *** 439,442 **** --- 458,464 ---- case WM_DESTROY: + #ifdef UNDER_CE + CEDevice::end(); + #endif if (RoadMapMainMenuBar != NULL) { #ifdef UNDER_CE |
|
From: Danny B. <dan...@us...> - 2008-10-19 16:01:13
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21990/win32 Modified Files: roadmap_path.c Log Message: Add a bit of documentation, error checking, and a couple of lines of code I obviously forgot to commit a while back. Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_path.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_path.c 27 May 2008 22:41:52 -0000 1.12 --- roadmap_path.c 19 Oct 2008 16:01:06 -0000 1.13 *************** *** 1,4 **** ! /* roadmap_path.c - a module to handle file path in an OS independent way. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 22,29 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * See roadmap_path.h. */ --- 21,29 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief handle file path in an OS independent way, this is the Windows CE implementation */ *************** *** 39,42 **** --- 39,45 ---- typedef struct RoadMapPathRecord *RoadMapPathList; + /** + * @brief + */ struct RoadMapPathRecord { RoadMapPathList next; *************** *** 75,81 **** /* The default path for the map files (the "maps" path): */ static char **RoadMapPathMaps = 0; static const char *RoadMapPathMapsSuffix = "roadmap/maps"; ! static const char *RoadMapPathMapsPreferred = "/Storage Card/roadmap/maps"; /* We don't have a user directory in wince so we'll leave this one empty */ --- 78,91 ---- /* The default path for the map files (the "maps" path): */ static char **RoadMapPathMaps = 0; + static const char *RoadMapPathMapsPreferred = "/Storage Card/roadmap/maps"; static const char *RoadMapPathMapsSuffix = "roadmap/maps"; ! /* The default path for the skin files (the "skin" path): */ ! static char *RoadMapPathSkin[] = { ! "&\\skins\\default\\day", ! "&\\skins\\default", ! NULL ! }; ! static const char *RoadMapPathSkinPreferred = "&\\skins"; /* We don't have a user directory in wince so we'll leave this one empty */ *************** *** 87,90 **** --- 97,103 ---- static BOOL (WINAPI* _FindNextFlashCard)(HANDLE, LPWIN32_FIND_DATA) = NULL; + /** + * @brief initialize, get FindFirstFlashCard() in a Windows CE version independent way + */ static void roadmap_path_init_dll(void) { *************** *** 98,101 **** --- 111,118 ---- } + /** + * @brief add the directory specified to the list of search directories + * @param dir + */ static void roadmap_path_insert(const char *dir) { *************** *** 105,119 **** if (i == ROADMAP_MAX_CARDS) return; ! if (RoadMapPathConfig == 0) RoadMapPathConfig = (char **)calloc(ROADMAP_MAX_CARDS + 1, sizeof(char *)); ! if (RoadMapPathMaps == 0) RoadMapPathMaps = (char **)calloc(ROADMAP_MAX_CARDS + 1, sizeof(char *)); RoadMapPathConfig[i] = malloc(l + strlen(RoadMapPathConfigSuffix) + 4); sprintf(RoadMapPathConfig[i], "/%s/%s", dir, RoadMapPathConfigSuffix); RoadMapPathMaps[i] = malloc(l + strlen(RoadMapPathMapsSuffix) + 4); sprintf(RoadMapPathMaps[i], "/%s/%s", dir, RoadMapPathMapsSuffix); --- 122,154 ---- if (i == ROADMAP_MAX_CARDS) return; ! if (RoadMapPathConfig == 0) { RoadMapPathConfig = (char **)calloc(ROADMAP_MAX_CARDS + 1, sizeof(char *)); ! if (RoadMapPathConfig == 0) { ! roadmap_log(ROADMAP_FATAL, "No more memory(%d)", ! (ROADMAP_MAX_CARDS + 1) * sizeof(char *)); ! } ! } ! if (RoadMapPathMaps == 0) { RoadMapPathMaps = (char **)calloc(ROADMAP_MAX_CARDS + 1, sizeof(char *)); + if (RoadMapPathMaps == 0) { + roadmap_log(ROADMAP_FATAL, "No more memory(%d)", + (ROADMAP_MAX_CARDS + 1) * sizeof(char *)); + } + } RoadMapPathConfig[i] = malloc(l + strlen(RoadMapPathConfigSuffix) + 4); + if (RoadMapPathConfig[i] == 0) { + roadmap_log(ROADMAP_FATAL, "no more memory(%d)", + l + strlen(RoadMapPathConfigSuffix) + 4); + } sprintf(RoadMapPathConfig[i], "/%s/%s", dir, RoadMapPathConfigSuffix); RoadMapPathMaps[i] = malloc(l + strlen(RoadMapPathMapsSuffix) + 4); + if (RoadMapPathMaps[i] == 0) { + roadmap_log(ROADMAP_FATAL, "No more memory(%d)", + l + strlen(RoadMapPathMapsSuffix) + 4); + } sprintf(RoadMapPathMaps[i], "/%s/%s", dir, RoadMapPathMapsSuffix); *************** *** 125,130 **** } ! ! static void roadmap_path_get_cards() { WIN32_FIND_DATA ffd; --- 160,167 ---- } ! /** ! * @brief Query your device to figure out how the flash (SD, ..) cards are named, add these directories to the search path. Or do something sensible by default if you can't find cards. ! */ ! static void roadmap_path_get_cards(void) { WIN32_FIND_DATA ffd; *************** *** 156,160 **** } ! static void roadmap_path_list_create(const char *name, char *items[], --- 193,202 ---- } ! /** ! * @brief ! * @param name ! * @param items ! * @param preferred ! */ static void roadmap_path_list_create(const char *name, char *items[], *************** *** 191,194 **** --- 233,241 ---- } + /** + * @brief + * @param name + * @return + */ static RoadMapPathList roadmap_path_find (const char *name) { *************** *** 204,207 **** --- 251,256 ---- roadmap_path_list_create ("maps", RoadMapPathMaps, RoadMapPathMapsPreferred); + roadmap_path_list_create ("skin", RoadMapPathSkin, + RoadMapPathSkinPreferred); roadmap_path_list_create ("user", RoadMapPathUser, "/"); *************** *** 217,221 **** /* Directory path strings operations. -------------------------------------- */ ! static char *roadmap_path_cat (const char *s1, const char *s2) { --- 266,275 ---- /* Directory path strings operations. -------------------------------------- */ ! /** ! * @brief concatename two parts of a file name ! * @param s1 ! * @param s2 ! * @return ! */ static char *roadmap_path_cat (const char *s1, const char *s2) { |
|
From: Danny B. <dan...@us...> - 2008-10-16 19:38:57
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16356 Modified Files: Makefile buildmap_osm_main.c buildmap_osm_text.c buildmap_osm_text.h buildus_county.c buildus_main.c roadmap_locator.c Added Files: roadmap_iso.c roadmap_iso.h Log Message: Commit my buildmap/buildus work for dealing with the ISO map organisation I'm proposing. This is work in progress (but it works for me). Committing it into CVS so it is easier to get feedback about it and for others to gain experience. Index: buildus_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildus_main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** buildus_main.c 21 Dec 2007 22:51:53 -0000 1.14 --- buildus_main.c 16 Oct 2008 19:38:45 -0000 1.15 *************** *** 1,4 **** ! /* buildus_main.c - The main function of the US directory builder tool. ! * * LICENSE: * --- 1,3 ---- ! /* * LICENSE: * *************** *** 22,25 **** --- 21,29 ---- */ + /** + * @file + * @brief The main function of the US directory builder tool. + */ + #include <string.h> #include <stdlib.h> *************** *** 27,30 **** --- 31,35 ---- #include <sys/types.h> #include <dirent.h> + #include <ctype.h> #include "roadmap_dbread.h" *************** *** 42,45 **** --- 47,51 ---- #include "buildus_fips.h" #include "buildus_county.h" + #include "roadmap_iso.h" static RoadMapConfigDescriptor RoadMapConfigMapPath = *************** *** 71,74 **** --- 77,83 ---- }; + /** + * @brief + */ static void buildus_save (void) { *************** *** 88,92 **** } ! static void buildus_scan_cities (int fips) { --- 97,104 ---- } ! /** ! * @brief ! * @param fips ! */ static void buildus_scan_cities (int fips) { *************** *** 107,111 **** name != NULL; name = roadmap_dictionary_get (cities, ++i)) { ! city = buildmap_dictionary_add (us_cities, name, strlen(name)); buildus_county_add_city (fips, city); --- 119,127 ---- name != NULL; name = roadmap_dictionary_get (cities, ++i)) { ! #ifdef VERBOSE ! fprintf(stderr, "buildus_scan_cities [cities %p] (fips %d), i %d,", ! us_cities, fips, i); ! fprintf(stderr, " name [%s]\n", name); ! #endif city = buildmap_dictionary_add (us_cities, name, strlen(name)); buildus_county_add_city (fips, city); *************** *** 113,117 **** } ! static void buildus_scan_maps (void) { --- 129,135 ---- } ! /** ! * @brief read the specified directory, filter out the map files, scan them ! */ static void buildus_scan_maps (void) { *************** *** 119,123 **** char *extension; const char *mappath; ! int found = 0; int fips; --- 137,144 ---- char *extension; const char *mappath; ! int found = 0, n; ! ! char country_iso[4] = {0, 0, 0, 0}; ! char country_division[4] = {0, 0, 0, 0}; int fips; *************** *** 158,173 **** entry = readdir(directory)) { ! if (strncmp (entry->d_name, "usc", 3) != 0) continue; ! extension = strrchr (entry->d_name, '.'); - if (extension == NULL) continue; if (strcmp (extension, ".rdm") != 0) continue; ! found = 1; ! fips = atoi (entry->d_name + 3); - buildmap_set_source (entry->d_name); if (! BuildMapSilent) buildmap_info ("scanning the county file..."); --- 179,236 ---- entry = readdir(directory)) { ! /* Make sure all files read end in ".rdm" */ extension = strrchr (entry->d_name, '.'); if (extension == NULL) continue; if (strcmp (extension, ".rdm") != 0) continue; ! /* Set the name of the file we're reading rather early, ! * so error messages mention it. ! */ ! buildmap_set_source (entry->d_name); ! n = buildmap_osm_filename_iso(entry->d_name, country_iso, country_division, ".rdm"); ! if (n) { ! static BuildMapDictionary BuildMapStateDictionary; ! static BuildMapDictionary county_dictionary; ! RoadMapString state_symbol, county_name; ! ! fips = roadmap_iso_alpha_to_num(country_iso) * 1000 + 1000000; ! if (n == 2) { ! fips += roadmap_iso_division_to_num(country_iso, country_division); ! buildmap_info("Country %s division %s fips %d", ! country_iso, country_division, fips); ! } else { ! buildmap_info("Country %s fips %d", country_iso, fips); ! } ! ! /* Create a fake county */ ! BuildMapStateDictionary = buildmap_dictionary_open ("state"); ! ! state_symbol = buildmap_dictionary_add (BuildMapStateDictionary, ! country_iso, strlen(country_iso)); ! if (state_symbol == 0) { ! buildmap_fatal (0, "invalid state description"); ! } ! buildus_county_add_state (state_symbol, state_symbol); ! ! county_dictionary = buildmap_dictionary_open ("county"); ! if (n == 2) { ! county_name = buildmap_dictionary_add (county_dictionary, ! country_division, strlen(country_division)); ! } else { ! county_name = buildmap_dictionary_add (county_dictionary, ! "fake county", 11); ! } ! ! buildus_county_add (fips, county_name, state_symbol); ! } else if (buildmap_osm_filename_usc(entry->d_name, &fips)) { ! ; /* It's decoded, that's all we needed. */ ! } else { ! /* File name is invalid, bail out */ ! continue; ! } ! ! found = 1; if (! BuildMapSilent) buildmap_info ("scanning the county file..."); *************** *** 184,192 **** roadmap_db_close (mappath, entry->d_name); } closedir (directory); - } if (!found) { buildmap_fatal (0, "No maps found\n", mappath); --- 247,262 ---- roadmap_db_close (mappath, entry->d_name); + + /* Don't report stuff about files we're already done with */ + buildmap_set_source (NULL); } closedir (directory); } + + /* Call this again just in case we've fallen through the loop with a file + * name we have no intention of reading. */ + buildmap_set_source (NULL); + if (!found) { buildmap_fatal (0, "No maps found\n", mappath); *************** *** 194,197 **** --- 264,272 ---- } + /** + * @brief + * @param progpath + * @param msg + */ void usage(char *progpath, const char *msg) { *************** *** 211,214 **** --- 286,324 ---- } + /** + * @brief load all countries from the ISO list + */ + void roadmap_iso_create_all_countries(void) + { + int i; + static BuildMapDictionary state_dictionary; + static BuildMapDictionary county_dictionary; + RoadMapString state_symbol, state_name, dw; + char symbol[8]; + + state_dictionary = buildmap_dictionary_open ("state"); + county_dictionary = buildmap_dictionary_open ("county"); + dw = buildmap_dictionary_add(state_dictionary, "DW", 2); + for (i=0; IsoCountryCodeTable[i].name; i++) { + sprintf(symbol, "%s", IsoCountryCodeTable[i].alpha2); + state_symbol = buildmap_dictionary_add (state_dictionary, + IsoCountryCodeTable[i].alpha3, strlen(IsoCountryCodeTable[i].alpha3) + ); + state_name = buildmap_dictionary_add (state_dictionary, + IsoCountryCodeTable[i].name, strlen(IsoCountryCodeTable[i].name)); + if (state_symbol == 0 || state_name == 0) { + buildmap_fatal (0, "invalid state description"); + } + + buildus_county_add_state (state_name, state_symbol); + } + } + + /** + * @brief + * @param argc + * @param argv + * @return + */ int main (int argc, char **argv) { *************** *** 253,259 **** } ! buildus_fips_read (BuildMapTiger, BuildMapVerbose); buildus_scan_maps (); --- 363,372 ---- } ! /* US specific : read states and counties from *.txt files */ buildus_fips_read (BuildMapTiger, BuildMapVerbose); + /* ISO stuff */ + roadmap_iso_create_all_countries(); + buildus_scan_maps (); Index: buildus_county.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildus_county.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** buildus_county.c 2 Sep 2008 16:11:20 -0000 1.8 --- buildus_county.c 16 Oct 2008 19:38:45 -0000 1.9 *************** *** 1,2 **** --- 1,3 ---- + #undef VERBOSE /* * LICENSE: *************** *** 73,77 **** ! #define MAX_US_STATE 100 /** --- 74,84 ---- ! /* ! * This needs to be defined as a much larger number than 99 : ! * - there's not only the US states but the ISO countries too, ! * - there's code there that relies on the 'fips' (now 1000 + country code) ! * to fit in the array StateCode ! */ ! #define MAX_US_STATE 2000 /** *************** *** 79,85 **** */ typedef struct { ! RoadMapString name; /**< */ ! RoadMapString symbol; /**< */ ! RoadMapArea edges; /**< */ } BuildUsState; --- 86,92 ---- */ typedef struct { ! RoadMapString name; /**< */ ! RoadMapString symbol; /**< */ ! RoadMapArea edges; /**< */ } BuildUsState; *************** *** 117,125 **** /** ! * @brief Add a county to the tables ! * @param fips the US standard number to indicate this county ! * @param name the name of this county ! * @param state_symbol the state in which this county is ! * @return the internal representation (index into table) of this county */ int buildus_county_add --- 124,132 ---- /** ! * @brief ! * @param fips ! * @param name ! * @param state_symbol ! * @return */ int buildus_county_add *************** *** 131,134 **** --- 138,153 ---- RoadMapCounty *this_county; + #ifdef VERBOSE + static BuildMapDictionary county_dictionary; + static BuildMapDictionary BuildMapStateDictionary; + + county_dictionary = buildmap_dictionary_open ("county"); + BuildMapStateDictionary = buildmap_dictionary_open ("state"); + fprintf(stderr, "buildus_county_add(%d,", fips); + fprintf(stderr, " %s, %s)\n", + buildmap_dictionary_get(county_dictionary, name), + buildmap_dictionary_get(BuildMapStateDictionary, state_symbol)); + #endif + if (CountyByFips == NULL) buildus_county_initialize (); *************** *** 145,154 **** if (this_county->name != name) { ! BuildMapDictionary county_dictionary; ! county_dictionary = buildmap_dictionary_open ("county"); buildmap_fatal (0, "non unique county FIPS code %d (%s, %s)", ! fips, ! buildmap_dictionary_get(county_dictionary, name), ! buildmap_dictionary_get(county_dictionary, this_county->name)); } return index; --- 164,173 ---- if (this_county->name != name) { ! static BuildMapDictionary county_dictionary; ! county_dictionary = buildmap_dictionary_open ("county"); buildmap_fatal (0, "non unique county FIPS code %d (%s, %s)", ! fips, ! buildmap_dictionary_get(county_dictionary, name), ! buildmap_dictionary_get(county_dictionary, this_county->name)); } return index; *************** *** 203,214 **** } else if (State[StateCode[fips]].symbol != state_symbol) { ! BuildMapDictionary BuildMapStateDictionary; BuildMapStateDictionary = buildmap_dictionary_open ("state"); buildmap_fatal (0, "invalid state FIPS (fips %d, state %s), not %s", ! fips, ! buildmap_dictionary_get(BuildMapStateDictionary, state_symbol), ! buildmap_dictionary_get(BuildMapStateDictionary, ! State[StateCode[fips]].symbol)); } --- 222,234 ---- } else if (State[StateCode[fips]].symbol != state_symbol) { ! static BuildMapDictionary BuildMapStateDictionary; BuildMapStateDictionary = buildmap_dictionary_open ("state"); buildmap_fatal (0, "invalid state FIPS (fips %d, state %s), not %s", ! fips, ! buildmap_dictionary_get(BuildMapStateDictionary, ! state_symbol), ! buildmap_dictionary_get(BuildMapStateDictionary, ! State[StateCode[fips]].symbol)); } *************** *** 217,223 **** /** ! * @brief Add a US state ! * @param name the name of this state ! * @param symbol the standard two-character symbol representing this state */ void buildus_county_add_state (RoadMapString name, RoadMapString symbol) { --- 237,243 ---- /** ! * @brief ! * @param name ! * @param symbol */ void buildus_county_add_state (RoadMapString name, RoadMapString symbol) { *************** *** 226,229 **** --- 246,256 ---- RoadMapArea area_reset = {0, 0, 0, 0}; + #ifdef VERBOSE + BuildMapDictionary state_dictionary = buildmap_dictionary_open ("state"); + fprintf(stderr, "buildus_county_add_state(%s, %s)\n", + buildmap_dictionary_get(state_dictionary, name), + buildmap_dictionary_get(state_dictionary, symbol)); + #endif + if (CountyByFips == NULL) buildus_county_initialize (); *************** *** 235,245 **** if (State[i].name != name) { ! BuildMapDictionary state_dictionary; ! state_dictionary = buildmap_dictionary_open ("state"); buildmap_fatal (0, "state symbol conflict (%s %s %s)", ! buildmap_dictionary_get(state_dictionary, symbol), ! buildmap_dictionary_get(state_dictionary, State[i].name), ! buildmap_dictionary_get(state_dictionary, name)); } return; --- 262,272 ---- if (State[i].name != name) { ! static BuildMapDictionary state_dictionary; ! state_dictionary = buildmap_dictionary_open ("state"); buildmap_fatal (0, "state symbol conflict (%s %s %s)", ! buildmap_dictionary_get(state_dictionary, symbol), ! buildmap_dictionary_get(state_dictionary, State[i].name), ! buildmap_dictionary_get(state_dictionary, name)); } return; *************** *** 249,253 **** if (StateCount == MAX_US_STATE - 1) { ! buildmap_fatal(0, "Cannot add more than %d states", MAX_US_STATE); } --- 276,280 ---- if (StateCount == MAX_US_STATE - 1) { ! buildmap_fatal(0, "Cannot add more than %d states", MAX_US_STATE); } *************** *** 272,275 **** --- 299,310 ---- struct RoadMapCity *this_city; + #ifdef VERBOSE + + RoadMapDictionary cities; + cities = buildmap_dictionary_open ("city"); + fprintf(stderr, "buildus_county_add_city (%d, %d - %s)\n", + fips, city, buildmap_dictionary_get(cities, city)); + #endif + if (CountyByFips == NULL) buildus_county_initialize (); *************** *** 286,290 **** if (index < 0) { ! buildmap_fatal (0, "unknown county FIPS code %05d", fips); } --- 321,325 ---- if (index < 0) { ! buildmap_fatal (0, "unknown county FIPS code %05d (add_city)", fips); } *************** *** 321,324 **** --- 356,365 ---- RoadMapCounty *this_county; + buildmap_info ( "County %d geometry n %d s %d w %d e %d", + fips, + bounding_box->north, + bounding_box->south, + bounding_box->west, + bounding_box->east); for (index = roadmap_hash_get_first (CountyByFips, fips); *************** *** 360,364 **** if (index < 0) { ! buildmap_fatal (0, "unknown county FIPS code %05d", fips); } } --- 401,405 ---- if (index < 0) { ! buildmap_fatal (0, "unknown county FIPS code %05d (set_position)", fips); } } *************** *** 497,500 **** --- 538,542 ---- state_max = one_county->fips / 1000; + #if 1 if (state_max != StateMaxCode) { buildmap_fatal *************** *** 502,505 **** --- 544,550 ---- state_max, StateMaxCode); } + #else + state_max = StateMaxCode; + #endif root = buildmap_db_add_section (NULL, "county"); --- NEW FILE: roadmap_iso.h --- /* * LICENSE: * * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief Includes for list of country codes from ISO 3166/MA standard, and conversion functions. */ int roadmap_iso_alpha_to_num(char *alpha); void roadmap_iso_create_all_countries(void); int buildmap_osm_filename_iso(char *fn, char *country, char *division, char *suffix); int roadmap_iso_division_to_num(char *country, char *division); int buildmap_osm_filename_usc(char *fn, int *fips); /** * @brief structure for iso 3166-1 country codes */ typedef struct iso_country { char *name; /**< official country names */ int numeric; /**< numeric form of iso code */ char alpha3[4]; /**< alpha 3 form of iso code */ char alpha2[3]; /**< alpha 2 form of iso code */ } iso_country; extern struct iso_country IsoCountryCodeTable[]; Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** Makefile 8 Aug 2008 12:54:55 -0000 1.129 --- Makefile 16 Oct 2008 19:38:45 -0000 1.130 *************** *** 48,52 **** roadmap_gpx.c \ roadmap_linefont.c \ ! roadmap_lang.c RMLIBOBJS = $(RMLIBSRC:.c=.o) --- 48,53 ---- roadmap_gpx.c \ roadmap_linefont.c \ ! roadmap_lang.c \ ! roadmap_iso.c RMLIBOBJS = $(RMLIBSRC:.c=.o) *************** *** 207,210 **** --- 208,212 ---- buildmap_zip.h \ buildus_county.h \ + roadmap_iso.h \ buildus_fips.h --- NEW FILE: roadmap_iso.c --- /* * LICENSE: * * Copyright (c) 2008, Danny Backx * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * RoadMap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief List of country codes from ISO 3166/MA standard, and conversion functions. * * List obtained from http://en.wikipedia.org/wiki/ISO_3166-1 . */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include "buildmap.h" #include "buildus_county.h" #include "roadmap.h" #include "roadmap_iso.h" /** * @brief table for iso 3166-1 country codes * * This would be static but we need to access it from roadmap_iso_create_all_countries(), * and that function calls a bunch of buildmap_* functions so it would cause link "issues" * in RoadMap if it would be in this source file. */ struct iso_country IsoCountryCodeTable[] = { { "Afghanistan", 4, "AFG", "AF" }, { "à land Islands", 248, "ALA", "AX" }, { "Albania", 8, "ALB", "AL" }, { "Algeria", 12, "DZA", "DZ" }, { "American Samoa", 16, "ASM", "AS" }, { "Andorra", 20, "AND", "AD" }, { "Angola", 24, "AGO", "AO" }, { "Anguilla", 660, "AIA", "AI" }, { "Antarctica", 10, "ATA", "AQ" }, { "Antigua and Barbuda", 28, "ATG", "AG" }, { "Argentina", 32, "ARG", "AR" }, { "Armenia", 51, "ARM", "AM" }, { "Aruba", 533, "ABW", "AW" }, { "Australia", 36, "AUS", "AU" }, { "Austria", 40, "AUT", "AT" }, { "Azerbaijan", 31, "AZE", "AZ" }, { "Bahamas", 44, "BHS", "BS" }, { "Bahrain", 48, "BHR", "BH" }, { "Bangladesh", 50, "BGD", "BD" }, { "Barbados", 52, "BRB", "BB" }, { "Belarus", 112, "BLR", "BY" }, { "Belgium", 56, "BEL", "BE" }, { "Belize", 84, "BLZ", "BZ" }, { "Benin", 204, "BEN", "BJ" }, { "Bermuda", 60, "BMU", "BM" }, { "Bhutan", 64, "BTN", "BT" }, { "Bolivia", 68, "BOL", "BO" }, { "Bosnia and Herzegovina", 70, "BIH", "BA" }, { "Botswana", 72, "BWA", "BW" }, { "Norway Bouvet Island", 74, "BVT", "BV" }, { "Brazil", 76, "BRA", "BR" }, { "British Indian Ocean Territory", 86, "IOT", "IO" }, { "Brunei Darussalam", 96, "BRN", "BN" }, { "Bulgaria", 100, "BGR", "BG" }, { "Burkina Faso", 854, "BFA", "BF" }, { "Burundi", 108, "BDI", "BI" }, { "Cambodia", 116, "KHM", "KH" }, { "Cameroon", 120, "CMR", "CM" }, { "Canada", 124, "CAN", "CA" }, { "Cape Verde", 132, "CPV", "CV" }, { "Cayman Islands", 136, "CYM", "KY" }, { "Central African Republic", 140, "CAF", "CF" }, { "Chad", 148, "TCD", "TD" }, { "Chile", 152, "CHL", "CL" }, { "China", 156, "CHN", "CN" }, { "Christmas Island", 162, "CXR", "CX" }, { "Cocos (Keeling) Islands", 166, "CCK", "CC" }, { "Colombia", 170, "COL", "CO" }, { "Comoros", 174, "COM", "KM" }, { "Congo", 178, "COG", "CG" }, { "Democratic Republic of the Congo", 180, "COD", "CD" }, { "Cook Islands", 184, "COK", "CK" }, { "Costa Rica", 188, "CRI", "CR" }, { "Côte d'Ivoire", 384, "CIV", "CI" }, { "Croatia", 191, "HRV", "HR" }, { "Cuba", 192, "CUB", "CU" }, { "Cyprus", 196, "CYP", "CY" }, { "Czech Republic", 203, "CZE", "CZ" }, { "Denmark", 208, "DNK", "DK" }, { "Djibouti", 262, "DJI", "DJ" }, { "Dominica", 212, "DMA", "DM" }, { "Dominican Republic", 214, "DOM", "DO" }, { "Ecuador", 218, "ECU", "EC" }, { "Egypt", 818, "EGY", "EG" }, { "El Salvador", 222, "SLV", "SV" }, { "Equatorial Guinea", 226, "GNQ", "GQ" }, { "Eritrea", 232, "ERI", "ER" }, { "Estonia", 233, "EST", "EE" }, { "Ethiopia", 231, "ETH", "ET" }, { "Falkland Islands (Malvinas)", 238, "FLK", "FK" }, { "Faroe Islands", 234, "FRO", "FO" }, { "Fiji", 242, "FJI", "FJ" }, { "Finland", 246, "FIN", "FI" }, { "France", 250, "FRA", "FR" }, { "French Guiana", 254, "GUF", "GF" }, { "French Polynesia", 258, "PYF", "PF" }, { "French Southern Territories", 260, "ATF", "TF" }, { "Gabon", 266, "GAB", "GA" }, { "Gambia", 270, "GMB", "GM" }, { "Georgia", 268, "GEO", "GE" }, { "Germany", 276, "DEU", "DE" }, { "Ghana", 288, "GHA", "GH" }, { "Gibraltar", 292, "GIB", "GI" }, { "Greece", 300, "GRC", "GR" }, { "Greenland", 304, "GRL", "GL" }, { "Grenada", 308, "GRD", "GD" }, { "Guadeloupe", 312, "GLP", "GP" }, { "Guam", 316, "GUM", "GU" }, { "Guatemala", 320, "GTM", "GT" }, { "Guernsey", 831, "GGY", "GG" }, { "Guinea", 324, "GIN", "GN" }, { "Guinea-Bissau", 624, "GNB", "GW" }, { "Guyana", 328, "GUY", "GY" }, { "Haiti", 332, "HTI", "HT" }, { "Australia Heard Island and McDonald Islands", 334, "HMD", "HM" }, { "Vatican City State", 336, "VAT", "VA" }, { "Honduras", 340, "HND", "HN" }, { "Hong Kong", 344, "HKG", "HK" }, { "Hungary", 348, "HUN", "HU" }, { "Iceland", 352, "ISL", "IS" }, { "India", 356, "IND", "IN" }, { "Indonesia", 360, "IDN", "ID" }, { "Islamic Republic of Iran", 364, "IRN", "IR" }, { "Iraq", 368, "IRQ", "IQ" }, { "Ireland", 372, "IRL", "IE" }, { "Isle of Man", 833, "IMN", "IM" }, { "Israel", 376, "ISR", "IL" }, { "Italy", 380, "ITA", "IT" }, { "Jamaica", 388, "JAM", "JM" }, { "Japan", 392, "JPN", "JP" }, { "Jersey", 832, "JEY", "JE" }, { "Jordan", 400, "JOR", "JO" }, { "Kazakhstan", 398, "KAZ", "KZ" }, { "Kenya", 404, "KEN", "KE" }, { "Kiribati", 296, "KIR", "KI" }, { "Democratic People's Republic of Korea", 408, "PRK", "KP" }, { "Republic of Korea", 410, "KOR", "KR" }, { "Kuwait", 414, "KWT", "KW" }, { "Kyrgyzstan", 417, "KGZ", "KG" }, { "Lao People's Democratic Republic", 418, "LAO", "LA" }, { "Latvia", 428, "LVA", "LV" }, { "Lebanon", 422, "LBN", "LB" }, { "Lesotho", 426, "LSO", "LS" }, { "Liberia", 430, "LBR", "LR" }, { "Libyan Arab Jamahiriya", 434, "LBY", "LY" }, { "Liechtenstein", 438, "LIE", "LI" }, { "Lithuania", 440, "LTU", "LT" }, { "Luxembourg", 442, "LUX", "LU" }, { "Macao", 446, "MAC", "MO" }, { "Macedonia, the former Yugoslav Republic of", 807, "MKD", "MK" }, { "Madagascar", 450, "MDG", "MG" }, { "Malawi", 454, "MWI", "MW" }, { "Malaysia", 458, "MYS", "MY" }, { "Maldives", 462, "MDV", "MV" }, { "Mali", 466, "MLI", "ML" }, { "Malta", 470, "MLT", "MT" }, { "Marshall Islands", 584, "MHL", "MH" }, { "Martinique", 474, "MTQ", "MQ" }, { "Mauritania", 478, "MRT", "MR" }, { "Mauritius", 480, "MUS", "MU" }, { "Mayotte", 175, "MYT", "YT" }, { "Mexico", 484, "MEX", "MX" }, { "Federated States of Micronesia", 583, "FSM", "FM" }, { "Moldova", 498, "MDA", "MD" }, { "Monaco", 492, "MCO", "MC" }, { "Mongolia", 496, "MNG", "MN" }, { "Montenegro", 499, "MNE", "ME" }, { "Montserrat", 500, "MSR", "MS" }, { "Morocco", 504, "MAR", "MA" }, { "Mozambique", 508, "MOZ", "MZ" }, { "Myanmar", 104, "MMR", "MM" }, { "Namibia", 516, "NAM", "NA" }, { "Nauru", 520, "NRU", "NR" }, { "Nepal", 524, "NPL", "NP" }, { "Netherlands", 528, "NLD", "NL" }, { "Netherlands Antilles", 530, "ANT", "AN" }, { "New Caledonia", 540, "NCL", "NC" }, { "New Zealand", 554, "NZL", "NZ" }, { "Nicaragua", 558, "NIC", "NI" }, { "Niger", 562, "NER", "NE" }, { "Nigeria", 566, "NGA", "NG" }, { "Niue", 570, "NIU", "NU" }, { "Norfolk Island", 574, "NFK", "NF" }, { "Northern Mariana Islands", 580, "MNP", "MP" }, { "Norway", 578, "NOR", "NO" }, { "Oman", 512, "OMN", "OM" }, { "Pakistan", 586, "PAK", "PK" }, { "Palau", 585, "PLW", "PW" }, { "Occupied Palestinian Territory", 275, "PSE", "PS" }, { "Panama", 591, "PAN", "PA" }, { "Papua New Guinea", 598, "PNG", "PG" }, { "Paraguay", 600, "PRY", "PY" }, { "Peru", 604, "PER", "PE" }, { "Philippines", 608, "PHL", "PH" }, { "Pitcairn", 612, "PCN", "PN" }, { "Poland", 616, "POL", "PL" }, { "Portugal", 620, "PRT", "PT" }, { "Puerto Rico", 630, "PRI", "PR" }, { "Qatar", 634, "QAT", "QA" }, { "Réunion", 638, "REU", "RE" }, { "Romania", 642, "ROU", "RO" }, { "Russian Federation", 643, "RUS", "RU" }, { "Rwanda", 646, "RWA", "RW" }, { "Saint Barthélemy", 652, "BLM", "BL" }, { "Saint Helena", 654, "SHN", "SH" }, { "Saint Kitts and Nevis", 659, "KNA", "KN" }, { "Saint Lucia", 662, "LCA", "LC" }, { "Saint Martin (French part)", 663, "MAF", "MF" }, { "Saint Pierre and Miquelon", 666, "SPM", "PM" }, { "Saint Vincent and the Grenadines", 670, "VCT", "VC" }, { "Samoa", 882, "WSM", "WS" }, { "San Marino", 674, "SMR", "SM" }, { "Sao Tome and Principe", 678, "STP", "ST" }, { "Saudi Arabia", 682, "SAU", "SA" }, { "Senegal", 686, "SEN", "SN" }, { "Serbia", 688, "SRB", "RS" }, { "Seychelles", 690, "SYC", "SC" }, { "Sierra Leone", 694, "SLE", "SL" }, { "Singapore", 702, "SGP", "SG" }, { "Slovakia", 703, "SVK", "SK" }, { "Slovenia", 705, "SVN", "SI" }, { "Solomon Islands", 90, "SLB", "SB" }, { "Somalia", 706, "SOM", "SO" }, { "South Africa", 710, "ZAF", "ZA" }, { "South Georgia and the South Sandwich Islands", 239, "SGS", "GS" }, { "Spain", 724, "ESP", "ES" }, { "Sri Lanka", 144, "LKA", "LK" }, { "Sudan", 736, "SDN", "SD" }, { "Suriname", 740, "SUR", "SR" }, { "Norway Svalbard and Jan Mayen", 744, "SJM", "SJ" }, { "Swaziland", 748, "SWZ", "SZ" }, { "Sweden", 752, "SWE", "SE" }, { "Switzerland", 756, "CHE", "CH" }, { "Syrian Arab Republic", 760, "SYR", "SY" }, { "Taiwan, Province of China", 158, "TWN", "TW" }, { "Tajikistan", 762, "TJK", "TJ" }, { "United Republic of Tanzania", 834, "TZA", "TZ" }, { "Thailand", 764, "THA", "TH" }, { "Timor-Leste", 626, "TLS", "TL" }, { "Togo", 768, "TGO", "TG" }, { "Tokelau", 772, "TKL", "TK" }, { "Tonga", 776, "TON", "TO" }, { "Trinidad and Tobago", 780, "TTO", "TT" }, { "Tunisia", 788, "TUN", "TN" }, { "Turkey", 792, "TUR", "TR" }, { "Turkmenistan", 795, "TKM", "TM" }, { "Turks and Caicos Islands", 796, "TCA", "TC" }, { "Tuvalu", 798, "TUV", "TV" }, { "Uganda", 800, "UGA", "UG" }, { "Ukraine", 804, "UKR", "UA" }, { "United Arab Emirates", 784, "ARE", "AE" }, { "United Kingdom", 826, "GBR", "GB" }, { "United States", 840, "USA", "US" }, { "United States Minor Outlying Islands", 581, "UMI", "UM" }, { "Uruguay", 858, "URY", "UY" }, { "Uzbekistan", 860, "UZB", "UZ" }, { "Vanuatu", 548, "VUT", "VU" }, { "Venezuela", 862, "VEN", "VE" }, { "Viet Nam", 704, "VNM", "VN" }, { "British Virgin Islands", 92, "VGB", "VG" }, { "Virgin Islands, U.S.", 850, "VIR", "VI" }, { "Wallis and Futuna", 876, "WLF", "WF" }, { "Western Sahara", 732, "ESH", "EH" }, { "Yemen", 887, "YEM", "YE" }, { "Zambia", 894, "ZMB", "ZM" }, { "Zimbabwe", 716, "ZWE", "ZW" }, { 0, 0, " ", " " }, }; /** * @brief form a file name for the map for a given fips (actually an encoded country code) * @param buf is the buffer to put the file name in * @param fips the input parameter * * FIX ME maybe this function should build a list of possible file names instead of just one */ void roadmap_iso_mapfile_from_fips(char *buf, int fips) { int i, j; int country = (fips / 1000) % 1000; for (i=0; IsoCountryCodeTable[i].name; i++) if (IsoCountryCodeTable[i].numeric == country) { sprintf(buf, "iso-%s.rdm", IsoCountryCodeTable[i].alpha2); for (j=0; buf[j]; j++) buf[j] = tolower(buf[j]); return; } } /** * @brief decode an ISO map file name, figure out whether it's valid * @param fn a string containing the file name * @param country the country code is returned in this variable * @param division the country division code is returned in this variable * @param suffix the suffix (e.g. ".osm" for the file name) * @return whether this is a valid file name * * The return parameters must be allocated by the caller. * * Note : http://en.wikipedia.org/wiki/ISO_3166-2 describes country division codes. * Summary : ISO 3166-2 codes consist of two parts, separated by a hyphen. * The first part is the ISO 3166-1 alpha-2 code element, the second is * alphabetic or numeric and has one, two or three characters. * The second part often is based on national standards. */ int buildmap_osm_filename_iso(char *fn, char *country, char *division, char *suffix) { int n; char pattern[32]; sprintf(pattern, "iso-%%[a-zA-Z]-%%[a-zA-Z0-9]%s", suffix); n = sscanf(fn, pattern, country, division); if (strlen(country) != 2) return 0; if (n == 2) { if (strlen(division) > 3) { division[0] = '\0'; return 1; } return 2; } division[0] = '\0'; if (n == 1) return 1; country[0] = '\0'; return 0; } /** * @brief Translate a division code into a number in a simplistic way * @param country the country code is used to read a file containing divisions * @param division this string is looked for in the country division file * @return the numeric representation of this country division * * This function looks up the "division" in a file that is supposed to * contain stuff about the "country". * The file is named "iso-division-%s [.txt]", and contains one line * per entry, each line has a number (this is what we look for), * whitespace, and the division code. * Example : * 1 bru * * Note : http://en.wikipedia.org/wiki/ISO_3166-2 describes country division codes. * Summary : ISO 3166-2 codes consist of two parts, separated by a hyphen. * The first part is the ISO 3166-1 alpha-2 code element, the second is * alphabetic or numeric and has one, two or three characters. * The second part often is based on national standards. */ int roadmap_iso_division_to_num(char *country, char *division) { char mfn[20], div[16]; FILE *f; int num; sprintf(mfn, "iso-division-%s" _TXT, country); f = fopen(mfn, "r"); if (! f) { /* How to report errors here ? */ roadmap_log(ROADMAP_WARNING, "Cannot open %s", mfn); return 0; } while (! feof(f)) { if (fscanf(f, "%d %s", &num, div) != 2) continue; if (strcmp(div, division) == 0) { fclose(f); return num; } } fclose(f); return 0; } /** * @brief interpret a USC style file name for a RoadMap map * @param fn this string contains the map filename * @param fips return the FIPS number in this variable * @return whether this is a valid file name */ int buildmap_osm_filename_usc(char *fn, int *fips) { int n, f; n = sscanf(fn, "usc%d.rdm", &f); if (n != 1) return 0; if (fips) *fips = f; return 1; } /** * @brief convert 2 or 3 character ISO country code to the numeric code * @param alpha the ISO country code (either 2 or 3 character form) * @return the numeric ISO country code */ int roadmap_iso_alpha_to_num(char *alpha) { int i; for (i=0; IsoCountryCodeTable[i].numeric; i++) { if (strcasecmp(alpha, IsoCountryCodeTable[i].alpha2) == 0) { return IsoCountryCodeTable[i].numeric; } if (strcasecmp(alpha, IsoCountryCodeTable[i].alpha3) == 0) { return IsoCountryCodeTable[i].numeric; } } return 0; } Index: buildmap_osm_text.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** buildmap_osm_text.h 4 Aug 2008 17:44:07 -0000 1.1 --- buildmap_osm_text.h 16 Oct 2008 19:38:45 -0000 1.2 *************** *** 27,32 **** */ ! #define LINELEN 512 void buildmap_osm_text_find_layers (void); ! int buildmap_osm_text_read(FILE * fdata); --- 27,32 ---- */ ! #define LINELEN 2048 void buildmap_osm_text_find_layers (void); ! int buildmap_osm_text_read(FILE * fdata, int country_num, int division_num); Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** buildmap_osm_text.c 7 Sep 2008 15:54:04 -0000 1.2 --- buildmap_osm_text.c 16 Oct 2008 19:38:45 -0000 1.3 *************** *** 86,89 **** --- 86,91 ---- NodeLat; /**< coordinates */ + static int NodeFakeFips; /**< fake postal code */ + /** * @brief some global variables *************** *** 279,292 **** if (NodeTownName) { #if 0 ! int fips = 32999 * 10000 + NodePostalCode; ! #else ! static int fips = 32999 * 10000; ! fips++; #endif - int year = 2008; RoadMapString s = buildmap_dictionary_add (DictionaryCity, (char *) NodeTownName, strlen(NodeTownName)); ! buildmap_city_add(fips, year, s); } if (NodePostalCode) { --- 281,294 ---- if (NodeTownName) { + NodeFakeFips++; + // buildmap_verbose ("buildmap_osm_text_node_end: fake fips %d\n", NodeFakeFips); + int year = 2008; #if 0 ! buildmap_verbose("Node %d town %s, no postal code", ! NodeId, NodeTownName); #endif RoadMapString s = buildmap_dictionary_add (DictionaryCity, (char *) NodeTownName, strlen(NodeTownName)); ! buildmap_city_add(NodeFakeFips, year, s); } if (NodePostalCode) { *************** *** 691,695 **** */ int ! buildmap_osm_text_read(FILE * fdata) { int got; --- 693,697 ---- */ int ! buildmap_osm_text_read(FILE * fdata, int country_num, int division_num) { int got; *************** *** 699,702 **** --- 701,706 ---- time_t t0, t1, t2, t3; + NodeFakeFips = 1000000 + country_num * 1000 + division_num; + (void) time(&t0); *************** *** 728,732 **** continue; if (*p != '<') ! buildmap_fatal(0, "invalid XML"); p++; /* point to character after '<' now */ --- 732,736 ---- continue; if (*p != '<') ! buildmap_fatal(0, "invalid XML (line %d, %s)", LineNo, buf); p++; /* point to character after '<' now */ Index: buildmap_osm_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buildmap_osm_main.c 13 Sep 2008 20:56:06 -0000 1.10 --- buildmap_osm_main.c 16 Oct 2008 19:38:45 -0000 1.11 *************** *** 50,53 **** --- 50,54 ---- #include "roadmap_osm.h" + #include "roadmap_iso.h" int BuildMapNoLongLines; *************** *** 235,240 **** int buildmap_osm_text_process_file(char *fn) { ! int ret = 0; FILE *f; f = fopen(fn, "r"); --- 236,243 ---- int buildmap_osm_text_process_file(char *fn) { ! int n, ret = 0; FILE *f; + char country[6], division[6]; + int fips, country_num, division_num; f = fopen(fn, "r"); *************** *** 244,250 **** } ! buildmap_metadata_add_attribute ("Territory", "Id", "32000"); ! buildmap_metadata_add_attribute ("Territory", "Parent", "be"); ! buildmap_metadata_add_value ("Territory", "Parent", "Belgium"); buildmap_metadata_add_attribute ("Class", "Name", "All"); --- 247,266 ---- } ! if ((n = buildmap_osm_filename_iso(fn, country, division, ".osm"))) { ! buildmap_metadata_add_attribute ("Territory", "Id", country); ! buildmap_metadata_add_attribute ("Territory", "Parent", country); ! buildmap_metadata_add_value ("Territory", "Parent", country); ! ! country_num = roadmap_iso_alpha_to_num(country); ! if (n == 2) ! division_num = roadmap_iso_division_to_num(country, division); ! } else if (buildmap_osm_filename_usc(fn, &fips)) { ! /* ?? */ ! buildmap_metadata_add_attribute ("Territory", "Id", fn); ! buildmap_metadata_add_attribute ("Territory", "Parent", fn); ! buildmap_metadata_add_value ("Territory", "Parent", fn); ! } else { ! buildmap_fatal(0, "Invalid file name \"%s\" should be ISO or USC shape", fn); ! } buildmap_metadata_add_attribute ("Class", "Name", "All"); *************** *** 252,256 **** buildmap_osm_common_find_layers(); ! ret = buildmap_osm_text_read(f); if (fclose(f) != 0) { buildmap_error(0, "problem fetching data"); --- 268,272 ---- buildmap_osm_common_find_layers(); ! ret = buildmap_osm_text_read(f, country_num, division_num); if (fclose(f) != 0) { buildmap_error(0, "problem fetching data"); Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_locator.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** roadmap_locator.c 16 Sep 2008 16:27:53 -0000 1.28 --- roadmap_locator.c 16 Oct 2008 19:38:45 -0000 1.29 *************** *** 174,178 **** if (buf == NULL) buf = filename; ! if (fips < 0) { roadmap_osm_filename(buf, 1, fips); } else { --- 174,180 ---- if (buf == NULL) buf = filename; ! if (fips > 1000000) { ! roadmap_iso_mapfile_from_fips(buf, fips); ! } else if (fips < 0) { roadmap_osm_filename(buf, 1, fips); } else { |
|
From: Danny B. <dan...@us...> - 2008-10-08 18:24:03
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4445 Modified Files: buildmap_messages.c Log Message: Add documentation, mostly stubs though. Get buildmap_set_source to accept a NULL parameter, the other code could cope with it already. Index: buildmap_messages.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_messages.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildmap_messages.c 3 Dec 2007 18:29:04 -0000 1.6 --- buildmap_messages.c 8 Oct 2008 18:23:57 -0000 1.7 *************** *** 1,7 **** ! /* buildmap_messages.c - a module for managing uniform error & info messages. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,38 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * void buildmap_set_source (char *name); ! * void buildmap_set_line (int line); ! * void buildmap_error (int column, char *format, ...); ! * void buildmap_fatal (int column, char *format, ...); ! * void buildmap_progress (int done, int estimated); ! * void buildmap_info (char *format, ...); ! * void buildmap_summary (int verbose, char *format, ...); ! * void buildmap_verbose (char *format, ...); ! * void buildmap_is_verbose (void); ! * int buildmap_get_error_count (void); ! * int buildmap_get_error_total (void); ! * void buildmap_message_level (int); * * This module is used to control and manage the appearance of messages --- 20,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! /** ! * @file ! * @brief a module for managing uniform error & info messages. * * This module is used to control and manage the appearance of messages *************** *** 67,81 **** BuildMapMessageLevel += level; if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); } ! void buildmap_set_source (const char *name) { const char *p; /* Get the file's base name (for error display purpose). */ - p = strrchr (name, '/'); --- 56,80 ---- BuildMapMessageLevel += level; + #ifndef _WIN32 if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); + #endif } ! /** ! * @brief set the name of the file we're processing, to be used in error reporting ! * @param name the file name, or NULL to erase previous setting ! */ void buildmap_set_source (const char *name) { const char *p; + if (name == NULL) { + if (SourceFile) + free(SourceFile); + SourceFile = NULL; + return; + } /* Get the file's base name (for error display purpose). */ p = strrchr (name, '/'); *************** *** 95,98 **** --- 94,101 ---- } + /** + * @brief indicate which line number we're processing + * @param line the number + */ void buildmap_set_line (int line) { *************** *** 100,104 **** } ! static void buildmap_show_source (FILE *output, const char *preamble, int column) { --- 103,112 ---- } ! /** ! * @brief ! * @param output ! * @param preamble ! * @param column ! */ static void buildmap_show_source (FILE *output, const char *preamble, int column) { *************** *** 119,123 **** } ! void buildmap_error (int column, const char *format, ...) { --- 127,135 ---- } ! /** ! * @brief print an error message ! * @param column ! * @param format ! */ void buildmap_error (int column, const char *format, ...) { *************** *** 154,158 **** } ! void buildmap_fatal (int column, const char *format, ...) { --- 166,174 ---- } ! /** ! * @brief print an error message and terminate the application ! * @param column ! * @param format ! */ void buildmap_fatal (int column, const char *format, ...) { *************** *** 186,190 **** } ! void buildmap_progress (int done, int estimated) { --- 202,210 ---- } ! /** ! * @brief ! * @param done ! * @param estimated ! */ void buildmap_progress (int done, int estimated) { *************** *** 202,206 **** } ! void buildmap_info (const char *format, ...) { --- 222,229 ---- } ! /** ! * @brief print an informational message ! * @param format ! */ void buildmap_info (const char *format, ...) { *************** *** 220,223 **** --- 243,250 ---- } + /** + * @brief + * @return + */ int buildmap_is_verbose (void) { *************** *** 225,228 **** --- 252,259 ---- } + /** + * @brief + * @param format + */ void buildmap_verbose (const char *format, ...) { *************** *** 239,243 **** } ! void buildmap_summary (int verbose, const char *format, ...) { --- 270,278 ---- } ! /** ! * @brief ! * @param verbose ! * @param format ! */ void buildmap_summary (int verbose, const char *format, ...) { *************** *** 275,289 **** } ! int buildmap_get_error_count (void) { return ErrorCount; } ! int buildmap_get_error_total (void) { return ErrorTotal; } ! void buildmap_check_allocated_with_source_line (char *source, int line, const void *allocated) { --- 310,335 ---- } ! /** ! * @brief ! * @return ! */ int buildmap_get_error_count (void) { return ErrorCount; } ! /** ! * @brief ! * @return ! */ int buildmap_get_error_total (void) { return ErrorTotal; } ! /** ! * @brief ! * @param source ! * @param line ! * @param allocated ! */ void buildmap_check_allocated_with_source_line (char *source, int line, const void *allocated) { |
|
From: Paul F. <pg...@us...> - 2008-10-07 19:46:08
|
Update of /cvsroot/roadmap/roadmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16710 Modified Files: README Log Message: make the action of the arrow keys (how far the map moves) configurable, with "Map.Panning Percent" Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** README 13 Sep 2008 20:55:01 -0000 1.157 --- README 7 Oct 2008 19:45:58 -0000 1.158 *************** *** 2548,2551 **** --- 2548,2560 ---- screen. Can be toggled by command as well. + [Map.Panning Percent] How far an arrow key will move the map view + + <<Format:>> integer + + <<Default:>> 25 + + <<Comment:>> Percentage (of the smaller or width or height) by + which the map will pan when an arrow key is used. + [Map.GPS map offset latitude] Allows tuning of GPS latitude results. |
|
From: Paul F. <pg...@us...> - 2008-10-07 19:46:07
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16710/src Modified Files: roadmap_screen.c Log Message: make the action of the arrow keys (how far the map moves) configurable, with "Map.Panning Percent" Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** roadmap_screen.c 7 Oct 2008 00:42:20 -0000 1.132 --- roadmap_screen.c 7 Oct 2008 19:45:59 -0000 1.133 *************** *** 75,78 **** --- 75,81 ---- ROADMAP_CONFIG_ITEM("Accuracy", "Mouse"); + static RoadMapConfigDescriptor RoadMapConfigMapPanningPercent = + ROADMAP_CONFIG_ITEM("Map", "Panning Percent"); + static RoadMapConfigDescriptor RoadMapConfigMapBackground = ROADMAP_CONFIG_ITEM("Map", "Background"); *************** *** 1946,1979 **** } ! #define FRACMOVE 4 ! // #define FRACMOVE 100 // tiny moves: useful for debug ! void roadmap_screen_move_up (void) { ! roadmap_screen_record_move (0, 0 - (RoadMapScreenHeight / FRACMOVE)); ! roadmap_start_request_repaint_map(REPAINT_NOW); ! } ! void roadmap_screen_move_down (void) { ! roadmap_screen_record_move (0, RoadMapScreenHeight / FRACMOVE); roadmap_start_request_repaint_map(REPAINT_NOW); } ! ! void roadmap_screen_move_right (void) { ! ! roadmap_screen_record_move (RoadMapScreenHeight / FRACMOVE, 0); ! roadmap_start_request_repaint_map(REPAINT_NOW); } void roadmap_screen_move_left (void) { ! ! roadmap_screen_record_move (0 - (RoadMapScreenHeight / FRACMOVE), 0); ! roadmap_start_request_repaint_map(REPAINT_NOW); } void roadmap_screen_zoom_in (void) { --- 1949,1992 ---- } ! #define MIN(a, b) (a) < (b) ? (a) : (b) ! enum { MOVE_UP, MOVE_DOWN, MOVE_LEFT, MOVE_RIGHT }; ! static void roadmap_screen_move (int dir) { + int mindim = MIN(RoadMapScreenHeight, RoadMapScreenWidth); + int percent = roadmap_config_get_integer (&RoadMapConfigMapPanningPercent); ! switch(dir) { ! case MOVE_UP: ! percent = -percent; ! case MOVE_DOWN: ! roadmap_screen_record_move (0, percent * mindim / 100); ! break; ! case MOVE_LEFT: ! percent = -percent; ! case MOVE_RIGHT: ! roadmap_screen_record_move (percent * mindim / 100, 0); ! break; ! } roadmap_start_request_repaint_map(REPAINT_NOW); } ! void roadmap_screen_move_up (void) { ! roadmap_screen_move(MOVE_UP); } + void roadmap_screen_move_down (void) { + roadmap_screen_move(MOVE_DOWN); + } void roadmap_screen_move_left (void) { ! roadmap_screen_move(MOVE_LEFT); } + void roadmap_screen_move_right (void) { + roadmap_screen_move(MOVE_RIGHT); + } void roadmap_screen_zoom_in (void) { *************** *** 2053,2056 **** --- 2066,2072 ---- roadmap_config_declare + ("preferences", &RoadMapConfigMapPanningPercent , "25"); + + roadmap_config_declare ("preferences", &RoadMapConfigMapBackground, "LightYellow"); |
|
From: Paul F. <pg...@us...> - 2008-10-07 14:52:24
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv18184 Modified Files: roadmap_label.c Log Message: fix uninitialized font size (alessandro briosi) Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** roadmap_label.c 7 Oct 2008 00:42:20 -0000 1.32 --- roadmap_label.c 7 Oct 2008 14:48:26 -0000 1.33 *************** *** 221,225 **** int doing_angles, int angle, RoadMapPen pen) { ! int size; #else void roadmap_label_draw_text(const char *text, --- 221,225 ---- int doing_angles, int angle, RoadMapPen pen) { ! int size = RoadMapLabelFontSize; #else void roadmap_label_draw_text(const char *text, |
|
From: Paul F. <pg...@us...> - 2008-10-07 02:17:01
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10786 Modified Files: roadmap_log.c Log Message: fix an undefined return value, and simplify the exit path for fatal log errors. Index: roadmap_log.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_log.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** roadmap_log.c 19 Sep 2008 16:21:40 -0000 1.24 --- roadmap_log.c 7 Oct 2008 01:12:47 -0000 1.25 *************** *** 163,167 **** } ! static int roadmap_redirect_one (struct roadmap_message_descriptor *category, const char *format, va_list ap) { --- 163,167 ---- } ! static void roadmap_redirect_one (struct roadmap_message_descriptor *category, const char *format, va_list ap) { *************** *** 227,237 **** roadmap_log_one (category, stderr, saved, source, line, format, ap); ! /* for now, assume that if someone has put in a redirect for fatal ! * errors, that they'll also take care of terminating. ! * (this is only necessary currently for gtk, which doesn't really run ! * its dialog synchronously, and if we exit here, we'll never see it.) */ ! if (!roadmap_redirect_one (category, format, ap)) { ! if (category->do_exit) exit(1); } --- 227,240 ---- roadmap_log_one (category, stderr, saved, source, line, format, ap); ! ! roadmap_redirect_one (category, format, ap); ! ! /* for now, assume that if someone has put in a redirect for ! * fatal errors, that they'll also take care of terminating. ! * (this is only necessary currently for gtk, which doesn't ! * really run its dialog synchronously, and if we exit here, ! * we'll never see it.) */ ! if (category->do_exit && !category->redirect) { exit(1); } |
|
From: Paul F. <pg...@us...> - 2008-10-07 01:30:11
|
Update of /cvsroot/roadmap/roadmap/src/qt4 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9958/qt4 Modified Files: qt_canvas.cc qt_canvas.h roadmap_canvas.cc Log Message: from Alessandro Briosi: > > finally had some time to clean up and "reimplement" the ADVANCED_STYLE > patches. > > part 2. roadmap_advanced_style.patch which adds all the additional > definitions (based on patch 1) to be loaded. > The only implementation available right now is qt4, I have added all the > "stubs" functions as in previous patch. > Index: roadmap_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt4/roadmap_canvas.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_canvas.cc 21 Mar 2008 23:09:00 -0000 1.2 --- roadmap_canvas.cc 7 Oct 2008 00:42:21 -0000 1.3 *************** *** 86,89 **** --- 86,92 ---- int *width, int *ascent, int *descent, int *can_tilt) { + #if !defined(ROADMAP_ADVANCED_STYLE) + roadMapCanvas->setFontSize(size); + #endif roadMapCanvas->getTextExtents(text, width, ascent, descent, can_tilt); } *************** *** 119,126 **** --- 122,284 ---- } + #if defined(ROADMAP_ADVANCED_STYLE) + int roadmap_canvas_get_thickness (RoadMapPen pen) { + return roadMapCanvas->getPenThickness(pen); + } + + void roadmap_canvas_set_opacity (int opacity) { + roadMapCanvas->setPenOpacity(opacity); + roadMapCanvas->setBrushOpacity(opacity); + } + + void roadmap_canvas_lighter (int factor) { + roadMapCanvas->setPenLighter(factor); + } + + void roadmap_canvas_darker (int factor) { + roadMapCanvas->setPenDarker(factor); + } + + void roadmap_canvas_set_linejoin(const char *join) { + if (strcasecmp(join,"Miter")==0) { + roadMapCanvas->setPenLineJoinStyle(0); + } else if (strcasecmp(join,"Bevel")==0) { + roadMapCanvas->setPenLineJoinStyle(0x40); + } else if (strcasecmp(join,"Round")==0) { + roadMapCanvas->setPenLineJoinStyle(0x80); + } else if (strcasecmp(join,"Svg")==0) { + roadMapCanvas->setPenLineJoinStyle(0x100); + } + } + + void roadmap_canvas_set_linecap(const char *cap) { + if (strcasecmp(cap,"Flat")==0) { + roadMapCanvas->setPenLineCapStyle(0); + } else if (strcasecmp(cap,"Square")==0) { + roadMapCanvas->setPenLineCapStyle(0x10); + } else if (strcasecmp(cap,"Round")==0) { + roadMapCanvas->setPenLineCapStyle(0x20); + } + } + + + void roadmap_canvas_set_brush_color(const char *color) { + roadMapCanvas->setBrushColor(color); + } + + void roadmap_canvas_set_brush_style(const char *style) { + if (strcasecmp(style,"Blank")==0) { + roadMapCanvas->setBrushStyle(0); + } else if (strcasecmp(style,"Solid")==0) { + roadMapCanvas->setBrushStyle(1); + } else if (strcasecmp(style,"Dense1")==0) { + roadMapCanvas->setBrushStyle(2); + } else if (strcasecmp(style,"Dense2")==0) { + roadMapCanvas->setBrushStyle(3); + } else if (strcasecmp(style,"Dense3")==0) { + roadMapCanvas->setBrushStyle(4); + } else if (strcasecmp(style,"Dense4")==0) { + roadMapCanvas->setBrushStyle(5); + } else if (strcasecmp(style,"Dense5")==0) { + roadMapCanvas->setBrushStyle(6); + } else if (strcasecmp(style,"Dense6")==0) { + roadMapCanvas->setBrushStyle(7); + } else if (strcasecmp(style,"Dense7")==0) { + roadMapCanvas->setBrushStyle(8); + } else if (strcasecmp(style,"Horizontal")==0) { + roadMapCanvas->setBrushStyle(9); + } else if (strcasecmp(style,"Vertical")==0) { + roadMapCanvas->setBrushStyle(10); + } else if (strcasecmp(style,"Cross")==0) { + roadMapCanvas->setBrushStyle(11); + } else if (strcasecmp(style,"BDiagonal")==0) { + roadMapCanvas->setBrushStyle(12); + } else if (strcasecmp(style,"FDiagonal")==0) { + roadMapCanvas->setBrushStyle(13); + } else if (strcasecmp(style,"CrossDiag")==0) { + roadMapCanvas->setBrushStyle(14); + } else if (strcasecmp(style,"LinearGradient")==0) { + //roadMapCanvas->setBrushStyle(15); + } else if (strcasecmp(style,"CanonicalGradient")==0) { + //roadMapCanvas->setBrushStyle(17); + } else if (strcasecmp(style,"RadialGradient")==0) { + //roadMapCanvas->setBrushStyle(16); + } else if (strcasecmp(style,"Texture")==0) { + // roadMapCanvas->setBrushStyle(24); + } + } + + void roadmap_canvas_set_label_font_name(const char *name) { + roadMapCanvas->setFontName(name); + } + + void roadmap_canvas_set_label_font_color(const char *color) { + roadMapCanvas->setFontColor(color); + } + + void roadmap_canvas_set_label_font_size(int size) { + roadMapCanvas->setFontSize(size); + } + + void roadmap_canvas_set_label_font_style(int style) { + + if (style & 1) { + roadMapCanvas->setFontItalic(1); + } + if (style & 2) { + roadMapCanvas->setFontStrikeOut(1); + } + if (style & 4) { + roadMapCanvas->setFontUnderline(1); + } + if (style & 8) { + roadMapCanvas->setFontCapitalize(1); + } + } + + void roadmap_canvas_set_label_font_spacing(int spacing) { + if (spacing<0 || spacing>99) return; + roadMapCanvas->setFontSpacing(spacing); + } + + void roadmap_canvas_set_label_font_weight(const char *weight) { + if (strcasecmp(weight,"Light")==0) { + roadMapCanvas->setFontWeight(25); + } else if (strcasecmp(weight,"Normal")==0) { + roadMapCanvas->setFontWeight(50); + } else if (strcasecmp(weight,"DemiBold")==0) { + roadMapCanvas->setFontWeight(61); + } else if (strcasecmp(weight,"Bold")==0) { + roadMapCanvas->setFontWeight(75); + } else if (strcasecmp(weight,"Black")==0) { + roadMapCanvas->setFontWeight(87); + } + } + + void roadmap_canvas_set_brush_isbackground(int is_background) { + roadMapCanvas->setBrushAsBackground(is_background); + } + + void roadmap_canvas_set_label_buffer_color(const char *color) { + roadMapCanvas->setFontBufferColor(color); + } + + void roadmap_canvas_set_label_buffer_size(int size) { + roadMapCanvas->setFontBufferSize(size); + } + + int roadmap_canvas_get_label_buffer_size(RoadMapPen pen) { + return roadMapCanvas->getFontBufferSize(pen); + } + + #endif /* ROADMAP_ADVANCED_STYLE */ + void roadmap_canvas_draw_string(RoadMapGuiPoint *position, int corner, int size, const char *text) { + #if !defined(ROADMAP_ADVANCED_STYLE) + roadMapCanvas->setFontSize(size); + #endif roadMapCanvas->drawString(position, corner, text); } *************** *** 130,133 **** --- 288,295 ---- int angle, const char *text) { + + #if !defined(ROADMAP_ADVANCED_STYLE) + roadMapCanvas->setFontSize(size); + #endif roadMapCanvas->drawStringAngle(position, 0, text, angle); } *************** *** 140,144 **** RoadMapGuiPoint *points, int fast_draw) { ! roadMapCanvas->drawMultipleLines(count, lines, points); } --- 302,306 ---- RoadMapGuiPoint *points, int fast_draw) { ! roadMapCanvas->drawMultipleLines(count, lines, points, fast_draw); } *************** *** 146,150 **** RoadMapGuiPoint *points, int filled, int fast_draw) { ! roadMapCanvas->drawMultiplePolygons(count, polygons, points, filled); } --- 308,313 ---- RoadMapGuiPoint *points, int filled, int fast_draw) { ! roadMapCanvas->drawMultiplePolygons(count, polygons, points, ! filled, fast_draw); } *************** *** 152,156 **** int *radius, int filled, int fast_draw) { ! roadMapCanvas->drawMultipleCircles(count, centers, radius, filled); } --- 315,320 ---- int *radius, int filled, int fast_draw) { ! roadMapCanvas->drawMultipleCircles(count, centers, radius, ! filled, fast_draw); } Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt4/qt_canvas.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** qt_canvas.cc 21 Mar 2008 23:09:00 -0000 1.4 --- qt_canvas.cc 7 Oct 2008 00:42:21 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- #include <qpainter.h> #include "qt_canvas.h" + #include <qdebug.h> *************** *** 45,48 **** --- 46,51 ---- currentPen = 0; roadMapCanvas = this; + basePen = createPen("stubPen"); + setPenThickness(2); /* turn off the default double-buffering */ *************** *** 74,84 **** if (p == 0) { - QPen* pen = new QPen(Qt::SolidLine/*Qt::DotLine*/); p = new roadmap_canvas_pen(); p->pen = pen; pens.insert(name, p); } ! currentPen = p->pen; return p; --- 77,98 ---- if (p == 0) { p = new roadmap_canvas_pen(); + QPen* pen = new QPen(Qt::SolidLine/*Qt::DotLine*/); p->pen = pen; + p->font = new QFont("Arial",12); + #if defined(ROADMAP_ADVANCED_STYLE) + p->brush = new QBrush(); + p->fontcolor = new QColor("#000000"); + p->capitalize = 0; + p->background = 0; + p->buffersize = 0; + p->buffercolor = new QColor("#ffffff"); + p->pen->setJoinStyle(Qt::RoundJoin); + p->pen->setCapStyle(Qt::RoundCap); + #endif pens.insert(name, p); } ! currentPen = p; return p; *************** *** 86,95 **** void RMapCanvas::selectPen(RoadMapPen p) { ! currentPen = p->pen; } void RMapCanvas::setPenColor(const char* color) { if (currentPen != 0) { ! currentPen->setColor(getColor(color)); } --- 100,111 ---- void RMapCanvas::selectPen(RoadMapPen p) { ! currentPen = p; } void RMapCanvas::setPenColor(const char* color) { if (currentPen != 0) { ! int opacity = currentPen->pen->color().alpha(); ! currentPen->pen->setColor(getColor(color)); ! currentPen->pen->color().setAlpha(opacity); } *************** *** 97,127 **** void RMapCanvas::setPenLineStyle(const char* style) { if (currentPen != 0) { ! if (strcasecmp (style, "dashed") == 0) { ! currentPen->setStyle(Qt::DashLine); ! } else { ! currentPen->setStyle(Qt::SolidLine); ! } } } ! void RMapCanvas::setPenThickness(int thickness) { ! if (currentPen != 0) { ! currentPen->setWidth(thickness); } } void RMapCanvas::erase() { if (pixmap) { ! pixmap->fill(currentPen->color()); } } void RMapCanvas::getTextExtents(const char* text, int* w, int* ascent, int* descent, int *can_tilt) { ! QFont f("Arial Bold",10); ! QFontMetrics fm(f); QRect r = fm.boundingRect(QString::fromUtf8(text)); --- 113,325 ---- void RMapCanvas::setPenLineStyle(const char* style) { + if (currentPen != 0) { + if (strcasecmp(style,"blank")==0) { + currentPen->pen->setStyle((Qt::PenStyle)0); + } else if (strcasecmp(style,"solid")==0) { + currentPen->pen->setStyle((Qt::PenStyle)1); + } else if (strcasecmp(style,"dashed")==0) { + currentPen->pen->setStyle((Qt::PenStyle)2); + } else if (strcasecmp(style,"dot")==0) { + currentPen->pen->setStyle((Qt::PenStyle)3); + } else if (strcasecmp(style,"dashdot")==0) { + currentPen->pen->setStyle((Qt::PenStyle)4); + } else if (strcasecmp(style,"dashdotdot")==0) { + currentPen->pen->setStyle((Qt::PenStyle)5); + } + } + } + + void RMapCanvas::setPenThickness(int thickness) { if (currentPen != 0) { ! currentPen->pen->setWidth(thickness); } + } + void RMapCanvas::setFontSize(int size) { + if (currentPen != 0) { + currentPen->font->setPointSize(size); + } } ! #if defined(ROADMAP_ADVANCED_STYLE) ! int RMapCanvas::getPenThickness(RoadMapPen p) { ! if (p != 0) { ! return (int) p->pen->width(); } + return 1; + } + + void RMapCanvas::setPenOpacity(int opacity) { + + if (currentPen != 0) { + QColor c(currentPen->pen->color().rgb()); + + c.setAlpha(opacity); + currentPen->pen->setColor(c); + + } } + void RMapCanvas::setPenLighter(int factor) { + + if (currentPen != 0) { + QColor c(currentPen->pen->color().light(factor)); + + currentPen->pen->setColor(c); + } + } + + void RMapCanvas::setPenDarker(int factor) { + + if (currentPen != 0) { + QColor c(currentPen->pen->color().dark(factor)); + + currentPen->pen->setColor(c); + } + } + + void RMapCanvas::setPenLineCapStyle(int cap) { + if (currentPen != 0) { + currentPen->pen->setCapStyle((Qt::PenCapStyle)cap); + } + } + + void RMapCanvas::setPenLineJoinStyle(int join) { + if (currentPen != 0) { + currentPen->pen->setJoinStyle((Qt::PenJoinStyle)join); + } + } + + void RMapCanvas::setBrushColor(const char *color) { + if (currentPen != 0) { + int opacity = currentPen->brush->color().alpha(); + QColor c(color); + c.setAlpha(opacity); + currentPen->brush->setColor(color); + if (currentPen->brush->style()==Qt::NoBrush) + currentPen->brush->setStyle(Qt::SolidPattern); + } + } + + void RMapCanvas::setBrushStyle(int style) { + if (currentPen != 0) { + currentPen->brush->setStyle((Qt::BrushStyle)style); + } + } + + void RMapCanvas::setBrushOpacity(int opacity) { + if (currentPen != 0) { + QColor c(currentPen->brush->color().rgb()); + c.setAlpha(opacity); + currentPen->brush->setColor(c); + } + } + + + void RMapCanvas::setFontName(const char *name) { + if (currentPen != 0) { + currentPen->font->setFamily(name); + QFont f(*currentPen->font); + if (!f.exactMatch()) { + qWarning("font family: <%s> match not found",f.family().trimmed().toUtf8().constData()); + } + } + } + + void RMapCanvas::setFontColor(const char *color) { + if (currentPen != 0) { + currentPen->fontcolor = new QColor(color); + } + } + + void RMapCanvas::setFontWeight(int weight) { + if (currentPen != 0) { + currentPen->font->setWeight(weight); + } + } + + void RMapCanvas::setFontSpacing(int spacing) { + if (currentPen != 0) { + currentPen->font->setStretch(spacing); + } + } + + void RMapCanvas::setFontItalic(int italic) { + if (currentPen != 0) { + currentPen->font->setItalic(italic); + } + } + + void RMapCanvas::setFontStrikeOut(int strikeout) { + if (currentPen != 0) { + currentPen->font->setStrikeOut(strikeout); + } + } + + void RMapCanvas::setFontUnderline(int underline) { + if (currentPen != 0) { + currentPen->font->setUnderline(underline); + } + } + + void RMapCanvas::setFontCapitalize(int capitalize) { + if (currentPen != 0) { + currentPen->capitalize = capitalize; + } + } + + void RMapCanvas::setBrushAsBackground(int background) { + if (currentPen != 0) { + currentPen->background = background; + } + } + + void RMapCanvas::setFontBufferColor(const char *color) { + if (currentPen != 0) { + currentPen->buffercolor = new QColor(color); + } + } + + void RMapCanvas::setFontBufferSize(int size) { + if (currentPen != 0) { + currentPen->buffersize = size; + } + } + + int RMapCanvas::getFontBufferSize(RoadMapPen pen) { + return pen->buffersize; + } + #endif /* ROADMAP_ADVANCED_STYLE */ + void RMapCanvas::erase() { if (pixmap) { ! pixmap->fill(currentPen->pen->color()); } } + void RMapCanvas::setupPainterPen(QPainter &p) { + + p.setPen(*currentPen->pen); + p.setFont(*currentPen->font); + #if defined(ROADMAP_ADVENCED_STYLE) + if (currentPen->background) { + p.setBackground(*currentPen->brush); + p.setBackgroundMode(Qt::OpaqueMode); + } else { + p.setBrush(*currentPen->brush); + } + #endif + } + + void RMapCanvas::getTextExtents(const char* text, int* w, int* ascent, int* descent, int *can_tilt) { ! #if defined(ROADMAP_ADVANCED_STYLE) ! QFontMetrics fm(*currentPen->font); ! #else ! QFontMetrics fm(*currentPen->font); ! #endif ! QRect r = fm.boundingRect(QString::fromUtf8(text)); *************** *** 145,152 **** QPainter p(pixmap); if (currentPen != 0) { ! p.setPen(*currentPen); } - QFont f("Arial Bold",10); - p.setFont(f); int text_width; --- 343,348 ---- QPainter p(pixmap); if (currentPen != 0) { ! setupPainterPen(p); } int text_width; *************** *** 171,174 **** --- 367,389 ---- y += text_ascent; + #if defined(ROADMAP_ADVANCED_STYLE) + if (currentPen != 0) { + /* draw the buffer */ + if (currentPen->buffersize!=0) { + QPen pen(p.pen()); + pen.setColor(*currentPen->buffercolor); + p.setPen(pen); + for (int i = x-currentPen->buffersize; + i <= x+currentPen->buffersize; i++) + for (int j = y-currentPen->buffersize; + j <= y+currentPen->buffersize; j++) + p.drawText(i, j, QString::fromUtf8(text)); + } + QPen pen(p.pen()); + pen.setColor(*currentPen->fontcolor); + p.setPen(pen); + } + #endif + p.drawText(x, y, QString::fromUtf8(text)); } *************** *** 183,191 **** QPainter p(pixmap); if (currentPen != 0) { ! p.setPen(*currentPen); } - QFont f("Arial Bold",10); - int text_width; int text_ascent; --- 398,404 ---- QPainter p(pixmap); if (currentPen != 0) { ! setupPainterPen(p); } int text_width; int text_ascent; *************** *** 193,199 **** getTextExtents(text, &text_width, &text_ascent, &text_descent, NULL); - p.setFont(f); p.translate(position->x,position->y); p.rotate((double)angle); p.drawText(-text_width/2, -text_descent, QString::fromUtf8(text)); #endif --- 406,430 ---- getTextExtents(text, &text_width, &text_ascent, &text_descent, NULL); p.translate(position->x,position->y); p.rotate((double)angle); + + #if defined(ROADMAP_ADVANCED_STYLE) + if (currentPen != 0) { + if (currentPen->buffersize!=0) { + QPen pen(p.pen()); + pen.setColor(*currentPen->buffercolor); + p.setPen(pen); + for (int i = 0-currentPen->buffersize; i <= currentPen->buffersize; i++) + for (int j = 0-currentPen->buffersize; j <= currentPen->buffersize; j++ + ) + p.drawText((-text_width/2)+i, j-text_descent, QString::fromUtf8(text) + ); + } + QPen pen(p.pen()); + pen.setColor(*currentPen->fontcolor); + p.setPen(pen); + } + #endif /* ROADMAP_ADVANCED_STYLE */ + p.drawText(-text_width/2, -text_descent, QString::fromUtf8(text)); #endif *************** *** 203,207 **** QPainter p(pixmap); if (currentPen != 0) { ! p.setPen(*currentPen); } --- 434,438 ---- QPainter p(pixmap); if (currentPen != 0) { ! setupPainterPen(p); } *************** *** 214,221 **** } ! void RMapCanvas::drawMultipleLines(int count, int* lines, RoadMapGuiPoint* points) { QPainter p(pixmap); if (currentPen != 0) { ! p.setPen(*currentPen); } --- 445,458 ---- } ! void RMapCanvas::drawMultipleLines(int count, int* lines, ! RoadMapGuiPoint* points, int fast_draw) { QPainter p(pixmap); if (currentPen != 0) { ! if (fast_draw) { ! basePen->pen->setColor(currentPen->pen->color()); ! p.setPen(*basePen->pen); ! } else { ! setupPainterPen(p); ! } } *************** *** 235,250 **** void RMapCanvas::drawMultiplePolygons(int count, int* polygons, ! RoadMapGuiPoint* points, int filled) { QPainter p(pixmap); if (currentPen != 0) { ! ! if (filled) { ! p.setPen(/* *currentPen*/ QPen(Qt::NoPen)); ! p.setBrush(QBrush(currentPen->color())); } else { ! p.setPen(*currentPen); } - } --- 472,498 ---- void RMapCanvas::drawMultiplePolygons(int count, int* polygons, ! RoadMapGuiPoint* points, int filled, int fast_draw) { QPainter p(pixmap); if (currentPen != 0) { ! if (filled && !fast_draw) { ! p.setPen(*currentPen->pen); ! #if defined(ROADMAP_ADVANCED_STYLE) ! if (currentPen->background) { ! p.setBackground(*currentPen->brush); ! p.setBackgroundMode(Qt::OpaqueMode); ! } else { ! if (currentPen->brush->style()==Qt::NoBrush) { ! p.setBrush(QColor(currentPen->pen->color())); ! } else { ! p.setBrush(*currentPen->brush); ! } ! } ! #else ! p.setBrush(QColor(currentPen->pen->color())); ! #endif } else { ! p.setPen(*currentPen->pen); } } *************** *** 265,277 **** void RMapCanvas::drawMultipleCircles(int count, RoadMapGuiPoint* centers, ! int* radius, int filled) { QPainter p(pixmap); if (currentPen != 0) { if (filled) { ! p.setPen(*currentPen); ! p.setBrush(QBrush(currentPen->color())); } else { ! p.setPen(*currentPen); } --- 513,538 ---- void RMapCanvas::drawMultipleCircles(int count, RoadMapGuiPoint* centers, ! int* radius, int filled, int fast_draw) { QPainter p(pixmap); if (currentPen != 0) { if (filled) { ! p.setPen(*currentPen->pen); ! #if defined(ROADMAP_ADVANCED_STYLE) ! if (currentPen->background) { ! p.setBackground(*currentPen->brush); ! p.setBackgroundMode(Qt::OpaqueMode); ! } else { ! if (currentPen->brush->style()==Qt::NoBrush) { ! p.setBrush(QColor(currentPen->pen->color())); ! } else { ! p.setBrush(*currentPen->brush); ! } ! } ! #else ! p.setBrush(QBrush(currentPen->pen->color())); ! #endif } else { ! p.setPen(*currentPen->pen); } Index: qt_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt4/qt_canvas.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** qt_canvas.h 21 Jun 2007 12:58:05 -0000 1.1 --- qt_canvas.h 7 Oct 2008 00:42:21 -0000 1.2 *************** *** 42,45 **** --- 42,54 ---- struct roadmap_canvas_pen { QPen* pen; + QFont* font; + #if defined(ROADMAP_ADVANCED_STYLE) + QBrush* brush; + int capitalize; + int background; + QColor* fontcolor; + QColor* buffercolor; + int buffersize; + #endif }; }; *************** *** 58,62 **** --- 67,99 ---- void setPenLineStyle(const char* style); void setPenThickness(int thickness); + void setFontSize(int size); + + #if defined(ROADMAP_ADVANCED_STYLE) + int getPenThickness(RoadMapPen p); + void setPenOpacity(int opacity); + void setPenLighter(int factor); + void setPenDarker(int factor); + void setPenLineStyle(int style); + void setPenLineCapStyle(int cap); + void setPenLineJoinStyle(int join); + void setBrushColor(const char *color); + void setBrushStyle(int style); + void setBrushOpacity(int opacity); + void setFontName(const char *name); + void setFontColor(const char *color); + void setFontWeight(int weight); + void setFontSpacing(int spacing); + void setFontItalic(int italic); + void setFontStrikeOut(int strikeout); + void setFontUnderline(int underline); + void setFontCapitalize(int capitalize); + void setBrushAsBackground(int background); + void setFontBufferColor(const char *color); + void setFontBufferSize(int size); + int getFontBufferSize(RoadMapPen pen); + #endif /* ROADMAP_ADVANCED_STYLE */ + void erase(void); + void setupPainterPen(QPainter &p); void drawString(RoadMapGuiPoint* position, int corner, const char* text); *************** *** 64,72 **** int center, const char* text, int angle); void drawMultiplePoints(int count, RoadMapGuiPoint* points); ! void drawMultipleLines(int count, int* lines, RoadMapGuiPoint* points); void drawMultiplePolygons(int count, int* polygons, ! RoadMapGuiPoint* points, int filled); void drawMultipleCircles(int count, RoadMapGuiPoint* centers, ! int* radius, int filled); void registerButtonPressedHandler(RoadMapCanvasMouseHandler handler); void registerButtonReleasedHandler(RoadMapCanvasMouseHandler handler); --- 101,110 ---- int center, const char* text, int angle); void drawMultiplePoints(int count, RoadMapGuiPoint* points); ! void drawMultipleLines(int count, int* lines, RoadMapGuiPoint* points, ! int fast_draw); void drawMultiplePolygons(int count, int* polygons, ! RoadMapGuiPoint* points, int filled, int fast_draw); void drawMultipleCircles(int count, RoadMapGuiPoint* centers, ! int* radius, int filled, int fast_draw); void registerButtonPressedHandler(RoadMapCanvasMouseHandler handler); void registerButtonReleasedHandler(RoadMapCanvasMouseHandler handler); *************** *** 87,91 **** QMap<QString, QColor*> colors; QMap<QString, RoadMapPen> pens; ! QPen* currentPen; QPixmap* pixmap; RoadMapCanvasConfigureHandler configureHandler; --- 125,130 ---- QMap<QString, QColor*> colors; QMap<QString, RoadMapPen> pens; ! RoadMapPen currentPen; ! RoadMapPen basePen; QPixmap* pixmap; RoadMapCanvasConfigureHandler configureHandler; |
|
From: Paul F. <pg...@us...> - 2008-10-07 00:45:54
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9958/qt Modified Files: roadmap_canvas.cc Log Message: from Alessandro Briosi: > > finally had some time to clean up and "reimplement" the ADVANCED_STYLE > patches. > > part 2. roadmap_advanced_style.patch which adds all the additional > definitions (based on patch 1) to be loaded. > The only implementation available right now is qt4, I have added all the > "stubs" functions as in previous patch. > Index: roadmap_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/roadmap_canvas.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** roadmap_canvas.cc 21 Mar 2008 23:09:00 -0000 1.13 --- roadmap_canvas.cc 7 Oct 2008 00:42:21 -0000 1.14 *************** *** 115,118 **** --- 115,140 ---- } + #if defined(ROADMAP_ADVANCED_STYLE) + /* this are stubs */ + void roadmap_canvas_set_opacity (int opacity) {} + + void roadmap_canvas_set_linejoin(const char *join) {} + void roadmap_canvas_set_linecap(const char *cap) {} + + void roadmap_canvas_set_brush_color(const char *color) {} + void roadmap_canvas_set_brush_style(const char *style) {} + void roadmap_canvas_set_brush_isbackground(int isbackground) {} + + void roadmap_canvas_set_label_font_name(const char *name) {} + void roadmap_canvas_set_label_font_color(const char *color) {} + void roadmap_canvas_set_label_font_size(int size) {} + void roadmap_canvas_set_label_font_spacing(int spacing) {} + void roadmap_canvas_set_label_font_weight(const char *weight) {} + void roadmap_canvas_set_label_font_style(int style) {} + + void roadmap_canvas_set_label_buffer_color(const char *color) {} + void roadmap_canvas_set_label_buffer_size(int size) {} + #endif /* ROADMAP_ADVANCED_STYLE */ + void roadmap_canvas_erase (void) { roadMapCanvas->erase(); |
|
From: Paul F. <pg...@us...> - 2008-10-07 00:45:36
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv9958/gtk2 Modified Files: roadmap_canvas.c Log Message: from Alessandro Briosi: > > finally had some time to clean up and "reimplement" the ADVANCED_STYLE > patches. > > part 2. roadmap_advanced_style.patch which adds all the additional > definitions (based on patch 1) to be loaded. > The only implementation available right now is qt4, I have added all the > "stubs" functions as in previous patch. > Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/roadmap_canvas.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** roadmap_canvas.c 21 Apr 2008 16:49:07 -0000 1.19 --- roadmap_canvas.c 7 Oct 2008 00:42:21 -0000 1.20 *************** *** 200,203 **** --- 200,225 ---- } + #if defined(ROADMAP_ADVANCED_STYLE) + /* this are stubs */ + void roadmap_canvas_set_opacity (int opacity) {} + + void roadmap_canvas_set_linejoin(const char *join) {} + void roadmap_canvas_set_linecap(const char *cap) {} + + void roadmap_canvas_set_brush_color(const char *color) {} + void roadmap_canvas_set_brush_style(const char *style) {} + void roadmap_canvas_set_brush_isbackground(int isbackground) {} + + void roadmap_canvas_set_label_font_name(const char *name) {} + void roadmap_canvas_set_label_font_color(const char *color) {} + void roadmap_canvas_set_label_font_size(int size) {} + void roadmap_canvas_set_label_font_spacing(int spacing) {} + void roadmap_canvas_set_label_font_weight(const char *weight) {} + void roadmap_canvas_set_label_font_style(int style) {} + + void roadmap_canvas_set_label_buffer_color(const char *color) {} + void roadmap_canvas_set_label_buffer_size(int size) {} + #endif /* ROADMAP_ADVANCED_STYLE */ + void roadmap_canvas_erase (void) { |