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: Ehud S. <esh...@us...> - 2006-07-16 12:26:53
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23247 Removed Files: roadmap.aps Log Message: Remove file. --- roadmap.aps DELETED --- |
From: Ehud S. <esh...@us...> - 2006-07-16 12:26:16
|
Update of /cvsroot/roadmap/roadmap_editor/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23212 Modified Files: Makefile roadmap_net.c Log Message: FreeMap auto sync. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/unix/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 15 Oct 2005 22:19:09 -0000 1.1.1.1 --- Makefile 16 Jul 2006 12:26:13 -0000 1.2 *************** *** 17,20 **** --- 17,21 ---- roadmap_library.c \ roadmap_net.c \ + ../md5.c \ roadmap_serial.c \ roadmap_spawn.c \ Index: roadmap_net.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/unix/roadmap_net.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_net.c 15 Oct 2005 22:19:09 -0000 1.1.1.1 --- roadmap_net.c 16 Jul 2006 12:26:13 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- #include <ctype.h> #include <errno.h> + #include <time.h> #include <unistd.h> *************** *** 42,45 **** --- 43,47 ---- #include "roadmap.h" + #include "md5.h" #include "roadmap_net.h" *************** *** 192,193 **** --- 194,214 ---- } + + int roadmap_net_unique_id (unsigned char *buffer, unsigned int size) { + struct MD5Context context; + unsigned char digest[16]; + time_t tm; + + time(&tm); + + MD5Init (&context); + MD5Update (&context, (unsigned char *)&tm, sizeof(tm)); + MD5Final (digest, &context); + + if (size > sizeof(digest)) size = sizeof(digest); + memcpy(buffer, digest, size); + + return size; + } + + |
From: Ehud S. <esh...@us...> - 2006-07-16 12:25:34
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/static In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22835 Modified Files: editor_dialog.c Log Message: FreeMap auto sync. Index: editor_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/static/editor_dialog.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** editor_dialog.c 12 May 2006 14:21:19 -0000 1.7 --- editor_dialog.c 16 Jul 2006 12:25:31 -0000 1.8 *************** *** 63,66 **** --- 63,67 ---- /* NOTE: This function modifies the street_range parameter */ + #if 0 static void decode_range (char *street_range, int *from1, *************** *** 80,84 **** ranges[num_ranges++] = street_range+i; ! if (num_ranges == (sizeof(ranges) / sizeof(ranges[0]))) break; while (isdigit (street_range[i]) && (i <= max)) i++; --- 81,85 ---- ranges[num_ranges++] = street_range+i; ! if (num_ranges == (sizeof(ranges) / sizeof(ranges[0]) - 1)) break; while (isdigit (street_range[i]) && (i <= max)) i++; *************** *** 112,115 **** --- 113,117 ---- } } + #endif *************** *** 235,240 **** (char *) roadmap_dialog_get_data ("General", "Text to Speech"); ! char *street_range = ! (char *) roadmap_dialog_get_data ("General", "Street range"); char *city = (char *) roadmap_dialog_get_data ("General", "City"); --- 237,242 ---- (char *) roadmap_dialog_get_data ("General", "Text to Speech"); ! /* char *street_range = ! (char *) roadmap_dialog_get_data ("General", "Street range"); */ char *city = (char *) roadmap_dialog_get_data ("General", "City"); *************** *** 255,259 **** l_from = l_to = r_from = r_to = -1; ! decode_range (street_range, &l_from, &l_to, &r_from, &r_to); speed_limit = (LineRouteMax) atoi (speed_limit_str); --- 257,261 ---- l_from = l_to = r_from = r_to = -1; ! //decode_range (street_range, &l_from, &l_to, &r_from, &r_to); speed_limit = (LineRouteMax) atoi (speed_limit_str); |
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22805 Modified Files: editor_export.c editor_export.h editor_upload.c editor_upload.h Added Files: editor_sync.c editor_sync.h Log Message: FreeMap auto sync. Index: editor_export.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** editor_export.c 13 Jul 2006 06:39:24 -0000 1.12 --- editor_export.c 16 Jul 2006 12:25:08 -0000 1.13 *************** *** 500,504 **** ! static int editor_export_data(const char *name) { ExportStream stream; --- 500,504 ---- ! int editor_export_data(const char *name, int ui) { ExportStream stream; *************** *** 514,526 **** if (fips < 0) { ! editor_log (ROADMAP_ERROR, "Can't locate current fips"); ! roadmap_messagebox ("Export Error", "Can't locate fips."); ! return -1; } if (editor_db_activate (fips) == -1) { ! editor_log (ROADMAP_ERROR, "Can't load editor db"); ! roadmap_messagebox ("Export Error", "No editor data to export."); ! return -1; } --- 514,531 ---- if (fips < 0) { ! if (!ui) { ! fips = 77001; ! } else { ! editor_log (ROADMAP_ERROR, "Can't locate current fips"); ! roadmap_messagebox ("Export Error", "Can't locate fips."); ! return -1; ! } } if (editor_db_activate (fips) == -1) { ! if (ui) { ! roadmap_messagebox ("Export Error", "No editor data to export."); ! } ! return 0; } *************** *** 532,537 **** if (!export_dirty_lines (&stream, name)) { ! editor_log (ROADMAP_INFO, "No trksegs are available for export."); ! roadmap_messagebox ("Export Error", "No new data to export."); if (stream.type != NULL_STREAM) { --- 537,544 ---- if (!export_dirty_lines (&stream, name)) { ! if (ui) { ! editor_log (ROADMAP_INFO, "No trksegs are available for export."); ! roadmap_messagebox ("Export Error", "No new data to export."); ! } if (stream.type != NULL_STREAM) { *************** *** 542,547 **** } close_export_stream (&stream); ! editor_export_upload (name); ! return 0; } --- 549,557 ---- } close_export_stream (&stream); ! ! if (ui) { ! editor_export_upload (name); ! } ! return 1; } *************** *** 651,657 **** editor_trkseg_reset_next_export (); - editor_export_upload (name); ! return 0; } --- 661,670 ---- editor_trkseg_reset_next_export (); ! if (ui) { ! editor_export_upload (name); ! } ! ! return 1; } *************** *** 698,702 **** (const char *filename, const char *mode) { ! editor_export_data (filename); } --- 711,715 ---- (const char *filename, const char *mode) { ! editor_export_data (filename, 1); } Index: editor_upload.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_upload.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** editor_upload.c 15 May 2006 19:52:48 -0000 1.2 --- editor_upload.c 16 Jul 2006 12:25:08 -0000 1.3 *************** *** 43,51 **** #include "roadmap_main.h" #include "roadmap_fileselection.h" #include "editor_upload.h" - static FILE *dbg_file; - #define ROADMAP_HTTP_MAX_CHUNK 4096 --- 43,50 ---- #include "roadmap_main.h" #include "roadmap_fileselection.h" + #include "md5.h" #include "editor_upload.h" #define ROADMAP_HTTP_MAX_CHUNK 4096 *************** *** 147,152 **** static int editor_http_send (RoadMapSocket socket, ! RoadMapDownloadCallbackError error, ! const char *format, ...) { va_list ap; --- 146,151 ---- static int editor_http_send (RoadMapSocket socket, ! RoadMapDownloadCallbackError error, ! const char *format, ...) { va_list ap; *************** *** 154,158 **** char buffer[ROADMAP_HTTP_MAX_CHUNK]; - if (!dbg_file) dbg_file = fopen ("/tmp/post3.gpx", "w"); va_start(ap, format); vsnprintf (buffer, sizeof(buffer), format, ap); --- 153,156 ---- *************** *** 160,164 **** length = strlen(buffer); - fwrite (buffer, length, 1, dbg_file); if (roadmap_net_send (socket, buffer, length) != length) { error ("send error on: %s", buffer); --- 158,161 ---- *************** *** 424,429 **** int loaded; int uploaded; - char buffer[ROADMAP_HTTP_MAX_CHUNK]; RoadMapFile file = roadmap_file_open (file_name, "r"); --- 421,426 ---- int loaded; int uploaded; char buffer[ROADMAP_HTTP_MAX_CHUNK]; + char digest_hex[100]; RoadMapFile file = roadmap_file_open (file_name, "r"); *************** *** 431,435 **** if (!ROADMAP_NET_IS_VALID(file)) { editor_upload_error ("Can't open file: %s\n", file_name); ! return 0; } --- 428,432 ---- if (!ROADMAP_NET_IS_VALID(file)) { editor_upload_error ("Can't open file: %s\n", file_name); ! return -1; } *************** *** 439,445 **** RoadMapUploadCurrentName = file_name; ! fd = editor_http_send_header (target, file_name, size, user_name, password, editor_upload_error); if (!ROADMAP_NET_IS_VALID(fd)) { ! return 0; } --- 436,455 ---- RoadMapUploadCurrentName = file_name; ! if (!user_name[0]) { ! unsigned char digest[16]; ! if (roadmap_net_unique_id (digest, sizeof(digest)) != sizeof(digest)) { ! return -1; ! } ! ! MD5Hex (digest, digest_hex); ! ! user_name = "anonymous"; ! password = digest_hex; ! } ! ! fd = editor_http_send_header ! (target, file_name, size, user_name, password, editor_upload_error); if (!ROADMAP_NET_IS_VALID(fd)) { ! return -1; } *************** *** 452,456 **** uploaded = roadmap_file_read (file, buffer, sizeof(buffer)); - fwrite (buffer, uploaded, 1, dbg_file); uploaded = roadmap_net_send (fd, buffer, uploaded); --- 462,465 ---- *************** *** 465,469 **** editor_http_send (fd, editor_upload_error, "\r\n-----------------------------10424402741337131014341297293--\r\n"); - fflush (dbg_file); loaded = sizeof(buffer); --- 474,477 ---- *************** *** 478,482 **** roadmap_messagebox ("Upload done.", buffer); ! return 1; cancel_upload: --- 486,490 ---- roadmap_messagebox ("Upload done.", buffer); ! return 0; cancel_upload: *************** *** 485,489 **** roadmap_dialog_hide ("Uploading"); ! return 0; } --- 493,497 ---- roadmap_dialog_hide ("Uploading"); ! return -1; } *************** *** 560,564 **** roadmap_fileselection_new ("Upload file", ! "gpx", roadmap_path_user (), "r", --- 568,572 ---- roadmap_fileselection_new ("Upload file", ! "gpx.gz", roadmap_path_user (), "r", *************** *** 566,569 **** --- 574,578 ---- } + void editor_upload_initialize (void) { *************** *** 577,578 **** --- 586,597 ---- } + + int editor_upload_auto (const char *filename) { + + return editor_post_file ( + roadmap_config_get (&RoadMapConfigTarget), + filename, + roadmap_config_get (&RoadMapConfigUser), + roadmap_config_get (&RoadMapConfigPassword)); + } + Index: editor_upload.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_upload.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** editor_upload.h 12 May 2006 14:21:55 -0000 1.1 --- editor_upload.h 16 Jul 2006 12:25:08 -0000 1.2 *************** *** 26,31 **** void editor_upload_initialize (void); ! void editor_upload_select (void); ! void editor_upload_file (const char *filename); #endif // INCLUDE__EDITOR_UPLOAD__H --- 26,32 ---- void editor_upload_initialize (void); ! void editor_upload_select (void); ! void editor_upload_file (const char *filename); ! int editor_upload_auto (const char *filename); #endif // INCLUDE__EDITOR_UPLOAD__H Index: editor_export.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_export.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor_export.h 12 May 2006 14:21:55 -0000 1.4 --- editor_export.h 16 Jul 2006 12:25:08 -0000 1.5 *************** *** 25,28 **** --- 25,29 ---- #define INCLUDE__EDITOR_EXPORT__H + int editor_export_data(const char *name, int ui); void editor_export_gpx (void); void editor_export_reset_dirty (void); --- NEW FILE: editor_sync.h --- /* editor_sync.h - synchronize data and maps * * LICENSE: * * Copyright 2006 Ehud Shabtai * * 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 */ #ifndef INCLUDE__EDITOR_SYNC_H #define INCLUDE__EDITOR_SYNC_H int export_sync (void); #endif // INCLUDE__EDITOR_SYNC_H --- NEW FILE: editor_sync.c --- /* editor_sync.c - synchronize data and maps * * LICENSE: * * Copyright 2006 Ehud Shabtai * * 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 * * SYNOPSYS: * * See editor_sync.h */ #include <stdlib.h> #include <string.h> #include <time.h> #include "roadmap.h" #include "roadmap_file.h" #include "roadmap_path.h" #include "roadmap_locator.h" #include "roadmap_metadata.h" #include "roadmap_messagebox.h" #include "editor_upload.h" #include "editor_export.h" #include "editor_download.h" #include "editor_sync.h" static int sync_do_export (void) { char path[255]; char name[255]; struct tm *tm; char *full_name; time_t now; int res; snprintf (path, sizeof(path), "%s/queue", roadmap_path_user()); roadmap_path_create (path); time(&now); tm = gmtime (&now); snprintf (name, sizeof(name), "rm_%02d_%02d_%02d%02d.gpx.gz", tm->tm_mday, tm->tm_mon, tm->tm_hour, tm->tm_min); full_name = roadmap_path_join (path, name); res = editor_export_data (full_name, 0); free (full_name); return res; } static int sync_do_upload (void) { char **files; char **cursor; char directory[255]; snprintf (directory, sizeof(directory), "%s/queue", roadmap_path_user()); files = roadmap_path_list (directory, ".gpx.gz"); for (cursor = files; *cursor != NULL; ++cursor) { char *full_name = roadmap_path_join (directory, *cursor); int res = editor_upload_auto (full_name); if (res == 0) { roadmap_file_remove (NULL, full_name); } free (full_name); } roadmap_path_list_free (files); return 0; } int export_sync (void) { int res; int fips; struct tm now_tm; struct tm map_time_tm; time_t now_t; time_t map_time_t; res = sync_do_export (); res = sync_do_upload (); fips = roadmap_locator_active (); if (fips < 0) { fips = 77001; } if (roadmap_locator_activate (fips) == -1) { roadmap_messagebox ("Error.", "Can't load map data."); return -1; } now_t = time (NULL); map_time_t = atoi(roadmap_metadata_get_attribute ("Version", "UnixTime")); if ((map_time_t + 3600*24) > now_t) { /* Map is less than 24 hours old. * A new version may still be available. */ now_tm = *gmtime(&now_t); map_time_tm = *gmtime(&map_time_t); if (now_tm.tm_mday == map_time_tm.tm_mday) { return 0; } else { /* new day - only download if new maps were already generated. */ if (now_tm.tm_hour < 2) return 0; } } res = editor_download_update_map (EDITOR_DOWNLOAD_AUTO); return 0; } |
From: Ehud S. <esh...@us...> - 2006-07-16 12:23:29
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22010 Modified Files: Makefile md5.c md5.h roadmap_download.c roadmap_locator.c roadmap_start.c Log Message: FreeMap auto sync. Index: md5.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/md5.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** md5.h 13 Jul 2006 06:36:58 -0000 1.1 --- md5.h 16 Jul 2006 12:23:25 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- void MD5Final(unsigned char digest[16], struct MD5Context *context); void MD5Transform(uint32 buf[4], uint32 const in[16]); + void MD5Hex(const unsigned char digest[16], char *buffer); /* Index: roadmap_download.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_download.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_download.c 13 Jul 2006 06:32:00 -0000 1.7 --- roadmap_download.c 16 Jul 2006 12:23:25 -0000 1.8 *************** *** 30,33 **** --- 30,34 ---- #include <stdlib.h> #include <stdarg.h> + #include <zlib.h> #include "roadmap.h" *************** *** 65,68 **** --- 66,70 ---- }; + #if 0 static struct roadmap_download_tool RoadMapDownloadCompressTools[] = { {".gz", "gunzip -f"}, *************** *** 71,74 **** --- 73,77 ---- {NULL, NULL} }; + #endif static RoadMapHash *RoadMapDownloadBlock = NULL; *************** *** 351,371 **** ! static void roadmap_download_uncompress (const char *destination) { ! char *p; ! char command[2048]; ! struct roadmap_download_tool *tool; ! for (tool = RoadMapDownloadCompressTools; tool->suffix != NULL; ++tool) { ! p = strstr (destination, tool->suffix); ! if ((p != NULL) && (strcmp (p, tool->suffix) == 0)) { ! snprintf (command, sizeof(command), "%s %s", tool->name, destination); ! roadmap_spawn_command (command); break; } } } --- 354,429 ---- ! static int roadmap_download_uncompress (const char *tmp_file, ! const char *destination) { char *p; ! RoadMapFile source_file; ! gzFile source_file_gz; ! RoadMapFile dest_file; ! char *dest_name = strdup(destination); ! int is_gz_file = 0; ! int res = 0; ! char buffer[1024]; ! int count; ! p = strstr (dest_name, ".gz"); ! if ((p != NULL) && (strcmp (p, ".gz") == 0)) { ! is_gz_file = 1; ! *p = '\0'; ! source_file_gz = gzopen(tmp_file, "rb"); ! if (!source_file_gz) res = -1; ! } else { ! source_file = roadmap_file_open (tmp_file, "r"); ! if (!ROADMAP_FILE_IS_VALID (source_file)) res = -1; ! } ! ! if (res != 0) { ! free(dest_name); ! roadmap_file_remove (NULL, tmp_file); ! return res; ! } ! ! roadmap_file_remove (NULL, dest_name); ! dest_file = roadmap_file_open (dest_name, "w"); ! if (!ROADMAP_FILE_IS_VALID (dest_file)) { ! res = -1; ! goto end; ! } ! ! while (1) { ! ! if (is_gz_file) { ! count = gzread (source_file_gz, buffer, sizeof(buffer)); ! } else { ! count = roadmap_file_read (source_file, buffer, sizeof(buffer)); ! } ! ! if (count <= 0) { ! res = count; break; } + + if (roadmap_file_write (dest_file, buffer, count) != count) { + res = -1; + break; + } + } + + end: + free(dest_name); + + if (is_gz_file) { + gzclose (source_file_gz); + } else { + roadmap_file_close (source_file); } + + if (ROADMAP_FILE_IS_VALID (dest_file)) { + roadmap_file_close (dest_file); + } + + return res; } *************** *** 379,382 **** --- 437,441 ---- char source[256]; char destination[256]; + const char *tmp_file; const char *format; *************** *** 395,400 **** --- 454,461 ---- directory = roadmap_path_parent (NULL, destination); roadmap_path_create (directory); + tmp_file = roadmap_path_join (directory, "dl_tmp.dat"); roadmap_path_free (directory); + roadmap_file_remove (NULL, tmp_file); /* FIXME: at this point, we should set a temporary destination *************** *** 416,438 **** if (protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, destination)) { char *tmp; ! roadmap_download_uncompress (destination); RoadMapDownloadRefresh = 1; /* download navigation data */ if ((tmp = strstr (source, ".rdm")) != NULL) { ! strcpy (tmp, ".dgl"); if ((tmp = strstr (destination, ".rdm")) != NULL) { ! strcpy (tmp, ".dgl"); if (!protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, destination)) { roadmap_messagebox ("Error", "Error downloading navigation data."); error = 1; } } --- 477,501 ---- if (protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, tmp_file)) { char *tmp; ! roadmap_download_uncompress (tmp_file, destination); RoadMapDownloadRefresh = 1; /* download navigation data */ if ((tmp = strstr (source, ".rdm")) != NULL) { ! memcpy (tmp, ".dgl", 4); if ((tmp = strstr (destination, ".rdm")) != NULL) { ! memcpy (tmp, ".dgl", 4); if (!protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, tmp_file)) { roadmap_messagebox ("Error", "Error downloading navigation data."); error = 1; + } else { + roadmap_download_uncompress (tmp_file, destination); } } *************** *** 448,451 **** --- 511,517 ---- } + roadmap_file_remove (NULL, tmp_file); + roadmap_path_free (tmp_file); + if (protocol == NULL) { *************** *** 491,494 **** --- 557,561 ---- char *format; const char *directory; + const char *tmp_file; *************** *** 516,527 **** directory = roadmap_path_parent (NULL, destination); roadmap_path_create (directory); - roadmap_path_free (directory); - ! /* FIXME: at this point, we should set a temporary destination ! * file name. When done with the transfer, we should rename the file ! * to its final name. That would replace the "freeze" in a more ! * elegant manner. ! */ /* Search for the correct protocol handler to call this time. */ --- 583,589 ---- directory = roadmap_path_parent (NULL, destination); roadmap_path_create (directory); ! tmp_file = roadmap_path_join (directory, "dl_tmp.dat"); ! roadmap_path_free (directory); /* Search for the correct protocol handler to call this time. */ *************** *** 537,543 **** if (protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, destination)) { ! roadmap_download_uncompress (destination); RoadMapDownloadRefresh = 1; } else { --- 599,605 ---- if (protocol->handler (&RoadMapDownloadCallbackFunctions, ! source, tmp_file)) { ! roadmap_download_uncompress (tmp_file, destination); RoadMapDownloadRefresh = 1; } else { *************** *** 550,553 **** --- 612,617 ---- } + roadmap_path_free (tmp_file); + if (protocol == NULL) { Index: md5.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/md5.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** md5.c 13 Jul 2006 06:36:58 -0000 1.1 --- md5.c 16 Jul 2006 12:23:25 -0000 1.2 *************** *** 248,249 **** --- 248,270 ---- buf[3] += d; } + + + void MD5Hex(const unsigned char digest[16], char *buffer) + { + unsigned int i; + + static const char bin2hex[] = { '0', '1', '2', '3', + '4', '5', '6', '7', + '8', '9', 'a', 'b', + 'c', 'd', 'e', 'f' }; + + for (i=0; i<sizeof(digest); i++) { + *buffer = bin2hex[digest[i] >> 4]; + buffer++; + *buffer = bin2hex[digest[i] & 0xf]; + buffer++; + } + + *buffer = '\0'; + } + Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile 13 Jul 2006 06:32:00 -0000 1.16 --- Makefile 16 Jul 2006 12:23:25 -0000 1.17 *************** *** 189,192 **** --- 189,193 ---- editor/export/editor_download.c \ editor/export/editor_upload.c \ + editor/export/editor_sync.c \ editor/db/editor_trkseg.c \ editor/track/editor_track_filter.c \ *************** *** 286,289 **** --- 287,293 ---- done if [ -d unix ] ; then $(MAKE) -C unix cleanone ; fi + find editor -name \*.o -exec rm {} \; + find navigate -name \*.o -exec rm {} \; + find agg -name \*.o -exec rm {} \; cleanone: Index: roadmap_locator.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_locator.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_locator.c 22 May 2006 09:09:30 -0000 1.9 --- roadmap_locator.c 16 Jul 2006 12:23:25 -0000 1.10 *************** *** 64,68 **** static int RoadMapCountyCacheSize = 0; ! static int RoadMapActiveCounty; static int RoadMapUsdirActive = 0; --- 64,68 ---- static int RoadMapCountyCacheSize = 0; ! static int RoadMapActiveCounty = -1; static int RoadMapUsdirActive = 0; Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** roadmap_start.c 13 Jul 2006 06:36:08 -0000 1.21 --- roadmap_start.c 16 Jul 2006 12:23:25 -0000 1.22 *************** *** 79,82 **** --- 79,83 ---- #include "editor/export/editor_upload.h" #include "editor/export/editor_download.h" + #include "editor/export/editor_sync.h" static const char *RoadMapMainTitle = "RoadMap"; *************** *** 303,306 **** --- 304,313 ---- + static void roadmap_start_sync_data (void) { + + export_sync (); + } + + /* The RoadMap menu and toolbar items: ----------------------------------- */ *************** *** 486,492 **** --- 493,503 ---- {"uploadgpx", "Upload GPX file", NULL, NULL, "Export editor data", roadmap_start_upload_gpx}, + {"detectreceiver", "Detect GPS receiver", NULL, NULL, "Auto-detect GPS receiver", roadmap_start_detect_receiver}, + {"sync", "Sync", NULL, NULL, + "Sync map and data", roadmap_start_sync_data}, + {NULL, NULL, NULL, NULL, NULL, NULL} }; *************** *** 502,505 **** --- 513,517 ---- RoadMapFactorySeparator, + "sync", "exportdata", "updatemap", |
From: Paul F. <pg...@us...> - 2006-07-15 16:56:15
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12566 Modified Files: roadmap_list.c roadmap_list.h Log Message: roadmap_list_remove() now returns pointer to removed item (i.e., 2nd arg). roadmap_linst_insert() was buggy (previously unused), replaced with exact inverse of code in roadmap_list_append(). Index: roadmap_list.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_list.c 25 Feb 2003 22:32:22 -0000 1.2 --- roadmap_list.c 15 Jul 2006 16:56:12 -0000 1.3 *************** *** 34,46 **** void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item) { ! item->previous = NULL; if (list->first == NULL) { ! list->first = item; ! list->last = item; } else { list->first->previous = item; } ! item->next = list->first; list->first = item; } --- 34,46 ---- void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item) { ! item->next = list->first; if (list->first == NULL) { ! list->last = item; ! list->first = item; } else { list->first->previous = item; } ! item->previous = NULL; list->first = item; } *************** *** 62,66 **** ! void roadmap_list_remove (RoadMapList *list, RoadMapListItem *item) { if (item->previous == NULL) { --- 62,66 ---- ! RoadMapListItem *roadmap_list_remove (RoadMapList *list, RoadMapListItem *item) { if (item->previous == NULL) { *************** *** 74,77 **** --- 74,78 ---- item->next->previous = item->previous; } + return item; } Index: roadmap_list.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_list.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_list.h 28 Feb 2003 08:28:21 -0000 1.3 --- roadmap_list.h 15 Jul 2006 16:56:12 -0000 1.4 *************** *** 47,51 **** void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item); void roadmap_list_append (RoadMapList *list, RoadMapListItem *item); ! void roadmap_list_remove (RoadMapList *list, RoadMapListItem *item); int roadmap_list_count (const RoadMapList *list); --- 47,51 ---- void roadmap_list_insert (RoadMapList *list, RoadMapListItem *item); void roadmap_list_append (RoadMapList *list, RoadMapListItem *item); ! RoadMapListItem *roadmap_list_remove (RoadMapList *list, RoadMapListItem *item); int roadmap_list_count (const RoadMapList *list); |
From: Paul F. <pg...@us...> - 2006-07-15 16:49:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10236 Modified Files: roadmap_trip.h Log Message: remove unneeded include Index: roadmap_trip.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_trip.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** roadmap_trip.h 6 Jul 2006 15:33:30 -0000 1.22 --- roadmap_trip.h 15 Jul 2006 16:49:29 -0000 1.23 *************** *** 26,30 **** #include "roadmap_types.h" - #include "roadmap_list.h" #include "roadmap_gps.h" --- 26,29 ---- |
From: Paul F. <pg...@us...> - 2006-07-15 16:49:09
|
Update of /cvsroot/roadmap/roadmap/src/gpx In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9852/gpx Modified Files: queue.h Log Message: no functional change -- comments/clarification Index: queue.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gpx/queue.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** queue.h 7 Dec 2005 14:21:09 -0000 1.1 --- queue.h 15 Jul 2006 16:49:00 -0000 1.2 *************** *** 36,42 **** #define QUEUE_LAST(head) ((head)->prev) #define QUEUE_EMPTY(head) ((head)->next == (head)) #define QUEUE_MOVE(newhead,oldhead) \ ! if ( (oldhead)->next == (oldhead) ) {\ ! (newhead)->next = (newhead)->prev = (newhead); \ } \ else { \ --- 36,45 ---- #define QUEUE_LAST(head) ((head)->prev) #define QUEUE_EMPTY(head) ((head)->next == (head)) + + /* anything attached to oldhead will be re-anchord at newhead. + * newhead will be cleared, and anything at newhead will be lost. */ #define QUEUE_MOVE(newhead,oldhead) \ ! if ( QUEUE_EMPTY(oldhead) ) {\ ! QUEUE_INIT(newhead); \ } \ else { \ *************** *** 46,58 **** (newhead)->prev->next = (newhead); \ } \ ! (oldhead)->next = (oldhead)->prev = (oldhead) #define QUEUE_SPLICE(tohead,fromhead) \ ! if ( (fromhead)->next != (fromhead) ) {\ (tohead)->prev->next = (fromhead)->next; \ (fromhead)->next->prev = (tohead)->prev; \ (fromhead)->prev->next = (tohead); \ (tohead)->prev = (fromhead)->prev; \ ! } #define ENQUEUE_TAIL(listhead, element) \ --- 49,64 ---- (newhead)->prev->next = (newhead); \ } \ ! QUEUE_INIT(oldhead) + /* anything attached to fromhead will be appended at the end of tohead. + * fromhead is emptied. */ #define QUEUE_SPLICE(tohead,fromhead) \ ! if ( !QUEUE_EMPTY(fromhead) ) {\ (tohead)->prev->next = (fromhead)->next; \ (fromhead)->next->prev = (tohead)->prev; \ (fromhead)->prev->next = (tohead); \ (tohead)->prev = (fromhead)->prev; \ ! } \ ! QUEUE_INIT(fromhead) #define ENQUEUE_TAIL(listhead, element) \ *************** *** 70,71 **** --- 76,83 ---- (element) != (listhead); \ (element) = (tmp)) + + #define QUEUE_FOR_EACH_FROM_TO(from, to, element, tmp) \ + for ((element) = (from); \ + (tmp) = QUEUE_NEXT(element), \ + (element) != (to); \ + (element) = (tmp)) |
From: Paul F. <pg...@us...> - 2006-07-13 18:09:40
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv29431 Modified Files: roadmap_linefont.c Log Message: no need for a second copy of the font vertices Index: roadmap_linefont.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_linefont.c 13 Jul 2006 15:40:58 -0000 1.2 --- roadmap_linefont.c 13 Jul 2006 18:09:35 -0000 1.3 *************** *** 157,160 **** --- 157,165 ---- /* get the number of vertices in this figure ... */ np = scanint(3); + + /* point directly at the ASCII font data */ + hf->hc[j].pt = (hpoint *)fontp; + fontp += np * sizeof(hpoint); + if (np > MAXPOINTS) { roadmap_log(ROADMAP_WARNING, *************** *** 162,180 **** np = MAXPOINTS; } - hf->hc[j].npnt = np; - hf->hc[j].pt = malloc(np * sizeof(hpoint)); - roadmap_check_allocated (hf->hc[j].pt ); ! /* read in the vertice coordinates ... ! * (note that pt[0] contains the left and right margin ! * values from the hershey data, which are unused in this ! * implementation.) ! */ ! for (i = 0; i < np; i++) { ! if (*fontp == '\n') fontp++; ! hf->hc[j].pt[i].x = *fontp++; /* x-coordinate */ ! if (*fontp == '\n') fontp++; ! hf->hc[j].pt[i].y = *fontp++; /* y-coordinate */ ! } } --- 167,172 ---- np = MAXPOINTS; } ! hf->hc[j].npnt = np; } *************** *** 341,345 **** * Richardson's Xrotfont package. To inline another such font, * simply quote each line, escape all '\' characters, and join ! * lines that are clearly continuations lines. * */ --- 333,339 ---- * Richardson's Xrotfont package. To inline another such font, * simply quote each line, escape all '\' characters, and join ! * lines that are clearly continuations lines. (The data in ! * this array is used directly by the code above, after some ! * initial pointers are set up into the array.) * */ |
From: Paul F. <pg...@us...> - 2006-07-13 15:48:02
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371 Modified Files: config.mk roadgps_screen.c roadmap_canvas.h roadmap_display.c roadmap_label.c Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadgps_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadgps_screen.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadgps_screen.c 26 Jun 2006 19:59:53 -0000 1.9 --- roadgps_screen.c 13 Jul 2006 15:47:53 -0000 1.10 *************** *** 369,373 **** roadmap_canvas_get_text_extents ! ("09", -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent + 2; --- 369,373 ---- roadmap_canvas_get_text_extents ! ("09", -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent + 2; Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** config.mk 13 Jul 2006 13:30:32 -0000 1.7 --- config.mk 13 Jul 2006 15:47:53 -0000 1.8 *************** *** 35,42 **** # QTDIR here. (But it might already be set in your environment.) # QTDIR = /usr # If you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in # some Familiar builds), set QT_NO_ROTATE. RoadMap will then use ! # its internal labeling font. # QT_NO_ROTATE = YES --- 35,46 ---- # QTDIR here. (But it might already be set in your environment.) # QTDIR = /usr + # If you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in # some Familiar builds), set QT_NO_ROTATE. RoadMap will then use ! # its internal labeling font. Unfortunately, QT's line drawing ! # makes the internal font is particularly hard to read. You may ! # also wish to add "CFLAGS += -DROADMAP_NO_LINEFONT" to force ! # horizionatl labels. # QT_NO_ROTATE = YES Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_display.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** roadmap_display.c 26 Jun 2006 19:59:53 -0000 1.25 --- roadmap_display.c 13 Jul 2006 15:47:53 -0000 1.26 *************** *** 283,287 **** roadmap_canvas_get_text_extents ! (sign->content, -1, &width, &ascent, &descent); width += 8; /* Keep some room around the text. */ --- 283,287 ---- roadmap_canvas_get_text_extents ! (sign->content, -1, &width, &ascent, &descent, NULL); width += 8; /* Keep some room around the text. */ *************** *** 582,586 **** } ! roadmap_canvas_get_text_extents (text, -1, &width, &ascent, &descent); if (corner & ROADMAP_CANVAS_RIGHT) { --- 582,586 ---- } ! roadmap_canvas_get_text_extents (text, -1, &width, &ascent, &descent, NULL); if (corner & ROADMAP_CANVAS_RIGHT) { Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_label.c 13 Jul 2006 13:30:33 -0000 1.9 --- roadmap_label.c 13 Jul 2006 15:47:53 -0000 1.10 *************** *** 150,154 **** roadmap_math_rotate_point (&poly[3], p, angle); ! // { int lines = 4; roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); } compute_bbox(poly, &c->bbox); --- 150,157 ---- roadmap_math_rotate_point (&poly[3], p, angle); ! #define POLY_OUTLINE 0 ! #if POLY_OUTLINE ! { int lines = 4; roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); } ! #endif compute_bbox(poly, &c->bbox); *************** *** 258,266 **** #if ROADMAP_USE_LINEFONT ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); #define CENTER_Y 0 #else - roadmap_canvas_get_text_extents(text, -1, &width, &ascent, &descent); #define CENTER_Y 1 #endif r.minx = 0; --- 261,274 ---- #if ROADMAP_USE_LINEFONT ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ #define CENTER_Y 0 + roadmap_linefont_extents(text, 16, &width, &ascent, &descent); #else #define CENTER_Y 1 + roadmap_canvas_get_text_extents + (text, -1, &width, &ascent, &descent, &i); + angles = angles && i; #endif r.minx = 0; *************** *** 288,294 **** cachePtr->angle -= 90; - /* the linefont font is bad. reading it is hard with a road - * running through it, so we don't center it on the road. - */ p = get_metrics (cachePtr, &r, CENTER_Y); } else { --- 296,299 ---- Index: roadmap_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_canvas.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** roadmap_canvas.h 26 Jun 2006 19:59:53 -0000 1.7 --- roadmap_canvas.h 13 Jul 2006 15:47:53 -0000 1.8 *************** *** 68,72 **** */ void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent); --- 68,73 ---- */ void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt); |
From: Paul F. <pg...@us...> - 2006-07-13 15:48:02
|
Update of /cvsroot/roadmap/roadmap/src/gtk In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371/gtk Modified Files: roadmap_canvas.c Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk/roadmap_canvas.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_canvas.c 26 Jun 2006 19:54:01 -0000 1.9 --- roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.10 *************** *** 81,85 **** void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent) { static int RoadMapCanvasAscent = 0; --- 81,86 ---- void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt) { static int RoadMapCanvasAscent = 0; *************** *** 113,116 **** --- 114,118 ---- *ascent = RoadMapCanvasAscent; *descent = RoadMapCanvasDescent; + if (can_tilt) *can_tilt = 0; } *************** *** 206,210 **** roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent); switch (corner) { --- 208,212 ---- roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent, NULL); switch (corner) { *************** *** 279,283 **** void roadmap_canvas_draw_multiple_polygons (int count, int *polygons, RoadMapGuiPoint *points, int filled, ! int fast_draw) { int i; --- 281,285 ---- void roadmap_canvas_draw_multiple_polygons (int count, int *polygons, RoadMapGuiPoint *points, int filled, ! int fast_draw) { int i; *************** *** 298,302 **** void roadmap_canvas_draw_multiple_circles (int count, RoadMapGuiPoint *centers, int *radius, int filled, ! int fast_draw) { int i; --- 300,304 ---- void roadmap_canvas_draw_multiple_circles (int count, RoadMapGuiPoint *centers, int *radius, int filled, ! int fast_draw) { int i; |
From: Paul F. <pg...@us...> - 2006-07-13 15:48:00
|
Update of /cvsroot/roadmap/roadmap/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371/win32 Modified Files: roadmap_canvas.c Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/win32/roadmap_canvas.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_canvas.c 26 Jun 2006 19:54:01 -0000 1.6 --- roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.7 *************** *** 84,88 **** void roadmap_canvas_get_text_extents (const char *text, int size, ! int *width, int *ascent, int *descent) { TEXTMETRIC metric; --- 84,88 ---- void roadmap_canvas_get_text_extents (const char *text, int size, ! int *width, int *ascent, int *descent, int *can_tilt) { TEXTMETRIC metric; *************** *** 95,98 **** --- 95,99 ---- *ascent = metric.tmAscent; *descent = metric.tmDescent; + if (can_tilt) *can_tilt = 0; } *************** *** 209,213 **** roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent; --- 210,214 ---- roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent; |
From: Paul F. <pg...@us...> - 2006-07-13 15:47:59
|
Update of /cvsroot/roadmap/roadmap/src/agg_support In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371/agg_support Modified Files: roadmap_canvas.cpp Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadmap_canvas.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/agg_support/roadmap_canvas.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_canvas.cpp 11 Jul 2006 22:52:32 -0000 1.2 --- roadmap_canvas.cpp 13 Jul 2006 15:47:53 -0000 1.3 *************** *** 134,141 **** void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent) { *ascent = 0; *descent = 0; wchar_t wstr[255]; --- 134,143 ---- void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt) { *ascent = 0; *descent = 0; + if (can_tilt) *can_tilt = 1; wchar_t wstr[255]; *************** *** 274,278 **** roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent; --- 276,280 ---- roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent; |
From: Paul F. <pg...@us...> - 2006-07-13 15:47:59
|
Update of /cvsroot/roadmap/roadmap/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371/gtk2 Modified Files: roadmap_canvas.c Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/gtk2/roadmap_canvas.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_canvas.c 26 Jun 2006 19:54:01 -0000 1.12 --- roadmap_canvas.c 13 Jul 2006 15:47:53 -0000 1.13 *************** *** 99,103 **** void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, int *ascent, int *descent) { PangoRectangle rectangle; --- 99,104 ---- void roadmap_canvas_get_text_extents ! (const char *text, int size, int *width, ! int *ascent, int *descent, int *can_tilt) { PangoRectangle rectangle; *************** *** 115,118 **** --- 116,120 ---- *ascent = PANGO_ASCENT(rectangle) / PANGO_SCALE; *descent = PANGO_DESCENT(rectangle) / PANGO_SCALE; + if (can_tilt) *can_tilt = 0; } *************** *** 208,212 **** roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent); text_height = text_ascent + text_descent; --- 210,214 ---- roadmap_canvas_get_text_extents ! (text, -1, &text_width, &text_ascent, &text_descent, NULL); text_height = text_ascent + text_descent; *************** *** 301,305 **** void roadmap_canvas_draw_multiple_polygons (int count, int *polygons, RoadMapGuiPoint *points, int filled, ! int fast_draw) { int i; --- 303,307 ---- void roadmap_canvas_draw_multiple_polygons (int count, int *polygons, RoadMapGuiPoint *points, int filled, ! int fast_draw) { int i; *************** *** 333,337 **** void roadmap_canvas_draw_multiple_circles (int count, RoadMapGuiPoint *centers, int *radius, int filled, ! int fast_draw) { int i; --- 335,339 ---- void roadmap_canvas_draw_multiple_circles (int count, RoadMapGuiPoint *centers, int *radius, int filled, ! int fast_draw) { int i; |
From: Paul F. <pg...@us...> - 2006-07-13 15:47:59
|
Update of /cvsroot/roadmap/roadmap/src/qt In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30371/qt Modified Files: qt_canvas.cc qt_canvas.h roadmap_canvas.cc Log Message: the canvas layer can now report whether or not it can print angled text, via new optional return arg from roadmap_canvas_get_text_extents(). all desktops now fall back to horizontal text if the interntal line font is turned off with -DROADMAP_NO_LINEFONT, and if no other angling (e.g., agg, or QT's rotate transform) is available. Index: roadmap_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/roadmap_canvas.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** roadmap_canvas.cc 27 Jun 2006 17:43:58 -0000 1.9 --- roadmap_canvas.cc 13 Jul 2006 15:47:53 -0000 1.10 *************** *** 84,90 **** void roadmap_canvas_get_text_extents(const char *text, int size, ! int *width, int *ascent, int *descent) { ! roadMapCanvas->getTextExtents(text, width, ascent, descent); } --- 84,90 ---- void roadmap_canvas_get_text_extents(const char *text, int size, ! int *width, int *ascent, int *descent, int *can_tilt) { ! roadMapCanvas->getTextExtents(text, width, ascent, descent, can_tilt); } Index: qt_canvas.cc =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** qt_canvas.cc 3 Jul 2006 12:30:11 -0000 1.11 --- qt_canvas.cc 13 Jul 2006 15:47:53 -0000 1.12 *************** *** 103,107 **** void RMapCanvas::getTextExtents(const char* text, int* w, int* ascent, ! int* descent) { QFont f("Arial Bold",12); --- 103,107 ---- void RMapCanvas::getTextExtents(const char* text, int* w, int* ascent, ! int* descent, int *can_tilt) { QFont f("Arial Bold",12); *************** *** 112,115 **** --- 112,120 ---- *ascent = fm.ascent(); *descent = fm.descent(); + #ifdef QT_NO_ROTATE + if (can_tilt) *can_tilt = 0; + #else + if (can_tilt) *can_tilt = 1; + #endif } *************** *** 133,137 **** int x, y; ! getTextExtents(text, &text_width, &text_ascent, &text_descent); switch (corner) { --- 138,142 ---- int x, y; ! getTextExtents(text, &text_width, &text_ascent, &text_descent, NULL); switch (corner) { Index: qt_canvas.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/qt/qt_canvas.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** qt_canvas.h 27 Jun 2006 17:43:58 -0000 1.6 --- qt_canvas.h 13 Jul 2006 15:47:53 -0000 1.7 *************** *** 74,78 **** void registerConfigureHandler(RoadMapCanvasConfigureHandler handler); void getTextExtents(const char* text, int* width, int* ascent, ! int* descent); int getHeight(); --- 74,78 ---- void registerConfigureHandler(RoadMapCanvasConfigureHandler handler); void getTextExtents(const char* text, int* width, int* ascent, ! int* descent, int *can_tilt); int getHeight(); |
From: Paul F. <pg...@us...> - 2006-07-13 15:41:05
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27555 Modified Files: roadmap_linefont.c Log Message: fix warning Index: roadmap_linefont.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_linefont.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_linefont.c 13 Jul 2006 13:30:33 -0000 1.1 --- roadmap_linefont.c 13 Jul 2006 15:40:58 -0000 1.2 *************** *** 110,114 **** static hershey_font hf[1]; ! static unsigned char *fontp; const unsigned char romans_font[]; --- 110,114 ---- static hershey_font hf[1]; ! static const unsigned char *fontp; const unsigned char romans_font[]; |
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6163/src Modified Files: Makefile config.mk options.mk roadmap_label.c roadmap_math.c roadmap_screen.c Added Files: roadmap_linefont.c roadmap_linefont.h Log Message: add support for drawing text on the map directly, using a simple Hershey font. also improve the label collision avoidance code for all map fonts. Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** config.mk 3 Jul 2006 12:28:17 -0000 1.6 --- config.mk 13 Jul 2006 13:30:32 -0000 1.7 *************** *** 20,25 **** CFLAGS = ! # if you know you need other libraries for your build, you can ! # add those here as well. for example: # LIBS += -L$(QTDIR)/lib64 LIBS = --- 20,25 ---- CFLAGS = ! # If you know you need other libraries for your build, you can ! # add those here as well. For example: # LIBS += -L$(QTDIR)/lib64 LIBS = *************** *** 32,41 **** # DESKTOP = QPE ! # if you select QT or QPE above, you might also want to set ! # QTDIR here: # QTDIR = /usr ! # if you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in ! # some Familiar builds), set QT_NO_ROTATE # QT_NO_ROTATE = YES --- 32,42 ---- # DESKTOP = QPE ! # If you select QT or QPE above, you might also want to set ! # QTDIR here. (But it might already be set in your environment.) # QTDIR = /usr ! # If you are using a build of QT without the QPainter::rotate() # call builtin (i.e., built with QT_NO_TRANSFORMATIONS, as in ! # some Familiar builds), set QT_NO_ROTATE. RoadMap will then use ! # its internal labeling font. # QT_NO_ROTATE = YES *************** *** 55,65 **** # SHAPEFILES = YES ! # In order to properly label streets on the map, it's necessary ! # to be able to draw text at arbitrary angles. RoadMap uses the ! # "Anti-Grain Geometry" library, libagg.a, in order to do this. ! # If you don't have this library, RoadMap can still do street ! # labels, but they will all be horizontal, and won't look as # nice. (for more information on AGG, see http://antigrain.com) ! # RoadMap requires version 2.4 of agg. # [ Note -- currently, only GTK2 supports AGG builds. ] # AGG = YES --- 56,65 ---- # SHAPEFILES = YES ! # For better-looking lines and a better looking street-label ! # font, RoadMap can use the "Anti-Grain Geometry" library, ! # libagg.a, on some desktops. If you don't have this library, ! # RoadMap can still do street labels, but they won't look as # nice. (for more information on AGG, see http://antigrain.com) ! # RoadMap requires version 2.4 of agg. # [ Note -- currently, only GTK2 supports AGG builds. ] # AGG = YES Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** options.mk 5 Jul 2006 15:32:09 -0000 1.4 --- options.mk 13 Jul 2006 13:30:33 -0000 1.5 *************** *** 95,123 **** endif ! # rotation support in QT/QPE ifeq ($(strip $(QT_NO_ROTATE)),YES) ! CFLAGS += -DQT_NO_ROTATE -UANGLED_LABELS else ifeq ($(strip $(DESKTOP)),QT) ! CFLAGS += -DANGLED_LABELS=1 endif ifeq ($(strip $(DESKTOP)),QPE) ! CFLAGS += -DANGLED_LABELS=1 endif endif - # later... - # ifneq ($(NAVIGATE),NO) - # LIBS += -L$(TOP)/dglib -ldgl - # endif - # each DESKTOP version has a fully-"native" canvas ! # implementation, as well as an agg-based implementation. ifeq ($(strip $(AGG)),NO) CANVAS_OBJS = roadmap_canvas.o else LIBS += -lagg -lfreetype ! CFLAGS += -DANGLED_LABELS=1 \ -I$(TOP)/agg_support \ -I/usr/include/agg2 \ --- 95,118 ---- endif ! # rotation support in QT/QPE? ifeq ($(strip $(QT_NO_ROTATE)),YES) ! CFLAGS += -DQT_NO_ROTATE else ifeq ($(strip $(DESKTOP)),QT) ! CFLAGS += -DROADMAP_NO_LINEFONT endif ifeq ($(strip $(DESKTOP)),QPE) ! CFLAGS += -DROADMAP_NO_LINEFONT endif endif # each DESKTOP version has a fully-"native" canvas ! # implementation, as well as a possible agg-based implementation. ifeq ($(strip $(AGG)),NO) CANVAS_OBJS = roadmap_canvas.o else LIBS += -lagg -lfreetype ! CFLAGS += -DROADMAP_NO_LINEFONT \ -I$(TOP)/agg_support \ -I/usr/include/agg2 \ Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** Makefile 5 Jul 2006 15:32:08 -0000 1.81 --- Makefile 13 Jul 2006 13:30:32 -0000 1.82 *************** *** 44,48 **** roadmap_sunrise.c \ roadmap_state.c \ ! roadmap_gpx.c RMLIBOBJS=$(RMLIBSRCS:.c=.o) --- 44,49 ---- roadmap_sunrise.c \ roadmap_state.c \ ! roadmap_gpx.c \ ! roadmap_linefont.c RMLIBOBJS=$(RMLIBSRCS:.c=.o) Index: roadmap_math.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_math.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** roadmap_math.c 2 Jul 2006 16:24:02 -0000 1.35 --- roadmap_math.c 13 Jul 2006 13:30:33 -0000 1.36 *************** *** 627,631 **** * rotate the coordinates of a point to an arbitrary angle */ ! void roadmap_math_rotate_point (RoadMapGuiPoint *points, RoadMapGuiPoint *center, int angle) { --- 627,631 ---- * rotate the coordinates of a point to an arbitrary angle */ ! void roadmap_math_rotate_point (RoadMapGuiPoint *point, RoadMapGuiPoint *center, int angle) { *************** *** 637,642 **** int y; - if (angle == 0) return; - if (angle != cached_angle) { cached_angle = angle; --- 637,640 ---- *************** *** 646,664 **** } ! x = points->x; ! y = points->y; ! points->x = center->x + (((x * cos_orientation) + (y * sin_orientation) + 16383) / 32768); ! points->y = center->y - (((y * cos_orientation) - (x * sin_orientation) + 16383) / 32768); if (RoadMapContext._3D_horizon) { ! roadmap_math_project (points); } } --- 644,664 ---- } ! x = point->x; ! y = point->y; ! point->x = center->x + (((x * cos_orientation) + (y * sin_orientation) + 16383) / 32768); ! point->y = center->y - (((y * cos_orientation) - (x * sin_orientation) + 16383) / 32768); + if (angle == 0) return; + if (RoadMapContext._3D_horizon) { ! roadmap_math_project (point); } } *************** *** 1579,1582 **** --- 1579,1585 ---- } + /* this routine isn't accurate for segments that are either very flat + * or very steep (i.e. within a few degrees of 0 or 90). + */ int roadmap_math_screen_intersect (RoadMapGuiPoint *f1, RoadMapGuiPoint *t1, RoadMapGuiPoint *f2, RoadMapGuiPoint *t2, *************** *** 1586,1589 **** --- 1589,1593 ---- double a1,b1; double a2,b2; + double x; if (f1->x == t1->x) { *************** *** 1606,1614 **** if (a1 == a2) return 0; ! isect->x = (int) ((b1 - b2) / (a2 - a1)); ! isect->y = (int) (b1 + isect->x * a1); #else long a1,b1; long a2,b2; if (f1->x == t1->x) { --- 1610,1624 ---- if (a1 == a2) return 0; ! x = (b1 - b2) / (a2 - a1); ! if (fabs(a1) < fabs(a2)) { ! isect->y = (int) (b1 + x * a1); ! } else { ! isect->y = (int) (b2 + x * a2); ! } ! isect->x = (int)x; #else long a1,b1; long a2,b2; + long x; if (f1->x == t1->x) { *************** *** 1620,1624 **** } ! if ((f2->x - t2->x) == 0) { a2 = 0; b2 = 1024 * f2->y; --- 1630,1634 ---- } ! if (f2->x == t2->x) { a2 = 0; b2 = 1024 * f2->y; *************** *** 1630,1635 **** if (a1 == a2) return 0; ! isect->x = (b1 - b2) / (a2 - a1); ! isect->y = (b1 + isect->x * a1) / 1024; #endif --- 1640,1650 ---- if (a1 == a2) return 0; ! x = (b1 - b2) / (a2 - a1); ! if (abs(a1) < abs(a2)) { ! isect->y = (b1 + x * a1) / 1024; ! } else { ! isect->y = (b2 + x * a2) / 1024; ! } ! isect->x = x; #endif --- NEW FILE: roadmap_linefont.c --- /* roadmap_linefont.c - draw text on a map. * * LICENSE: * * Copyright 2006 Paul G. Fox * * 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 * * Some of the platforms on which RoadMap runs do not have font support * sophisticated enough to render angled or scaled text. (The GTK-1.2 * desktop is one of these, some builds of QT are another.) This file * provides a fallback mechanism for drawing text on a map image, for * those platforms. * * The code in this file borrows heavily from the Xrotfont package * posted to Usenet in 1992 by Alan Richardson. His implementation * was based in turn on an earlier work distributed with the Hershey * fonts themselves. Credits as listed in Alan Richardson's compilation * are copied here. Additional original use restrictions appear * at bottom of this file. * * * ****************************************************************** * * hersheytext.c - routines to facilitate the loading and * painting of hershey fonts * * Functions: hersheytext() * load_hershey_font() * scanint() * * Date: 8/5/92 * * Copyright (c) 1992 Alan Richardson * * ***************************************************************** * * The code in this file is based heavily on the program "hershey.c", * distributed with the Hershey fonts. The credits for that program ... * * Translated by Pete Holzmann * Octopus Enterprises * 19611 La Mar Court * Cupertino, CA 95014 * * Original... * .. By James Hurt when with * .. Deere and Company * .. John Deere Road * .. Moline, IL 61265 * * .. now with Cognition, Inc. * .. 900 Technology Park Drive * .. Billerica, MA 01821 * * * * */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_gui.h" #include "roadmap_math.h" #include "roadmap_canvas.h" #include "roadmap_linefont.h" #ifdef ROADMAP_USE_LINEFONT #define MAXCHARS 100 #define MAXPOINTS 256 typedef struct { unsigned char x, y; } hpoint; /* hershey font stuff ... */ typedef struct { hpoint *pt; unsigned char npnt; unsigned char minx, maxx; } hershey_char; typedef struct hershey_font { hershey_char hc[MAXCHARS]; short nchars; unsigned char miny, maxy; } hershey_font; static hershey_font hf[1]; static unsigned char *fontp; const unsigned char romans_font[]; /* this function scans an integer, using n characters of the input stream, ignoring newlines ... */ static int scanint(int n) { char buf[20]; int i, c; for (i = 0; i < n; i++) { while ((c = *fontp++) == '\n'); /* discard spare newlines */ if (c == '\0') return (-1); buf[i] = c; } buf[i] = 0; return (atoi(buf)); } /* this loads font information from a file into memory */ static void roadmap_load_hershey_font(void) { int np; int i, j; /* point to hershey font data ... data has already been * sorted into ASCII order. * (Note: RoadMap only supports "Roman Simplex") */ fontp = romans_font; /* loop through the characters in the file ... */ for (j = 0; j < MAXCHARS; j++) { /* read character number and data ... */ if (scanint(5) < 1) { break; } else { /* get the number of vertices in this figure ... */ np = scanint(3); if (np > MAXPOINTS) { roadmap_log(ROADMAP_WARNING, "Too many points in hershey character, truncated"); np = MAXPOINTS; } hf->hc[j].npnt = np; hf->hc[j].pt = malloc(np * sizeof(hpoint)); roadmap_check_allocated (hf->hc[j].pt ); /* read in the vertice coordinates ... * (note that pt[0] contains the left and right margin * values from the hershey data, which are unused in this * implementation.) */ for (i = 0; i < np; i++) { if (*fontp == '\n') fontp++; hf->hc[j].pt[i].x = *fontp++; /* x-coordinate */ if (*fontp == '\n') fontp++; hf->hc[j].pt[i].y = *fontp++; /* y-coordinate */ } } } if (j >= MAXCHARS) { roadmap_log(ROADMAP_WARNING, "Too many characters in line font, font truncated"); j = MAXCHARS - 1; } hf->nchars = j; /* determine the size of each character ... */ /* initialise ... */ hf->miny = 255; hf->maxy = 0; /* loop through each character ... */ for (j = 1; j < hf->nchars; j++) { hf->hc[j].minx = 255; hf->hc[j].maxx = 0; for (i = 1; i < hf->hc[j].npnt; i++) { if (hf->hc[j].pt[i].x != ' ') { if (hf->hc[j].pt[i].x < hf->hc[j].minx) hf->hc[j].minx = hf->hc[j].pt[i].x; if (hf->hc[j].pt[i].x > hf->hc[j].maxx) hf->hc[j].maxx = hf->hc[j].pt[i].x; if (hf->hc[j].pt[i].y < hf->miny) hf->miny = hf->hc[j].pt[i].y; if (hf->hc[j].pt[i].y > hf->maxy) hf->maxy = hf->hc[j].pt[i].y; } } } /* do the space character by hand ... same width as 't' */ hf->hc[0].minx = hf->hc['t' - ' '].minx; hf->hc[0].maxx = hf->hc['t' - ' '].maxx; /* a little offset for a nice appearance ... */ for (j = 0; j < hf->nchars; j++) { hf->hc[j].minx -= 3; hf->hc[j].maxx += 3; } } void roadmap_linefont_extents (const char *text, int size, int *width, int *ascent, int *descent) { int len, scale; const char *t; int k; if (fontp == 0) { roadmap_load_hershey_font(); } scale = 1024 * size / (hf->maxy - hf->miny); /* find the length of the string in pixels ... */ len = 0; for (t = text; *t; t++) { k = *t - ' '; if (k < hf->nchars) { len += hf->hc[k].maxx - hf->hc[k].minx; } } *width = scale * len / 1024; *ascent = scale * (hf->maxy - hf->miny)/ 1024; *descent = 0; /* hershey gives no info re: "baseline" */ } /* render a string to the screen ... */ void roadmap_linefont_text (const char *text, int where, RoadMapGuiPoint *center, int size, int theta) { RoadMapGuiPoint *p, points[MAXPOINTS]; int i, k, len, height, xp, yp, count; long scale; const char *t; /* scale factor ... */ scale = 1024 * size / (hf->maxy - hf->miny); /* find the length of the string in pixels ... */ len = 0; for (t = text; *t; t++) { k = *t - ' '; if (k < hf->nchars) { len += hf->hc[k].maxx - hf->hc[k].minx; } } /* alignment stuff ... */ xp = center->x + 1; yp = center->y; len = scale * len / 1024; height = scale * (hf->maxy - hf->miny) / 1024; if (where & ROADMAP_LINEFONT_RIGHT) xp -= len; else if (where & ROADMAP_LINEFONT_CENTER_X) xp -= len / 2; if (where & ROADMAP_LINEFONT_LOWER) yp -= height; else if (where & ROADMAP_LINEFONT_CENTER_Y) yp -= (height / 2); p = points; count = 0; /* loop through each character in the string ... */ for (t = text; *t; t++) { k = *t - ' '; if (k >= hf->nchars) { continue; } /* loop through each vertex ... */ for (i = 1; i < hf->hc[k].npnt; i++) { if (hf->hc[k].pt[i].x == ' ') { if (count) { roadmap_canvas_draw_multiple_lines (1, &count, points, 1); p = points; count = 0; } } else { p->x = xp + scale * (hf->hc[k].pt[i].x - hf->hc[k].minx) / 1024; p->y = yp + scale * (hf->hc[k].pt[i].y - hf->miny) / 1024; p->x = p->x - center->x; p->y = center->y - p->y; roadmap_math_rotate_point (p, center, theta); p++; count++; } } if (count) { roadmap_canvas_draw_multiple_lines (1, &count, points, 1); p = points; count = 0; } /* advance the starting coordinate ... */ xp += scale * (hf->hc[k].maxx - hf->hc[k].minx) / 1024; } } /* This string is simply an in-line version of the file "romans", * the Roman-Simplex font distributed on Usenet with with Alan * Richardson's Xrotfont package. To inline another such font, * simply quote each line, escape all '\' characters, and join * lines that are clearly continuations lines. * */ const unsigned char romans_font[] = " 699 1JZ\n" " 714 9MWRFRT RRYQZR[SZRY\n" " 717 6JZNFNM RVFVM\n" " 733 12H]SBLb RYBRb RLOZO RKUYU\n" " 719 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX\n" " 2271 32F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT\n" " 734 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y\n" " 731 8MWRHQGRFSGSIRKQL\n" " 721 11KYVBTDRGPKOPOTPYR]T`Vb\n" " 722 11KYNBPDRGTKUPUTTYR]P`Nb\n" " 2219 9JZRFRR RMIWO RWIMO\n" " 725 6E_RIR[ RIR[R\n" " 711 9MWSZR[QZRYSZS\\R^Q_\n" " 724 3E_IR[R\n" " 710 6MWRYQZR[SZRY\n" " 720 3G][BIb\n" " 700 18H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF\n" " 701 5H\\NJPISFS[\n" " 702 15H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[\n" " 703 16H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW\n" " 704 7H\\UFKTZT RUFU[\n" " 705 18H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW\n" " 706 24H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT\n" " 707 6H\\YFO[ RKFYF\n" " 708 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF\n" " 709 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX\n" " 712 12MWRMQNROSNRM RRYQZR[SZRY\n" " 713 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_\n" " 2241 4F^ZIJRZ[\n" " 726 6E_IO[O RIU[U\n" " 2242 4F^JIZRJ[\n" " 715 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY\n" " 2273 56E`WNVLTKQKOLNMMPMSNUPVSVUUVS RQKOMNPNSOUPV RWKVSVUXVZV\\T]Q]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYZX RXKWSWUXV\n" " 501 9I[RFJ[ RRFZ[ RMTWT\n" " 502 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[\n" " 503 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV\n" " 504 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[\n" " 505 12H[LFL[ RLFYF RLPTP RL[Y[\n" " 506 9HZLFL[ RLFYF RLPTP\n" " 507 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS\n" " 508 9G]KFK[ RYFY[ RKPYP\n" " 509 3NVRFR[\n" " 510 11JZVFVVUYTZR[P[NZMYLVLT\n" " 511 9G\\KFK[ RYFKT RPOY[\n" " 512 6HYLFL[ RL[X[\n" " 513 12F^JFJ[ RJFR[ RZFR[ RZFZ[\n" " 514 9G]KFK[ RKFY[ RYFY[\n" " 515 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF\n" " 516 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ\n" " 517 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]\n" " 518 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[\n" " 519 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX\n" " 520 6JZRFR[ RKFYF\n" " 521 11G]KFKULXNZQ[S[VZXXYUYF\n" " 522 6I[JFR[ RZFR[\n" " 523 12F^HFM[ RRFM[ RRFW[ R\\FW[\n" " 524 6H\\KFY[ RYFK[\n" " 525 7I[JFRPR[ RZFRP\n" " 526 9H\\YFK[ RKFYF RK[Y[\n" " 2223 12KYOBOb RPBPb ROBVB RObVb\n" " 804 3KYKFY^\n" " 2224 12KYTBTb RUBUb RNBUB RNbUb\n" " 2262 11JZPLRITL RMORJWO RRJR[\n" " 999 3JZJ]Z]\n" " 730 8MWSFRGQIQKRLSKRJ\n" " 601 18I\\XMX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 602 18H[LFL[ RLPNNPMSMUNWPXSXUWXUZS[P[NZLX\n" " 603 15I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 604 18I\\XFX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 605 18I[LSXSXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 606 9MYWFUFSGRJR[ ROMVM\n" " 607 23I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 608 11I\\MFM[ RMQPNRMUMWNXQX[\n" " 609 9NVQFRGSFREQF RRMR[\n" " 610 12MWRFSGTFSERF RSMS^RaPbNb\n" " 611 9IZMFM[ RWMMW RQSX[\n" " 612 3NVRFR[\n" " 613 19CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][\n" " 614 11I\\MMM[ RMQPNRMUMWNXQX[\n" " 615 18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM\n" " 616 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX\n" " 617 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX\n" " 618 9KXOMO[ ROSPPRNTMWM\n" " 619 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX\n" " 620 9MYRFRWSZU[W[ ROMVM\n" " 621 11I\\MMMWNZP[S[UZXW RXMX[\n" " 622 6JZLMR[ RXMR[\n" " 623 12G]JMN[ RRMN[ RRMV[ RZMV[\n" " 624 6J[MMX[ RXMM[\n" " 625 10JZLMR[ RXMR[P_NaLbKb\n" " 626 9J[XMM[ RMMXM RM[X[\n" " 2225 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb\n" " 723 3NVRBRb\n" " 2226 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb\n\n" " 2246 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O\n" " 718 14KYQFOGNINKOMQNSNUMVKVIUGSFQF\n"; /* original restriction text from mod.sources posting of the fonts follows: ----quote begins--- Mod.sources: Volume 4, Issue 42 Submitted by: pyramid!octopus!pete (Pete Holzmann) This is part 1 of five parts of the first Usenet distribution of the Hershey Fonts. See the README file for more details. Peter Holzmann, Octopus Enterprises USPS: 19611 La Mar Court, Cupertino, CA 95014 UUCP: {hplabs!hpdsd,pyramid}!octopus!pete Phone: 408/996-7746 This distribution is made possible through the collective encouragement of the Usenet Font Consortium, a mailing list that sprang to life to get this accomplished and that will now most likely disappear into the mists of time... Thanks are especially due to Jim Hurt, who provided the packed font data for the distribution, along with a lot of other help. This file describes the Hershey Fonts in general, along with a description of the other files in this distribution and a simple re-distribution restriction. USE RESTRICTION: This distribution of the Hershey Fonts may be used by anyone for any purpose, commercial or otherwise, providing that: 1. The following acknowledgements must be distributed with the font data: - The Hershey Fonts were originally created by Dr. A. V. Hershey while working at the U. S. National Bureau of Standards. - The format of the Font data in this distribution was originally created by James Hurt Cognition, Inc. 900 Technology Park Drive Billerica, MA 01821 (mit-eddie!ci-dandelion!hurt) 2. The font data in this distribution may be converted into any other format *EXCEPT* the format distributed by the U.S. NTIS (which organization holds the rights to the distribution and use of the font data in that particular format). Not that anybody would really *want* to use their format... each point is described in eight bytes as "xxx yyy:", where xxx and yyy are the coordinate values as ASCII numbers. ----quote ends--- [ the original text continues, but describes files and formats not present here. -pgf ] */ #endif /* ROADMAP_USE_LINEFONT */ Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** roadmap_screen.c 2 Jul 2006 16:24:02 -0000 1.66 --- roadmap_screen.c 13 Jul 2006 13:30:33 -0000 1.67 *************** *** 64,71 **** #include "roadmap_screen.h" - #ifndef ANGLED_LABELS - #define ANGLED_LABELS 0 - #endif - static RoadMapConfigDescriptor RoadMapConfigDeltaX = --- 64,67 ---- *************** *** 657,666 **** cutoff_dist = roadmap_math_screen_distance (&label_cutoff, &loweredge, MATH_DIST_SQUARED); ! } ! #if ANGLED_LABELS ! else { angle_ptr = ∠ } - #endif } --- 653,659 ---- cutoff_dist = roadmap_math_screen_distance (&label_cutoff, &loweredge, MATH_DIST_SQUARED); ! } else { angle_ptr = ∠ } } *************** *** 1023,1028 **** if (!RoadMapScreenDragging) { ! roadmap_label_draw_cache ! (ANGLED_LABELS && RoadMapScreen3dHorizon == 0); } } --- 1016,1020 ---- if (!RoadMapScreenDragging) { ! roadmap_label_draw_cache (RoadMapScreen3dHorizon == 0); } } *************** *** 1359,1366 **** } void roadmap_screen_move_up (void) { ! roadmap_screen_record_move (0, 0 - (RoadMapScreenHeight / 4)); roadmap_screen_repaint (); } --- 1351,1359 ---- } + #define FRACMOVE 4 void roadmap_screen_move_up (void) { ! roadmap_screen_record_move (0, 0 - (RoadMapScreenHeight / FRACMOVE)); roadmap_screen_repaint (); } *************** *** 1369,1373 **** void roadmap_screen_move_down (void) { ! roadmap_screen_record_move (0, RoadMapScreenHeight / 4); roadmap_screen_repaint (); } --- 1362,1366 ---- void roadmap_screen_move_down (void) { ! roadmap_screen_record_move (0, RoadMapScreenHeight / FRACMOVE); roadmap_screen_repaint (); } *************** *** 1376,1380 **** void roadmap_screen_move_right (void) { ! roadmap_screen_record_move (RoadMapScreenHeight / 4, 0); roadmap_screen_repaint (); } --- 1369,1373 ---- void roadmap_screen_move_right (void) { ! roadmap_screen_record_move (RoadMapScreenHeight / FRACMOVE, 0); roadmap_screen_repaint (); } *************** *** 1383,1387 **** void roadmap_screen_move_left (void) { ! roadmap_screen_record_move (0 - (RoadMapScreenHeight / 4), 0); roadmap_screen_repaint (); } --- 1376,1380 ---- void roadmap_screen_move_left (void) { ! roadmap_screen_record_move (0 - (RoadMapScreenHeight / FRACMOVE), 0); roadmap_screen_repaint (); } --- NEW FILE: roadmap_linefont.h --- /* roadmap_linefont.h - draw text on a map. * * LICENSE: * * Copyright 2006 Paul G. Fox * * 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 */ #ifndef ROADMAP_NO_LINEFONT #define ROADMAP_USE_LINEFONT 1 void roadmap_linefont_extents (const char *text, int size, int *width, int *ascent, int *descent); void roadmap_linefont_text (const char *text, int allign, RoadMapGuiPoint *center, int size, int theta); #define ROADMAP_LINEFONT_LEFT 0 #define ROADMAP_LINEFONT_RIGHT 1 #define ROADMAP_LINEFONT_CENTER_X 2 #define ROADMAP_LINEFONT_UPPER 0 #define ROADMAP_LINEFONT_LOWER 4 #define ROADMAP_LINEFONT_CENTER_Y 8 #define ROADMAP_LINEFONT_CENTERED \ (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_CENTER_Y) #define ROADMAP_LINEFONT_CENTERED_ABOVE \ (ROADMAP_LINEFONT_CENTER_X | ROADMAP_LINEFONT_LOWER) #endif Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_label.c 3 Jul 2006 13:21:58 -0000 1.8 --- roadmap_label.c 13 Jul 2006 13:30:33 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- #include "roadmap_plugin.h" #include "roadmap_canvas.h" + #include "roadmap_linefont.h" #include "roadmap_label.h" *************** *** 63,68 **** static int point_in_bbox( RoadMapGuiPoint *p, RoadMapGuiRect *bb) { ! if ((p->x < bb->minx) || (p->x > bb->maxx) || ! (p->y > bb->maxy) || (p->y < bb->miny)) return 0; --- 64,69 ---- static int point_in_bbox( RoadMapGuiPoint *p, RoadMapGuiRect *bb) { ! if ((p->x <= bb->minx) || (p->x >= bb->maxx) || ! (p->y >= bb->maxy) || (p->y <= bb->miny)) return 0; *************** *** 77,80 **** --- 78,82 ---- RoadMapGuiPoint isect; int ai, bi; + for (ai = 0; ai < 4; ai++) { for (bi = 0; bi < 4; bi++) { *************** *** 82,87 **** &b[bi], &b[(bi+1)%4], &isect)) { if (point_in_bbox(&isect, &c1->bbox) && ! point_in_bbox(&isect, &c2->bbox)) return 1; } } --- 84,90 ---- &b[bi], &b[(bi+1)%4], &isect)) { if (point_in_bbox(&isect, &c1->bbox) && ! point_in_bbox(&isect, &c2->bbox)) { return 1; + } } } *************** *** 109,119 **** static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect) { RoadMapGuiPoint q; int x1=0, y1=0; RoadMapGuiPoint *poly = c->poly; int w, h; - int buffer = 0; - int lines = 2; int angle = c->angle; RoadMapGuiPoint *p = &c->point; --- 112,121 ---- static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; RoadMapGuiPoint *poly = c->poly; + int buffer = 1; int w, h; int angle = c->angle; RoadMapGuiPoint *p = &c->point; *************** *** 123,128 **** /* position CC */ ! x1 = -(int)(w/2.0) + 0; // ox; ! y1 = (int)(h/2.0) + 0; // oy; q.x = x1 - rect->minx; --- 125,131 ---- /* position CC */ ! x1 = -(w/2); ! ! y1 = centered_y ? (h/2) : 0; q.x = x1 - rect->minx; *************** *** 140,144 **** poly[2].x = x1 + w + buffer; /* ur */ ! poly[2].y = -(y1 -h - buffer); roadmap_math_rotate_point (&poly[2], p, angle); --- 143,147 ---- poly[2].x = x1 + w + buffer; /* ur */ ! poly[2].y = -(y1 - h - buffer); roadmap_math_rotate_point (&poly[2], p, angle); *************** *** 147,153 **** roadmap_math_rotate_point (&poly[3], p, angle); ! lines = 4; ! ! /* roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); */ compute_bbox(poly, &c->bbox); --- 150,154 ---- roadmap_math_rotate_point (&poly[3], p, angle); ! // { int lines = 4; roadmap_canvas_draw_multiple_lines(1, &lines, poly, 1); } compute_bbox(poly, &c->bbox); *************** *** 235,238 **** --- 236,240 ---- RoadMapGuiRect r; const char *text; + short aang; labelCacheMemberObj *cachePtr=NULL; *************** *** 255,259 **** --- 257,267 ---- cachePtr->street = properties.plugin_street; + #if ROADMAP_USE_LINEFONT + roadmap_linefont_extents(text, 16, &width, &ascent, &descent); + #define CENTER_Y 0 + #else roadmap_canvas_get_text_extents(text, -1, &width, &ascent, &descent); + #define CENTER_Y 1 + #endif r.minx = 0; r.maxx=width+1; *************** *** 268,272 **** cachePtr->status = 1; /* assume label *can* be drawn */ ! /* The stored point is not screen orieneted, rotate is needed */ roadmap_math_rotate_coordinates (1, &cachePtr->point); --- 276,280 ---- cachePtr->status = 1; /* assume label *can* be drawn */ ! /* The stored point is not screen oriented, rotate is needed */ roadmap_math_rotate_coordinates (1, &cachePtr->point); *************** *** 280,284 **** cachePtr->angle -= 90; ! p = get_metrics (cachePtr, &r); } else { /* Text will be horizontal, so bypass a lot of math. --- 288,295 ---- cachePtr->angle -= 90; ! /* the linefont font is bad. reading it is hard with a road ! * running through it, so we don't center it on the road. ! */ ! p = get_metrics (cachePtr, &r, CENTER_Y); } else { /* Text will be horizontal, so bypass a lot of math. *************** *** 305,312 **** &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient. else... */ ! if(!angles || ! poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; --- 316,342 ---- &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient */ ! if(!angles) { ! cachePtr->status = 0; ! break; ! } ! ! /* if labels are almost horizontal, the bbox check is ! * sufficient. (in addition, the line intersector ! * has trouble with flat or steep lines) ! */ ! aang = abs(cachePtr->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; ! } ! aang = abs(RoadMapLabelCache.labels[i]->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; ! } + /* otherwise we do the full poly check */ + if ( poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { cachePtr->status = 0; break; *************** *** 328,331 **** --- 358,366 ---- } + #if ROADMAP_USE_LINEFONT + roadmap_linefont_text (text, + angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, + &cachePtr->point, 16, cachePtr->angle); + #else if (angles) { roadmap_canvas_draw_string_angle *************** *** 335,338 **** --- 370,374 ---- (&cachePtr->point, ROADMAP_CANVAS_CENTER, text); } + #endif } /* next label */ *************** *** 349,352 **** --- 385,391 ---- roadmap_canvas_set_foreground (roadmap_config_get (&RoadMapConfigLabelsColor)); + + /* assume this will only affect our internal line fonts */ + roadmap_canvas_set_thickness (2); return 0; |
From: Paul F. <pg...@us...> - 2006-07-13 13:30:37
|
Update of /cvsroot/roadmap/roadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6163 Modified Files: README Log Message: add support for drawing text on the map directly, using a simple Hershey font. also improve the label collision avoidance code for all map fonts. Index: README =================================================================== RCS file: /cvsroot/roadmap/roadmap/README,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** README 3 Jul 2006 17:20:34 -0000 1.95 --- README 13 Jul 2006 13:30:32 -0000 1.96 *************** *** 118,136 **** future. ! By default RoadMap use the shapelib library (to decode the shape file ! format). The shape file format is only used for converting the Digital ! Charts of the World. If only US maps from the census bureau are used, ! or if only pre-built maps are used, then there is no need for shapelib: ! build RoadMap with the make option: SHAPEFILES=NO. ! By default, RoadMap uses the expat library to load GPX trip and landmark ! files. RoadMap can be built without expat using the make option: EXPAT=NO. ! Likewise, RoadMap will use the agg library to render angled text when ! labeling streets. If you don't have agg, RoadMap will label with ! horizontal strings. Use: AGG=NO. RoadMap requires version 2.4 of the ! agg library -- 2.3 is incompatible. If your linux distribution includes ! 2.3, make sure that if you install 2.4 as well, that RoadMap finds both ! headers and libraries from 2.4. --- 118,138 ---- future. ! RoadMap can use the shapelib library (to decode the shape file format). ! The shape file format is only used for converting the Digital Charts of ! the World. If only US maps from the census bureau are used, or if only ! pre-built maps are used, then there is no need for shapelib: set ! SHAPEFILES = NO in config.mk. ! RoadMap uses the expat library to load GPX trip and landmark files. ! RoadMap can be built without expat, with some loss of functionality, by ! changing config.mk to say: EXPAT = NO. ! Likewise, RoadMap can sometimes use the agg library to render anti- ! aliased maps and street label text. If you don't have agg, RoadMap ! will label with a (relatively crude) built-in font. To use agg: ! AGG = YES. RoadMap requires version 2.4 of the agg library -- 2.3 is ! incompatible. If your linux distribution includes 2.3, make sure that ! if you install 2.4 as well, that RoadMap finds both headers and ! libraries from 2.4. *************** *** 583,589 **** [AGG=NO] Do not try to link roadmap with the agg library. - The side effect is that street labels may be written - horizontally, rather than "along" their street. (QT and QPE - builds can do angled labels without the agg library.) ---- --- 585,588 ---- |
From: Ehud S. <esh...@us...> - 2006-07-13 06:49:41
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10685 Added Files: Makefile.win32 Log Message: Generic win32 fixes. --- NEW FILE: Makefile.win32 --- # --- Installation options ------------------------------------------------- DESTDIR= INSTALLDIR=/usr/local desktopdir=$(INSTALLDIR)/applications pkgdatadir=$(INSTALLDIR)/share/roadmap pkgmapsdir=/var/lib/roadmap bindir=$(INSTALLDIR)/bin pkgbindir=$(bindir) menudir=$(DESTDIR)/usr/lib/menu ICONDIR=$(INSTALLDIR)/share/pixmaps mandir=$(INSTALLDIR)/share/man man1dir=$(mandir)/man1 INSTALL = install INSTALL_DATA = install -m644 # --- Tool specific options ------------------------------------------------ RANLIB = ranlib WARNFLAGS = -W -Wall -Wno-unused-parameter ifeq ($(MODE),DEBUG) # Memory leak detection using mtrace: # Do not forget to set the trace file using the env. variable MALLOC_TRACE, # then use the mtrace tool to analyze the output. MODECFLAGS=-g $(WARNFLAGS) -DROADMAP_DEBUG_HEAP -DNOIGNORE MODELDFLAGS= else ifeq ($(MODE),PROFILE) MODECFLAGS=-g $(WARNFLAGS) -pg -fprofile-arcs -g MODELDFLAGS=-pg else MODECFLAGS=-O2 -ffast-math -fomit-frame-pointer -DNDEBUG=1 $(WARNFLAGS) $(OPTIONS) MODELDFLAGS= endif endif ifeq ($(SQL),SQLITE) SQLCFLAGS=-DROADMAP_USES_SQLITE SQLLDFLAGS=-lsqlite SQLTOOLS=sqliteload else SQLCFLAGS= SQLLDFLAGS= SQLTOOLS= endif ifeq ($(DESKTOP),GTK2) RDMODULES=gtk2 else ifeq ($(DESKTOP),GPE) RDMODULES=gtk2 else ifeq ($(DESKTOP),GTK) RDMODULES=gtk else ifeq ($(DESKTOP),QT) RDMODULES=qt else ifeq ($(DESKTOP),QPE) RDMODULES=qt else ifeq ($(DESKTOP),WIN32) RDMODULES=win32 else RDMODULES=gtk gtk2 qt endif endif endif endif endif endif HOST=`uname -s` ifeq ($(HOST),Darwin) ARFLAGS="r" else ARFLAGS="rf" endif ifeq ($(SHAPEFILES),NO) ROADMAP_USE_SHAPEFILES= SHAPELDFLAGS= else ROADMAP_USE_SHAPEFILES=-DROADMAP_USE_SHAPEFILES SHAPELDFLAGS=-lshp endif CFLAGS=$(MODECFLAGS) $(SQLCFLAGS) $(ROADMAP_USE_SHAPEFILES) -I/usr/local/include -I$(PWD) -I./dglib -DROADMAP_USE_POSTGRES LDFLAGS=$(MODELDFLAGS) $(SQLLDFLAGS) $(SHAPELDFLAGS) -lpq -L ./dglib RDMLIBS=libroadmap.a win32/libosroadmap.a LIBS=$(RDMLIBS) -lpopt -lm -ldgl # --- RoadMap sources & targets -------------------------------------------- RMLIBSRCS=roadmap_log.c \ roadmap_message.c \ roadmap_string.c \ roadmap_voice.c \ roadmap_list.c \ roadmap_config.c \ roadmap_option.c \ roadmap_metadata.c \ roadmap_county.c \ roadmap_locator.c \ roadmap_math.c \ roadmap_hash.c \ roadmap_dbread.c \ roadmap_dictionary.c \ roadmap_square.c \ roadmap_point.c \ roadmap_line.c \ roadmap_line_route.c \ roadmap_shape.c \ roadmap_turns.c \ roadmap_place.c \ roadmap_polygon.c \ roadmap_street.c \ roadmap_plugin.c \ roadmap_geocode.c \ roadmap_history.c \ roadmap_input.c \ roadmap_nmea.c \ roadmap_gpsd2.c \ roadmap_io.c \ roadmap_gps.c \ roadmap_object.c \ roadmap_state.c \ roadmap_driver.c \ roadmap_adjust.c \ roadmap_sunrise.c RMLIBOBJS=$(RMLIBSRCS:.c=.o) RMGUISRCS=roadmap_sprite.c \ roadmap_object.c \ roadmap_screen_obj.c \ roadmap_trip.c \ roadmap_layer.c \ roadmap_fuzzy.c \ roadmap_navigate.c \ roadmap_pointer.c \ roadmap_screen.c \ roadmap_display.c \ roadmap_factory.c \ roadmap_preferences.c \ roadmap_address.c \ roadmap_crossing.c \ roadmap_coord.c \ roadmap_download.c \ roadmap_help.c \ roadmap_label.c \ roadmap_start.c RMGUIOBJS=$(RMGUISRCS:.c=.o) RGGUISRCS=roadgps_start.c \ roadmap_factory.c \ roadmap_help.c \ roadgps_screen.c \ roadgps_logger.c RGGUIOBJS=$(RGGUISRCS:.c=.o) RMPLUGINSRCS=roadmap_copy.c \ roadmap_httpcopy.c \ editor/editor_main.c \ editor/editor_plugin.c \ editor/editor_screen.c \ editor/static/editor_dialog.c \ editor/db/editor_street.c \ editor/db/editor_point.c \ editor/db/editor_shape.c \ editor/db/editor_line.c \ editor/db/editor_square.c \ editor/db/editor_route.c \ editor/db/editor_dictionary.c \ buildmap_dbwrite.c \ buildmap_metadata.c \ buildmap_messages.c \ editor/db/editor_override.c \ editor/export/editor_export.c \ editor/export/editor_download.c \ editor/export/editor_upload.c \ editor/db/editor_trkseg.c \ editor/track/editor_track_filter.c \ editor/track/editor_track_util.c \ editor/track/editor_track_main.c \ editor/track/editor_track_unknown.c \ editor/track/editor_track_known.c \ editor/db/editor_db.c \ navigate/navigate_main.c \ navigate/navigate_instr.c \ navigate/navigate_bar.c \ navigate/navigate_plugin.c \ navigate/navigate_dglib.c \ RMPLUGINOBJS=$(RMPLUGINSRCS:.c=.o) DMSRCS=dumpmap_main.c DMOBJS=$(DMSRCS:.c=.o) BMSRCS=buildmap_messages.c \ buildmap_dictionary.c \ buildmap_dbwrite.c \ buildmap_metadata.c \ buildmap_city.c \ buildmap_square.c \ buildmap_point.c \ buildmap_street.c \ buildmap_area.c \ buildmap_line.c \ buildmap_line_route.c \ buildmap_dglib.c \ buildmap_shape.c \ buildmap_turn_restrictions.c \ buildmap_polygon.c \ buildmap_range.c \ buildmap_zip.c \ buildmap_tiger.c \ buildmap_shapefile.c \ buildmap_empty.c \ buildmap_postgres.c \ buildmap_place.c \ buildmap_main.c BMOBJS=$(BMSRCS:.c=.o) BPSRCS=buildmap_messages.c \ buildmap_dictionary.c \ buildmap_dbwrite.c \ buildmap_square.c \ buildmap_point.c \ buildmap_place.c \ buildplace_main.c BPOBJS=$(BPSRCS:.c=.o) BUSRCS=buildus_main.c \ buildus_fips.c \ buildus_county.c \ buildmap_dictionary.c \ buildmap_dbwrite.c \ buildmap_messages.c BUOBJS=$(BUSRCS:.c=.o) PKGDATAFILES=sprites preferences schema session drivers BUILD=buildmap buildus dumpmap buildplace SCRIPTS=rdmdownload rdmgetall rdmgenmaps rdmgendcwmaps rdmcompare RUNTIME=$(RDMLIBS) libguiroadgps.a libguiroadmap.a DRIVERS=rdmkismet rdmghost rdmfriends rdmtrace TOOLS=sunrise $(SQLTOOLS) # --- Conventional targets ---------------------------------------- all: everything runtime: $(RUNTIME) build: $(BUILD) strip: strip -s $(RUNTIME) strip -s $(BUILD) clean: cleanone for module in icons $(RDMODULES) ; \ do \ if [ -d $$module ] ; then \ $(MAKE) -C $$module cleanone || exit 1; \ fi ; \ done if [ -d win32 ] ; then $(MAKE) -C win32 cleanone ; fi cleanone: rm -f *.o *.a *.da $(BUILD) $(TOOLS) $(DRIVERS) # Clean up CVS backup files as well. $(RM) .#* install: everything mkdir -p $(DESTDIR)$(pkgmapsdir) chmod a+rx $(DESTDIR)$(pkgmapsdir) mkdir -p $(DESTDIR)$(pkgdatadir) chmod a+rx $(DESTDIR)$(pkgdatadir) cd $(DESTDIR)$(pkgdatadir) && rm -f $(PKGDATAFILES) cp $(PKGDATAFILES) $(DESTDIR)$(pkgdatadir)/. cd $(DESTDIR)$(pkgdatadir) ; chmod a+r $(PKGDATAFILES) mkdir -p $(DESTDIR)$(pkgbindir) cd $(DESTDIR)$(pkgbindir) && rm -f $(BUILD) $(SCRIPTS) cp $(BUILD) $(SCRIPTS) $(DRIVERS) $(DESTDIR)$(pkgbindir)/. cd $(DESTDIR)$(pkgbindir) && chmod a+x $(BUILD) $(SCRIPTS) $(DRIVERS) if [ -d $(menudir) ] ; then cp roadmap.menu $(menudir)/roadmap; fi mkdir -p $(DESTDIR)$(ICONDIR) cd icons && $(MAKE) ICONDIR="$(DESTDIR)$(ICONDIR)" install cp -f roadmap*.png $(DESTDIR)$(ICONDIR)/. mkdir -p $(DESTDIR)$(desktopdir) cp -f roadmap.desktop $(DESTDIR)$(desktopdir)/. mkdir -p $(DESTDIR)$(man1dir) $(INSTALL_DATA) roadgps.1 roadmap.1 $(DESTDIR)$(man1dir)/. installdoc: webdoc copy ../web/manual.html $(DESTDIR)$(pkgdatadir)/manual.html webdoc: aptconvert -toc -enc ASCII ../web/manual.html ../README uninstall: cd $(DESTDIR)$(pkgdatadir) && rm -f $(PKGDATAFILES) cd $(DESTDIR)$(pkgbindir) && rm -f $(BUILD) $(SCRIPTS) $(DRIVERS) if [ -d $(menudir) ] ; then rm -f $(menudir)/roadmap; fi cd icons && $(MAKE) ICONDIR="$(DESTDIR)$(ICONDIR)" uninstall cd $(DESTDIR)$(ICONDIR) && rm -f roadmap*.png cd $(DESTDIR)$(desktopdir) && rm -f roadmap.desktop cd $(DESTDIR)$(man1dir) && rm -f roadgps.1 roadmap.1 everything: modules runtime modules: for module in icons $(RDMODULES) ; \ do \ if [ -d $$module ] ; then \ $(MAKE) -C $$module STDCFLAGS="$(CFLAGS)" all || exit 1; \ fi ; \ done cleanall: for module in icons $(RDMODULES) ; \ do \ if [ -d $$module ] ; then \ $(MAKE) -C $$module clean ; \ fi ; \ done find editor/ -name \*.o -exec rm {} \; rebuild: cleanall everything sunrise: roadmap_sunrise.c $(CC) -g -DSUNRISE_PROGRAM roadmap_sunrise.c -o sunrise -lm sqliteload: sqliteload.c $(CC) -g sqliteload.c $(SQLCFLAGS) $(SQLLDFLAGS) -o sqliteload -lm rdmkismet: roadmap_kismet.c $(RDMLIBS) $(CC) -g roadmap_kismet.c -o rdmkismet $(RDMLIBS) $(RDMLIBS) -lm rdmghost: roadmap_ghost.c $(RDMLIBS) $(CC) -g roadmap_ghost.c -o rdmghost $(RDMLIBS) -lm rdmfriends: roadmap_friends.c $(RDMLIBS) $(CC) -g roadmap_friends.c -o rdmfriends $(RDMLIBS) $(RDMLIBS) -lm rdmtrace: roadmap_trace.c $(RDMLIBS) $(CC) -g roadmap_trace.c -o rdmtrace $(RDMLIBS) -lm # --- The real targets -------------------------------------------- libroadmap.a: $(RMLIBOBJS) $(AR) $(ARFLAGS) libroadmap.a $(RMLIBOBJS) $(RANLIB) libroadmap.a libguiroadmap.a: $(RMGUIOBJS) $(RMPLUGINOBJS) $(AR) $(ARFLAGS) libguiroadmap.a $(RMGUIOBJS) $(RMPLUGINOBJS) $(RANLIB) libguiroadmap.a libguiroadgps.a: $(RGGUIOBJS) $(AR) $(ARFLAGS) libguiroadgps.a $(RGGUIOBJS) $(RANLIB) libguiroadgps.a win32/libosroadmap.a: if [ -d win32 ] ; then $(MAKE) -f Makefile.os -C win32 "CFLAGS=$(CFLAGS) -I.." ; fi dumpmap: $(DMOBJS) $(RDMLIBS) $(CC) $(LDFLAGS) $(DMOBJS) -o dumpmap $(LIBS) buildmap: $(BMOBJS) $(RDMLIBS) $(CC) $(LDFLAGS) $(BMOBJS) -o buildmap $(LIBS) buildus: $(BUOBJS) $(RDMLIBS) $(CC) $(LDFLAGS) $(BUOBJS) -o buildus $(LIBS) buildplace: $(BPOBJS) $(RDMLIBS) $(CC) $(LDFLAGS) $(BPOBJS) -o buildplace $(LIBS) |
From: Ehud S. <esh...@us...> - 2006-07-13 06:49:06
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10413 Added Files: Makefile Makefile.os Log Message: Generic win32 fixes. --- NEW FILE: Makefile.os --- # --- Tool specific options ------------------------------------------------ RANLIB = ranlib HOST=`uname -s` ifeq ($(HOST),Darwin) ARFLAGS="r" else ARFLAGS="rf" endif CPPFLAGS = -DUNICODE -D_UNICODE # --- RoadMap sources & targets -------------------------------------------- OSLIBSRCS=roadmap_file.c \ roadmap_path.c \ roadmap_library.c \ roadmap_net.c \ roadmap_serial.c \ roadmap_spawn.c \ roadmap_time.c \ roadmap_win32.c \ listports.c \ wince_input_mon.c \ ../md5.c OSLIBOBJS=$(OSLIBSRCS:.c=.o) # --- Conventional targets ---------------------------------------- all: runtime build: runtime: libosroadmap.a clean: cleanone cleanone: rm -f *.o *.a *.da install: uninstall: # --- The real targets -------------------------------------------- libosroadmap.a: $(OSLIBOBJS) $(AR) $(ARFLAGS) libosroadmap.a $(OSLIBOBJS) $(RANLIB) libosroadmap.a --- NEW FILE: Makefile --- # --- Installation options ------------------------------------------------- DESTDIR= INSTALLDIR=/usr/local bindir=$(INSTALLDIR)/bin # --- Tool specific options ------------------------------------------------ RANLIB=ranlib STRIP=strip WARNFLAGS = -W -Wall -Wno-unused-parameter RDMLIBS= ../libroadmap.a libwin32roadmap.a libosroadmap.a ../libroadmap.a libwin32roadmap.a ifeq ($(MODE),DEBUG) STDCFLAGS=-g $(WARNFLAGS) -DROADMAP_DEBUG_HEAP else ifeq ($(MODE),PROFILE) STDCFLAGS=-g $(WARNFLAGS) -pg -fprofile-arcs -g LDFLAGS=-pg $(LDFLAGS) else STDCFLAGS=-O2 -ffast-math -fomit-frame-pointer $(WARNFLAGS) $(OPTIONS) endif endif HOST=`uname -s` ifeq ($(HOST),Darwin) ARFLAGS="r" else ARFLAGS="rf" endif CFLAGS = $(STDCFLAGS) $(GPECFLAGS) $(GUICFLAGS) -I.. -I/usr/local/include -DNDEBUG -w -fno-underscoring CPPFLAGS = -DUNICODE -D_UNICODE LIBS = $(RDMLIBS) $(GPELDFLAGS) $(GUILDFLAGS) -lm -L ../dglib -ldgl -L../agg -lagg_w32 -L../freetype -lfreetype_w32 -lwsock32 -lgdi32 -lcomdlg32 ifeq ($(BIDI),YES) LIBS += -lfribidi CFLAGS += -DUSE_FRIBIDI endif CXXFLAGS = $(CFLAGS) -I../agg/include -I/usr/include/freetype2 -I/usr/include/fribidi # --- RoadMap sources & targets ----------------------------------- RMLIBSRCS=roadmap_messagebox.c \ roadmap_dialog.c \ roadmap_fileselection.c RMLIBOBJS=$(RMLIBSRCS:.c=.o) roadmap_canvas_agg.o ../agg/roadmap_canvas.o ../agg/font_freetype/agg_font_freetype.o RUNTIME=gtkroadgps gtkroadmap # --- Conventional targets ---------------------------------------- .PHONY: all others build runtime clean cleanone install uninstall all: runtime others: $(MAKE) -f Makefile.win32 -C .. CFLAGS="$(STDCFLAGS)" runtime $(MAKE) -f Makefile.win32 -C ../agg CFLAGS="$(STDCFLAGS)" runtime $(MAKE) -f Makefile.win32 -C ../freetype CFLAGS="$(STDCFLAGS)" runtime build: $(MAKE) -C .. CFLAGS="$(STDCFLAGS)" build runtime: others $(RUNTIME) clean: cleanone $(MAKE) -C .. cleanone $(MAKE) -C .. -C win32 cleanone cleanone: rm -f *.o *.a *.da $(RUNTIME) install: all $(MAKE) -C .. install $(STRIP) $(RUNTIME) mkdir -p $(DESTDIR)$(bindir) cd $(DESTDIR)$(bindir) && rm -f $(RUNTIME) roadmap roadgps install $(RUNTIME) $(DESTDIR)$(bindir) ln -s gtkroadmap $(DESTDIR)$(bindir)/roadmap ln -s gtkroadgps $(DESTDIR)$(bindir)/roadgps uninstall: cd $(DESTDIR)$(bindir) && rm -f $(RUNTIME) roadmap roadgps $(MAKE) -C .. uninstall # --- The real targets -------------------------------------------- libwin32roadmap.a: $(RMLIBOBJS) $(AR) $(ARFLAGS) libwin32roadmap.a $(RMLIBOBJS) $(RANLIB) libwin32roadmap.a RES = /opt/xmingw/bin/i386-mingw32msvc-windres roadmap_rc.o: roadmap.rc $(RES) --language=0 $(RESFLAGS) $(AM_RESFLAGS) -o $@ $< gtkroadmap: roadmap_main.o roadmap_rc.o ../libguiroadmap.a $(RDMLIBS) $(CXX) $(LDFLAGS) roadmap_main.o -o gtkroadmap ../libguiroadmap.a $(LIBS) gtkroadgps: roadmap_main.o roadmap_rc.o ../libguiroadgps.a $(RDMLIBS) $(CXX) $(LDFLAGS) roadmap_main.o -o gtkroadgps ../libguiroadgps.a $(LIBS) |
From: Ehud S. <esh...@us...> - 2006-07-13 06:48:21
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10260 Modified Files: listports.c listports.h roadmap.rc roadmap_canvas_agg.cpp roadmap_dialog.c roadmap_file.c roadmap_fileselection.c roadmap_net.c roadmap_serial.c roadmap_spawn.c roadmap_time.c roadmap_win32.c Log Message: Generic win32 fixes. Index: roadmap_win32.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_win32.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_win32.c 2 May 2006 12:57:21 -0000 1.3 --- roadmap_win32.c 13 Jul 2006 06:48:17 -0000 1.4 *************** *** 35,39 **** if (len < 0) { ! return _T(""); } else { LPWSTR result = malloc(len * sizeof(WCHAR) + 2); --- 35,39 ---- if (len < 0) { ! return L""; } else { LPWSTR result = malloc(len * sizeof(WCHAR) + 2); Index: roadmap_time.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_time.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_time.c 15 Oct 2005 22:19:11 -0000 1.1.1.1 --- roadmap_time.c 13 Jul 2006 06:48:17 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- */ + #include <stdio.h> #include "../roadmap.h" #include "../roadmap_time.h" Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_dialog.c 10 Jun 2006 08:29:09 -0000 1.8 --- roadmap_dialog.c 13 Jul 2006 06:48:17 -0000 1.9 *************** *** 30,35 **** #include <windows.h> #include "resource.h" - #include <aygshell.h> #include <commctrl.h> #include "../roadmap.h" --- 30,37 ---- #include <windows.h> #include "resource.h" #include <commctrl.h> + #ifdef UNDER_CE + #include <aygshell.h> + #endif #include "../roadmap.h" *************** *** 510,514 **** psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = ! PSH_PROPSHEETPAGE|PSH_MAXIMIZE|PSH_USECALLBACK|PSH_MODELESS; psh.hwndParent = dialog->w; psh.hInstance = g_hInst; --- 512,519 ---- psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = ! PSH_PROPSHEETPAGE|PSH_USECALLBACK|PSH_MODELESS; ! #ifdef UNDER_CE ! psh.dwFlags |= PSH_MAXIMIZE; ! #endif psh.hwndParent = dialog->w; psh.hInstance = g_hInst; *************** *** 531,534 **** --- 536,540 ---- free((void*)psp[i].pszTitle); } + } *************** *** 672,676 **** item->label = CreateWindowEx ( 0, ! _T("STATIC"), // Class name name_unicode, // Window name dwStyle, // Window style --- 678,682 ---- item->label = CreateWindowEx ( 0, ! L"STATIC", // Class name name_unicode, // Window name dwStyle, // Window style *************** *** 692,696 **** item->w = CreateWindowEx ( 0, ! _T("EDIT"), // Class name NULL, // Window name dwStyle, // Window style --- 698,702 ---- item->w = CreateWindowEx ( 0, ! L"EDIT", // Class name NULL, // Window name dwStyle, // Window style *************** *** 711,715 **** item->label = CreateWindowEx ( 0, ! _T("STATIC"), // Class name name_unicode, // Window name dwStyle, // Window style --- 717,721 ---- item->label = CreateWindowEx ( 0, ! L"STATIC", // Class name name_unicode, // Window name dwStyle, // Window style *************** *** 726,730 **** item->w = CreateWindowEx ( 0, ! _T("COMBOBOX"), // Class name NULL, // Window name dwStyle, // Window style --- 732,736 ---- item->w = CreateWindowEx ( 0, ! L"COMBOBOX", // Class name NULL, // Window name dwStyle, // Window style *************** *** 757,761 **** item->label = CreateWindowEx ( 0, ! _T("STATIC"), // Class name name_unicode, // Window name dwStyle, // Window style --- 763,767 ---- item->label = CreateWindowEx ( 0, ! L"STATIC", // Class name name_unicode, // Window name dwStyle, // Window style *************** *** 771,775 **** item->w = CreateWindowEx ( 0, ! _T("STATIC"), // Class name NULL, // Window name dwStyle, // Window style --- 777,781 ---- item->w = CreateWindowEx ( 0, ! L"STATIC", // Class name NULL, // Window name dwStyle, // Window style *************** *** 785,792 **** case ROADMAP_WIDGET_BUTTON: ! name_unicode = ConvertToWideChar(name, CP_UTF8); item->w = CreateWindowEx ( 0, ! _T("BUTTON"), // Class name name_unicode, // Window name dwStyle, // Window style --- 791,799 ---- case ROADMAP_WIDGET_BUTTON: ! name_unicode = ConvertToWideChar(name, CP_UTF8); ! item->w = CreateWindowEx ( 0, ! L"BUTTON", // Class name name_unicode, // Window name dwStyle, // Window style *************** *** 806,810 **** item->label = CreateWindowEx ( 0, ! _T("STATIC"), // Class name name_unicode, // Window name dwStyle, // Window style --- 813,817 ---- item->label = CreateWindowEx ( 0, ! L"STATIC", // Class name name_unicode, // Window name dwStyle, // Window style *************** *** 821,825 **** item->w = CreateWindowEx ( 0, ! _T("LISTBOX"), // Class name NULL, // Window name dwStyle, // Window style --- 828,832 ---- item->w = CreateWindowEx ( 0, ! L"LISTBOX", // Class name NULL, // Window name dwStyle, // Window style *************** *** 859,866 **** case WM_INITDIALOG: { - SHINITDLGINFO shidi; RoadMapDialogItem dialog; RoadMapDialogItem frame; ! int num_buttons; shidi.dwMask = SHIDIM_FLAGS; --- 866,874 ---- case WM_INITDIALOG: { RoadMapDialogItem dialog; RoadMapDialogItem frame; ! int num_buttons; ! #ifdef UNDER_CE ! SHINITDLGINFO shidi; shidi.dwMask = SHIDIM_FLAGS; *************** *** 868,880 **** SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; shidi.hDlg = hDlg; ! SHInitDialog(&shidi); dialog = (RoadMapDialogItem)lParam; SetWindowLong(hDlg, GWL_USERDATA, (LONG)dialog); - SetWindowLong(hDlg, GWL_STYLE, - GetWindowLong(hDlg, GWL_STYLE) | WS_NONAVDONEBUTTON); - - SHDoneButton(hDlg, SHDB_HIDE); - /* create buttons */ num_buttons = 0; --- 876,888 ---- SHIDIF_SIZEDLGFULLSCREEN | SHIDIF_EMPTYMENU; shidi.hDlg = hDlg; ! SHInitDialog(&shidi); ! SetWindowLong(hDlg, GWL_STYLE, ! GetWindowLong(hDlg, GWL_STYLE) | WS_NONAVDONEBUTTON); ! SHDoneButton(hDlg, SHDB_HIDE); ! ! #endif dialog = (RoadMapDialogItem)lParam; SetWindowLong(hDlg, GWL_USERDATA, (LONG)dialog); /* create buttons */ num_buttons = 0; *************** *** 885,890 **** } } ! } ! return (INT_PTR)TRUE; case WM_SIZE: --- 893,911 ---- } } ! } ! #ifdef UNDER_CE ! return (INT_PTR)TRUE; ! #endif ! /* Fall through to resize the dialog */ ! ! { ! RECT rc; ! ! GetWindowRect(hDlg, &rc); ! lParam = MAKELPARAM(rc.right-rc.left+1, rc.bottom-rc.top+1); ! } ! ! ! case WM_SIZE: *************** *** 965,968 **** --- 986,990 ---- return TRUE; } + return (INT_PTR)FALSE; } *************** *** 974,981 **** { case WM_INITDIALOG: ! { SHINITDLGINFO sid; - PROPSHEETPAGE *psp; - RoadMapDialogItem frame; sid.dwMask = SHIDIM_FLAGS; /* This is the only allowed value. */ --- 996,1004 ---- { case WM_INITDIALOG: ! { ! PROPSHEETPAGE *psp; ! RoadMapDialogItem frame; ! #ifdef UNDER_CE SHINITDLGINFO sid; sid.dwMask = SHIDIM_FLAGS; /* This is the only allowed value. */ *************** *** 984,988 **** SHInitDialog(&sid); ! psp = (PROPSHEETPAGE*) lParam; frame = (RoadMapDialogItem)psp->lParam; --- 1007,1011 ---- SHInitDialog(&sid); ! #endif psp = (PROPSHEETPAGE*) lParam; frame = (RoadMapDialogItem)psp->lParam; *************** *** 992,996 **** } return (INT_PTR)TRUE; ! case WM_SETTINGCHANGE: { --- 1015,1020 ---- } return (INT_PTR)TRUE; ! ! #ifdef UNDER_CE case WM_SETTINGCHANGE: { *************** *** 1018,1022 **** lParam = MAKELPARAM(w, h); wParam = 0; ! } /* fall through to resize */ case WM_SIZE: --- 1042,1047 ---- lParam = MAKELPARAM(w, h); wParam = 0; ! } ! #endif /* fall through to resize */ case WM_SIZE: Index: roadmap_serial.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_serial.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_serial.c 21 May 2006 16:36:06 -0000 1.6 --- roadmap_serial.c 13 Jul 2006 06:48:17 -0000 1.7 *************** *** 34,38 **** #define MAX_SERIAL_SPEEDS 10 ! static BOOL list_port_callback(LPVOID pCallbackValue, LISTPORTS_PORTINFO* lpPortInfo) { --- 34,38 ---- #define MAX_SERIAL_SPEEDS 10 ! static BOOL CALLBACK list_port_callback(LPVOID pCallbackValue, LISTPORTS_PORTINFO* lpPortInfo) { *************** *** 139,143 **** if (!serial_ports[0]) { ! ListPorts (list_port_callback, NULL); } --- 139,143 ---- if (!serial_ports[0]) { ! ListPorts (&list_port_callback, NULL); } Index: listports.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/listports.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** listports.h 2 May 2006 12:55:44 -0000 1.1 --- listports.h 13 Jul 2006 06:48:17 -0000 1.2 *************** *** 74,76 **** #elif VERSION_LISTPORTS!=0x00020000 #error You have included two LISTPORTS.H with different version numbers ! #endif \ No newline at end of file --- 74,77 ---- #elif VERSION_LISTPORTS!=0x00020000 #error You have included two LISTPORTS.H with different version numbers ! #endif ! Index: roadmap_net.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_net.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap_net.c 15 Oct 2005 22:19:21 -0000 1.1.1.1 --- roadmap_net.c 13 Jul 2006 06:48:17 -0000 1.2 *************** *** 29,32 **** --- 29,33 ---- #include <windows.h> #include <winsock.h> + #include <ctype.h> #include "../roadmap.h" *************** *** 142,148 **** ! int roadmap_net_send (RoadMapSocket socket, void *data, int length) { ! return send(socket, data, length, 0); } --- 143,160 ---- ! int roadmap_net_send (RoadMapSocket socket, const void *data, int length) { ! int sent = 0; ! ! while (sent < length) { ! ! int res = send(socket, data, length, 0); ! ! if (res <= 0) return -1; ! ! sent += res; ! } ! ! return sent; } *************** *** 201,202 **** --- 213,305 ---- } + + #ifdef UNDER_CE + #include <winioctl.h> + #include "../md5.h" + + __declspec(dllimport) + BOOL KernelIoControl( DWORD dwIoControlCode, LPVOID lpInBuf, DWORD nInBufSize, LPVOID lpOutBuf, DWORD nOutBufSize, LPDWORD lpBytesReturned); + + #define IOCTL_HAL_GET_DEVICEID CTL_CODE(FILE_DEVICE_HAL, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) + + typedef struct _DEVICE_ID { + DWORD dwSize; + DWORD dwPresetIDOffset; + DWORD dwPresetIDBytes; + DWORD dwPlatformIDOffset; + DWORD dwPlatformIDBytes; + } DEVICE_ID, *PDEVICE_ID; + + + int roadmap_net_unique_id(unsigned char *buffer, unsigned int size) + { + DWORD dwOutBytes; + int nBuffSize = 128; + BYTE *arrOutBuff = (byte *) LocalAlloc(LMEM_FIXED, nBuffSize); + PDEVICE_ID pDevId; + BOOL bRes; + + if (size < 16) { + return -1; + } + + pDevId = (PDEVICE_ID) &arrOutBuff[0]; + pDevId->dwSize = nBuffSize; + + bRes = KernelIoControl(IOCTL_HAL_GET_DEVICEID, 0, 0, arrOutBuff, nBuffSize, &dwOutBytes); + + // if buffer not large enough, reallocate the buffer + if (!bRes && GetLastError() == 122) + { + nBuffSize = pDevId->dwSize; + arrOutBuff = (byte *) LocalReAlloc(arrOutBuff, nBuffSize, LMEM_MOVEABLE); + bRes = KernelIoControl(IOCTL_HAL_GET_DEVICEID, 0, 0, arrOutBuff, nBuffSize, &dwOutBytes); + } + + if (bRes) { + + struct MD5Context context; + unsigned char digest[16]; + + MD5Init (&context); + + MD5Update (&context, arrOutBuff + pDevId->dwPresetIDOffset, pDevId->dwPresetIDBytes); + MD5Update (&context, arrOutBuff + pDevId->dwPlatformIDOffset, pDevId->dwPlatformIDBytes); + MD5Final (digest, &context); + + if (size > sizeof(digest)) size = sizeof(digest); + memcpy(buffer, digest, size); + + LocalFree(arrOutBuff); + + return size; + } + + /* Some older PPC devices only return the ID if the buffer + * is exactly the size of a GUID, so attempt to retrieve + * the ID this way. + */ + bRes = KernelIoControl(IOCTL_HAL_GET_DEVICEID, 0, 0, arrOutBuff, 16, &dwOutBytes); + + if (bRes) { + struct MD5Context context; + unsigned char digest[16]; + + MD5Init (&context); + + MD5Update (&context, arrOutBuff, 16); + MD5Final (digest, &context); + + if (size > sizeof(digest)) size = sizeof(digest); + memcpy(buffer, digest, size); + + LocalFree(arrOutBuff); + + return size; + } + + LocalFree(arrOutBuff); + + return -1; + } + #endif Index: listports.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/listports.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** listports.c 2 May 2006 12:55:44 -0000 1.1 --- listports.c 13 Jul 2006 06:48:17 -0000 1.2 *************** *** 254,258 **** } ! if (_tcsncicmp(lpPortName,TEXT("COM"),3)!=0) continue; // We want only COM serial ports //if (dwError=RegQueryValueEx(hkLevel1, TEXT("INDEX"), NULL, NULL, (LPBYTE)&index, &wordSize)) { --- 254,258 ---- } ! if (_wcsnicmp(lpPortName,TEXT("COM"),3)!=0) continue; // We want only COM serial ports //if (dwError=RegQueryValueEx(hkLevel1, TEXT("INDEX"), NULL, NULL, (LPBYTE)&index, &wordSize)) { *************** *** 410,414 **** /* check if it is a serial port (instead of, say, a parallel port) */ ! if(_tcsncicmp(lpPortName,TEXT("COM"),3)!=0)continue; /* now go for "FRIENDLYNAME" */ --- 410,414 ---- /* check if it is a serial port (instead of, say, a parallel port) */ ! if(_wcsnicmp(lpPortName,TEXT("COM"),3)!=0)continue; /* now go for "FRIENDLYNAME" */ Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_spawn.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_spawn.c 22 Jun 2006 18:46:29 -0000 1.4 --- roadmap_spawn.c 13 Jul 2006 06:48:17 -0000 1.5 *************** *** 28,44 **** #include <windows.h> #include "../roadmap.h" #include "../roadmap_list.h" #include "../roadmap_spawn.h" ! typedef void (*text2speech)(const char *text); ! static int flite_dll_initialized = 0; ! static HINSTANCE flite_dll_inst; ! static text2speech flite_t2s; ! static HANDLE flite_thread; ! static HANDLE flite_inuse_event; ! static HANDLE flite_launch_event; ! static RoadMapFeedback *flite_feedback; ! static const char *flite_text; static char *RoadMapSpawnPath = NULL; --- 28,45 ---- #include <windows.h> + #include <stdio.h> #include "../roadmap.h" #include "../roadmap_list.h" #include "../roadmap_spawn.h" ! typedef void (*text2speech)(const char *text); ! static int flite_dll_initialized = 0; ! static HINSTANCE flite_dll_inst; ! static text2speech flite_t2s; ! static HANDLE flite_thread; ! static HANDLE flite_inuse_event; ! static HANDLE flite_launch_event; ! static RoadMapFeedback *flite_feedback; ! static const char *flite_text; static char *RoadMapSpawnPath = NULL; *************** *** 46,129 **** static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; ! DWORD WINAPI FliteThread(LPVOID lpParam) { ! ! while (1) { ! char *text; ! ! if (WaitForSingleObject(flite_launch_event, INFINITE) != WAIT_OBJECT_0) { ! roadmap_log (ROADMAP_ERROR, ! "FliteThread - error waiting for event. No more talking."); ! break; ! } ! ! text = strdup(flite_text); ! SetEvent(flite_inuse_event); ! ! flite_t2s(text); ! free(text); ! ! flite_feedback->handler (flite_feedback->data); ! } ! ! return 0; ! } ! ! ! static int exec_flite_dll (const char *command_line, ! RoadMapFeedback *feedback) { ! ! if (flite_dll_initialized == -1) return -1; ! ! if (!flite_dll_initialized) { ! char full_name[MAX_PATH]; ! LPWSTR full_name_unicode; ! ! snprintf(full_name, MAX_PATH, "%s\\flite_dll.dll", RoadMapSpawnPath); ! full_name_unicode = ConvertToWideChar(full_name, CP_UTF8); ! ! flite_dll_inst = LoadLibrary(full_name_unicode); ! free (full_name_unicode); ! if (!flite_dll_inst) { ! flite_dll_initialized = -1; ! return -1; ! } ! ! flite_t2s = (text2speech)GetProcAddress(flite_dll_inst, L"text2speech"); ! if (!flite_t2s) { ! FreeLibrary(flite_dll_inst); ! flite_dll_initialized = -1; ! return -1; ! } ! ! flite_inuse_event = CreateEvent(NULL, FALSE, FALSE, NULL); ! flite_launch_event = CreateEvent(NULL, FALSE, FALSE, NULL); ! ! flite_thread = CreateThread(NULL, 0, FliteThread, 0, 0, NULL); ! ! SetThreadPriority(flite_thread, THREAD_PRIORITY_HIGHEST); ! ! flite_dll_initialized = 1; ! } ! ! do { ! while (*command_line && (*command_line == ' ')) command_line++; ! if(*command_line == '-') { ! while (*command_line && (*command_line != ' ')) command_line++; ! } ! } while ((*command_line == ' ') || (*command_line == '-')); ! ! flite_text = command_line; ! flite_feedback = feedback; ! ! SetEvent (flite_launch_event); ! if (WaitForSingleObject (flite_inuse_event, 1000) != WAIT_OBJECT_0) { ! ! ResetEvent (flite_launch_event); ! feedback->handler (feedback->data); ! } ! ! return 0; ! } ! static int roadmap_spawn_child (const char *name, --- 47,132 ---- static RoadMapList RoadMapSpawnActive = ROADMAP_LIST_EMPTY; ! DWORD WINAPI FliteThread(LPVOID lpParam) { ! ! while (1) { ! char *text; ! ! if (WaitForSingleObject(flite_launch_event, INFINITE) != WAIT_OBJECT_0) { ! roadmap_log (ROADMAP_ERROR, ! "FliteThread - error waiting for event. No more talking."); ! break; ! } ! ! text = strdup(flite_text); ! SetEvent(flite_inuse_event); ! ! flite_t2s(text); ! free(text); ! ! flite_feedback->handler (flite_feedback->data); ! } ! ! return 0; ! } ! ! ! #ifdef UNDER_CE ! static int exec_flite_dll (const char *command_line, ! RoadMapFeedback *feedback) { ! ! if (flite_dll_initialized == -1) return -1; ! ! if (!flite_dll_initialized) { ! char full_name[MAX_PATH]; ! LPWSTR full_name_unicode; ! ! snprintf(full_name, MAX_PATH, "%s\\flite_dll.dll", RoadMapSpawnPath); ! full_name_unicode = ConvertToWideChar(full_name, CP_UTF8); ! ! flite_dll_inst = LoadLibrary(full_name_unicode); ! free (full_name_unicode); ! if (!flite_dll_inst) { ! flite_dll_initialized = -1; ! return -1; ! } ! ! flite_t2s = (text2speech)GetProcAddress(flite_dll_inst, L"text2speech"); ! if (!flite_t2s) { ! FreeLibrary(flite_dll_inst); ! flite_dll_initialized = -1; ! return -1; ! } ! ! flite_inuse_event = CreateEvent(NULL, FALSE, FALSE, NULL); ! flite_launch_event = CreateEvent(NULL, FALSE, FALSE, NULL); ! ! flite_thread = CreateThread(NULL, 0, FliteThread, 0, 0, NULL); ! ! SetThreadPriority(flite_thread, THREAD_PRIORITY_HIGHEST); ! ! flite_dll_initialized = 1; ! } ! ! do { ! while (*command_line && (*command_line == ' ')) command_line++; ! if(*command_line == '-') { ! while (*command_line && (*command_line != ' ')) command_line++; ! } ! } while ((*command_line == ' ') || (*command_line == '-')); ! ! flite_text = command_line; ! flite_feedback = feedback; ! ! SetEvent (flite_launch_event); ! if (WaitForSingleObject (flite_inuse_event, 1000) != WAIT_OBJECT_0) { ! ! ResetEvent (flite_launch_event); ! feedback->handler (feedback->data); ! } ! ! return 0; ! } ! #endif ! static int roadmap_spawn_child (const char *name, *************** *** 204,213 **** const char *command_line, RoadMapFeedback *feedback) ! { ! if (!strcmp (name, "flite") && ! (exec_flite_dll(command_line, feedback) != -1)) { ! ! return 0; ! } roadmap_list_append (&RoadMapSpawnActive, &feedback->link); --- 207,218 ---- const char *command_line, RoadMapFeedback *feedback) ! { ! #ifdef UNDER_CE ! if (!strcmp (name, "flite") && ! (exec_flite_dll(command_line, feedback) != -1)) { ! ! return 0; ! } ! #endif roadmap_list_append (&RoadMapSpawnActive, &feedback->link); Index: roadmap_canvas_agg.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_canvas_agg.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_canvas_agg.cpp 15 May 2006 19:51:55 -0000 1.4 --- roadmap_canvas_agg.cpp 13 Jul 2006 06:48:17 -0000 1.5 *************** *** 48,52 **** #include "agg_renderer_outline_aa.h" #include "agg_pixfmt_rgb_packed.h" ! #include "agg_path_storage.h" #include "util/agg_color_conv_rgb8.h" #include "platform/win32/agg_win32_bmp.h" --- 48,52 ---- #include "agg_renderer_outline_aa.h" #include "agg_pixfmt_rgb_packed.h" ! #include "agg_path_storage.h" #include "util/agg_color_conv_rgb8.h" #include "platform/win32/agg_win32_bmp.h" Index: roadmap.rc =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap.rc,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** roadmap.rc 15 Oct 2005 22:19:11 -0000 1.1.1.1 --- roadmap.rc 13 Jul 2006 06:48:17 -0000 1.2 *************** *** 9,12 **** --- 9,23 ---- // #include "newres.h" + #ifndef _WIN32_IE + #define _WIN32_IE 0x0500 + #include <winresrc.h> + #endif + + #ifndef I_IMAGENONE + #define I_IMAGENONE (-1) + #define TBSTATE_ENABLED 0 + #define TBSTYLE_DROPDOWN 0 + #define TBSTYLE_AUTOSIZE 0 + #endif ///////////////////////////////////////////////////////////////////////////// *************** *** 57,61 **** IDM_MENU, 1, I_IMAGENONE, IDM_MAIN_COMMAND1, TBSTATE_ENABLED, ! TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_HELP, 0, 0, END --- 68,72 ---- IDM_MENU, 1, I_IMAGENONE, IDM_MAIN_COMMAND1, TBSTATE_ENABLED, ! TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE, IDS_HELP, 0, 0 END *************** *** 159,179 **** // ! IDB_RM_COUNTERCLOCKWISE BITMAP DISCARDABLE "icons\\rm_counterclockwise.bmp" ! IDB_RM_DESTINATION BITMAP DISCARDABLE "icons\\rm_destination.bmp" ! IDB_RM_DOWN BITMAP DISCARDABLE "icons\\rm_down.bmp" ! IDB_RM_FULL BITMAP DISCARDABLE "icons\\rm_full.bmp" ! IDB_RM_GPS BITMAP DISCARDABLE "icons\\rm_gps.bmp" ! IDB_RM_HOLD BITMAP DISCARDABLE "icons\\rm_hold.bmp" ! IDB_RM_LEFT BITMAP DISCARDABLE "icons\\rm_left.bmp" ! IDB_RM_LOCATION BITMAP DISCARDABLE "icons\\rm_location.bmp" ! IDB_RM_QUIT BITMAP DISCARDABLE "icons\\rm_quit.bmp" ! IDB_RM_RECORD BITMAP DISCARDABLE "icons\\rm_record.bmp" ! IDB_RM_RIGHT BITMAP DISCARDABLE "icons\\rm_right.bmp" ! IDB_RM_STOP BITMAP DISCARDABLE "icons\\rm_stop.bmp" ! IDB_RM_UP BITMAP DISCARDABLE "icons\\rm_up.bmp" ! IDB_RM_ZOOM1 BITMAP DISCARDABLE "icons\\rm_zoom1.bmp" ! IDB_RM_ZOOMIN BITMAP DISCARDABLE "icons\\rm_zoomin.bmp" ! IDB_RM_ZOOMOUT BITMAP DISCARDABLE "icons\\rm_zoomout.bmp" ! IDB_RM_CLOCKWISE BITMAP DISCARDABLE "icons\\rm_clockwise.bmp" ///////////////////////////////////////////////////////////////////////////// --- 170,190 ---- // ! IDB_RM_COUNTERCLOCKWISE BITMAP DISCARDABLE "icons/rm_counterclockwise.bmp" ! IDB_RM_DESTINATION BITMAP DISCARDABLE "icons/rm_destination.bmp" ! IDB_RM_DOWN BITMAP DISCARDABLE "icons/rm_down.bmp" ! IDB_RM_FULL BITMAP DISCARDABLE "icons/rm_full.bmp" ! IDB_RM_GPS BITMAP DISCARDABLE "icons/rm_gps.bmp" ! IDB_RM_HOLD BITMAP DISCARDABLE "icons/rm_hold.bmp" ! IDB_RM_LEFT BITMAP DISCARDABLE "icons/rm_left.bmp" ! IDB_RM_LOCATION BITMAP DISCARDABLE "icons/rm_location.bmp" ! IDB_RM_QUIT BITMAP DISCARDABLE "icons/rm_quit.bmp" ! IDB_RM_RECORD BITMAP DISCARDABLE "icons/rm_record.bmp" ! IDB_RM_RIGHT BITMAP DISCARDABLE "icons/rm_right.bmp" ! IDB_RM_STOP BITMAP DISCARDABLE "icons/rm_stop.bmp" ! IDB_RM_UP BITMAP DISCARDABLE "icons/rm_up.bmp" ! IDB_RM_ZOOM1 BITMAP DISCARDABLE "icons/rm_zoom1.bmp" ! IDB_RM_ZOOMIN BITMAP DISCARDABLE "icons/rm_zoomin.bmp" ! IDB_RM_ZOOMOUT BITMAP DISCARDABLE "icons/rm_zoomout.bmp" ! IDB_RM_CLOCKWISE BITMAP DISCARDABLE "icons/rm_clockwise.bmp" ///////////////////////////////////////////////////////////////////////////// Index: roadmap_file.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_file.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_file.c 12 May 2006 14:23:04 -0000 1.4 --- roadmap_file.c 13 Jul 2006 06:48:17 -0000 1.5 *************** *** 26,38 **** * See roadmap_file.h. */ ! #include <stdio.h> #include "../roadmap.h" #include "../roadmap_path.h" #include "../roadmap_file.h" ! struct RoadMapFileContextStructure { HANDLE hFile; void *base; --- 26,42 ---- * See roadmap_file.h. */ ! #include <stdio.h> #include "../roadmap.h" #include "../roadmap_path.h" #include "../roadmap_file.h" ! ! #ifndef INVALID_SET_FILE_POINTER ! #define INVALID_SET_FILE_POINTER (-1) ! #endif struct RoadMapFileContextStructure { + HANDLE hMapFile; HANDLE hFile; void *base; *************** *** 268,272 **** sprintf (UniqueNameBuffer, ! "%s%d_%d", base, ft[0].dwLowDateTime%10000, UniqueNameCounter); UniqueNameCounter += 1; --- 272,276 ---- sprintf (UniqueNameBuffer, ! "%s%d_%d", base, (int)(ft[0].dwLowDateTime%10000), UniqueNameCounter); UniqueNameCounter += 1; *************** *** 285,294 **** DWORD file_size; int map_mode; ! int open_mode; context = malloc (sizeof(*context)); roadmap_check_allocated(context); ! context->hFile = INVALID_HANDLE_VALUE; context->base = NULL; context->size = 0; --- 289,300 ---- DWORD file_size; int map_mode; ! int open_mode; ! int view_mode; context = malloc (sizeof(*context)); roadmap_check_allocated(context); ! context->hFile = INVALID_HANDLE_VALUE; ! context->hMapFile = INVALID_HANDLE_VALUE; context->base = NULL; context->size = 0; *************** *** 296,303 **** if (strcmp(mode, "r") == 0) { open_mode = GENERIC_READ; ! map_mode = PAGE_READONLY; } else if (strchr (mode, 'w') != NULL) { open_mode = GENERIC_READ | GENERIC_WRITE; ! map_mode = PAGE_READWRITE; } else { roadmap_log (ROADMAP_ERROR, --- 302,311 ---- if (strcmp(mode, "r") == 0) { open_mode = GENERIC_READ; ! map_mode = PAGE_READONLY; ! view_mode = FILE_MAP_READ; } else if (strchr (mode, 'w') != NULL) { open_mode = GENERIC_READ | GENERIC_WRITE; ! map_mode = PAGE_READWRITE; ! view_mode = FILE_MAP_WRITE; } else { roadmap_log (ROADMAP_ERROR, *************** *** 306,311 **** } ! if ((name[0] == '\\') || (name[0] == '/')) { LPWSTR name_unicode = ConvertToWideChar(name, CP_UTF8); context->hFile = CreateFileForMapping( name_unicode, --- 314,321 ---- } ! if ((name[0] == '\\') || (name[0] == '/') || (name[1] == ':')) { LPWSTR name_unicode = ConvertToWideChar(name, CP_UTF8); + + #ifdef UNDER_CE context->hFile = CreateFileForMapping( name_unicode, *************** *** 313,316 **** --- 323,337 ---- FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_WRITE_THROUGH, NULL); + + #else + context->hFile = CreateFile( + name_unicode, + open_mode, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + 0 ); + #endif free(name_unicode); sequence = ""; /* Whatever, but NULL. */ *************** *** 353,356 **** --- 374,378 ---- full_name_unicode = ConvertToWideChar(full_name, CP_UTF8); + #ifdef UNDER_CE context->hFile = CreateFileForMapping( full_name_unicode, *************** *** 358,361 **** --- 380,394 ---- FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + #else + + context->hFile = CreateFile( + full_name_unicode, + open_mode, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + 0 ); + #endif free(full_name_unicode); *************** *** 389,393 **** context->size = file_size; ! context->hFile = CreateFileMapping( context->hFile, NULL, --- 422,426 ---- context->size = file_size; ! context->hMapFile = CreateFileMapping( context->hFile, NULL, *************** *** 395,399 **** 0,0,0); ! if (context->hFile == INVALID_HANDLE_VALUE) { if (sequence == 0) { roadmap_log (ROADMAP_INFO, "cannot open file %s", name); --- 428,432 ---- 0,0,0); ! if (context->hMapFile == INVALID_HANDLE_VALUE) { if (sequence == 0) { roadmap_log (ROADMAP_INFO, "cannot open file %s", name); *************** *** 405,410 **** context->base = MapViewOfFile( ! context->hFile, ! FILE_MAP_READ, 0,0,0 ); --- 438,443 ---- context->base = MapViewOfFile( ! context->hMapFile, ! view_mode, 0,0,0 ); *************** *** 447,453 **** } ! if (context->hFile != INVALID_HANDLE_VALUE ) { ! CloseHandle(context->hFile); ! } free(context); *file = NULL; --- 480,493 ---- } ! if (context->hMapFile != INVALID_HANDLE_VALUE ) { ! CloseHandle(context->hMapFile); ! } ! ! #ifndef UNDER_CE ! if (context->hFile != INVALID_HANDLE_VALUE ) { ! CloseHandle(context->hFile); ! } ! #endif ! free(context); *file = NULL; Index: roadmap_fileselection.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_fileselection.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_fileselection.c 12 May 2006 14:22:18 -0000 1.3 --- roadmap_fileselection.c 13 Jul 2006 06:48:17 -0000 1.4 *************** *** 27,31 **** #include <windows.h> ! #include <Commdlg.h> #include "../roadmap.h" --- 27,31 ---- #include <windows.h> ! #include <commdlg.h> #include "../roadmap.h" |
From: Ehud S. <esh...@us...> - 2006-07-13 06:46:30
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9490 Modified Files: Roadmap.vcw Log Message: Change download interfaces to allow auto download. Index: Roadmap.vcw =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/Roadmap.vcw,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Roadmap.vcw 12 May 2006 14:23:38 -0000 1.6 --- Roadmap.vcw 13 Jul 2006 06:46:26 -0000 1.7 *************** *** 95,98 **** --- 95,101 ---- Project_Dep_Name agg End Project Dependency + Begin Project Dependency + Project_Dep_Name zlib + End Project Dependency }}} *************** *** 270,273 **** --- 273,288 ---- ############################################################################### + Project: "zlib"="C:\Projects\zlib-1.2.3\zlib.vcp" - Package Owner=<4> + + Package=<5> + {{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### + Global: |
From: Ehud S. <esh...@us...> - 2006-07-13 06:46:29
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9490/libroadmap Modified Files: libroadmap.vcp Log Message: Change download interfaces to allow auto download. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libroadmap.vcp 10 Jun 2006 08:29:41 -0000 1.11 --- libroadmap.vcp 13 Jul 2006 06:46:26 -0000 1.12 *************** *** 785,788 **** --- 785,919 ---- # Begin Source File + SOURCE=..\..\..\editor\export\editor_download.c + + !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" + + DEP_CPP_EDITOR_D=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_display.h"\ + "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_httpcopy.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_EDITOR_D=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_display.h"\ + "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_httpcopy.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_EDITOR_D=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_display.h"\ + "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_httpcopy.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_EDITOR_D=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_display.h"\ + "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_httpcopy.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_EDITOR_D=\ + "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\editor_main.h"\ + "..\..\..\editor\export\editor_download.h"\ + "..\..\..\editor\export\editor_export.h"\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_canvas.h"\ + "..\..\..\roadmap_db.h"\ + "..\..\..\roadmap_dbread.h"\ + "..\..\..\roadmap_dictionary.h"\ + "..\..\..\roadmap_display.h"\ + "..\..\..\roadmap_download.h"\ + "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_httpcopy.h"\ + "..\..\..\roadmap_locator.h"\ + "..\..\..\roadmap_messagebox.h"\ + "..\..\..\roadmap_plugin.h"\ + "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\editor\export\editor_export.c *************** *** 818,821 **** --- 949,953 ---- "..\..\roadmap_win32.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" *************** *** 846,849 **** --- 978,982 ---- "..\..\roadmap_win32.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" *************** *** 895,898 **** --- 1028,1032 ---- "..\..\win32_serial.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" *************** *** 943,947 **** --- 1077,1084 ---- "..\..\roadmap_win32.h"\ "..\..\win32_serial.h"\ + "C:\Projects\zlib-1.2.3\zconf.h"\ + "C:\Projects\zlib-1.2.3\zlib.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" *************** *** 989,992 **** --- 1126,1130 ---- "..\..\win32_serial.h"\ + # ADD CPP /I "c:\projects\zlib-1.2.3" !ENDIF *************** *** 2794,2797 **** --- 2932,2936 ---- DEP_CPP_EDITOR_TRA=\ "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_line.h"\ "..\..\..\editor\db\editor_point.h"\ "..\..\..\editor\db\editor_route.h"\ *************** *** 2831,2834 **** --- 2970,2974 ---- DEP_CPP_EDITOR_TRA=\ "..\..\..\editor\db\editor_db.h"\ + "..\..\..\editor\db\editor_line.h"\ "..\..\..\editor\db\editor_point.h"\ "..\..\..\editor\db\editor_route.h"\ *************** *** 3644,3654 **** --- 3784,3803 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_path.h"\ "..\..\..\roadmap_plugin.h"\ "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_screen_obj.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_string.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ *************** *** 3661,3671 **** --- 3810,3829 ---- "..\..\..\roadmap_canvas.h"\ "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_gps.h"\ "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_math.h"\ + "..\..\..\roadmap_net.h"\ "..\..\..\roadmap_path.h"\ "..\..\..\roadmap_plugin.h"\ "..\..\..\roadmap_screen.h"\ + "..\..\..\roadmap_screen_obj.h"\ + "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_spawn.h"\ + "..\..\..\roadmap_string.h"\ "..\..\..\roadmap_types.h"\ "..\..\roadmap_win32.h"\ + "..\..\win32_serial.h"\ |
From: Ehud S. <esh...@us...> - 2006-07-13 06:46:29
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libosroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9490/libosroadmap Modified Files: libosroadmap.vcp Log Message: Change download interfaces to allow auto download. Index: libosroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libosroadmap/libosroadmap.vcp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libosroadmap.vcp 2 May 2006 13:02:12 -0000 1.4 --- libosroadmap.vcp 13 Jul 2006 06:46:26 -0000 1.5 *************** *** 274,277 **** --- 274,318 ---- # Begin Source File + SOURCE=..\..\..\md5.c + + !IF "$(CFG)" == "libosroadmap - Win32 (WCE ARM) Release" + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE x86) Release" + + DEP_CPP_MD5_C=\ + "..\..\..\md5.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_MD5_C=\ + "..\..\..\md5.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_MD5_C=\ + "..\..\..\md5.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_MD5_C=\ + "..\..\..\md5.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_MD5_C=\ + "..\..\..\md5.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\win32\roadmap_file.c *************** *** 469,472 **** --- 510,514 ---- DEP_CPP_ROADMAP=\ + "..\..\..\md5.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_net.h"\ *************** *** 478,481 **** --- 520,524 ---- DEP_CPP_ROADMAP=\ + "..\..\..\md5.h"\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_net.h"\ *************** *** 630,633 **** --- 673,677 ---- "..\..\..\roadmap_serial.h"\ "..\..\..\roadmap_types.h"\ + "..\..\listports.h"\ "..\..\roadmap_win32.h"\ "..\..\win32_serial.h"\ |
From: Ehud S. <esh...@us...> - 2006-07-13 06:45:55
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9114 Modified Files: wince_input_mon.c Log Message: Fix GPS timeout problem. Index: wince_input_mon.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_input_mon.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wince_input_mon.c 2 May 2006 12:56:30 -0000 1.7 --- wince_input_mon.c 13 Jul 2006 06:45:51 -0000 1.8 *************** *** 40,45 **** LPWSTR url_unicode = ConvertToWideChar(name, CP_UTF8); DCB dcb; ! COMMTIMEOUTS ct; ! hCommPort = CreateFile (url_unicode, GENERIC_READ | GENERIC_WRITE, --- 40,45 ---- LPWSTR url_unicode = ConvertToWideChar(name, CP_UTF8); DCB dcb; ! COMMTIMEOUTS ct; ! hCommPort = CreateFile (url_unicode, GENERIC_READ | GENERIC_WRITE, *************** *** 47,51 **** NULL, OPEN_EXISTING, ! FILE_FLAG_WRITE_THROUGH, NULL); --- 47,51 ---- NULL, OPEN_EXISTING, ! FILE_ATTRIBUTE_NORMAL, NULL); *************** *** 56,86 **** } dcb.DCBlength = sizeof(DCB); if(!GetCommState(hCommPort, &dcb)) { ! roadmap_serial_close(hCommPort); ! return INVALID_HANDLE_VALUE; } dcb.BaudRate = baud_rate; - dcb.fRtsControl = RTS_CONTROL_DISABLE; - dcb.fDtrControl = DTR_CONTROL_DISABLE; - dcb.ByteSize = 8; - dcb.fParity = FALSE; - dcb.StopBits = ONESTOPBIT; if(!SetCommState(hCommPort, &dcb)) { ! roadmap_serial_close(hCommPort); ! return INVALID_HANDLE_VALUE; ! } ! ! ct.ReadIntervalTimeout = MAXDWORD; ! ct.ReadTotalTimeoutMultiplier = MAXDWORD; ! ct.ReadTotalTimeoutConstant = 10000; ! ct.WriteTotalTimeoutMultiplier = 10; ! ct.WriteTotalTimeoutConstant = 100; ! ! if(!SetCommTimeouts(hCommPort, &ct)) { ! roadmap_serial_close(hCommPort); ! return INVALID_HANDLE_VALUE; } --- 56,110 ---- } + Sleep(50); + + GetCommTimeouts(hCommPort, &ct); + ct.ReadIntervalTimeout = MAXDWORD; + ct.ReadTotalTimeoutMultiplier = MAXDWORD; + ct.ReadTotalTimeoutConstant = 100; + /* ct.WriteTotalTimeoutMultiplier = 10; + ct.WriteTotalTimeoutConstant = 100; */ + + if(!SetCommTimeouts(hCommPort, &ct)) { + roadmap_log (ROADMAP_ERROR, "Error setting comm timeouts. %d", + GetLastError()); + /*roadmap_serial_close(hCommPort); + return INVALID_HANDLE_VALUE;*/ + } + + + memset(&dcb, 0, sizeof(DCB)); dcb.DCBlength = sizeof(DCB); + if(!GetCommState(hCommPort, &dcb)) { ! roadmap_log (ROADMAP_ERROR, "Error getting comm state. %d", ! GetLastError()); ! /*roadmap_serial_close(hCommPort); ! return INVALID_HANDLE_VALUE;*/ } + dcb.fBinary = TRUE; /* Binary mode; no EOF check */ + dcb.fParity = FALSE; /* Disable parity checking */ + dcb.fOutxCtsFlow = FALSE; /* No CTS output flow control */ + dcb.fOutxDsrFlow = FALSE; /* No DSR output flow control */ + dcb.fDtrControl = DTR_CONTROL_DISABLE; /* DTR flow control type */ + dcb.fDsrSensitivity = FALSE; /* DSR sensitivity */ + dcb.fTXContinueOnXoff = FALSE; /* XOFF continues Tx */ + dcb.fOutX = FALSE; /* No XON/XOFF out flow control */ + dcb.fInX = FALSE; /* No XON/XOFF in flow control */ + dcb.fErrorChar = FALSE; /* Disable error replacement */ + dcb.fNull = FALSE; /* Disable null stripping */ + dcb.fRtsControl = RTS_CONTROL_DISABLE; /* RTS flow control */ + dcb.fAbortOnError = FALSE; /* Do not abort reads/writes on */ + dcb.ByteSize = 8; /* Number of bits/byte, 4-8 */ + dcb.Parity = NOPARITY; /* 0-4=no,odd,even,mark,space */ + dcb.StopBits = ONESTOPBIT; /* 0,1,2 = 1, 1.5, 2 */ + dcb.BaudRate = baud_rate; if(!SetCommState(hCommPort, &dcb)) { ! roadmap_log (ROADMAP_ERROR, "Error setting comm state. %d", ! GetLastError()); ! /*roadmap_serial_close(hCommPort); ! return INVALID_HANDLE_VALUE;*/ } |