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: Junqian X. <xj...@gm...> - 2006-08-06 09:46:39
|
On 8/4/06, Paul Fox <pg...@fo...> wrote: not sure. pascal maintains the website. but as you've figured out, > it's moot if you're using CVS, since the rdm format has changed. > My objective is to use the latest Tiger vector maps with the compiled zroadmap ipkg on my Zaurus PDA. The zroadmap package is compiled by others but I believe it's based on the 1.0.12 source from Pascal's website. The maps (2004 2nd ed.) on Pascal's website is usable with the zroadmap program on my Zaurus, but as I said I need something more up-to-date. I didn't know the rdm format has changed. Indeed, the rdm maps I generated using rdmgenmaps (from CVS) does not work. I went another route -- grabbed the 1.0.12 source and make build with -SHAPEFILES=NO. However, I was not able to generate rdm using rdmgenmaps. Does that mean the 2005 ed. Tiger map format is different than the 2004 ed.? Do you have any suggestion how to build a usable 2005 2nd ed. map for the 1.0.12 version zroadmap program? Thanks Junqian |
|
From: Paul F. <pg...@fo...> - 2006-08-04 13:06:54
|
junqian wrote: > After CVS checkout from SF, > > in ~/roadmap/src > make build > gives the following error: > > make: *** No rule to make target `unix/libosroadmap.a', needed by > `buildmap'. Stop. > > could you double check if the make file is complete? thanks. i've just commited the fix to the Makefile. i rarely use "make build", since i'm usually building the whole package. at line 214, change this: build: $(BUILD) to this: build: unix gpx $(BUILD) and you should be okay. paul =--------------------- paul fox, pg...@fo... (arlington, ma, where it's 63.7 degrees) |
|
From: Paul F. <pg...@us...> - 2006-08-04 13:03:49
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2871 Modified Files: Makefile Log Message: fix the "build:" target. buildmap and friends shouldn't need the gpx library, but it's in RDMLIBS, and therefore in everyone's dependencies. the unix lib, however, really is needed. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** Makefile 13 Jul 2006 13:30:32 -0000 1.82 --- Makefile 4 Aug 2006 13:03:40 -0000 1.83 *************** *** 212,216 **** done ! build: $(BUILD) strip: --- 212,216 ---- done ! build: unix gpx $(BUILD) strip: |
|
From: Junqian X. <xj...@gm...> - 2006-08-04 11:06:18
|
After CVS checkout from SF, in ~/roadmap/src make build gives the following error: make: *** No rule to make target `unix/libosroadmap.a', needed by `buildmap'. Stop. could you double check if the make file is complete? Thanks Junqian |
|
From: Ehud S. <esh...@us...> - 2006-07-28 22:19:37
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8597 Added Files: roadmap_sound.c Log Message: Play WAV files. --- NEW FILE: roadmap_sound.c --- /* roadmap_sound.c - Play sound. * * 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 roadmap_sound.h */ #include <windows.h> #include "../roadmap.h" #include "../roadmap_path.h" #include "../roadmap_sound.h" #define MAX_LISTS 2 static RoadMapSoundList sound_lists[MAX_LISTS]; static CRITICAL_SECTION SoundCriticalSection; static HANDLE SoundEvent; static HANDLE sound_thread; static int current_list = -1; DWORD WINAPI SoundThread (LPVOID lpParam) { SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL); while (1) { int i; WaitForSingleObject(SoundEvent, INFINITE); while (1) { RoadMapSoundList list; EnterCriticalSection (&SoundCriticalSection); current_list = (current_list + 1) % MAX_LISTS; if (sound_lists[current_list] == NULL) { /* nothing to play */ current_list = -1; } LeaveCriticalSection (&SoundCriticalSection); if (current_list == -1) break; list = sound_lists[current_list]; for (i=0; i<roadmap_sound_list_count (list); i++) { roadmap_sound_play (roadmap_sound_list_get (list, i)); } roadmap_sound_list_free (list); sound_lists[current_list] = NULL; } } } int roadmap_sound_play (const char *file_name) { char full_name[256]; LPWSTR file_name_unicode; BOOL res; snprintf (full_name, sizeof(full_name), "%s\\sound\\%s", roadmap_path_user (), file_name); file_name_unicode = ConvertToWideChar(full_name, CP_UTF8); res = PlaySound(file_name_unicode, NULL, SND_SYNC | SND_FILENAME); free(file_name_unicode); if (res == TRUE) return 0; else return -1; } RoadMapSoundList roadmap_sound_list_create (void) { return (RoadMapSoundList) calloc (1, sizeof(struct roadmap_sound_list_t)); } int roadmap_sound_list_add (RoadMapSoundList list, const char *name) { if (list->count == MAX_SOUND_LIST) return -1; strncpy (list->list[list->count], name, sizeof(list->list[0])); list->list[list->count][sizeof(list->list[0])-1] = '\0'; list->count++; return list->count - 1; } int roadmap_sound_list_count (const RoadMapSoundList list) { return list->count; } const char *roadmap_sound_list_get (const RoadMapSoundList list, int i) { if (i >= MAX_SOUND_LIST) return NULL; return list->list[i]; } void roadmap_sound_list_free (RoadMapSoundList list) { free(list); } int roadmap_sound_play_list (const RoadMapSoundList list) { EnterCriticalSection (&SoundCriticalSection); if (current_list == -1) { /* not playing */ sound_lists[0] = list; SetEvent(SoundEvent); } else { int next = (current_list + 1) % MAX_LISTS; if (sound_lists[next] != NULL) { roadmap_sound_list_free (sound_lists[next]); } sound_lists[next] = list; } LeaveCriticalSection (&SoundCriticalSection); return 0; } void roadmap_sound_initialize (void) { SoundEvent = CreateEvent (NULL, FALSE, FALSE, NULL); InitializeCriticalSection (&SoundCriticalSection); sound_thread = CreateThread(NULL, 0, SoundThread, NULL, 0, NULL); } void roadmap_sound_shutdown (void) { CloseHandle (SoundEvent); DeleteCriticalSection (&SoundCriticalSection); } |
|
From: Ehud S. <esh...@us...> - 2006-07-28 21:39:24
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3844 Modified Files: buildmap_postgres.c Log Message: Add support for street ranges. Index: buildmap_postgres.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/buildmap_postgres.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** buildmap_postgres.c 5 Jun 2006 09:12:56 -0000 1.9 --- buildmap_postgres.c 27 Jul 2006 14:16:13 -0000 1.10 *************** *** 68,72 **** /* ROADS */ ! static const char *roads_sql = "SELECT segments.id AS id, AsText(simplify(segments.the_geom, 0.00002)) AS the_geom, segments.road_type AS layer, segments.from_node AS from_node_id, segments.to_node AS to_node_id, streets.name AS street_name, streets.text2speech as text2speech, cities.name as city_name FROM segments LEFT JOIN streets ON segments.street_id = streets.id LEFT JOIN cities ON streets.city_id = cities.id;"; static const char *roads_route_sql = "SELECT segments.id AS id, segments.from_car_allowed AS from_car_allowed, segments.to_car_allowed AS to_car_allowed, segments.from_max_speed AS from_max_speed, segments.to_max_speed AS to_max_speed, segments.from_cross_time AS from_cross_time, segments.to_cross_time AS to_cross_time, segments.road_type AS layer FROM segments;"; static const char *country_borders_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM borders;"; --- 68,72 ---- /* ROADS */ ! static const char *roads_sql = "SELECT segments.id AS id, AsText(simplify(segments.the_geom, 0.00002)) AS the_geom, segments.road_type AS layer, segments.from_node AS from_node_id, segments.to_node AS to_node_id, streets.name AS street_name, streets.text2speech as text2speech, cities.name as city_name, fraddl, toaddl, fraddr, toaddr FROM segments LEFT JOIN streets ON segments.street_id = streets.id LEFT JOIN cities ON streets.city_id = cities.id;"; static const char *roads_route_sql = "SELECT segments.id AS id, segments.from_car_allowed AS from_car_allowed, segments.to_car_allowed AS to_car_allowed, segments.from_max_speed AS from_max_speed, segments.to_max_speed AS to_max_speed, segments.from_cross_time AS from_cross_time, segments.to_cross_time AS to_cross_time, segments.road_type AS layer FROM segments;"; static const char *country_borders_sql = "SELECT id AS id, AsText(simplify(the_geom, 0.00002)) AS the_geom FROM borders;"; *************** *** 314,322 **** } else { ! buildmap_range_add ! (line, street, 1, 11, zip, city); ! buildmap_range_add ! (line, street, 2, 12, zip, city); } --- 314,339 ---- } else { ! const char *fraddl = PQgetvalue(db_result, irec, column++); ! const char *toaddl = PQgetvalue(db_result, irec, column++); ! const char *fraddr = PQgetvalue(db_result, irec, column++); ! const char *toaddr = PQgetvalue(db_result, irec, column++); ! if (fraddl[0] && fraddr[0]) { ! ! buildmap_range_add ! (line, street, atoi(fraddl), atoi(toaddl), zip, city); ! buildmap_range_add ! (line, street, atoi(fraddr), atoi(toaddr), zip, city); ! ! } else { ! ! buildmap_range_add_no_address (line, street); ! /* ! buildmap_range_add ! (line, street, 1, 11, zip, city); ! buildmap_range_add ! (line, street, 2, 12, zip, city); ! */ ! } } |
|
From: Ehud S. <esh...@us...> - 2006-07-28 21:38:28
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8102 Modified Files: roadmap_spawn.c Log Message: Change text to speech thread to critical priority. Index: roadmap_spawn.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_spawn.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** roadmap_spawn.c 16 Jul 2006 12:28:50 -0000 1.6 --- roadmap_spawn.c 27 Jul 2006 14:26:09 -0000 1.7 *************** *** 60,64 **** text = strdup(flite_text); SetEvent(flite_inuse_event); ! flite_t2s(text); free(text); --- 60,64 ---- text = strdup(flite_text); SetEvent(flite_inuse_event); ! flite_t2s(text); free(text); *************** *** 103,107 **** flite_thread = CreateThread(NULL, 0, FliteThread, 0, 0, NULL); ! SetThreadPriority(flite_thread, THREAD_PRIORITY_HIGHEST); flite_dll_initialized = 1; --- 103,107 ---- flite_thread = CreateThread(NULL, 0, FliteThread, 0, 0, NULL); ! SetThreadPriority(flite_thread, THREAD_PRIORITY_TIME_CRITICAL); flite_dll_initialized = 1; *************** *** 132,136 **** static int roadmap_spawn_child (const char *name, const char *command_line, ! RoadMapPipe pipes[2]) { PROCESS_INFORMATION pi; --- 132,137 ---- static int roadmap_spawn_child (const char *name, const char *command_line, ! RoadMapPipe pipes[2], ! int feedback) { PROCESS_INFORMATION pi; *************** *** 173,178 **** free(command_line_unicode); } - CloseHandle(pi.hThread); if (pipes != NULL) { --- 174,183 ---- free(command_line_unicode); } + + CloseHandle(pi.hThread); + if (!feedback) { + CloseHandle(pi.hProcess); + } if (pipes != NULL) { *************** *** 205,209 **** const char *command_line) { ! return roadmap_spawn_child (name, command_line, NULL); } --- 210,214 ---- const char *command_line) { ! return roadmap_spawn_child (name, command_line, NULL, 0); } *************** *** 222,226 **** roadmap_list_append (&RoadMapSpawnActive, &feedback->link); ! feedback->child = roadmap_spawn_child (name, command_line, NULL); return feedback->child; --- 227,231 ---- roadmap_list_append (&RoadMapSpawnActive, &feedback->link); ! feedback->child = roadmap_spawn_child (name, command_line, NULL, 1); return feedback->child; *************** *** 234,238 **** { roadmap_list_append (&RoadMapSpawnActive, &feedback->link); ! feedback->child = roadmap_spawn_child (name, command_line, pipes); return feedback->child; --- 239,243 ---- { roadmap_list_append (&RoadMapSpawnActive, &feedback->link); ! feedback->child = roadmap_spawn_child (name, command_line, pipes, 0); return feedback->child; |
|
From: Ehud S. <esh...@us...> - 2006-07-28 21:12:15
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6023 Modified Files: editor_main.c Log Message: Bump version. Index: editor_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/editor_main.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** editor_main.c 17 Jul 2006 06:33:48 -0000 1.12 --- editor_main.c 27 Jul 2006 14:21:14 -0000 1.13 *************** *** 41,45 **** int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.8.0 pre1"; int editor_is_enabled (void) { --- 41,45 ---- int EditorPluginID = -1; ! const char *EDITOR_VERSION = "0.8.0 pre3"; int editor_is_enabled (void) { |
|
From: Ehud S. <esh...@us...> - 2006-07-28 21:08:43
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3442 Added Files: roadmap_sound.h Log Message: Oops, I forgot to commit the sound header file... --- NEW FILE: roadmap_sound.h --- /* roadmap_sound.h - Play sound * * 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 __ROADMAP_SOUND__H #define __ROADMAP_SOUND__H #define MAX_SOUND_LIST 20 #define MAX_SOUND_NAME 30 struct roadmap_sound_list_t { int count; char list[MAX_SOUND_LIST][MAX_SOUND_NAME]; }; typedef struct roadmap_sound_list_t *RoadMapSoundList; RoadMapSoundList roadmap_sound_list_create (void); int roadmap_sound_list_add (RoadMapSoundList list, const char *name); int roadmap_sound_list_count (const RoadMapSoundList list); const char *roadmap_sound_list_get (const RoadMapSoundList list, int i); void roadmap_sound_list_free (RoadMapSoundList list); int roadmap_sound_play (const char *file_name); int roadmap_sound_play_list (const RoadMapSoundList list); void roadmap_sound_initialize (void); void roadmap_sound_shutdown (void); #endif // __ROADMAP_SOUND__H |
|
From: Ehud S. <esh...@us...> - 2006-07-28 03:52:15
|
Update of /cvsroot/roadmap/roadmap_editor/src/gtk2 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6773 Modified Files: roadmap_dialog.c Log Message: I18n Change select widget to return the text labels from its internal data memory. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/gtk2/roadmap_dialog.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_dialog.c 15 May 2006 19:51:20 -0000 1.3 --- roadmap_dialog.c 27 Jul 2006 14:23:05 -0000 1.4 *************** *** 41,44 **** --- 41,45 ---- #include "roadmap_keyboard.h" + #define ROADMAP_DIALOG_NO_LANG #include "roadmap_dialog.h" *************** *** 429,433 **** const char *name, int count, ! char **labels, void **values, RoadMapDialogCallback callback) { --- 430,434 ---- const char *name, int count, ! const char **labels, void **values, RoadMapDialogCallback callback) { *************** *** 442,445 **** --- 443,450 ---- child->widget_type = ROADMAP_WIDGET_CHOICE; + if (labels == values) { + child->data_is_string = 1; + } + menu = gtk_menu_new (); *************** *** 455,458 **** --- 460,468 ---- menu_item = gtk_menu_item_new_with_label (labels[i]); + if (child->data_is_string) { + GtkWidget *menu_label = gtk_bin_get_child(GTK_BIN(menu_item)); + choice[i].value = gtk_label_get_text(GTK_LABEL(menu_label)); + } + gtk_menu_shell_append (GTK_MENU_SHELL(menu), menu_item); *************** *** 474,480 **** child->value = choice[0].value; - if (labels == values) { - child->data_is_string = 1; - } } --- 484,487 ---- *************** *** 609,613 **** ! void roadmap_dialog_add_button (char *label, RoadMapDialogCallback callback) { RoadMapDialogItem dialog = RoadMapDialogCurrent; --- 616,621 ---- ! void roadmap_dialog_add_button (const char *label, ! RoadMapDialogCallback callback) { RoadMapDialogItem dialog = RoadMapDialogCurrent; *************** *** 841,880 **** (GCallback) roadmap_dialog_chosen, (gpointer) (choice+i)); - gtk_widget_show (item); - gtk_option_menu_set_history (GTK_OPTION_MENU(this_item->w), i); - memcpy (this_item->choice + this_item->num_choices, this_item->choice + this_item->num_choices - 1, sizeof(RoadMapDialogSelection)); ! this_item->choice[this_item->num_choices].value = (const char *)data; this_item->num_choices++; - } ! #if 0 ! for (i=0; i < this_item->num_choices; i++) { ! if (this_item->value == this_item->choice[i].value) { ! break; ! } ! } ! ! if (i == this_item->num_choices) break; ! ! this_item->value = this_item->choice[i].value = (const char *)data; ! { ! GtkWidget *menu = gtk_option_menu_get_menu (GTK_OPTION_MENU(this_item->w)); ! gtk_option_menu_set_history (GTK_OPTION_MENU(this_item->w), ! (i + 1) % this_item->num_choices); ! ! GList *glist = gtk_container_get_children (GTK_CONTAINER(menu)); ! GtkMenuItem *item = g_list_nth_data (glist, i); ! GtkWidget *menu_label = gtk_bin_get_child(GTK_BIN(item)); ! gtk_label_set_text(GTK_LABEL(menu_label), (const char *)data); ! gtk_option_menu_set_history (GTK_OPTION_MENU(this_item->w), i); ! ! g_list_free (glist); ! } } ! #endif break; } --- 849,865 ---- (GCallback) roadmap_dialog_chosen, (gpointer) (choice+i)); memcpy (this_item->choice + this_item->num_choices, this_item->choice + this_item->num_choices - 1, sizeof(RoadMapDialogSelection)); ! menu = gtk_bin_get_child(GTK_BIN(item)); ! this_item->choice[this_item->num_choices].value = ! gtk_label_get_text(GTK_LABEL(menu)); this_item->num_choices++; ! gtk_widget_show (item); ! gtk_option_menu_set_history (GTK_OPTION_MENU(this_item->w), i); } ! break; } |
|
From: Ehud S. <esh...@us...> - 2006-07-28 00:32:31
|
Update of /cvsroot/roadmap/roadmap_editor/src/unix In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv8988 Modified Files: Makefile Added Files: roadmap_sound.c Log Message: Play WAV files. --- NEW FILE: roadmap_sound.c --- /* roadmap_library.c - a low level module to manage plugins for RoadMap. * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * 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 roadmap_library.h */ #include <stdlib.h> #include <string.h> #include "roadmap.h" #include "roadmap_sound.h" RoadMapSoundList roadmap_sound_list_create (void) { return (RoadMapSoundList) calloc (1, sizeof(struct roadmap_sound_list_t)); } int roadmap_sound_list_add (RoadMapSoundList list, const char *name) { if (list->count == MAX_SOUND_LIST) return -1; strncpy (list->list[list->count], name, sizeof(list->list[0])); list->list[list->count][sizeof(list->list[0])-1] = '\0'; list->count++; return list->count - 1; } int roadmap_sound_list_count (const RoadMapSoundList list) { return list->count; } const char *roadmap_sound_list_get (const RoadMapSoundList list, int i) { if (i >= MAX_SOUND_LIST) return NULL; return list->list[i]; } void roadmap_sound_list_free (RoadMapSoundList list) { free(list); } int roadmap_sound_play (const char *file_name) { return 0; } int roadmap_sound_play_list (const RoadMapSoundList list) { return 0; } void roadmap_sound_initialize (void) {} void roadmap_sound_shutdown (void) {} Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/unix/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 16 Jul 2006 12:26:13 -0000 1.2 --- Makefile 27 Jul 2006 14:28:20 -0000 1.3 *************** *** 19,22 **** --- 19,23 ---- ../md5.c \ roadmap_serial.c \ + roadmap_sound.c \ roadmap_spawn.c \ roadmap_time.c |
|
From: Ehud S. <esh...@us...> - 2006-07-27 23:24:56
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libosroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9496/libosroadmap Modified Files: libosroadmap.vcp Log Message: Update evc project files. Index: libosroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libosroadmap/libosroadmap.vcp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** libosroadmap.vcp 13 Jul 2006 06:46:26 -0000 1.5 --- libosroadmap.vcp 27 Jul 2006 14:29:59 -0000 1.6 *************** *** 693,696 **** --- 693,757 ---- # Begin Source File + SOURCE=..\..\roadmap_sound.c + + !IF "$(CFG)" == "libosroadmap - Win32 (WCE ARM) Release" + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE x86) Release" + + DEP_CPP_ROADMAP_SO=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_sound.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_ROADMAP_SO=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_sound.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_ROADMAP_SO=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_sound.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_ROADMAP_SO=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_sound.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libosroadmap - Win32 (WCE ARMV4) Profiler" + + DEP_CPP_ROADMAP_SO=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_sound.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=..\..\..\win32\roadmap_spawn.c |
|
From: Ehud S. <esh...@us...> - 2006-07-27 21:32:39
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9496/libroadmap Modified Files: libroadmap.vcp Log Message: Update evc project files. Index: libroadmap.vcp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/wince_env/libroadmap/libroadmap.vcp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libroadmap.vcp 16 Jul 2006 12:30:55 -0000 1.13 --- libroadmap.vcp 27 Jul 2006 14:29:59 -0000 1.14 *************** *** 623,626 **** --- 623,627 ---- "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_layer.h"\ "..\..\..\roadmap_line.h"\ *************** *** 661,664 **** --- 662,666 ---- "..\..\..\roadmap_dictionary.h"\ "..\..\..\roadmap_gui.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_layer.h"\ "..\..\..\roadmap_line.h"\ *************** *** 3783,3786 **** --- 3785,3789 ---- "..\..\..\roadmap_httpcopy.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_main.h"\ *************** *** 3809,3812 **** --- 3812,3816 ---- "..\..\..\roadmap_httpcopy.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_main.h"\ *************** *** 4371,4374 **** --- 4375,4379 ---- "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_sound.h"\ "..\..\..\roadmap_spawn.h"\ "..\..\..\roadmap_street.h"\ *************** *** 4420,4423 **** --- 4425,4429 ---- "..\..\..\roadmap_screen.h"\ "..\..\..\roadmap_serial.h"\ + "..\..\..\roadmap_sound.h"\ "..\..\..\roadmap_spawn.h"\ "..\..\..\roadmap_street.h"\ *************** *** 5520,5523 **** --- 5526,5530 ---- "..\..\..\roadmap_input.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_main.h"\ *************** *** 5549,5552 **** --- 5556,5560 ---- "..\..\..\roadmap_input.h"\ "..\..\..\roadmap_io.h"\ + "..\..\..\roadmap_lang.h"\ "..\..\..\roadmap_list.h"\ "..\..\..\roadmap_main.h"\ *************** *** 6036,6045 **** # Begin Source File ! SOURCE=..\..\..\roadmap_line.c !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_db_line.h"\ --- 6044,6129 ---- # Begin Source File ! SOURCE=..\..\..\roadmap_lang.c !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" + + DEP_CPP_ROADMAP_L=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_hash.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" + + DEP_CPP_ROADMAP_L=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_hash.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" + + DEP_CPP_ROADMAP_L=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_hash.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" + + DEP_CPP_ROADMAP_L=\ + "..\..\..\roadmap.h"\ + "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_hash.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" + DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ + "..\..\..\roadmap_config.h"\ + "..\..\..\roadmap_file.h"\ + "..\..\..\roadmap_hash.h"\ + "..\..\..\roadmap_lang.h"\ + "..\..\..\roadmap_path.h"\ + "..\..\..\roadmap_types.h"\ + "..\..\roadmap_win32.h"\ + + + !ENDIF + + # End Source File + # Begin Source File + + SOURCE=..\..\..\roadmap_line.c + + !IF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Release" + + DEP_CPP_ROADMAP_LI=\ + "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ "..\..\..\roadmap_db_line.h"\ *************** *** 6054,6058 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6138,6142 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARM) Debug" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6068,6072 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6152,6156 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6082,6086 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6166,6170 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6096,6100 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6180,6184 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6113,6117 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6197,6201 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6130,6134 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" ! DEP_CPP_ROADMAP_L=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6214,6218 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6158,6162 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6242,6246 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Release" ! DEP_CPP_ROADMAP_LIN=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6170,6174 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6254,6258 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE x86) Debug" ! DEP_CPP_ROADMAP_LIN=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6182,6186 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6266,6270 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Debug" ! DEP_CPP_ROADMAP_LIN=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6194,6198 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6278,6282 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Release" ! DEP_CPP_ROADMAP_LIN=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ *************** *** 6206,6210 **** !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" ! DEP_CPP_ROADMAP_LI=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ --- 6290,6294 ---- !ELSEIF "$(CFG)" == "libroadmap - Win32 (WCE ARMV4) Profiler" ! DEP_CPP_ROADMAP_LIN=\ "..\..\..\roadmap.h"\ "..\..\..\roadmap_db.h"\ |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:29:13
|
Update of /cvsroot/roadmap/roadmap_editor/src/navigate In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9223 Modified Files: navigate_main.c Log Message: Play WAV files. Index: navigate_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/navigate/navigate_main.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** navigate_main.c 11 Jun 2006 12:43:43 -0000 1.10 --- navigate_main.c 27 Jul 2006 14:29:04 -0000 1.11 *************** *** 50,53 **** --- 50,54 ---- #include "roadmap_point.h" #include "roadmap_layer.h" + #include "roadmap_sound.h" #include "navigate_plugin.h" *************** *** 303,310 **** void navigate_update (RoadMapPosition *position, PluginLine *current) { ! int annouce = 0; const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; int group_id = segment->group_id; const char *inst_text = ""; if (!NavigateTrackEnabled) return; --- 304,315 ---- void navigate_update (RoadMapPosition *position, PluginLine *current) { ! int announce = 0; const NavigateSegment *segment = NavigateSegments + NavigateCurrentSegment; int group_id = segment->group_id; const char *inst_text = ""; + const char *inst_voice = NULL; + RoadMapSoundList sound_list; + const int ANNOUNCES[] = { 800, 200, 50 }; + int announce_distance = 0; if (!NavigateTrackEnabled) return; *************** *** 337,349 **** --- 342,358 ---- case TURN_LEFT: inst_text = "Turn left"; + inst_voice = "TurnLeft.wav"; break; case KEEP_LEFT: inst_text = "Keep left"; + inst_voice = "KeepLeft.wav"; break; case TURN_RIGHT: inst_text = "Turn right"; + inst_voice = "TurnRight.wav"; break; case KEEP_RIGHT: inst_text = "Keep right"; + inst_voice = "KeepRight.wav"; break; case APPROACHING_DESTINATION: *************** *** 352,355 **** --- 361,365 ---- case CONTINUE: inst_text = "Continue straight"; + inst_voice = "Straight.wav"; break; default: *************** *** 360,363 **** --- 370,377 ---- NavigateDistanceToTurn <= 10) { + sound_list = roadmap_sound_list_create (); + roadmap_sound_list_add (sound_list, "Arrive.wav"); + roadmap_sound_play_list (sound_list); + NavigateTrackEnabled = 0; navigate_bar_set_mode (NavigateTrackEnabled); *************** *** 370,384 **** if (NavigateNextAnnounce == -1) { ! NavigateNextAnnounce = 50; ! annouce = 1; } ! if (NavigateDistanceToTurn <= NavigateNextAnnounce) { NavigateNextAnnounce = 0; ! annouce = 1; } ! if (annouce) { PluginStreetProperties properties; --- 384,423 ---- if (NavigateNextAnnounce == -1) { ! unsigned int i; ! for (i=0; i<sizeof(ANNOUNCES)/sizeof(ANNOUNCES[0]) - 1; i++) { ! ! if (NavigateDistanceToTurn > ANNOUNCES[i]) { ! NavigateNextAnnounce = ANNOUNCES[i]; ! break; ! } ! } ! ! if (NavigateNextAnnounce == -1) { ! NavigateNextAnnounce = ! ANNOUNCES[sizeof(ANNOUNCES)/sizeof(ANNOUNCES[0]) - 1]; ! } } ! if (NavigateNextAnnounce && ! (NavigateDistanceToTurn <= NavigateNextAnnounce)) { ! unsigned int i; ! ! announce_distance = NavigateNextAnnounce; NavigateNextAnnounce = 0; ! ! if (inst_voice) { ! announce = 1; ! } ! ! for (i=0; i<sizeof(ANNOUNCES)/sizeof(ANNOUNCES[0]); i++) { ! ! if (NavigateDistanceToTurn > ANNOUNCES[i]) { ! NavigateNextAnnounce = ANNOUNCES[i]; ! } ! } } ! if (announce) { PluginStreetProperties properties; *************** *** 394,414 **** roadmap_message_set ('C', properties.city); ! if (NavigateDistanceToTurn <= 50) { roadmap_message_unset ('w'); } else { int distance_far = ! roadmap_math_to_trip_distance(NavigateDistanceToTurn); if (distance_far > 0) { roadmap_message_set ('w', "%d %s", distance_far, roadmap_math_trip_unit()); } else { roadmap_message_set ('w', "%d %s", ! NavigateDistanceToTurn, roadmap_math_distance_unit()); }; } ! roadmap_voice_announce ("Driving Instruction"); } --- 433,467 ---- roadmap_message_set ('C', properties.city); ! sound_list = roadmap_sound_list_create (); ! if (!NavigateNextAnnounce) { roadmap_message_unset ('w'); } else { + char distance_str[100]; int distance_far = ! roadmap_math_to_trip_distance(announce_distance); ! ! roadmap_sound_list_add (sound_list, "within.wav"); if (distance_far > 0) { roadmap_message_set ('w', "%d %s", distance_far, roadmap_math_trip_unit()); + + sprintf(distance_str, "%d", distance_far); + roadmap_sound_list_add (sound_list, distance_str); + roadmap_sound_list_add (sound_list, roadmap_math_trip_unit()); } else { roadmap_message_set ('w', "%d %s", ! announce_distance, roadmap_math_distance_unit()); ! ! sprintf(distance_str, "%d", announce_distance); ! roadmap_sound_list_add (sound_list, distance_str); ! roadmap_sound_list_add (sound_list, roadmap_math_distance_unit()); }; } ! roadmap_sound_list_add (sound_list, inst_voice); ! //roadmap_voice_announce ("Driving Instruction"); ! roadmap_sound_play_list (sound_list); } |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:25:44
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7733 Modified Files: roadmap_main.cpp Log Message: Fix auto sync. Index: roadmap_main.cpp =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_main.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** roadmap_main.cpp 17 Jul 2006 06:35:45 -0000 1.14 --- roadmap_main.cpp 27 Jul 2006 14:25:39 -0000 1.15 *************** *** 124,127 **** --- 124,148 ---- ROADMAP_CONFIG_ITEM("GPS", "Virtual"); + static HANDLE g_hMutexAppRunning; + + BOOL AppInstanceExists() + { + BOOL bAppRunning = FALSE; + + g_hMutexAppRunning = CreateMutex( NULL, FALSE, + L"Global\\FreeMap RoadMap"); + + if (( g_hMutexAppRunning != NULL ) && + ( GetLastError() == ERROR_ALREADY_EXISTS)) + { + + CloseHandle( g_hMutexAppRunning ); + g_hMutexAppRunning = NULL; + } + + return ( g_hMutexAppRunning == NULL ); + } + + #ifndef _ROADGPS static void roadmap_main_start_sync (void) { *************** *** 288,297 **** SHInitExtraControls(); ! if (!wcscmp(lpCmdLine, APP_RUN_AT_RS232_DETECT)) { do_sync = true; } #endif ! //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); --- 309,321 ---- SHInitExtraControls(); ! if (!wcscmp(lpCmdLine, APP_RUN_AT_RS232_DETECT) || ! !wcscmp(lpCmdLine, APP_RUN_AFTER_SYNC)) { do_sync = true; } #endif ! ! BOOL other_instance = AppInstanceExists (); ! //If it is already running, then focus on the window, and exit hWnd = FindWindow(szWindowClass, NULL); *************** *** 309,313 **** } } ! if (!MyRegisterClass(hInstance, szWindowClass)) { --- 333,339 ---- } } ! ! if (other_instance) return 0; ! if (!MyRegisterClass(hInstance, szWindowClass)) { |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:25:25
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv7708 Modified Files: listports.c Log Message: Fix serial port detection for del axim 51. Index: listports.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/listports.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** listports.c 13 Jul 2006 06:48:17 -0000 1.2 --- listports.c 27 Jul 2006 14:25:19 -0000 1.3 *************** *** 231,236 **** LPTSTR lpFriendlyName=NULL; LISTPORTS_PORTINFO portinfo; ! // DWORD index; DWORD wordSize = sizeof(DWORD); portinfo.lpPortName = (LPTSTR)malloc(64); --- 231,237 ---- LPTSTR lpFriendlyName=NULL; LISTPORTS_PORTINFO portinfo; ! DWORD index; DWORD wordSize = sizeof(DWORD); + BYTE found[20] = {0}; portinfo.lpPortName = (LPTSTR)malloc(64); *************** *** 271,274 **** --- 272,280 ---- portinfo.lpTechnology=TEXT(""); /* this information is not available */ + if (swscanf(portinfo.lpPortName, L"COM%d:", &index)) { + + if (index<sizeof(found)/sizeof(found[0])) found[index] = 1; + } + if(!lpCbk(lpCbkValue, &portinfo)){ break; *************** *** 276,279 **** --- 282,330 ---- } + if(hKey!=NULL) { + RegCloseKey(hKey); + hKey = NULL; + } + + if(dwError=RegOpenKeyEx(HKEY_LOCAL_MACHINE,TEXT("Drivers\\Builtin"), + 0,KEY_READ,&hKey)){ + goto end; + } else { + + DWORD dwIndex = 0; + + for(;;){ + TCHAR SubKeyName[20]; + DWORD cbSubkeyName = 20 * sizeof(TCHAR); + FILETIME filetime; + + if(!(dwError=RegEnumKeyEx(hKey,dwIndex,SubKeyName,&cbSubkeyName, + 0,NULL,NULL,&filetime))){ + + if (!wcsncmp(SubKeyName, L"Serial", 6)) { + DWORD index = 0; + + if (swscanf(SubKeyName, L"Serial%d:", &index)) { + + if (index && (index<sizeof(found)/sizeof(found[0]))) { + found[index] = 1; + + _stprintf((LPTSTR)portinfo.lpPortName, L"COM%u", index); + if(!lpCbk(lpCbkValue, &portinfo)){ + break; + } + } + } + } + } + else if(dwError!=ERROR_MORE_DATA){ /* not enough space */ + goto end; + } + + dwIndex++; + } + } + + end: free((LPTSTR)portinfo.lpPortName); |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:23:46
|
Update of /cvsroot/roadmap/roadmap_editor/src/win32 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6864 Modified Files: roadmap_dialog.c Log Message: I18n Change select widget to return the text labels from its internal data memory. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/win32/roadmap_dialog.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_dialog.c 16 Jul 2006 12:28:50 -0000 1.10 --- roadmap_dialog.c 27 Jul 2006 14:23:41 -0000 1.11 *************** *** 37,41 **** #include "../roadmap.h" #include "../roadmap_types.h" ! #include "../roadmap_start.h" #include "../roadmap_dialog.h" --- 37,44 ---- #include "../roadmap.h" #include "../roadmap_types.h" ! #include "../roadmap_start.h" ! #include "../roadmap_lang.h" ! ! #define ROADMAP_DIALOG_NO_LANG #include "../roadmap_dialog.h" *************** *** 72,76 **** RoadMapDialogCallback callback; char *value; ! char *label; } RoadMapDialogSelection; --- 75,79 ---- RoadMapDialogCallback callback; char *value; ! const char *label; } RoadMapDialogSelection; *************** *** 325,329 **** const char *name, int count, ! char **labels, void **values, RoadMapDialogCallback callback) --- 328,332 ---- const char *name, int count, ! const char **labels, void **values, RoadMapDialogCallback callback) *************** *** 440,444 **** ! void roadmap_dialog_add_button (char *label, RoadMapDialogCallback callback) { --- 443,447 ---- ! void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { *************** *** 466,469 **** --- 469,500 ---- } + + static char *roadmap_dialog_selection_get(RoadMapDialogItem item, int i) + { + static char *text = NULL; + TCHAR data[255]; + int len; + + if (text) { + free(text); + text = NULL; + } + + len = SendMessage(item->w, CB_GETLBTEXTLEN, (WPARAM)i, 0); + if (len >= 255) return ""; + + if (SendMessage(item->w, CB_GETLBTEXT, (WPARAM)i, (LPARAM)data) == + CB_ERR) { + + return ""; + } + + text = ConvertToMultiByte(data, CP_UTF8); + + if (!text) return ""; + + return text; + } + void roadmap_dialog_complete (int use_keyboard) *************** *** 493,498 **** DialogFunc, (LPARAM)dialog); ! ShowWindow(dialog->w, SW_HIDE); ! str = ConvertToWideChar(dialog->title, CP_UTF8); SetWindowText(dialog->w, str); free(str); --- 524,533 ---- DialogFunc, (LPARAM)dialog); ! ShowWindow(dialog->w, SW_HIDE); ! if (dialog->title[0] == '.') { ! str = ConvertToWideChar(dialog->title+1, CP_UTF8); ! } else { ! str = ConvertToWideChar(dialog->title, CP_UTF8); ! } SetWindowText(dialog->w, str); free(str); *************** *** 504,509 **** psp[count-i].dwFlags = PSP_PREMATURE|PSP_USETITLE; psp[count-i].hInstance = g_hInst; ! psp[count-i].pszTemplate = MAKEINTRESOURCE(IDD_GENERIC); ! psp[count-i].pszTitle = ConvertToWideChar(frame->name, CP_UTF8); psp[count-i].pfnDlgProc = TabDialogFunc; psp[count-i].lParam = (LPARAM) frame; --- 539,550 ---- psp[count-i].dwFlags = PSP_PREMATURE|PSP_USETITLE; psp[count-i].hInstance = g_hInst; ! psp[count-i].pszTemplate = MAKEINTRESOURCE(IDD_GENERIC); ! ! if (frame->name[0] == '.') { ! psp[count-i].pszTitle = ConvertToWideChar(frame->name+1, CP_UTF8); ! } else { ! psp[count-i].pszTitle = ConvertToWideChar(frame->name, CP_UTF8); ! } ! psp[count-i].pfnDlgProc = TabDialogFunc; psp[count-i].lParam = (LPARAM) frame; *************** *** 564,576 **** case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: ! { ! GetWindowText(this_item->w, str, sizeof(str)/sizeof(str[0])); ! if (this_item->ansi_value != NULL) { ! free(this_item->ansi_value); ! } ! this_item->ansi_value = ConvertToMultiByte(str, CP_UTF8); ! return this_item->ansi_value; } ! break; } --- 605,630 ---- case ROADMAP_WIDGET_PASSWORD: case ROADMAP_WIDGET_ENTRY: ! GetWindowText(this_item->w, str, sizeof(str)/sizeof(str[0])); ! if (this_item->ansi_value != NULL) { ! free(this_item->ansi_value); } ! this_item->ansi_value = ConvertToMultiByte(str, CP_UTF8); ! return this_item->ansi_value; ! ! case ROADMAP_WIDGET_CHOICE: ! if (this_item->data_is_string) { ! if ((this_item->ansi_value != NULL) && ! this_item->ansi_value[0]) { ! ! free(this_item->ansi_value); ! } ! ! this_item->ansi_value = ! strdup(roadmap_dialog_selection_get(this_item, ! SendMessage(this_item->w, CB_GETCURSEL, 0, 0))); ! ! return this_item->ansi_value; ! } ! break; } *************** *** 606,610 **** if ((data == this_item->choice[i].value) || (this_item->data_is_string && ! !strcmp (this_item->choice[i].value, data))) { SendMessage --- 660,664 ---- if ((data == this_item->choice[i].value) || (this_item->data_is_string && ! !strcmp (roadmap_dialog_selection_get(this_item, i), data))) { SendMessage *************** *** 1118,1126 **** continue; } ! if (item->widget_type == ROADMAP_WIDGET_LIST) { ! MoveWindow(label, ! column_edge_width, curr_y + label_y_add, ! first_column_width, row_height - label_y_add, ! TRUE); curr_y += row_height; MoveWindow(widget, --- 1172,1188 ---- continue; } ! if (item->widget_type == ROADMAP_WIDGET_LIST) { ! if (!roadmap_lang_rtl ()) { ! MoveWindow(label, ! column_edge_width, curr_y + label_y_add, ! first_column_width, row_height - label_y_add, ! TRUE); ! } else { ! MoveWindow(label, ! width - column_edge_width - first_column_width, ! curr_y + label_y_add, ! first_column_width, row_height - label_y_add, ! TRUE); ! } curr_y += row_height; MoveWindow(widget, *************** *** 1132,1154 **** if (label != NULL) { unsigned int widget_height = row_height; ! MoveWindow(label, ! column_edge_width, curr_y + label_y_add, ! first_column_width, row_height - label_y_add, ! TRUE); ! ! if (item->widget_type == ROADMAP_WIDGET_CHOICE) { ! widget_height = height - curr_y - 2; ! if (widget_height > MAX_LIST_HEIGHT*2) { ! widget_height = MAX_LIST_HEIGHT*2; ! } ! } ! MoveWindow(widget, ! column_edge_width + first_column_width + ! column_separator, ! curr_y, ! width - (column_edge_width*2 + ! first_column_width + column_separator), ! widget_height, TRUE); } else { MoveWindow(widget, --- 1194,1232 ---- if (label != NULL) { unsigned int widget_height = row_height; + + if (item->widget_type == ROADMAP_WIDGET_CHOICE) { + widget_height = height - curr_y - 2; + if (widget_height > MAX_LIST_HEIGHT*2) { + widget_height = MAX_LIST_HEIGHT*2; + } + } + + if (!roadmap_lang_rtl ()) { + MoveWindow(label, + column_edge_width, curr_y + label_y_add, + first_column_width, row_height - label_y_add, + TRUE); ! MoveWindow(widget, ! column_edge_width + first_column_width + ! column_separator, ! curr_y, ! width - (column_edge_width*2 + ! first_column_width + column_separator), ! widget_height, TRUE); ! } else { ! MoveWindow(label, ! width - column_edge_width - first_column_width, ! curr_y + label_y_add, ! first_column_width, row_height - label_y_add, ! TRUE); ! ! MoveWindow(widget, ! column_edge_width, ! curr_y, ! width - (column_edge_width*2 + ! first_column_width + column_separator), ! widget_height, TRUE); ! } } else { MoveWindow(widget, |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:22:17
|
Update of /cvsroot/roadmap/roadmap_editor/src/editor/export In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6433 Modified Files: editor_upload.c Log Message: Close the file when done. Index: editor_upload.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/editor/export/editor_upload.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** editor_upload.c 16 Jul 2006 12:25:08 -0000 1.3 --- editor_upload.c 27 Jul 2006 14:22:11 -0000 1.4 *************** *** 438,442 **** if (!user_name[0]) { unsigned char digest[16]; ! if (roadmap_net_unique_id (digest, sizeof(digest)) != sizeof(digest)) { return -1; } --- 438,443 ---- if (!user_name[0]) { unsigned char digest[16]; ! if (roadmap_net_unique_id (digest, sizeof(digest)) != sizeof(digest)) { ! roadmap_file_close (file); return -1; } *************** *** 450,454 **** fd = editor_http_send_header (target, file_name, size, user_name, password, editor_upload_error); ! if (!ROADMAP_NET_IS_VALID(fd)) { return -1; } --- 451,456 ---- fd = editor_http_send_header (target, file_name, size, user_name, password, editor_upload_error); ! if (!ROADMAP_NET_IS_VALID(fd)) { ! roadmap_file_close (file); return -1; } *************** *** 481,485 **** } ! roadmap_net_close (fd); roadmap_dialog_hide ("Uploading"); buffer[loaded] = 0; --- 483,488 ---- } ! roadmap_net_close (fd); ! roadmap_file_close (file); roadmap_dialog_hide ("Uploading"); buffer[loaded] = 0; *************** *** 490,494 **** cancel_upload: ! roadmap_net_close (fd); roadmap_dialog_hide ("Uploading"); --- 493,498 ---- cancel_upload: ! roadmap_net_close (fd); ! roadmap_file_close (file); roadmap_dialog_hide ("Uploading"); |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:20:25
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5581 Modified Files: roadmap_nmea.c Log Message: Fix VTG sentence (may exist with no info). Index: roadmap_nmea.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_nmea.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_nmea.c 13 Jul 2006 06:35:23 -0000 1.3 --- roadmap_nmea.c 27 Jul 2006 14:20:17 -0000 1.4 *************** *** 378,381 **** --- 378,382 ---- if (argc <= 5) return 0; + if (!argv[1][0] || !argv[5][0]) return 0; RoadMapNmeaReceived.vtg.steering = *************** *** 754,757 **** --- 755,760 ---- mnea_checksum, checksum); + + return 0; } } |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:19:39
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5161 Modified Files: roadmap_download.c Log Message: Modify message box text. Index: roadmap_download.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_download.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_download.c 16 Jul 2006 12:23:25 -0000 1.8 --- roadmap_download.c 27 Jul 2006 14:19:30 -0000 1.9 *************** *** 358,362 **** char *p; RoadMapFile source_file; ! gzFile source_file_gz; RoadMapFile dest_file; char *dest_name = strdup(destination); --- 358,362 ---- char *p; RoadMapFile source_file; ! gzFile source_file_gz; RoadMapFile dest_file; char *dest_name = strdup(destination); *************** *** 381,394 **** 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; } --- 381,394 ---- 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; } *************** *** 406,415 **** } ! if (roadmap_file_write (dest_file, buffer, count) != count) { ! res = -1; ! break; } } ! end: free(dest_name); --- 406,415 ---- } ! if (roadmap_file_write (dest_file, buffer, count) != count) { ! res = -1; ! break; } } ! end: free(dest_name); *************** *** 420,426 **** roadmap_file_close (source_file); } ! if (ROADMAP_FILE_IS_VALID (dest_file)) { ! roadmap_file_close (dest_file); } --- 420,426 ---- roadmap_file_close (source_file); } ! if (ROADMAP_FILE_IS_VALID (dest_file)) { ! roadmap_file_close (dest_file); } *************** *** 646,650 **** basename = strrchr (source, '/'); if (basename == NULL) { ! roadmap_messagebox ("Download Error", "Bad source file name (no path)"); return -1; } --- 646,650 ---- basename = strrchr (source, '/'); if (basename == NULL) { ! roadmap_messagebox (source, "Bad source file name (no path)"); return -1; } |
|
From: Ehud S. <esh...@us...> - 2006-07-27 14:19:15
|
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv5083 Modified Files: roadmap_address.c Log Message: Fix history. Index: roadmap_address.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_address.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** roadmap_address.c 11 Jun 2006 12:42:49 -0000 1.5 --- roadmap_address.c 27 Jul 2006 14:19:08 -0000 1.6 *************** *** 50,54 **** #define MAX_NAMES 100 ! static char *def_values[2] = {"", "Search"}; static int RoadMapAddressSearchCount; static char *RoadMapAddressSearchNames[MAX_NAMES]; --- 50,54 ---- #define MAX_NAMES 100 ! static const char *def_values[2] = {"", ""}; static int RoadMapAddressSearchCount; static char *RoadMapAddressSearchNames[MAX_NAMES]; *************** *** 387,396 **** static void roadmap_address_other_cb (const char *name, void *context) { ! if (roadmap_dialog_get_data ("Address", "City:") == def_values[1]) { roadmap_dialog_set_data ("Address", "City:", def_values[0]); roadmap_address_search_dialog (NULL, roadmap_address_city_result, context); ! } else if (roadmap_dialog_get_data ("Address", "Street:") == def_values[1]) { roadmap_dialog_set_data ("Address", "Street:", def_values[0]); --- 387,397 ---- static void roadmap_address_other_cb (const char *name, void *context) { ! if (!strcmp(roadmap_dialog_get_data ("Address", "City:"), def_values[1]) ){ roadmap_dialog_set_data ("Address", "City:", def_values[0]); roadmap_address_search_dialog (NULL, roadmap_address_city_result, context); ! } else if (!strcmp(roadmap_dialog_get_data ("Address", "Street:"), ! def_values[1])) { roadmap_dialog_set_data ("Address", "Street:", def_values[0]); *************** *** 404,407 **** --- 405,412 ---- static void roadmap_address_dialog (RoadMapAddressDialog *context) { + if (!def_values[1][0]) { + def_values[1] = roadmap_lang_get ("Search"); + } + if (roadmap_dialog_activate (context->title, context)) { *************** *** 435,438 **** --- 440,453 ---- if (context->history) { + void *history = context->history; + + while (history) { + void *prev = context->history; + + roadmap_address_set (context); + context->history = roadmap_history_before ('A', context->history); + if (context->history == prev) break; + } + context->history = history; roadmap_address_set (context); } |
Update of /cvsroot/roadmap/roadmap_editor/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4705 Modified Files: Makefile roadmap_config.c roadmap_config.h roadmap_dialog.h roadmap_start.c Added Files: roadmap_lang.c roadmap_lang.h Log Message: I18n --- NEW FILE: roadmap_lang.h --- /* roadmap_lang.h - I18n * * 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 __ROADMAP_LANG__H #define __ROADMAP_LANG__H void roadmap_lang_initialize (void); const char* roadmap_lang_get (const char *name); int roadmap_lang_rtl (void); #endif // __ROADMAP_LANG__H --- NEW FILE: roadmap_lang.c --- /* roadmap_lang.c - i18n * * 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 roadmap_lang.h. */ #include <string.h> #include <stdlib.h> #include <stdarg.h> #include "roadmap.h" #include "roadmap_path.h" #include "roadmap_file.h" #include "roadmap_config.h" #include "roadmap_hash.h" #include "roadmap_lang.h" #define INITIAL_ITEMS_SIZE 50 struct RoadMapLangItem { const char *name; const char *value; }; static struct RoadMapLangItem *RoadMapLangItems; static int RoadMapLangSize; static int RoadMapLangCount; static RoadMapHash *RoadMapLangHash; static int RoadMapLangLoaded = 0; static int roadmap_lang_hash_str (const char *str) { int hash = 0; unsigned int i; for (i=0; i<strlen(str); i++) { hash += str[i]; } return hash; } static void roadmap_lang_allocate (void) { if (RoadMapLangSize == 0) { RoadMapLangSize = INITIAL_ITEMS_SIZE; RoadMapLangItems = calloc(RoadMapLangSize, sizeof(struct RoadMapLangItem)); RoadMapLangHash = roadmap_hash_new ("lang_hash", RoadMapLangSize); } else { RoadMapLangSize *= 2; RoadMapLangItems = realloc(RoadMapLangItems, RoadMapLangSize * sizeof(struct RoadMapLangItem)); roadmap_hash_resize (RoadMapLangHash, RoadMapLangSize); } if (RoadMapLangItems == NULL) { roadmap_log (ROADMAP_FATAL, "No memory."); } } static void roadmap_lang_new_item (const char *name, const char *value) { int hash = roadmap_lang_hash_str (name); if (RoadMapLangCount == RoadMapLangSize) { roadmap_lang_allocate (); } RoadMapLangItems[RoadMapLangCount].name = name; RoadMapLangItems[RoadMapLangCount].value = value; roadmap_hash_add (RoadMapLangHash, hash, RoadMapLangCount); RoadMapLangCount++; } static int roadmap_lang_load (const char *path) { char *p; FILE *file; char line[1024]; char *name; char *value; file = roadmap_file_fopen (path, "lang", "sr"); if (file == NULL) return 0; while (!feof(file)) { /* Read the next line, skip empty lines and comments. */ if (fgets (line, sizeof(line), file) == NULL) break; p = roadmap_config_extract_data (line, sizeof(line)); if (p == NULL) continue; /* Decode the line (name= value). */ name = p; p = roadmap_config_skip_until (p, '='); if (*p != '=') continue; *(p++) = 0; p = roadmap_config_skip_spaces (p); value = p; p = roadmap_config_skip_until (p, 0); *p = 0; name = strdup (name); value = strdup (value); roadmap_lang_new_item (name, value); } fclose (file); return 1; } void roadmap_lang_initialize (void) { const char *p; roadmap_lang_allocate (); p = roadmap_path_user (); RoadMapLangLoaded = roadmap_lang_load (p); } const char* roadmap_lang_get (const char *name) { int hash; int i; if (!RoadMapLangLoaded) return name; hash = roadmap_lang_hash_str (name); for (i = roadmap_hash_get_first (RoadMapLangHash, hash); i >= 0; i = roadmap_hash_get_next (RoadMapLangHash, i)) { if (!strcmp(name, RoadMapLangItems[i].name)) { return RoadMapLangItems[i].value; } } return name; } int roadmap_lang_rtl (void) { return 1; } Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile 16 Jul 2006 12:23:25 -0000 1.17 --- Makefile 27 Jul 2006 14:18:46 -0000 1.18 *************** *** 132,135 **** --- 132,136 ---- roadmap_driver.c \ roadmap_adjust.c \ + roadmap_lang.c \ roadmap_sunrise.c Index: roadmap_dialog.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_dialog.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_dialog.h 15 May 2006 19:22:36 -0000 1.3 --- roadmap_dialog.h 27 Jul 2006 14:18:46 -0000 1.4 *************** *** 88,96 **** * not when the OK button is called--that is the job of the OK button * callback. */ void roadmap_dialog_new_choice (const char *frame, const char *name, int count, ! char **labels, void **values, RoadMapDialogCallback callback); --- 88,99 ---- * not when the OK button is called--that is the job of the OK button * callback. + * + * Note: A choice widget is expected to be able to retrive its text labels + * from its internal data structures. */ void roadmap_dialog_new_choice (const char *frame, const char *name, int count, ! const char **labels, void **values, RoadMapDialogCallback callback); *************** *** 113,117 **** /* Add one button to the bottom of the dialog. */ ! void roadmap_dialog_add_button (char *label, RoadMapDialogCallback callback); /* When all done with building the dialog, call this to finalize and show: */ --- 116,121 ---- /* Add one button to the bottom of the dialog. */ ! void roadmap_dialog_add_button ! (const char *label, RoadMapDialogCallback callback); /* When all done with building the dialog, call this to finalize and show: */ *************** *** 124,126 **** --- 128,243 ---- void roadmap_dialog_protect (const char *frame, const char *name); + #ifndef ROADMAP_DIALOG_NO_LANG + #include "roadmap_lang.h" + + static __inline int roadmap_dialog_activate_i (const char *name, void *context) { + return roadmap_dialog_activate (roadmap_lang_get (name), context); + } + + static __inline void roadmap_dialog_hide_i (const char *name) { + roadmap_dialog_hide (roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_new_label_i + (const char *frame, const char *name) { + + roadmap_dialog_new_label + (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_new_entry_i + (const char *frame, const char *name, RoadMapDialogCallback callback) { + + roadmap_dialog_new_entry + (roadmap_lang_get (frame), roadmap_lang_get (name), callback); + } + + static __inline void roadmap_dialog_new_password_i + (const char *frame, const char *name) { + + roadmap_dialog_new_password + (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_new_color_i + (const char *frame, const char *name) { + + roadmap_dialog_new_color + (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_new_choice_i + (const char *frame, + const char *name, + int count, + const char **labels, + void **values, + RoadMapDialogCallback callback) { + + roadmap_dialog_new_choice (roadmap_lang_get (frame), + roadmap_lang_get (name), + count, labels, values, callback); + } + + static __inline void roadmap_dialog_new_list_i + (const char *frame, const char *name) { + + roadmap_dialog_new_list (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_show_list_i + (const char *frame, + const char *name, + int count, + char **labels, + void **values, + RoadMapDialogCallback callback) { + + roadmap_dialog_show_list (roadmap_lang_get (frame), + roadmap_lang_get (name), + count, labels, values, callback); + } + + static __inline void roadmap_dialog_add_button_i + (const char *label, RoadMapDialogCallback callback) { + + roadmap_dialog_add_button (roadmap_lang_get (label), callback); + } + + static __inline void *roadmap_dialog_get_data_i + (const char *frame, const char *name) { + + return roadmap_dialog_get_data + (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + static __inline void roadmap_dialog_set_data_i + (const char *frame, const char *name, const void *data) { + + roadmap_dialog_set_data + (roadmap_lang_get (frame), roadmap_lang_get (name), data); + } + + static __inline void roadmap_dialog_protect_i + (const char *frame, const char *name) { + + roadmap_dialog_protect (roadmap_lang_get (frame), roadmap_lang_get (name)); + } + + #define roadmap_dialog_activate roadmap_dialog_activate_i + #define roadmap_dialog_hide roadmap_dialog_hide_i + #define roadmap_dialog_new_label roadmap_dialog_new_label_i + #define roadmap_dialog_new_entry roadmap_dialog_new_entry_i + #define roadmap_dialog_new_password roadmap_dialog_new_password_i + #define roadmap_dialog_new_color roadmap_dialog_new_color_i + #define roadmap_dialog_new_choice roadmap_dialog_new_choice_i + #define roadmap_dialog_new_list roadmap_dialog_new_list_i + #define roadmap_dialog_show_list roadmap_dialog_show_list_i + #define roadmap_dialog_add_button roadmap_dialog_add_button_i + #define roadmap_dialog_select roadmap_dialog_select_i + #define roadmap_dialog_get_data roadmap_dialog_get_data_i + #define roadmap_dialog_set_data roadmap_dialog_set_data_i + #define roadmap_dialog_protect roadmap_dialog_protect_i + #endif + #endif // INCLUDE__ROADMAP_DIALOG__H Index: roadmap_config.h =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_config.h 15 May 2006 19:25:46 -0000 1.3 --- roadmap_config.h 27 Jul 2006 14:18:46 -0000 1.4 *************** *** 74,77 **** --- 74,81 ---- + char *roadmap_config_skip_until (char *p, char c); + + char *roadmap_config_skip_spaces (char *p); + char *roadmap_config_extract_data (char *line, int size); Index: roadmap_config.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_config.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap_config.c 15 May 2006 19:25:46 -0000 1.4 --- roadmap_config.c 27 Jul 2006 14:18:46 -0000 1.5 *************** *** 435,451 **** - static char *roadmap_config_skip_until (char *p, char c) { - - while (*p != '\n' && *p != c && *p != 0) p++; - return p; - } - - static char *roadmap_config_skip_spaces (char *p) { - - while (*p == ' ' || *p == '\t') p++; - return p; - } - - static int roadmap_config_load (const char *path, RoadMapConfig *config, int intended_state) { --- 435,438 ---- *************** *** 558,561 **** --- 545,562 ---- + char *roadmap_config_skip_until (char *p, char c) { + + while (*p != '\n' && *p != c && *p != 0) p++; + return p; + } + + + char *roadmap_config_skip_spaces (char *p) { + + while (*p == ' ' || *p == '\t') p++; + return p; + } + + char *roadmap_config_extract_data (char *line, int size) { Index: roadmap_start.c =================================================================== RCS file: /cvsroot/roadmap/roadmap_editor/src/roadmap_start.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** roadmap_start.c 17 Jul 2006 06:29:37 -0000 1.23 --- roadmap_start.c 27 Jul 2006 14:18:46 -0000 1.24 *************** *** 72,75 **** --- 72,77 ---- #include "roadmap_help.h" #include "roadmap_pointer.h" + #include "roadmap_sound.h" + #include "roadmap_lang.h" #include "navigate/navigate_main.h" *************** *** 994,997 **** --- 996,1001 ---- roadmap_driver_initialize (); roadmap_config_initialize (); + roadmap_lang_initialize (); + roadmap_sound_initialize (); roadmap_gps_register_listener (&roadmap_gps_update); *************** *** 1050,1053 **** --- 1054,1058 ---- roadmap_plugin_shutdown (); roadmap_driver_shutdown (); + roadmap_sound_shutdown (); roadmap_history_save (); roadmap_config_save (0); |
|
From: Paul F. <pg...@us...> - 2006-07-20 03:45:02
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15627 Modified Files: roadmap_label.c Log Message: eliminate excessive TRACE debug lines Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** roadmap_label.c 20 Jul 2006 03:42:37 -0000 1.12 --- roadmap_label.c 20 Jul 2006 03:44:57 -0000 1.13 *************** *** 40,46 **** #include "roadmap_label.h" - // #define TRACE(x, ...) roadmap_log(x,__VA_ARGS__) - #define TRACE(x, ...) - #define MIN(a, b) (a) < (b) ? (a) : (b) #define MAX(a, b) (a) > (b) ? (a) : (b) --- 40,43 ---- *************** *** 218,227 **** last_generation = RoadMapLabelGeneration; - TRACE(ROADMAP_WARNING, "start: cached %d new %d spare %d alloced %d", - roadmap_list_count(&RoadMapLabelCache), - roadmap_list_count(&RoadMapLabelNew), - roadmap_list_count(&RoadMapLabelSpares), - RoadMapLabelCacheAlloced); - /* Cheap cache invalidation: if the previous center of screen * is still visible, assume that the cache is still more useful --- 215,218 ---- *************** *** 306,315 **** roadmap_canvas_select_pen (RoadMapLabelPen); - TRACE(ROADMAP_WARNING, "cached %d new %d spare %d alloced %d", - roadmap_list_count(&RoadMapLabelCache), - roadmap_list_count(&RoadMapLabelNew), - roadmap_list_count(&RoadMapLabelSpares), - RoadMapLabelCacheAlloced); - /* We want to process the cache first, in order to render previously * rendered labels again. Only after doing so (checking for updates --- 297,300 ---- *************** *** 318,322 **** */ for (whichlist = OLDLIST; whichlist <= NEWLIST; whichlist++) { - TRACE(ROADMAP_WARNING, "which %d", whichlist); ROADMAP_LIST_FOR_EACH --- 303,306 ---- *************** *** 327,334 **** cPtr = (roadmap_label *)item; - TRACE(ROADMAP_WARNING, "considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); if (cPtr->gen < RoadMapLabelGenerationFloor) { - TRACE(ROADMAP_WARNING, "gen expired"); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 311,316 ---- *************** *** 341,348 **** if (whichlist == OLDLIST) { ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { - TRACE(ROADMAP_WARNING, "new --"); ncPtr = (roadmap_label *)item2; if (ncPtr->gen == 0) { - TRACE(ROADMAP_WARNING, "new: marked off"); continue; } --- 323,328 ---- *************** *** 384,388 **** cPtr->gen = ncPtr->gen; - TRACE(ROADMAP_WARNING, "new: found %d (%d)", ncPtr->gen, RoadMapLabelGeneration); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&ncPtr->link)); --- 364,367 ---- *************** *** 394,407 **** if (cPtr->gen != RoadMapLabelGeneration) { - TRACE(ROADMAP_WARNING, "wrong gen"); continue; } - TRACE(ROADMAP_WARNING, "still considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); - roadmap_plugin_get_street_properties (&cPtr->line, &properties); if (!properties.street || !*properties.street) { - TRACE(ROADMAP_WARNING, "no props"); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 373,382 ---- *************** *** 438,443 **** /* text is too long for this feature */ if ((width / 4) > cPtr->featuresize) { - cPtr->gen = 0; - TRACE(ROADMAP_WARNING, "toosmall"); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 413,416 ---- *************** *** 475,480 **** midpt.x > roadmap_canvas_width() || midpt.y > roadmap_canvas_height()) { - cPtr->gen = 0; /* over the edge */ - TRACE(ROADMAP_WARNING, "off edge"); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 448,451 ---- *************** *** 483,488 **** - TRACE(ROADMAP_WARNING, "before rendered, considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); - /* compare against already rendered labels */ if (whichlist == NEWLIST) --- 454,457 ---- *************** *** 494,502 **** ( RoadMapLabelCache.list_first, end, item2, tmp2) { - TRACE(ROADMAP_WARNING, "rendered --"); ocPtr = (roadmap_label *)item2; if (ocPtr->gen != RoadMapLabelGeneration) { - TRACE(ROADMAP_WARNING, "rendered: wrong gen %d (%d)", ocPtr->gen, RoadMapLabelGeneration); continue; } --- 463,469 ---- *************** *** 505,509 **** if(roadmap_plugin_same_street(&cPtr->street, &ocPtr->street)) { cPtr->gen = 0; /* label is a duplicate */ - TRACE(ROADMAP_WARNING, "rendered: dup"); break; } --- 472,475 ---- *************** *** 515,519 **** /* if labels are horizontal, bbox check is sufficient */ if(!angles) { - TRACE(ROADMAP_WARNING, "rendered: rectovl"); cPtr->gen = 0; break; --- 481,484 ---- *************** *** 526,530 **** aang = abs(cPtr->angle); if (aang < 4 || aang > 86) { - TRACE(ROADMAP_WARNING, "rendered: steep"); cPtr->gen = 0; break; --- 491,494 ---- *************** *** 532,536 **** aang = abs(ocPtr->angle); if (aang < 4 || aang > 86) { - TRACE(ROADMAP_WARNING, "rendered: steep"); cPtr->gen = 0; break; --- 496,499 ---- *************** *** 539,543 **** /* otherwise we do the full poly check */ if (poly_overlap (ocPtr, cPtr)) { - TRACE(ROADMAP_WARNING, "rendered: polyover"); cPtr->gen = 0; break; --- 502,505 ---- *************** *** 545,552 **** } } - TRACE(ROADMAP_WARNING, "after rendered, considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); if(cPtr->gen == 0) { - TRACE(ROADMAP_WARNING, "bagging"); roadmap_list_insert (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); --- 507,512 ---- *************** *** 576,586 **** } /* next list */ - TRACE(ROADMAP_WARNING, "e: cached %d new %d spare %d alloced %d", - roadmap_list_count(&RoadMapLabelCache), - roadmap_list_count(&RoadMapLabelNew), - roadmap_list_count(&RoadMapLabelSpares), - RoadMapLabelCacheAlloced); - - RoadMapLabelGeneration++; return 0; --- 536,539 ---- |
|
From: Paul F. <pg...@us...> - 2006-07-20 03:42:42
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14880 Modified Files: roadmap_label.c Log Message: no tabs Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_label.c 20 Jul 2006 03:22:01 -0000 1.11 --- roadmap_label.c 20 Jul 2006 03:42:37 -0000 1.12 *************** *** 322,326 **** ROADMAP_LIST_FOR_EACH (whichlist == OLDLIST ? &RoadMapLabelCache : &RoadMapLabelNew, ! item, tmp) { PluginStreetProperties properties; --- 322,326 ---- ROADMAP_LIST_FOR_EACH (whichlist == OLDLIST ? &RoadMapLabelCache : &RoadMapLabelNew, ! item, tmp) { PluginStreetProperties properties; *************** *** 336,342 **** } ! /* If still working through previously rendered labels, ! * check for updates ! */ if (whichlist == OLDLIST) { ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { --- 336,342 ---- } ! /* If still working through previously rendered labels, ! * check for updates ! */ if (whichlist == OLDLIST) { ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { *************** *** 354,381 **** /* Found a new version of this existing line */ ! if (cPtr->angle != ncPtr->angle) { ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! cPtr->angle = ncPtr->angle; ! } else { ! /* Angle is unchanged -- simple movement only */ int dx, dy; ! dx = ncPtr->point.x - cPtr->point.x; ! dy = ncPtr->point.y - cPtr->point.y; ! if (dx != 0 || dy != 0) { ! int i; ! for (i = 0; i < 4; i++) { ! cPtr->poly[i].x += dx; ! cPtr->poly[i].y += dy; ! } ! cPtr->bbox.minx += dx; ! cPtr->bbox.maxx += dx; ! cPtr->bbox.miny += dy; ! cPtr->bbox.maxy += dy; ! } ! } cPtr->point = ncPtr->point; --- 354,381 ---- /* Found a new version of this existing line */ ! if (cPtr->angle != ncPtr->angle) { ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! cPtr->angle = ncPtr->angle; ! } else { ! /* Angle is unchanged -- simple movement only */ int dx, dy; ! dx = ncPtr->point.x - cPtr->point.x; ! dy = ncPtr->point.y - cPtr->point.y; ! if (dx != 0 || dy != 0) { ! int i; ! for (i = 0; i < 4; i++) { ! cPtr->poly[i].x += dx; ! cPtr->poly[i].y += dy; ! } ! cPtr->bbox.minx += dx; ! cPtr->bbox.maxx += dx; ! cPtr->bbox.miny += dy; ! cPtr->bbox.maxy += dy; ! } ! } cPtr->point = ncPtr->point; *************** *** 414,468 **** cPtr->street = properties.plugin_street; ! if (cPtr->bbox.minx > cPtr->bbox.maxx) { #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ ! label_center_y = 0; #else ! int i; ! roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); ! angles = angles && i; ! label_center_y = 1; #endif ! /* text is too long for this feature */ ! if ((width / 4) > cPtr->featuresize) { ! cPtr->gen = 0; ! TRACE(ROADMAP_WARNING, "toosmall"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! r.minx = 0; ! r.maxx = width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; ! if (angles) { ! p = get_metrics (cPtr, &r, label_center_y); ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) ! */ ! p = cPtr->point; ! cPtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; ! } ! } --- 414,468 ---- cPtr->street = properties.plugin_street; ! if (cPtr->bbox.minx > cPtr->bbox.maxx) { #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ ! label_center_y = 0; #else ! int i; ! roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); ! angles = angles && i; ! label_center_y = 1; #endif ! /* text is too long for this feature */ ! if ((width / 4) > cPtr->featuresize) { ! cPtr->gen = 0; ! TRACE(ROADMAP_WARNING, "toosmall"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! r.minx = 0; ! r.maxx = width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; ! if (angles) { ! p = get_metrics (cPtr, &r, label_center_y); ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) ! */ ! p = cPtr->point; ! cPtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; ! } ! } *************** *** 486,496 **** /* compare against already rendered labels */ ! if (whichlist == NEWLIST) ! end = (RoadMapListItem *)&RoadMapLabelCache; ! else ! end = item; ROADMAP_LIST_FOR_EACH_FROM_TO ! ( RoadMapLabelCache.list_first, end, item2, tmp2) { TRACE(ROADMAP_WARNING, "rendered --"); --- 486,496 ---- /* compare against already rendered labels */ ! if (whichlist == NEWLIST) ! end = (RoadMapListItem *)&RoadMapLabelCache; ! else ! end = item; ROADMAP_LIST_FOR_EACH_FROM_TO ! ( RoadMapLabelCache.list_first, end, item2, tmp2) { TRACE(ROADMAP_WARNING, "rendered --"); *************** *** 567,575 **** } #endif ! if (whichlist == NEWLIST) { ! /* move the rendered label to the cache */ roadmap_list_append (&RoadMapLabelCache, roadmap_list_remove(&cPtr->link)); ! } } /* next label */ --- 567,575 ---- } #endif ! if (whichlist == NEWLIST) { ! /* move the rendered label to the cache */ roadmap_list_append (&RoadMapLabelCache, roadmap_list_remove(&cPtr->link)); ! } } /* next label */ |
|
From: Paul F. <pg...@us...> - 2006-07-20 03:22:06
|
Update of /cvsroot/roadmap/roadmap/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6295 Modified Files: roadmap_label.c roadmap_label.h roadmap_screen.c Log Message: make label cache a true cache. adds stability to labels -- labels already on the screen are kept in their current positions, by forcing them to be redone first. Index: roadmap_label.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_label.h 3 Jul 2006 13:21:58 -0000 1.3 --- roadmap_label.h 20 Jul 2006 03:22:01 -0000 1.4 *************** *** 30,59 **** #include "roadmap_gui.h" - /* should be related by a power of 2 */ - #define MIN_LABELS 256 - #define MAX_LABELS 2048 - - typedef struct { - - int featuresize; - - PluginLine line; - PluginStreet street; - - RoadMapGuiPoint point; /* label point */ - RoadMapGuiRect bbox; /* label bounding box */ - RoadMapGuiPoint poly[4]; - - short angle; /* degrees */ - short status; /* has this label been drawn or not */ - - } labelCacheMemberObj; - - typedef struct { - labelCacheMemberObj **labels; - int numlabels; - int maxlabels; - } labelCacheObj; - int roadmap_label_add (const RoadMapGuiPoint *point, int angle, --- 30,33 ---- *************** *** 65,67 **** --- 39,43 ---- int roadmap_label_draw_cache (int angles); + void roadmap_label_start (void); + #endif // __ROADMAP_LABEL__H Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** roadmap_screen.c 13 Jul 2006 13:30:33 -0000 1.67 --- roadmap_screen.c 20 Jul 2006 03:22:01 -0000 1.68 *************** *** 623,627 **** int total_length; int *total_length_ptr = 0; ! int angle = 0; int *angle_ptr = 0; RoadMapGuiPoint seg_middle; --- 623,627 ---- int total_length; int *total_length_ptr = 0; ! int angle = 90; int *angle_ptr = 0; RoadMapGuiPoint seg_middle; *************** *** 971,974 **** --- 971,976 ---- } + roadmap_label_start(); + /* - For each candidate county: */ *************** *** 1352,1355 **** --- 1354,1358 ---- #define FRACMOVE 4 + // #define FRACMOVE 100 // tiny moves: useful for debug void roadmap_screen_move_up (void) { Index: roadmap_label.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_label.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** roadmap_label.c 13 Jul 2006 15:47:53 -0000 1.10 --- roadmap_label.c 20 Jul 2006 03:22:01 -0000 1.11 *************** *** 37,42 **** --- 37,46 ---- #include "roadmap_linefont.h" + #include "roadmap_list.h" #include "roadmap_label.h" + // #define TRACE(x, ...) roadmap_log(x,__VA_ARGS__) + #define TRACE(x, ...) + #define MIN(a, b) (a) < (b) ? (a) : (b) #define MAX(a, b) (a) > (b) ? (a) : (b) *************** *** 48,53 **** ROADMAP_CONFIG_ITEM("Labels", "Color"); ! static labelCacheObj RoadMapLabelCache; ! static int RoadMapLabelCacheFull = 0; static RoadMapPen RoadMapLabelPen; --- 52,85 ---- ROADMAP_CONFIG_ITEM("Labels", "Color"); ! /* this is fairly arbitrary */ ! #define MAX_LABELS 2048 ! ! typedef struct { ! RoadMapListItem link; ! ! int featuresize; ! ! PluginLine line; ! PluginStreet street; ! ! RoadMapGuiPoint point; /* label point */ ! RoadMapGuiRect bbox; /* label bounding box */ ! RoadMapGuiPoint poly[4]; ! ! short angle; /* degrees */ ! short gen; /* combination "drawn" flag and generation marker */ ! ! } roadmap_label; ! ! static RoadMapList RoadMapLabelCache; ! static RoadMapList RoadMapLabelSpares; ! static RoadMapList RoadMapLabelNew; ! ! static int RoadMapLabelCacheFull; ! static int RoadMapLabelCacheAlloced; ! ! static int RoadMapLabelGeneration = 1; ! static int RoadMapLabelGenerationFloor; ! static RoadMapPen RoadMapLabelPen; *************** *** 72,76 **** /* doesn't check for one completely inside the other -- just intersection */ ! static int poly_overlap (labelCacheMemberObj *c1, labelCacheMemberObj *c2) { RoadMapGuiPoint *a = c1->poly; --- 104,108 ---- /* doesn't check for one completely inside the other -- just intersection */ ! static int poly_overlap (roadmap_label *c1, roadmap_label *c2) { RoadMapGuiPoint *a = c1->poly; *************** *** 86,90 **** point_in_bbox(&isect, &c2->bbox)) { return 1; ! } } } --- 118,122 ---- point_in_bbox(&isect, &c2->bbox)) { return 1; ! } } } *************** *** 111,116 **** ! static RoadMapGuiPoint get_metrics(labelCacheMemberObj *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; --- 143,148 ---- ! static RoadMapGuiPoint get_metrics(roadmap_label *c, ! RoadMapGuiRect *rect, int centered_y) { RoadMapGuiPoint q; int x1=0, y1=0; *************** *** 160,203 **** } ! static int roadmap_label_check_allocations(void) { ! ! if (!RoadMapLabelCache.labels) { ! RoadMapLabelCache.maxlabels = MIN_LABELS; ! RoadMapLabelCache.labels = malloc(MIN_LABELS * sizeof(labelCacheObj)); ! roadmap_check_allocated (RoadMapLabelCache.labels ); ! memset (RoadMapLabelCache.labels, ! 0, MIN_LABELS * sizeof(labelCacheObj)); ! } else if (RoadMapLabelCache.numlabels == RoadMapLabelCache.maxlabels) { ! if (RoadMapLabelCache.maxlabels == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); ! RoadMapLabelCacheFull = 1; ! return -1; ! } ! RoadMapLabelCache.maxlabels *= 2; ! RoadMapLabelCache.labels = realloc( RoadMapLabelCache.labels, ! RoadMapLabelCache.maxlabels * sizeof(labelCacheObj)); ! roadmap_check_allocated (RoadMapLabelCache.labels ); ! memset (&RoadMapLabelCache.labels[RoadMapLabelCache.numlabels], ! 0, RoadMapLabelCache.numlabels * sizeof(labelCacheObj)); } ! return 0; } int roadmap_label_add (const RoadMapGuiPoint *point, int angle, int featuresize, const PluginLine *line) { ! labelCacheMemberObj *cachePtr; ! ! if (RoadMapLabelCacheFull) return -1; if (featuresize < --- 192,244 ---- } ! static int normalize_angle(int angle) { ! angle += roadmap_math_get_orientation (); ! while (angle > 360) angle -= 360; ! while (angle < 0) angle += 360; ! if (angle >= 180) angle -= 180; ! angle -= 90; ! return angle; ! } ! /* called when a screen repaint is complete. keeping track of ! * label "generations" involves keeping track of full refreshes, ! * not individual calls to roadmap_label_draw_cache(). ! */ ! void roadmap_label_start (void) { ! static int last_generation = -100; ! int last_zoom; ! static RoadMapPosition last_center; ! RoadMapLabelGenerationFloor = last_generation; ! last_generation = RoadMapLabelGeneration; ! TRACE(ROADMAP_WARNING, "start: cached %d new %d spare %d alloced %d", ! roadmap_list_count(&RoadMapLabelCache), ! roadmap_list_count(&RoadMapLabelNew), ! roadmap_list_count(&RoadMapLabelSpares), ! RoadMapLabelCacheAlloced); + /* Cheap cache invalidation: if the previous center of screen + * is still visible, assume that the cache is still more useful + * than not. + */ + if ( !roadmap_math_point_is_visible (&last_center) ) { + ROADMAP_LIST_SPLICE (&RoadMapLabelSpares, &RoadMapLabelCache); } ! roadmap_math_get_context (&last_center, &last_zoom); ! } + int roadmap_label_add (const RoadMapGuiPoint *point, int angle, int featuresize, const PluginLine *line) { ! roadmap_label *cPtr = 0; if (featuresize < *************** *** 206,388 **** } ! if (roadmap_label_check_allocations() != 0) { ! return -1; ! } ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels]; ! if (!cachePtr) { ! cachePtr = malloc (sizeof (*cachePtr)); ! roadmap_check_allocated (cachePtr); ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels] = cachePtr; } ! cachePtr->featuresize = featuresize; ! cachePtr->line = *line; ! cachePtr->angle = angle; ! cachePtr->point = *point; ! cachePtr->status = 0; ! RoadMapLabelCache.numlabels++; return 0; } - int roadmap_label_draw_cache (int angles) { ! int l; ! int i; ! int width; ! int ascent; ! int descent; RoadMapGuiPoint p; RoadMapGuiRect r; const char *text; short aang; ! ! labelCacheMemberObj *cachePtr=NULL; roadmap_canvas_select_pen (RoadMapLabelPen); ! for(l=0; l<RoadMapLabelCache.numlabels; l++) { ! PluginStreetProperties properties; ! cachePtr = RoadMapLabelCache.labels[l]; ! roadmap_plugin_get_street_properties (&cachePtr->line, &properties); ! if (!properties.street || !*properties.street) { ! goto recycle; ! } ! text = properties.street; ! cachePtr->street = properties.plugin_street; ! #if ROADMAP_USE_LINEFONT ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ ! #define CENTER_Y 0 ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); ! #else ! #define CENTER_Y 1 ! roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); ! angles = angles && i; ! #endif ! r.minx = 0; ! r.maxx=width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; ! /* text is too long for this feature */ ! if ((width >> 2) > cachePtr->featuresize) { ! goto recycle; ! } ! cachePtr->status = 1; /* assume label *can* be drawn */ ! /* The stored point is not screen oriented, rotate is needed */ ! roadmap_math_rotate_coordinates (1, &cachePtr->point); ! if (angles) { ! cachePtr->angle += roadmap_math_get_orientation (); ! while (cachePtr->angle > 360) cachePtr->angle -= 360; ! while (cachePtr->angle < 0) cachePtr->angle += 360; ! if (cachePtr->angle >= 180) cachePtr->angle -= 180; ! cachePtr->angle -= 90; ! p = get_metrics (cachePtr, &r, CENTER_Y); ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) */ ! p = cachePtr->point; ! cachePtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cachePtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cachePtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cachePtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; ! } ! for(i=0; i<l; i++) { /* compare against rendered label */ ! /* compare bounding polygons and check for duplicates */ ! if(roadmap_plugin_same_street(&cachePtr->street, ! &RoadMapLabelCache.labels[i]->street)) { ! /* label is a duplicate */ ! cachePtr->status = 0; ! break; } ! if (rect_overlap (&RoadMapLabelCache.labels[i]->bbox, ! &cachePtr->bbox)) { ! /* if labels are horizontal, bbox check is sufficient */ ! if(!angles) { ! cachePtr->status = 0; ! break; ! } ! /* if labels are almost horizontal, the bbox check is ! * sufficient. (in addition, the line intersector ! * has trouble with flat or steep lines) ! */ ! aang = abs(cachePtr->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; } ! aang = abs(RoadMapLabelCache.labels[i]->angle); ! if (aang < 4 || aang > 86) { ! cachePtr->status = 0; ! break; } ! /* otherwise we do the full poly check */ ! if ( poly_overlap (RoadMapLabelCache.labels[i], cachePtr)) { ! cachePtr->status = 0; break; } } ! } ! if(!cachePtr->status) { ! recycle: ! /* move us out of the "under consideration" group */ ! if (l < RoadMapLabelCache.numlabels - 1) { ! labelCacheMemberObj * tmpPtr = cachePtr; ! cachePtr = RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1]; ! RoadMapLabelCache.labels[RoadMapLabelCache.numlabels-1] = tmpPtr;; ! RoadMapLabelCache.labels[l--] = cachePtr; ! RoadMapLabelCache.numlabels--; } - continue; /* next label */ - } ! #if ROADMAP_USE_LINEFONT ! roadmap_linefont_text (text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cachePtr->point, 16, cachePtr->angle); #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&p, &cachePtr->point, cachePtr->angle, text); ! } else { ! roadmap_canvas_draw_string ! (&cachePtr->point, ROADMAP_CANVAS_CENTER, text); ! } #endif ! } /* next label */ ! RoadMapLabelCache.numlabels = 0; ! RoadMapLabelCacheFull = 0; return 0; } - int roadmap_label_activate (void) { --- 247,590 ---- } ! if (!ROADMAP_LIST_EMPTY(&RoadMapLabelSpares)) { ! cPtr = (roadmap_label *)roadmap_list_remove ! (ROADMAP_LIST_FIRST(&RoadMapLabelSpares)); ! } else { ! if (RoadMapLabelCacheFull) return -1; ! if (RoadMapLabelCacheAlloced == MAX_LABELS) { ! roadmap_log (ROADMAP_WARNING, "Too many streets to label them all."); ! RoadMapLabelCacheFull = 1; ! return -1; ! } ! cPtr = malloc (sizeof (*cPtr)); ! roadmap_check_allocated (cPtr); ! RoadMapLabelCacheAlloced++; } ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! cPtr->line = *line; ! cPtr->featuresize = featuresize; ! cPtr->angle = normalize_angle(angle); ! ! cPtr->point = *point; ! ! /* The stored point is not screen oriented, rotate is needed */ ! roadmap_math_rotate_coordinates (1, &cPtr->point); ! ! ! /* the "generation" of a label is refreshed when it is re-added. ! * later, labels cache entries more than a generation old will ! * be discarded. ! */ ! cPtr->gen = RoadMapLabelGeneration; ! ! roadmap_list_append(&RoadMapLabelNew, &cPtr->link); return 0; } int roadmap_label_draw_cache (int angles) { ! RoadMapListItem *item, *tmp; ! RoadMapListItem *item2, *tmp2; ! RoadMapListItem *end; ! int width, ascent, descent; RoadMapGuiPoint p; RoadMapGuiRect r; + RoadMapGuiPoint midpt; const char *text; short aang; ! roadmap_label *cPtr, *ocPtr, *ncPtr; ! int whichlist; ! #define OLDLIST 0 ! #define NEWLIST 1 ! int label_center_y; roadmap_canvas_select_pen (RoadMapLabelPen); ! TRACE(ROADMAP_WARNING, "cached %d new %d spare %d alloced %d", ! roadmap_list_count(&RoadMapLabelCache), ! roadmap_list_count(&RoadMapLabelNew), ! roadmap_list_count(&RoadMapLabelSpares), ! RoadMapLabelCacheAlloced); ! /* We want to process the cache first, in order to render previously ! * rendered labels again. Only after doing so (checking for updates ! * in the new list as we go), we'll process what's left of the new ! * list -- those are the truly new labels for this repaint. ! */ ! for (whichlist = OLDLIST; whichlist <= NEWLIST; whichlist++) { ! TRACE(ROADMAP_WARNING, "which %d", whichlist); ! ROADMAP_LIST_FOR_EACH ! (whichlist == OLDLIST ? &RoadMapLabelCache : &RoadMapLabelNew, ! item, tmp) { ! PluginStreetProperties properties; ! cPtr = (roadmap_label *)item; ! TRACE(ROADMAP_WARNING, "considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); ! if (cPtr->gen < RoadMapLabelGenerationFloor) { ! TRACE(ROADMAP_WARNING, "gen expired"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! /* If still working through previously rendered labels, ! * check for updates ! */ ! if (whichlist == OLDLIST) { ! ROADMAP_LIST_FOR_EACH (&RoadMapLabelNew, item2, tmp2) { ! TRACE(ROADMAP_WARNING, "new --"); ! ncPtr = (roadmap_label *)item2; ! if (ncPtr->gen == 0) { ! TRACE(ROADMAP_WARNING, "new: marked off"); ! continue; ! } ! if (cPtr->line.plugin_id == ncPtr->line.plugin_id && ! cPtr->line.line_id == ncPtr->line.line_id && ! cPtr->line.layer == ncPtr->line.layer && ! cPtr->line.fips == ncPtr->line.fips) { ! /* Found a new version of this existing line */ ! if (cPtr->angle != ncPtr->angle) { ! cPtr->bbox.minx = 1; ! cPtr->bbox.maxx = -1; ! cPtr->angle = ncPtr->angle; ! } else { ! /* Angle is unchanged -- simple movement only */ ! int dx, dy; ! dx = ncPtr->point.x - cPtr->point.x; ! dy = ncPtr->point.y - cPtr->point.y; ! if (dx != 0 || dy != 0) { ! int i; ! for (i = 0; i < 4; i++) { ! cPtr->poly[i].x += dx; ! cPtr->poly[i].y += dy; ! } ! cPtr->bbox.minx += dx; ! cPtr->bbox.maxx += dx; ! cPtr->bbox.miny += dy; ! cPtr->bbox.maxy += dy; ! } ! } ! cPtr->point = ncPtr->point; ! cPtr->featuresize = ncPtr->featuresize; ! cPtr->gen = ncPtr->gen; ! TRACE(ROADMAP_WARNING, "new: found %d (%d)", ncPtr->gen, RoadMapLabelGeneration); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&ncPtr->link)); ! break; ! } ! } } + if (cPtr->gen != RoadMapLabelGeneration) { + TRACE(ROADMAP_WARNING, "wrong gen"); + continue; + } ! TRACE(ROADMAP_WARNING, "still considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); ! roadmap_plugin_get_street_properties (&cPtr->line, &properties); ! if (!properties.street || !*properties.street) { ! TRACE(ROADMAP_WARNING, "no props"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! ! text = properties.street; ! ! ! cPtr->street = properties.plugin_street; ! ! if (cPtr->bbox.minx > cPtr->bbox.maxx) { ! ! #ifdef ROADMAP_USE_LINEFONT ! ! roadmap_linefont_extents(text, 16, &width, &ascent, &descent); ! ! /* The linefont font isn't pretty. Reading it is hard with ! * a road running through it, so we don't center labels on ! * the road. */ ! label_center_y = 0; ! ! #else ! int i; ! ! roadmap_canvas_get_text_extents ! (text, -1, &width, &ascent, &descent, &i); ! ! angles = angles && i; ! ! label_center_y = 1; ! #endif ! ! /* text is too long for this feature */ ! if ((width / 4) > cPtr->featuresize) { ! cPtr->gen = 0; ! TRACE(ROADMAP_WARNING, "toosmall"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; } ! ! r.minx = 0; ! r.maxx = width+1; ! r.miny = 0; ! r.maxy = ascent + descent + 1; ! ! if (angles) { ! ! p = get_metrics (cPtr, &r, label_center_y); ! ! } else { ! /* Text will be horizontal, so bypass a lot of math. ! * (and compensate for eventual centering of text.) ! */ ! p = cPtr->point; ! cPtr->bbox.minx = r.minx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.maxx = r.maxx + p.x - (r.maxx - r.minx)/2; ! cPtr->bbox.miny = r.miny + p.y - (r.maxy - r.miny)/2; ! cPtr->bbox.maxy = r.maxy + p.y - (r.maxy - r.miny)/2; } + } ! ! /* Bounding box midpoint */ ! midpt.x = ( cPtr->bbox.maxx + cPtr->bbox.minx) / 2; ! midpt.y = ( cPtr->bbox.maxy + cPtr->bbox.miny) / 2; ! ! /* Too far over the edge of the screen? */ ! if (midpt.x < 0 || midpt.y < 0 || ! midpt.x > roadmap_canvas_width() || ! midpt.y > roadmap_canvas_height()) { ! cPtr->gen = 0; /* over the edge */ ! TRACE(ROADMAP_WARNING, "off edge"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; ! } ! ! ! TRACE(ROADMAP_WARNING, "before rendered, considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); ! ! /* compare against already rendered labels */ ! if (whichlist == NEWLIST) ! end = (RoadMapListItem *)&RoadMapLabelCache; ! else ! end = item; ! ! ROADMAP_LIST_FOR_EACH_FROM_TO ! ( RoadMapLabelCache.list_first, end, item2, tmp2) { ! ! TRACE(ROADMAP_WARNING, "rendered --"); ! ocPtr = (roadmap_label *)item2; ! ! if (ocPtr->gen != RoadMapLabelGeneration) { ! TRACE(ROADMAP_WARNING, "rendered: wrong gen %d (%d)", ocPtr->gen, RoadMapLabelGeneration); ! continue; ! } ! ! /* street already labelled */ ! if(roadmap_plugin_same_street(&cPtr->street, &ocPtr->street)) { ! cPtr->gen = 0; /* label is a duplicate */ ! TRACE(ROADMAP_WARNING, "rendered: dup"); break; } + + + /* if bounding boxes don't overlap, we're clear */ + if (rect_overlap (&ocPtr->bbox, &cPtr->bbox)) { + + /* if labels are horizontal, bbox check is sufficient */ + if(!angles) { + TRACE(ROADMAP_WARNING, "rendered: rectovl"); + cPtr->gen = 0; + break; + } + + /* if labels are "almost" horizontal, the bbox check is + * close enough. (in addition, the line intersector + * has trouble with flat or steep lines.) + */ + aang = abs(cPtr->angle); + if (aang < 4 || aang > 86) { + TRACE(ROADMAP_WARNING, "rendered: steep"); + cPtr->gen = 0; + break; + } + aang = abs(ocPtr->angle); + if (aang < 4 || aang > 86) { + TRACE(ROADMAP_WARNING, "rendered: steep"); + cPtr->gen = 0; + break; + } + + /* otherwise we do the full poly check */ + if (poly_overlap (ocPtr, cPtr)) { + TRACE(ROADMAP_WARNING, "rendered: polyover"); + cPtr->gen = 0; + break; + } + } } ! TRACE(ROADMAP_WARNING, "after rendered, considering, gen %d (%d)", cPtr->gen, RoadMapLabelGeneration); ! if(cPtr->gen == 0) { ! TRACE(ROADMAP_WARNING, "bagging"); ! roadmap_list_insert ! (&RoadMapLabelSpares, roadmap_list_remove(&cPtr->link)); ! continue; /* next label */ } ! #ifdef ROADMAP_USE_LINEFONT ! roadmap_linefont_text (text, ! angles ? ROADMAP_LINEFONT_CENTERED_ABOVE : ROADMAP_LINEFONT_CENTERED, ! &cPtr->point, 16, cPtr->angle); #else ! if (angles) { ! roadmap_canvas_draw_string_angle ! (&p, &cPtr->point, cPtr->angle, text); ! } else { ! roadmap_canvas_draw_string ! (&cPtr->point, ROADMAP_CANVAS_CENTER, text); ! } #endif + if (whichlist == NEWLIST) { + /* move the rendered label to the cache */ + roadmap_list_append + (&RoadMapLabelCache, roadmap_list_remove(&cPtr->link)); + } ! } /* next label */ ! } /* next list */ ! TRACE(ROADMAP_WARNING, "e: cached %d new %d spare %d alloced %d", ! roadmap_list_count(&RoadMapLabelCache), ! roadmap_list_count(&RoadMapLabelNew), ! roadmap_list_count(&RoadMapLabelSpares), ! RoadMapLabelCacheAlloced); ! ! ! RoadMapLabelGeneration++; return 0; } int roadmap_label_activate (void) { *************** *** 406,409 **** --- 608,615 ---- ("preferences", &RoadMapConfigLabelsColor, "#000000"); + ROADMAP_LIST_INIT(&RoadMapLabelCache); + ROADMAP_LIST_INIT(&RoadMapLabelSpares); + ROADMAP_LIST_INIT(&RoadMapLabelNew); + return 0; } |