You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael F. <ho...@us...> - 2008-03-25 16:59:18
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2337/gui/gtk Modified Files: gui_gtk_window.c Log Message: GTK:Add:Add basic support for former destinations and bookmarks Index: gui_gtk_window.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_window.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gui_gtk_window.c 18 Mar 2008 22:50:11 -0000 1.24 --- gui_gtk_window.c 25 Mar 2008 16:59:19 -0000 1.25 *************** *** 24,27 **** --- 24,28 ---- #include "vehicle.h" #include "map.h" + #include "coord.h" #ifdef USE_HILDON *************** *** 223,226 **** --- 224,230 ---- gui_gtk_action_activate(GtkToggleAction *action, struct action_cb_data *data) { + if(data->attr.type == attr_destination) { + navit_set_destination(data->gui->nav, data->attr.u.pcoord, NULL); + } } static void *************** *** 374,387 **** struct attr attr; struct action_cb_data *data; ! if(navit_get_attr(this->nav, attr_former_destination_map, &attr, NULL) && attr.u.map) { ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=0x13a3e2; ! data->attr.u.pcoord->y=0x5d6d6a; ! gui_gtk_add_menu(this, "Destination 1", "Muenchen","/ui/MenuBar/Route/FormerDestinations/FormerDestinationMenuAdditions",data); } } --- 378,405 ---- struct attr attr; struct action_cb_data *data; + struct map_rect *mr=NULL; + struct item *item; + struct coord c; + int count=0; + char *name, *label; ! if(navit_get_attr(this->nav, attr_former_destination_map, &attr, NULL) && attr.u.map && (mr=map_rect_new(attr.u.map, NULL))) { ! while ((item=map_rect_get_item(mr))) { ! if (item->type != type_former_destination) continue; ! name=g_strdup_printf("Destination %d", count++); ! item_attr_get(item, attr_label, &attr); ! label=attr.u.str; ! item_coord_get(item, &c, 1); ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=c.x; ! data->attr.u.pcoord->y=c.y; ! gui_gtk_add_menu(this, name, label, "/ui/MenuBar/Route/FormerDestinations/FormerDestinationMenuAdditions",data); ! g_free(name); ! } ! map_rect_destroy(mr); } } *************** *** 390,403 **** gui_gtk_bookmarks_init(struct gui_priv *this) { struct action_cb_data *data; ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=0x13a3e2; ! data->attr.u.pcoord->y=0x5d6d6a; ! gui_gtk_add_menu(this, "Bookmark 1", "Muenchen","/ui/MenuBar/Route/Bookmarks/BookmarkMenuAdditions",data); } --- 408,437 ---- gui_gtk_bookmarks_init(struct gui_priv *this) { + struct attr attr; struct action_cb_data *data; + struct map_rect *mr=NULL; + struct item *item; + struct coord c; + int count=0; + char *name, *label; ! if(navit_get_attr(this->nav, attr_bookmark_map, &attr, NULL) && attr.u.map && (mr=map_rect_new(attr.u.map, NULL))) { ! while ((item=map_rect_get_item(mr))) { ! if (item->type != type_bookmark) continue; ! name=g_strdup_printf("Bookmark %d", count++); ! item_attr_get(item, attr_label, &attr); ! label=attr.u.str; ! item_coord_get(item, &c, 1); ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=c.x; ! data->attr.u.pcoord->y=c.y; ! gui_gtk_add_menu(this, name, label, "/ui/MenuBar/Route/Bookmarks/BookmarkMenuAdditions",data); ! g_free(name); ! } ! } } |
From: Michael F. <ho...@us...> - 2008-03-25 00:07:50
|
Update of /cvsroot/navit/navit/src/xpm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16341/xpm Added Files: peak.xpm Log Message: Core:Add:Add missing peak.xpm --- NEW FILE: peak.xpm --- /* XPM */ static char * peak_xpm[] = { "8 8 2 1", " c None", ". c #FF00FF", " ", " .. ", " .. ", " .... ", " .... ", " ...... ", " ...... ", "........"}; |
From: Aurelien J. <au...@gn...> - 2008-03-24 22:37:05
|
On Mon, 24 Mar 2008 17:36:52 +0000 Martin Schaller <mar...@us...> wrote: > Update of /cvsroot/navit/navit/src > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18072 > > Modified Files: > graphics.c item_def.h layout.c layout.h navit.xml osm2navit.c > xmlconfig.c > Log Message: > Add:Core:Added patches from Aurelien Jacobs Thanks, but it seems this commit is missing the peak.xpm file that was part of the patch. Aurel |
From: Martin S. <mar...@us...> - 2008-03-24 17:50:15
|
Update of /cvsroot/navit/navit/po In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25882 Modified Files: nl.po Log Message: Add:NLS:Added patch from Udo van den Heuvel Index: nl.po =================================================================== RCS file: /cvsroot/navit/navit/po/nl.po,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nl.po 21 Feb 2008 16:59:33 -0000 1.6 --- nl.po 24 Mar 2008 17:50:20 -0000 1.7 *************** *** 942,946 **** #: ../src/country.c:162 msgid "Montenegro" ! msgstr "" #. 663 --- 942,946 ---- #: ../src/country.c:162 msgid "Montenegro" ! msgstr "Montenegro" #. 663 *************** *** 952,956 **** #: ../src/country.c:164 msgid "Madagascar" ! msgstr "" #. 584 --- 952,956 ---- #: ../src/country.c:164 msgid "Madagascar" ! msgstr "Madagascar" #. 584 *************** *** 958,967 **** #, fuzzy msgid "Marshall Islands" ! msgstr "Färöer" #. 807 #: ../src/country.c:166 msgid "Macedonia, the former Yugoslav Republic of" ! msgstr "" #. 466 --- 958,967 ---- #, fuzzy msgid "Marshall Islands" ! msgstr "Marshall eilanden" #. 807 #: ../src/country.c:166 msgid "Macedonia, the former Yugoslav Republic of" ! msgstr "Macedonië" #. 466 *************** *** 969,983 **** #, fuzzy msgid "Mali" ! msgstr "Malta" #. 104 #: ../src/country.c:168 msgid "Myanmar" ! msgstr "" #. 496 #: ../src/country.c:169 msgid "Mongolia" ! msgstr "" #. 446 --- 969,983 ---- #, fuzzy msgid "Mali" ! msgstr "Mali" #. 104 #: ../src/country.c:168 msgid "Myanmar" ! msgstr "Myanmar" #. 496 #: ../src/country.c:169 msgid "Mongolia" ! msgstr "Mongolië" #. 446 *************** *** 985,989 **** #, fuzzy msgid "Macao" ! msgstr "Monaco" #. 580 --- 985,989 ---- #, fuzzy msgid "Macao" ! msgstr "Macao" #. 580 *************** *** 995,1005 **** #: ../src/country.c:172 msgid "Martinique" ! msgstr "" #. 478 #: ../src/country.c:173 - #, fuzzy msgid "Mauritania" ! msgstr "Litouwen" #. 500 --- 995,1004 ---- #: ../src/country.c:172 msgid "Martinique" ! msgstr "Martinique" #. 478 #: ../src/country.c:173 msgid "Mauritania" ! msgstr "Mauretanië" #. 500 *************** *** 1027,1036 **** #, fuzzy msgid "Malawi" ! msgstr "Malta" #. 484 #: ../src/country.c:179 msgid "Mexico" ! msgstr "" #. 458 --- 1026,1035 ---- #, fuzzy msgid "Malawi" ! msgstr "Malawi" #. 484 #: ../src/country.c:179 msgid "Mexico" ! msgstr "Mexico" #. 458 *************** *** 1038,1047 **** #, fuzzy msgid "Malaysia" ! msgstr "Malta" #. 508 #: ../src/country.c:181 msgid "Mozambique" ! msgstr "" #. 516 --- 1037,1046 ---- #, fuzzy msgid "Malaysia" ! msgstr "Maleisië" #. 508 #: ../src/country.c:181 msgid "Mozambique" ! msgstr "Mozambique" #. 516 *************** *** 1049,1053 **** #, fuzzy msgid "Namibia" ! msgstr "Libyen" #. 540 --- 1048,1052 ---- #, fuzzy msgid "Namibia" ! msgstr "Namibië" #. 540 *************** *** 1055,1064 **** #, fuzzy msgid "New Caledonia" ! msgstr "Macedonië" #. 562 #: ../src/country.c:184 msgid "Niger" ! msgstr "" #. 574 --- 1054,1063 ---- #, fuzzy msgid "New Caledonia" ! msgstr "Nieuw Caledonië" #. 562 #: ../src/country.c:184 msgid "Niger" ! msgstr "Niger" #. 574 *************** *** 1066,1081 **** #, fuzzy msgid "Norfolk Island" ! msgstr "Färöer" #. 566 #: ../src/country.c:186 - #, fuzzy msgid "Nigeria" ! msgstr "Algerije" #. 558 #: ../src/country.c:187 msgid "Nicaragua" ! msgstr "" #. 528 --- 1065,1079 ---- #, fuzzy msgid "Norfolk Island" ! msgstr "" #. 566 #: ../src/country.c:186 msgid "Nigeria" ! msgstr "Nigeria" #. 558 #: ../src/country.c:187 msgid "Nicaragua" ! msgstr "NIcaragua" #. 528 *************** *** 1087,1101 **** #: ../src/country.c:189 msgid "Norway" ! msgstr "Norwegen" #. 524 #: ../src/country.c:190 msgid "Nepal" ! msgstr "" #. 520 #: ../src/country.c:191 msgid "Nauru" ! msgstr "" #. 570 --- 1085,1099 ---- #: ../src/country.c:189 msgid "Norway" ! msgstr "Noorwegen" #. 524 #: ../src/country.c:190 msgid "Nepal" ! msgstr "Nepal" #. 520 #: ../src/country.c:191 msgid "Nauru" ! msgstr "Nauru" #. 570 *************** *** 1103,1107 **** #, fuzzy msgid "Niue" ! msgstr "Nummer" #. 554 --- 1101,1105 ---- #, fuzzy msgid "Niue" ! msgstr "" #. 554 *************** *** 1109,1148 **** #, fuzzy msgid "New Zealand" ! msgstr "Nederland" #. 512 #: ../src/country.c:194 msgid "Oman" ! msgstr "" #. 591 #: ../src/country.c:195 msgid "Panama" ! msgstr "" #. 604 #: ../src/country.c:196 msgid "Peru" ! msgstr "" #. 258 #: ../src/country.c:197 msgid "French Polynesia" ! msgstr "" #. 598 #: ../src/country.c:198 msgid "Papua New Guinea" ! msgstr "" #. 608 #: ../src/country.c:199 msgid "Philippines" ! msgstr "" #. 586 #: ../src/country.c:200 msgid "Pakistan" ! msgstr "" #. 616 --- 1107,1146 ---- #, fuzzy msgid "New Zealand" ! msgstr "Nieuw Zeeland" #. 512 #: ../src/country.c:194 msgid "Oman" ! msgstr "Oman" #. 591 #: ../src/country.c:195 msgid "Panama" ! msgstr "Panama" #. 604 #: ../src/country.c:196 msgid "Peru" ! msgstr "Peru" #. 258 #: ../src/country.c:197 msgid "French Polynesia" ! msgstr "Frans Polynesië" #. 598 #: ../src/country.c:198 msgid "Papua New Guinea" ! msgstr "Papua Nieuw Guinea" #. 608 #: ../src/country.c:199 msgid "Philippines" ! msgstr "Philippijnen" #. 586 #: ../src/country.c:200 msgid "Pakistan" ! msgstr "Pakistan" #. 616 *************** *** 1164,1173 **** #: ../src/country.c:204 msgid "Puerto Rico" ! msgstr "" #. 275 #: ../src/country.c:205 msgid "Palestinian Territory, Occupied" ! msgstr "" #. 620 --- 1162,1171 ---- #: ../src/country.c:204 msgid "Puerto Rico" ! msgstr "Puerto Rico" #. 275 #: ../src/country.c:205 msgid "Palestinian Territory, Occupied" ! msgstr "Palestijns Gebied, Bezet" #. 620 *************** *** 1180,1195 **** #, fuzzy msgid "Palau" ! msgstr "Malta" #. 600 #: ../src/country.c:208 msgid "Paraguay" ! msgstr "" #. 634 #: ../src/country.c:209 - #, fuzzy msgid "Qatar" ! msgstr "Data" #. 638 --- 1178,1192 ---- #, fuzzy msgid "Palau" ! msgstr "" #. 600 #: ../src/country.c:208 msgid "Paraguay" ! msgstr "Paraguay" #. 634 #: ../src/country.c:209 msgid "Qatar" ! msgstr "Qatair" #. 638 *************** *** 1217,1221 **** #, fuzzy msgid "Rwanda" ! msgstr "Roemenië" # --- 1214,1218 ---- #, fuzzy msgid "Rwanda" ! msgstr "Rwanda" # *************** *** 1223,1238 **** #: ../src/country.c:215 msgid "Saudi Arabia" ! msgstr "Saudi-Arabien" #. 090 #: ../src/country.c:216 - #, fuzzy msgid "Solomon Islands" ! msgstr "Färöer" #. 690 #: ../src/country.c:217 msgid "Seychelles" ! msgstr "" #. 736 --- 1220,1234 ---- #: ../src/country.c:215 msgid "Saudi Arabia" ! msgstr "Saudi-Arabië" #. 090 #: ../src/country.c:216 msgid "Solomon Islands" ! msgstr "" #. 690 #: ../src/country.c:217 msgid "Seychelles" ! msgstr "Seychellen" #. 736 *************** *** 1240,1244 **** #, fuzzy msgid "Sudan" ! msgstr "Spanje" #. 752 --- 1236,1240 ---- #, fuzzy msgid "Sudan" ! msgstr "Soedan" #. 752 *************** *** 1250,1254 **** #: ../src/country.c:220 msgid "Singapore" ! msgstr "" #. 654 --- 1246,1250 ---- #: ../src/country.c:220 msgid "Singapore" ! msgstr "Singapore" #. 654 *************** *** 1275,1279 **** #: ../src/country.c:225 msgid "Sierra Leone" ! msgstr "" #. 674 --- 1271,1275 ---- #: ../src/country.c:225 msgid "Sierra Leone" ! msgstr "Siërra Leone" #. 674 *************** *** 1285,1289 **** #: ../src/country.c:227 msgid "Senegal" ! msgstr "" #. 706 --- 1281,1285 ---- #: ../src/country.c:227 msgid "Senegal" ! msgstr "Senegal" #. 706 *************** *** 1291,1295 **** #, fuzzy msgid "Somalia" ! msgstr "Roemenië" #. 740 --- 1287,1291 ---- #, fuzzy msgid "Somalia" ! msgstr "Somalië" #. 740 *************** *** 1297,1301 **** #, fuzzy msgid "Suriname" ! msgstr "Syrien" #. 678 --- 1293,1297 ---- #, fuzzy msgid "Suriname" ! msgstr "Suriname" #. 678 *************** *** 1307,1316 **** #: ../src/country.c:231 msgid "El Salvador" ! msgstr "" #. 760 #: ../src/country.c:232 msgid "Syrian Arab Republic" ! msgstr "" #. 748 --- 1303,1312 ---- #: ../src/country.c:231 msgid "El Salvador" ! msgstr "El Salvador" #. 760 #: ../src/country.c:232 msgid "Syrian Arab Republic" ! msgstr "Syrië" #. 748 *************** *** 1318,1322 **** #, fuzzy msgid "Swaziland" ! msgstr "Zwitserland" #. 796 --- 1314,1318 ---- #, fuzzy msgid "Swaziland" ! msgstr "Swasiland" #. 796 *************** *** 1328,1332 **** #: ../src/country.c:235 msgid "Chad" ! msgstr "" #. 260 --- 1324,1328 ---- #: ../src/country.c:235 msgid "Chad" ! msgstr "Tjaad" #. 260 *************** *** 1338,1342 **** #: ../src/country.c:237 msgid "Togo" ! msgstr "" #. 764 --- 1334,1338 ---- #: ../src/country.c:237 msgid "Togo" ! msgstr "Togo" #. 764 *************** *** 1344,1348 **** #, fuzzy msgid "Thailand" ! msgstr "Finnland" #. 762 --- 1340,1344 ---- #, fuzzy msgid "Thailand" ! msgstr "Thailand" #. 762 *************** *** 1365,1369 **** #, fuzzy msgid "Turkmenistan" ! msgstr "Tunesië" #. 788 --- 1361,1365 ---- #, fuzzy msgid "Turkmenistan" ! msgstr "Turkmenistan" #. 788 *************** *** 1376,1380 **** #, fuzzy msgid "Tonga" ! msgstr "Plaats" #. 792 --- 1372,1376 ---- #, fuzzy msgid "Tonga" ! msgstr "Tonga" #. 792 *************** *** 1386,1405 **** #: ../src/country.c:246 msgid "Trinidad and Tobago" ! msgstr "" #. 798 #: ../src/country.c:247 msgid "Tuvalu" ! msgstr "" #. 158 #: ../src/country.c:248 msgid "Taiwan, Province of China" ! msgstr "" #. 834 #: ../src/country.c:249 msgid "Tanzania, United Republic of" ! msgstr "" #. 804 --- 1382,1401 ---- #: ../src/country.c:246 msgid "Trinidad and Tobago" ! msgstr "Trinidad en Tobago" #. 798 #: ../src/country.c:247 msgid "Tuvalu" ! msgstr "Tuvalu" #. 158 #: ../src/country.c:248 msgid "Taiwan, Province of China" ! msgstr "Taiwan" #. 834 #: ../src/country.c:249 msgid "Tanzania, United Republic of" ! msgstr "Tanzania" #. 804 *************** *** 1411,1415 **** #: ../src/country.c:251 msgid "Uganda" ! msgstr "" #. 581 --- 1407,1411 ---- #: ../src/country.c:251 msgid "Uganda" ! msgstr "Oeganda" #. 581 *************** *** 1421,1440 **** #: ../src/country.c:253 msgid "United States" ! msgstr "" #. 858 #: ../src/country.c:254 msgid "Uruguay" ! msgstr "" #. 860 #: ../src/country.c:255 msgid "Uzbekistan" ! msgstr "" #. 336 #: ../src/country.c:256 msgid "Holy See (Vatican City State)" ! msgstr "" #. 670 --- 1417,1437 ---- #: ../src/country.c:253 msgid "United States" ! msgstr "Verenigde Staten" #. 858 #: ../src/country.c:254 msgid "Uruguay" ! msgstr "Uruguay" #. 860 #: ../src/country.c:255 msgid "Uzbekistan" ! msgstr "Uzbekistan" #. 336 #: ../src/country.c:256 msgid "Holy See (Vatican City State)" ! msgstr "Vaticaanstad" ! #. 670 *************** *** 1446,1465 **** #: ../src/country.c:258 msgid "Venezuela" ! msgstr "" #. 092 #: ../src/country.c:259 msgid "Virgin Islands, British" ! msgstr "" #. 850 #: ../src/country.c:260 msgid "Virgin Islands, U.S." ! msgstr "" #. 704 #: ../src/country.c:261 msgid "Viet Nam" ! msgstr "" #. 548 --- 1443,1462 ---- #: ../src/country.c:258 msgid "Venezuela" ! msgstr "Venezuela" #. 092 #: ../src/country.c:259 msgid "Virgin Islands, British" ! msgstr "Britse Maagdeneilanden" #. 850 #: ../src/country.c:260 msgid "Virgin Islands, U.S." ! msgstr "Maagdeneilanden, USA" #. 704 #: ../src/country.c:261 msgid "Viet Nam" ! msgstr "Vietnam" #. 548 *************** *** 1476,1485 **** #: ../src/country.c:264 msgid "Samoa" ! msgstr "" #. 887 #: ../src/country.c:265 msgid "Yemen" ! msgstr "" #. 175 --- 1473,1482 ---- #: ../src/country.c:264 msgid "Samoa" ! msgstr "Samoa" #. 887 #: ../src/country.c:265 msgid "Yemen" ! msgstr "Jemen" #. 175 *************** *** 1492,1506 **** #: ../src/country.c:267 msgid "South Africa" ! msgstr "" #. 894 #: ../src/country.c:268 msgid "Zambia" ! msgstr "" #. 716 #: ../src/country.c:269 msgid "Zimbabwe" ! msgstr "" #: ../src/gui/gtk/destination.c:96 ../src/gui/gtk/destination.c:97 --- 1489,1503 ---- #: ../src/country.c:267 msgid "South Africa" ! msgstr "Zuid Africa" #. 894 #: ../src/country.c:268 msgid "Zambia" ! msgstr "Zambia" #. 716 #: ../src/country.c:269 msgid "Zimbabwe" ! msgstr "Zimbabwe" #: ../src/gui/gtk/destination.c:96 ../src/gui/gtk/destination.c:97 *************** *** 1630,1634 **** #: ../src/gui/gtk/gui_gtk_action.c:234 msgid "VisibleTowns" ! msgstr "Sichtbare Städte" #: ../src/gui/gtk/gui_gtk_action.c:235 --- 1627,1631 ---- #: ../src/gui/gtk/gui_gtk_action.c:234 msgid "VisibleTowns" ! msgstr "Zichtbare Steden" #: ../src/gui/gtk/gui_gtk_action.c:235 |
From: Martin S. <mar...@us...> - 2008-03-24 17:39:24
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19603 Modified Files: item_def.h navit.xml osm2navit.c Log Message: Add:Core:Added patches from Christoph Eckert Index: item_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/item_def.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** item_def.h 24 Mar 2008 17:36:50 -0000 1.28 --- item_def.h 24 Mar 2008 17:39:29 -0000 1.29 *************** *** 279,282 **** --- 279,289 ---- ITEM(bridge) ITEM(tunnel) + ITEM(bridleway) + ITEM(cycleway) + ITEM(footway) + ITEM(steps) + ITEM(track_paved) + ITEM(track_gravelled) + ITEM(track_unpaved) /* Area */ ITEM2(0xc0000000,area) Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** osm2navit.c 24 Mar 2008 17:36:50 -0000 1.65 --- osm2navit.c 24 Mar 2008 17:39:29 -0000 1.66 *************** *** 123,131 **** "w aeroway terminal poly_terminal\n" "w amenity parking poly_car_parking\n" ! "w highway cycleway street_nopass\n" ! "w highway footway street_nopass\n" ! "w highway steps street_nopass\n" ! "w highway cyclepath street_nopass\n" ! "w highway track street_nopass\n" "w highway service street_service\n" "w highway pedestrian street_pedestrian\n" --- 123,132 ---- "w aeroway terminal poly_terminal\n" "w amenity parking poly_car_parking\n" ! "w highway bridleway bridleway\n" ! "w highway cycleway cycleway\n" ! "w highway cyclepath cycleway\n" ! "w highway footway footway\n" ! "w highway steps steps\n" ! "w highway track track_gravelled\n" "w highway service street_service\n" "w highway pedestrian street_pedestrian\n" *************** *** 135,139 **** "w highway tertiary street_2_city\n" "w highway secondary street_3_city\n" ! "w highway unsurfaced street_nopass\n" "w highway primary street_4_city\n" "w highway primary_link ramp\n" --- 136,140 ---- "w highway tertiary street_2_city\n" "w highway secondary street_3_city\n" ! "w highway unsurfaced track_gravelled\n" "w highway primary street_4_city\n" "w highway primary_link ramp\n" Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** navit.xml 24 Mar 2008 17:36:50 -0000 1.46 --- navit.xml 24 Mar 2008 17:39:29 -0000 1.47 *************** *** 80,84 **** </mapset> ! <layout name="Tag" color= "#ffefb7"> <layer name="sea" details="0"> <item type="image" order="0-"> --- 80,84 ---- </mapset> ! <layout name="Car" color= "#ffefb7"> <layer name="sea" details="0"> [...1093 lines suppressed...] ! </item> ! <item type="poi_gc_webcam" order="0-"> ! <icon src="gc_webcam.xpm" /> ! </item> ! <item type="traffic_signals" order="13-"> ! <icon src="traffic_signals.xpm" /> ! </item> ! <item type="poly_flats,poly_scrub,poly_military_zone,poly_marine,plantation,tundra" order="0-"> ! <polygon color="#a0a0a0" /> ! <label label_size="5" /> ! </item> ! <item type="rg_segment" order="0-"> ! <polyline color="#FF089C" width="1" /> ! </item> ! <item type="rg_point" order="0-"> ! <circle color="#FF089C" radius="10" label_size="7" /> ! </item> ! </layer> </layout> </navit> |
From: Martin S. <mar...@us...> - 2008-03-24 17:36:46
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18072 Modified Files: graphics.c item_def.h layout.c layout.h navit.xml osm2navit.c xmlconfig.c Log Message: Add:Core:Added patches from Aurelien Jacobs Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** navit.xml 18 Mar 2008 23:39:28 -0000 1.45 --- navit.xml 24 Mar 2008 17:36:50 -0000 1.46 *************** *** 130,140 **** </item> <item type="rail" order="6-"> ! <polyline color="#808080" width="3" /> </item> <item type="ferry" order="5-"> ! <polyline color="#000000" width="1" /> </item> <item type="border_country" order="0-"> ! <polyline color="#b8434e" width="1" /> </item> <item type="border_state" order="0-"> --- 130,140 ---- </item> <item type="rail" order="6-"> ! <polyline color="#808080" width="3" dash="10" /> </item> <item type="ferry" order="5-"> ! <polyline color="#000000" width="1" dash="10" /> </item> <item type="border_country" order="0-"> ! <polyline color="#b8434e" width="1" dash="10,5,2,5" /> </item> <item type="border_state" order="0-"> *************** *** 846,849 **** --- 846,852 ---- <icon src="oil_field.xpm" /> </item> + <item type="poi_peak" order="6-"> + <icon src="peak.xpm" /> + </item> <item type="poi_personal_service" order="0-"> <icon src="personal_service.xpm" /> *************** *** 858,861 **** --- 861,868 ---- <icon src="public_office.xpm" /> </item> + <item type="poi_rail_station" order="9-"> + <circle color="#ff0000" radius="3" width="3" /> + <circle color="#000000" radius="6" width="2" label_size="8" /> + </item> <item type="poi_repair_service" order="0-"> <icon src="repair_service.xpm" /> Index: item_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/item_def.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** item_def.h 14 Mar 2008 16:03:52 -0000 1.27 --- item_def.h 24 Mar 2008 17:36:50 -0000 1.28 *************** *** 231,234 **** --- 231,236 ---- ITEM(nav_roundabout_l7) ITEM(nav_roundabout_l8) + ITEM(poi_peak) + ITEM(poi_rail_station) /* Line */ ITEM2(0x80000000,line) Index: graphics.c =================================================================== RCS file: /cvsroot/navit/navit/src/graphics.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** graphics.c 4 Mar 2008 06:11:14 -0000 1.37 --- graphics.c 24 Mar 2008 17:36:50 -0000 1.38 *************** *** 390,393 **** --- 390,397 ---- if (e->u.polyline.width > 1) gc->meth.gc_set_linewidth(gc->priv, e->u.polyline.width); + if (e->u.polyline.width > 0 && e->u.polyline.dash_num > 0) + graphics_gc_set_dashes(gc, e->u.polyline.width, 0, + e->u.polyline.dash_table, + e->u.polyline.dash_num); gra->meth.draw_lines(gra->priv, gc->priv, di->pnt, di->count); break; Index: layout.c =================================================================== RCS file: /cvsroot/navit/navit/src/layout.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** layout.c 10 Feb 2008 21:00:48 -0000 1.5 --- layout.c 24 Mar 2008 17:36:50 -0000 1.6 *************** *** 69,75 **** struct element * ! polyline_new(struct color *color, int width, int directed) { struct element *e; e = g_new0(struct element, 1); --- 69,77 ---- struct element * ! polyline_new(struct color *color, int width, int directed, ! int *dash_table, int dash_num) { struct element *e; + int i; e = g_new0(struct element, 1); *************** *** 78,81 **** --- 80,86 ---- e->u.polyline.width=width; e->u.polyline.directed=directed; + e->u.polyline.dash_num=dash_num; + for (i=0; i<dash_num; i++) + e->u.polyline.dash_table[i] = dash_table[i]; return e; Index: xmlconfig.c =================================================================== RCS file: /cvsroot/navit/navit/src/xmlconfig.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** xmlconfig.c 14 Feb 2008 18:09:41 -0000 1.30 --- xmlconfig.c 24 Mar 2008 17:36:50 -0000 1.31 *************** *** 146,149 **** --- 146,163 ---- static int + convert_number_list(const char *val, int *table, int size) + { + char *tok,*str,*val_str,*saveptr=NULL; + int i; + str=val_str=g_strdup(val); + for (i=0; i<size && (tok=strtok_r(str, ",", &saveptr)); i++) { + table[i]=convert_number(tok); + str=NULL; + } + g_free(val_str); + return i; + } + + static int xmlconfig_config(struct xmlstate *state) { *************** *** 526,531 **** { struct color color; ! const char *width, *directed; ! int w=0,d=0; if (! find_color(state, 1, &color)) --- 540,545 ---- { struct color color; ! const char *width, *dash, *directed; ! int w=0, d=0, dt[4], ds=0; if (! find_color(state, 1, &color)) *************** *** 534,542 **** if (width) w=convert_number(width); directed=find_attribute(state, "directed", 0); if (directed) d=convert_number(directed); ! state->element_object=polyline_new(&color, w, d); if (! state->element_object) return 0; --- 548,559 ---- if (width) w=convert_number(width); + dash=find_attribute(state, "dash", 0); + if (dash) + ds=convert_number_list(dash, dt, sizeof(dt)/sizeof(*dt)); directed=find_attribute(state, "directed", 0); if (directed) d=convert_number(directed); ! state->element_object=polyline_new(&color, w, d, dt, ds); if (! state->element_object) return 0; Index: layout.h =================================================================== RCS file: /cvsroot/navit/navit/src/layout.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** layout.h 10 Feb 2008 21:00:48 -0000 1.6 --- layout.h 24 Mar 2008 17:36:50 -0000 1.7 *************** *** 18,21 **** --- 18,23 ---- int width; int directed; + int dash_num; + unsigned char dash_table[4]; } polyline; struct element_polygon { *************** *** 58,62 **** void itemtype_add_element(struct itemtype *itemtype, struct element *element); struct element *polygon_new(struct color *color); ! struct element *polyline_new(struct color *color, int width, int directed); struct element *circle_new(struct color *color, int radius, int width, int label_size); struct element *label_new(int label_size); --- 60,65 ---- void itemtype_add_element(struct itemtype *itemtype, struct element *element); struct element *polygon_new(struct color *color); ! struct element *polyline_new(struct color *color, int width, int directed, ! int *dash_table, int dash_num); struct element *circle_new(struct color *color, int radius, int width, int label_size); struct element *label_new(int label_size); Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** osm2navit.c 21 Mar 2008 20:23:48 -0000 1.64 --- osm2navit.c 24 Mar 2008 17:36:50 -0000 1.65 *************** *** 106,109 **** --- 106,110 ---- "n man_made tower poi_tower\n" "n natural bay poi_bay\n" + "n natural peak poi_peak\n" "n place suburb district_label\n" "n place city town_label_2e5\n" *************** *** 111,114 **** --- 112,116 ---- "n place village town_label_2e3\n" "n place hamlet town_label_2e2\n" + "n railway station poi_rail_station\n" "w amenity place_of_worship poly_building\n" "w building glasshouse poly_building\n" *************** *** 156,160 **** "w railway rail rail\n" "w railway narrow_gauge rail\n" - "w railway station poly_building\n" "w railway subway rail\n" "w railway tram rail\n" --- 158,161 ---- |
From: Martin S. <mar...@us...> - 2008-03-24 17:25:54
|
Update of /cvsroot/navit/navit/src/xpm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12415 Modified Files: theater.xpm Log Message: Add:xpm:Added icon from Helge Hafting Index: theater.xpm =================================================================== RCS file: /cvsroot/navit/navit/src/xpm/theater.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** theater.xpm 14 Dec 2007 18:57:41 -0000 1.1 --- theater.xpm 24 Mar 2008 17:25:56 -0000 1.2 *************** *** 1,149 **** /* XPM */ ! static char *theater[] = { ! /* columns rows colors chars-per-pixel */ ! "16 15 128 2", ! " c black", ! ". c #010101", ! "X c #020202", ! "o c gray1", ! "O c gray2", ! "+ c gray4", ! "@ c #0C0C0C", ! "# c gray7", ! "$ c #151515", ! "% c #161616", ! "& c #1D1D1D", ! "* c #232323", ! "= c gray14", ! "- c #272727", ! "; c gray16", ! ": c gray17", ! "> c #2C2C2C", ! ", c gray18", ! "< c gray19", ! "1 c gray20", ! "2 c #343434", ! "3 c gray22", ! "4 c #393939", ! "5 c gray23", ! "6 c #3F3F3F", ! "7 c gray27", ! "8 c #464646", ! "9 c gray28", ! "0 c #484848", ! "q c #494949", ! "w c #4B4B4B", ! "e c #4C4C4C", ! "r c gray30", ! "t c gray31", ! "y c #505050", ! "u c #515151", ! "i c gray32", ! "p c gray33", ! "a c #555555", ! "s c gray34", ! "d c #585858", ! "f c gray35", ! "g c #5A5A5A", ! "h c #606060", ! "j c gray38", ! "k c #626262", ! "l c gray39", ! "z c gray40", ! "x c DimGray", ! "c c #6A6A6A", ! "v c gray42", ! "b c #6D6D6D", ! "n c gray44", ! "m c #717171", ! "M c gray45", ! "N c gray46", ! "B c #767676", ! "V c gray47", ! "C c #797979", ! "Z c #7C7C7C", ! "A c gray49", ! "S c #7E7E7E", ! "D c gray50", ! "F c #808080", ! "G c #818181", ! "H c gray51", ! "J c #838383", ! "K c #8B8B8B", ! "L c gray55", ! "P c #8D8D8D", ! "I c gray57", ! "U c #929292", ! "Y c #939393", ! "T c gray58", ! "R c #959595", ! "E c #979797", ! "W c #9A9A9A", ! "Q c #9D9D9D", ! "! c gray63", ! "~ c #A2A2A2", ! "^ c #A4A4A4", ! "/ c #A5A5A5", ! "( c gray65", ! ") c gray66", ! "_ c #AAAAAA", ! "` c #ACACAC", ! "' c gray68", ! "] c #AFAFAF", ! "[ c #B4B4B4", ! "{ c #B7B7B7", ! "} c gray73", ! "| c gray", ! " . c gray75", ! ".. c #C0C0C0", ! "X. c #C3C3C3", ! "o. c #CACACA", ! "O. c #CDCDCD", ! "+. c #CECECE", ! "@. c gray81", ! "#. c #D0D0D0", ! "$. c LightGray", ! "%. c gray83", ! "&. c gray84", ! "*. c #D8D8D8", ! "=. c gray85", ! "-. c #DADADA", ! ";. c gainsboro", ! ":. c gray87", ! ">. c gray88", ! ",. c #E2E2E2", ! "<. c #E4E4E4", ! "1. c gray90", ! "2. c #E7E7E7", ! "3. c #E9E9E9", ! "4. c #EAEAEA", ! "5. c gray92", ! "6. c gray93", ! "7. c #EEEEEE", ! "8. c #F4F4F4", ! "9. c gray96", ! "0. c #F6F6F6", ! "q. c gray97", ! "w. c #F8F8F8", ! "e. c #F9F9F9", ! "r. c #FBFBFB", ! "t. c gray99", ! "y. c #FEFEFE", ! "u. c gray100", ! /* pixels */ ! "u.u.u.u.u.u.u.u.u.u.u.u.u.@.@.u.", ! "u.u.u.u.u.u.@.F *.q.9.:.~ 4 h u.", ! "u.Q U u.u.u.1.t t g t 9 9 g 6 9.", ! "u.K E B q.u.3.9 s 4 F 4 4 9.", ! "u.K u.~ h h h q * E O , , s 1 5.", ! "u.A } ~ | u.1.z & _ 9 : } *.y | ", ! ":.A 3.U :.3.{ g - B q F # % t } ", ! "&.W X.} F *.b 4 t , E + y 3.", ! "u.b u.u.g 1.u.q.t , % E F 2 7 9.", ! "u.v _ { s 7.~ 5.* q F U _ V v u.", ! "u.F _ , X.V v y K q A @ : 6 @.u.", ! "u.*.b : 1 s o.u.V q y 4 F u.u.", ! "u.u.h _ v s _ u.u.u.~ U &.q.u.u.", ! "u.u.@.y B g q.u.u.u.u.u.u.u.u.u.", ! "u.u.u.9.3.9.u.u.u.u.u.u.u.u.u.u." ! }; --- 1,72 ---- /* XPM */ ! static char * theater_xpm[] = { ! "16 15 54 1", ! " c None", ! ". c #FFFFFF", ! "+ c #CFCFCF", ! "@ c #808080", ! "# c #D8D8D8", ! "$ c #F7F7F7", ! "% c #F5F5F5", ! "& c #DEDEDE", ! "* c #A2A2A2", ! "= c #393939", ! "- c #606060", ! "; c #9D9D9D", ! "> c #929292", ! ", c #E5E5E5", ! "' c #4F4F4F", ! ") c #5A5A5A", ! "! c #474747", ! "~ c #3F3F3F", ! "{ c #8B8B8B", ! "] c #979797", ! "^ c #767676", ! "/ c #E9E9E9", ! "( c #000000", ! "_ c #575757", ! ": c #494949", ! "< c #232323", ! "[ c #050505", ! "} c #2E2E2E", ! "| c #333333", ! "1 c #EBEBEB", ! "2 c #7D7D7D", ! "3 c #BABABA", ! "4 c #BEBEBE", ! "5 c #666666", ! "6 c #1D1D1D", ! "7 c #AAAAAA", ! "8 c #2B2B2B", ! "9 c #505050", ! "0 c #B7B7B7", ! "a c #272727", ! "b c #121212", ! "c c #161616", ! "d c #D6D6D6", ! "e c #9A9A9A", ! "f c #C3C3C3", ! "g c #6D6D6D", ! "h c #0A0A0A", ! "i c #343434", ! "j c #454545", ! "k c #6B6B6B", ! "l c #EEEEEE", ! "m c #787878", ! "n c #0C0C0C", ! "o c #CACACA", ! " ... ..++.", ! " .. .+@#$%&*=-.", ! ".;>. .,'')'!!)~%", ! ".{]^$./!(_(=@==%", ! ".{.*---:<][}}_|1", ! ".23*4.,567!83#94", ! "&2/>&/0)a^:@bc'3", ! "def3@#g='(}](h9/", ! ".g..),.$'}c]@ij%", ! ".k70_l*1<:@>7mk.", ! ".@7}fmk9{:2n8~+.", ! ".#g8(|_o.m:9=@. ", ! " .-7k_7. .*>d$ ", ! " .+9^)$ ... ", ! " .%/% "}; |
From: Martin S. <mar...@us...> - 2008-03-21 20:23:44
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2134 Modified Files: osm2navit.c search.c Log Message: Fix:Core:More search fixes Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** osm2navit.c 28 Feb 2008 19:34:08 -0000 1.63 --- osm2navit.c 21 Mar 2008 20:23:48 -0000 1.64 *************** *** 28,31 **** --- 28,33 ---- #endif + #define IS_TOWN(item) ((item).type >= type_town_label && (item).type <= type_town_label_1e7) + #define IS_STREET(item) ((item).type >= type_street_nopass && (item).type <= type_ferry) static GHashTable *dedupe_ways_hash; *************** *** 338,345 **** char label_attr_buffer[BUFFER_SIZE]; struct attr_bin street_name_attr = { 0, attr_street_name }; - char street_name_attr_buffer[BUFFER_SIZE]; struct attr_bin street_name_systematic_attr = { --- 340,350 ---- char label_attr_buffer[BUFFER_SIZE]; + struct attr_bin town_name_attr = { + 0, attr_town_name + }; + struct attr_bin street_name_attr = { 0, attr_street_name }; struct attr_bin street_name_systematic_attr = { *************** *** 367,374 **** { int l; ! l=strlen(buffer)+1; ! while (l % 4) ! buffer[l++]='\0'; ! a->len=l/4+1; } --- 372,382 ---- { int l; ! if (buffer && buffer[0]) { ! l=strlen(buffer)+1; ! while (l % 4) ! buffer[l++]='\0'; ! a->len=l/4+1; ! } else ! a->len=0; } *************** *** 455,465 **** level=5; if (! strcmp(k,"name")) { - if (in_way) { - strcpy(street_name_attr_buffer, v); - pad_text_attr(&street_name_attr, street_name_attr_buffer); - } else { strcpy(label_attr_buffer, v); pad_text_attr(&label_attr, label_attr_buffer); - } level=5; } --- 463,468 ---- *************** *** 511,518 **** if ( (type != type_street_unkn ) && ( type != type_point_unkn ) ) { ! if (coverage && type >= type_street_nopass && type <= type_ramp) item.type=type_coverage; - else - item.type=type; } else --- 514,520 ---- if ( (type != type_street_unkn ) && ( type != type_point_unkn ) ) { ! item.type=type; ! if (coverage && IS_STREET(item)) item.type=type_coverage; } else *************** *** 617,620 **** --- 619,623 ---- item.type=type_point_unkn; label_attr.len=0; + town_name_attr.len=0; debug_attr.len=0; is_in_buffer[0]='\0'; *************** *** 728,731 **** --- 731,735 ---- coord_count=0; item.type=type_street_unkn; + label_attr.len=0; street_name_attr.len=0; street_name_systematic_attr.len=0; *************** *** 774,779 **** } pad_text_attr(&debug_attr, debug_attr_buffer); ! if (street_name_attr.len) ! alen+=street_name_attr.len+1; if (street_name_systematic_attr.len) alen+=street_name_systematic_attr.len+1; --- 778,783 ---- } pad_text_attr(&debug_attr, debug_attr_buffer); ! if (label_attr.len) ! alen+=label_attr.len+1; if (street_name_systematic_attr.len) alen+=street_name_systematic_attr.len+1; *************** *** 786,790 **** fwrite(&item, sizeof(item), 1, out); fwrite(coord_buffer, coord_count*sizeof(struct coord), 1, out); ! write_attr(out, &street_name_attr, street_name_attr_buffer); write_attr(out, &street_name_systematic_attr, street_name_systematic_attr_buffer); write_attr(out, &debug_attr, debug_attr_buffer); --- 790,798 ---- fwrite(&item, sizeof(item), 1, out); fwrite(coord_buffer, coord_count*sizeof(struct coord), 1, out); ! if (IS_STREET(item)) { ! street_name_attr.len=label_attr.len; ! write_attr(out, &street_name_attr, label_attr_buffer); ! } else ! write_attr(out, &label_attr, label_attr_buffer); write_attr(out, &street_name_systematic_attr, street_name_systematic_attr_buffer); write_attr(out, &debug_attr, debug_attr_buffer); *************** *** 809,816 **** fwrite(&item, sizeof(item), 1, out); fwrite(&ni->c, 1*sizeof(struct coord), 1, out); ! write_attr(out, &label_attr, label_attr_buffer); write_attr(out, &debug_attr, debug_attr_buffer); #ifdef GENERATE_INDEX ! if (item.type >= type_town_label && item.type <= type_town_label_1e7 && label_attr.len) { char *tok,*buf=is_in_buffer; while ((tok=strtok(buf, ","))) { --- 817,828 ---- fwrite(&item, sizeof(item), 1, out); fwrite(&ni->c, 1*sizeof(struct coord), 1, out); ! if (IS_TOWN(item)) { ! town_name_attr.len=label_attr.len; ! write_attr(out, &town_name_attr, label_attr_buffer); ! } else ! write_attr(out, &label_attr, label_attr_buffer); write_attr(out, &debug_attr, debug_attr_buffer); #ifdef GENERATE_INDEX ! if (IS_TOWN(item) && town_name_attr.len) { char *tok,*buf=is_in_buffer; while ((tok=strtok(buf, ","))) { *************** *** 838,842 **** fwrite(&item, sizeof(item), 1, result->file); fwrite(&ni->c, 1*sizeof(struct coord), 1, result->file); ! write_attr(result->file, &label_attr, label_attr_buffer); result->count++; result->size+=(item.clen+3+label_attr.len+1)*4; --- 850,854 ---- fwrite(&item, sizeof(item), 1, result->file); fwrite(&ni->c, 1*sizeof(struct coord), 1, result->file); ! write_attr(result->file, &town_name_attr, label_attr_buffer); result->count++; result->size+=(item.clen+3+label_attr.len+1)*4; *************** *** 859,864 **** attr1=(struct attr_bin *)((int *)(ib1+1)+ib1->clen); attr2=(struct attr_bin *)((int *)(ib2+1)+ib1->clen); ! assert(attr1->type == attr_label); ! assert(attr2->type == attr_label); s1=(char *)(attr1+1); s2=(char *)(attr2+1); --- 871,876 ---- attr1=(struct attr_bin *)((int *)(ib1+1)+ib1->clen); attr2=(struct attr_bin *)((int *)(ib2+1)+ib1->clen); ! assert(attr1->type == attr_town_name); ! assert(attr2->type == attr_town_name); s1=(char *)(attr1+1); s2=(char *)(attr2+1); *************** *** 1372,1376 **** #endif c[i]=ni->c; ! if (ni->ref_way > 1 && i != 0 && i != ccount-1 && ib->type >= type_street_nopass && ib->type <= type_ferry) { write_item_part(out, ib, last, i); last=i; --- 1384,1388 ---- #endif c[i]=ni->c; ! if (ni->ref_way > 1 && i != 0 && i != ccount-1 && IS_STREET(*ib)) { write_item_part(out, ib, last, i); last=i; Index: search.c =================================================================== RCS file: /cvsroot/navit/navit/src/search.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** search.c 21 Mar 2008 19:38:45 -0000 1.13 --- search.c 21 Mar 2008 20:23:48 -0000 1.14 *************** *** 242,255 **** search_add_result(struct search_list_level *le, void *p) { - #if 0 if (! g_hash_table_lookup(le->hash, p)) { - #endif g_hash_table_insert(le->hash, p, (void *)1); le->list=g_list_append(le->list, p); return 1; - #if 0 } return 0; - #endif } --- 242,251 ---- |
From: Martin S. <mar...@us...> - 2008-03-21 20:23:44
|
Update of /cvsroot/navit/navit/src/data/binfile In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2134/data/binfile Modified Files: binfile.c Log Message: Fix:Core:More search fixes Index: binfile.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/binfile/binfile.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** binfile.c 27 Feb 2008 21:40:20 -0000 1.20 --- binfile.c 21 Mar 2008 20:23:48 -0000 1.21 *************** *** 54,59 **** enum attr_type attr_last; int label; ! unsigned int *street_name_attr; ! unsigned int *street_name_systematic_attr; struct map_selection *sel; struct map_priv *m; --- 54,58 ---- enum attr_type attr_last; int label; ! unsigned int *label_attr[2]; struct map_selection *sel; struct map_priv *m; *************** *** 168,172 **** struct tile *t=mr->t; enum attr_type type; ! int size; if (attr_type != mr->attr_last) { --- 167,171 ---- struct tile *t=mr->t; enum attr_type type; ! int i,size; if (attr_type != mr->attr_last) { *************** *** 179,186 **** if (type == attr_label) mr->label=1; if (type == attr_street_name) ! mr->street_name_attr=t->pos_attr; if (type == attr_street_name_systematic) ! mr->street_name_systematic_attr=t->pos_attr; if (type == attr_type || attr_type == attr_any) { if (attr_type == attr_any) { --- 178,187 ---- if (type == attr_label) mr->label=1; + if (type == attr_town_name) + mr->label_attr[0]=t->pos_attr; if (type == attr_street_name) ! mr->label_attr[0]=t->pos_attr; if (type == attr_street_name_systematic) ! mr->label_attr[1]=t->pos_attr; if (type == attr_type || attr_type == attr_any) { if (attr_type == attr_any) { *************** *** 195,203 **** } } ! if (!mr->label && (attr_type == attr_any || attr_type == attr_label) && (mr->street_name_attr || mr->street_name_systematic_attr)) { ! mr->label=1; ! attr->type=attr_label; ! attr_data_set(attr, (mr->street_name_attr ? mr->street_name_attr : mr->street_name_systematic_attr) +1); ! return 1; } return 0; --- 196,208 ---- } } ! if (!mr->label && (attr_type == attr_any || attr_type == attr_label)) { ! for (i = 0 ; i < sizeof(mr->label_attr)/sizeof(int *) ; i++) { ! if (mr->label_attr[i]) { ! mr->label=1; ! attr->type=attr_label; ! attr_data_set(attr, mr->label_attr[i]+1); ! return 1; ! } ! } } return 0; *************** *** 391,396 **** mr->item.id_lo=t->pos-t->start; mr->label=0; ! mr->street_name_attr=NULL; ! mr->street_name_systematic_attr=NULL; setup_pos(mr); if ((mr->item.type == type_submap) && (!mr->country_id)) { --- 396,400 ---- mr->item.id_lo=t->pos-t->start; mr->label=0; ! memset(mr->label_attr, 0, sizeof(mr->label_attr)); setup_pos(mr); if ((mr->item.type == type_submap) && (!mr->country_id)) { *************** *** 437,442 **** mr->item.id_lo=id_lo; mr->label=0; ! mr->street_name_attr=NULL; ! mr->street_name_systematic_attr=NULL; setup_pos(mr); return &mr->item; --- 441,445 ---- mr->item.id_lo=id_lo; mr->label=0; ! memset(mr->label_attr, 0, sizeof(mr->label_attr)); setup_pos(mr); return &mr->item; |
From: Martin S. <mar...@us...> - 2008-03-21 19:39:14
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13600 Modified Files: country.c search.c Log Message: Fix:Core:Some more searching improvements Index: search.c =================================================================== RCS file: /cvsroot/navit/navit/src/search.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** search.c 21 Mar 2008 17:52:13 -0000 1.12 --- search.c 21 Mar 2008 19:38:45 -0000 1.13 *************** *** 17,22 **** GHashTable *hash; GList *list,*curr,*last; - int complete; - }; --- 17,20 ---- *************** *** 143,147 **** else ret->item=*item; ! if (item_attr_get(item, attr_label, &attr)) ret->name=map_convert_string(item->map,attr.u.str); if (item_attr_get(item, attr_town_postal, &attr)) --- 141,145 ---- else ret->item=*item; ! if (item_attr_get(item, attr_town_name, &attr)) ret->name=map_convert_string(item->map,attr.u.str); if (item_attr_get(item, attr_town_postal, &attr)) *************** *** 222,228 **** le->search=NULL; } ! if (le->search) { g_hash_table_destroy(le->hash); } curr=le->list; while (curr) { --- 220,229 ---- le->search=NULL; } ! #if 0 /* FIXME */ ! if (le->hash) { g_hash_table_destroy(le->hash); + le->hash=NULL; } + #endif curr=le->list; while (curr) { *************** *** 235,239 **** le->curr=NULL; le->last=NULL; - le->complete=0; } --- 236,239 ---- *************** *** 242,251 **** --- 242,255 ---- search_add_result(struct search_list_level *le, void *p) { + #if 0 if (! g_hash_table_lookup(le->hash, p)) { + #endif g_hash_table_insert(le->hash, p, (void *)1); le->list=g_list_append(le->list, p); return 1; + #if 0 } return 0; + #endif } *************** *** 260,264 **** le=&this_->levels[level]; dbg(1,"le=%p\n", le); ! while(! le->complete) { dbg(1,"le->search=%p\n", le->search); if (! le->search) { --- 264,268 ---- le=&this_->levels[level]; dbg(1,"le=%p\n", le); ! for (;;) { dbg(1,"le->search=%p\n", le->search); if (! le->search) { *************** *** 274,279 **** leu->curr=g_list_next(leu->curr); } le->search=mapset_search_new(this_->ms, le->parent, &le->attr, le->partial); ! le->hash=g_hash_table_new_full(search_item_hash_hash, search_item_hash_equal, g_free, NULL); } dbg(1,"le->search=%p\n", le->search); --- 278,286 ---- leu->curr=g_list_next(leu->curr); } + if (le->parent) + dbg(1,"mapset_search_new with item(%d,%d)\n", le->parent->id_hi, le->parent->id_lo); + dbg(1,"attr=%s\n", attr_to_name(le->attr.type)); le->search=mapset_search_new(this_->ms, le->parent, &le->attr, le->partial); ! le->hash=g_hash_table_new(search_item_hash_hash, search_item_hash_equal); } dbg(1,"le->search=%p\n", le->search); *************** *** 282,285 **** --- 289,293 ---- if (item) { void *p=NULL; + dbg(1,"id_hi=%d id_lo=%d\n", item->id_hi, item->id_lo); this_->result.country=NULL; this_->result.town=NULL; *************** *** 311,316 **** search_list_result_destroy(level, p); } ! } else ! le->complete=1; } return NULL; --- 319,329 ---- search_list_result_destroy(level, p); } ! } else { ! mapset_search_destroy(le->search); ! le->search=NULL; ! g_hash_table_destroy(le->hash); ! if (! level) ! break; ! } } return NULL; Index: country.c =================================================================== RCS file: /cvsroot/navit/navit/src/country.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** country.c 17 Feb 2008 14:58:20 -0000 1.11 --- country.c 21 Mar 2008 19:38:45 -0000 1.12 *************** *** 21,25 **** #define _n(STRING) gettext_noop(STRING) ! struct country country[]= { { 20, "AND", "AD", "AND", /* 020 */ _n("Andorra")}, {784, "UAE", "AE", "ARE", /* 784 */ _n("United Arab Emirates")}, --- 21,25 ---- #define _n(STRING) gettext_noop(STRING) ! static struct country country[]= { { 20, "AND", "AD", "AND", /* 020 */ _n("Andorra")}, {784, "UAE", "AE", "ARE", /* 784 */ _n("United Arab Emirates")}, |
From: Martin S. <mar...@us...> - 2008-03-21 19:38:45
|
Update of /cvsroot/navit/navit/src/data/mg In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13600/data/mg Modified Files: map.c mg.h town.c Log Message: Fix:Core:Some more searching improvements Index: town.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/mg/town.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** town.c 21 Mar 2008 17:52:14 -0000 1.6 --- town.c 21 Mar 2008 19:38:48 -0000 1.7 *************** *** 39,42 **** --- 39,43 ---- { struct town_priv *twn=priv_data; + int len; attr->type=attr_type; *************** *** 60,64 **** return ((attr->u.str && attr->u.str[0]) ? 1:0); case attr_town_postal: ! attr->u.str=twn->postal_code1; twn->attr_next=attr_district_name; return ((attr->u.str && attr->u.str[0]) ? 1:0); --- 61,70 ---- return ((attr->u.str && attr->u.str[0]) ? 1:0); case attr_town_postal: ! strncpy(twn->postal, twn->postal_code1, 32); ! attr->u.str=twn->postal; ! len=mg_country_postal_len(twn->country); ! if (!len) ! len=31; ! twn->postal[len]='\0'; twn->attr_next=attr_district_name; return ((attr->u.str && attr->u.str[0]) ? 1:0); *************** *** 226,230 **** while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) { dir=town_search_compare(&mr->search_p, mr); ! if (! dir && (mr->search_partial == 0 || leaf)) { mr->search_linear=1; mr->search_p=NULL; --- 232,236 ---- while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) { dir=town_search_compare(&mr->search_p, mr); ! if (! dir && leaf) { mr->search_linear=1; mr->search_p=NULL; *************** *** 232,242 **** } } ! if (! mr->search_linear) return NULL; } ! if (! tree_search_next_lin(&mr->ts, &mr->search_p)) return NULL; ! if (town_search_compare(&mr->search_p, mr)) return NULL; dbg(1,"found %d blocks\n",mr->search_blk_count); } --- 238,254 ---- } } ! if (! mr->search_linear) { ! dbg(1,"not found\n"); return NULL; + } } ! if (! tree_search_next_lin(&mr->ts, &mr->search_p)) { ! dbg(1,"linear not found\n"); return NULL; ! } ! if (town_search_compare(&mr->search_p, mr)) { ! dbg(1,"no match\n"); return NULL; + } dbg(1,"found %d blocks\n",mr->search_blk_count); } Index: map.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/mg/map.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** map.c 21 Mar 2008 17:52:14 -0000 1.11 --- map.c 21 Mar 2008 19:38:46 -0000 1.12 *************** *** 8,14 **** ! struct country_isonum { int country; int isonum; } country_isonums[]={ { 1,203}, --- 8,16 ---- ! static struct country_isonum { int country; int isonum; + int postal_len; + char *postal_prefix; } country_isonums[]={ { 1,203}, *************** *** 39,43 **** { 47,578}, { 48,616}, ! { 49,276}, { 50,292}, { 51,620}, --- 41,45 ---- { 47,578}, { 48,616}, ! { 49,276,5,"D@@"}, { 50,292}, { 51,620}, *************** *** 118,121 **** --- 120,141 ---- } + int mg_country_postal_len(int country) + { + int i; + for (i = 0 ; i < sizeof(country_isonums)/sizeof(struct country_isonum) ; i++) + if (country_isonums[i].country == country) + return country_isonums[i].postal_len; + return 0; + } + + static char *mg_country_postal_prefix(int isonum) + { + int i; + for (i = 0 ; i < sizeof(country_isonums)/sizeof(struct country_isonum) ; i++) + if (country_isonums[i].isonum == isonum) + return country_isonums[i].postal_prefix; + return NULL; + } + static int file_next(struct map_rect_priv *mr) *************** *** 317,320 **** --- 337,341 ---- { struct map_rect_priv *mr=g_new0(struct map_rect_priv, 1); + char *prefix; dbg(1,"id_lo=0x%x\n", item->id_lo); dbg(1,"search=%s\n", search->u.str); *************** *** 325,331 **** if (item->type != type_country_label) return NULL; tree_search_init(map->dirname, "town.b1", &mr->ts, 0); mr->current_file=file_town_twn; ! mr->search_str=g_strdup(search->u.str); mr->search_country=mg_country_from_isonum(item->id_lo); break; --- 346,356 ---- if (item->type != type_country_label) return NULL; + prefix=mg_country_postal_prefix(item->id_lo); + if (! prefix) + return NULL; tree_search_init(map->dirname, "town.b1", &mr->ts, 0); mr->current_file=file_town_twn; ! mr->search_str=g_strdup_printf("%s%s",prefix,search->u.str); ! dbg(0,"search_str='%s'\n",mr->search_str); mr->search_country=mg_country_from_isonum(item->id_lo); break; *************** *** 363,366 **** --- 388,392 ---- struct map_rect_priv *mr=(struct map_rect_priv *)ms; + dbg(1,"mr=%p\n", mr); if (! mr) return; Index: mg.h =================================================================== RCS file: /cvsroot/navit/navit/src/data/mg/mg.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mg.h 17 Feb 2008 12:02:24 -0000 1.8 --- mg.h 21 Mar 2008 19:38:46 -0000 1.9 *************** *** 50,53 **** --- 50,54 ---- enum attr_type attr_next; char debug[256]; + char postal[32]; struct item town_attr_item; }; *************** *** 273,276 **** --- 274,278 ---- int mg_country_from_isonum(int isonum); int mg_country_to_isonum(int country); + int mg_country_postal_len(int country); int block_init(struct map_rect_priv *mr); |
From: Martin S. <mar...@us...> - 2008-03-21 17:52:16
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23945 Modified Files: search.c search.h Log Message: Fix:data_mg:Fixed some search bugs Index: search.c =================================================================== RCS file: /cvsroot/navit/navit/src/search.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** search.c 22 Feb 2008 10:36:45 -0000 1.11 --- search.c 21 Mar 2008 17:52:13 -0000 1.12 *************** *** 72,75 **** --- 72,78 ---- level=0; break; + case attr_town_postal: + level=1; + break; case attr_town_name: level=1; *************** *** 144,147 **** --- 147,152 ---- if (item_attr_get(item, attr_town_postal, &attr)) ret->postal=map_convert_string(item->map,attr.u.str); + if (item_attr_get(item, attr_district_name, &attr)) + ret->district=map_convert_string(item->map,attr.u.str); if (item_coord_get(item, &c, 1)) { ret->c=g_new(struct pcoord, 1); Index: search.h =================================================================== RCS file: /cvsroot/navit/navit/src/search.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** search.h 19 Nov 2007 19:58:18 -0000 1.4 --- search.h 21 Mar 2008 17:52:13 -0000 1.5 *************** *** 19,22 **** --- 19,23 ---- char *postal; char *name; + char *district; }; |
From: Martin S. <mar...@us...> - 2008-03-21 17:52:11
|
Update of /cvsroot/navit/navit/src/data/mg In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23945/data/mg Modified Files: map.c town.c Log Message: Fix:data_mg:Fixed some search bugs Index: town.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/mg/town.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** town.c 6 Dec 2007 21:41:22 -0000 1.5 --- town.c 21 Mar 2008 17:52:14 -0000 1.6 *************** *** 186,198 **** char *name; ! country=get_u16_unal(p); ! dbg(1,"country 0x%x ", country); ! name=get_string(p); ! dbg(1,"name '%s' ",name); ! mr->search_blk_count=get_u32_unal(p); ! mr->search_blk_off=(struct block_offset *)(*p); ! dbg(1,"len %d ", mr->search_blk_count); ! (*p)+=mr->search_blk_count*4; ! d=mr->search_country-country; if (!d) { if (mr->search_partial) --- 186,206 ---- char *name; ! if (mr->search_type == attr_town_postal) { ! mr->search_blk_count=1; ! mr->search_blk_off=(struct block_offset *)(*p); ! *p+=4; ! name=get_string(p); ! d=0; ! } else { ! country=get_u16_unal(p); ! dbg(1,"country 0x%x ", country); ! name=get_string(p); ! dbg(1,"name '%s' ",name); ! mr->search_blk_count=get_u32_unal(p); ! mr->search_blk_off=(struct block_offset *)(*p); ! dbg(1,"len %d ", mr->search_blk_count); ! (*p)+=mr->search_blk_count*4; ! d=mr->search_country-country; ! } if (!d) { if (mr->search_partial) *************** *** 214,252 **** if (! mr->search_blk_count) { ! if (mr->search_partial) { ! dbg(1,"partial 0x%x '%s' ***\n", mr->search_country, mr->search_str); ! if (! mr->search_linear) { ! while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) { ! dir=town_search_compare(&mr->search_p, mr); ! if (! dir && leaf) { ! mr->search_linear=1; ! mr->search_p=NULL; ! break; ! } ! } ! if (! mr->search_linear) ! return NULL; ! } ! if (! tree_search_next_lin(&mr->ts, &mr->search_p)) ! return NULL; ! if (town_search_compare(&mr->search_p, mr)) ! return NULL; ! dbg(1,"found %d blocks\n",mr->search_blk_count); ! } else { ! #if 0 ! dbg(1,"full 0x%x '%s' ***\n", country, search); ! while (tree_search_next(&ts, &p, dir) != -1) { ! ps=p; ! printf("0x%x ",p-ts.f->begin); ! dir=show_town2(&p, country, search, 0); ! if (! dir) { ! printf("*** found full: "); ! show_town2(&ps, country, search, 0); break; } } ! #endif ! return NULL; } } if (! mr->search_blk_count) --- 222,243 ---- if (! mr->search_blk_count) { ! dbg(1,"partial %d 0x%x '%s' ***\n", mr->search_partial, mr->search_country, mr->search_str); ! if (! mr->search_linear) { ! while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) { ! dir=town_search_compare(&mr->search_p, mr); ! if (! dir && (mr->search_partial == 0 || leaf)) { ! mr->search_linear=1; ! mr->search_p=NULL; break; } } ! if (! mr->search_linear) ! return NULL; } + if (! tree_search_next_lin(&mr->ts, &mr->search_p)) + return NULL; + if (town_search_compare(&mr->search_p, mr)) + return NULL; + dbg(1,"found %d blocks\n",mr->search_blk_count); } if (! mr->search_blk_count) Index: map.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/mg/map.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** map.c 17 Feb 2008 12:02:24 -0000 1.10 --- map.c 21 Mar 2008 17:52:14 -0000 1.11 *************** *** 322,325 **** --- 322,333 ---- mr->search_type=search->type; switch (search->type) { + case attr_town_postal: + if (item->type != type_country_label) + return NULL; + tree_search_init(map->dirname, "town.b1", &mr->ts, 0); + mr->current_file=file_town_twn; + mr->search_str=g_strdup(search->u.str); + mr->search_country=mg_country_from_isonum(item->id_lo); + break; case attr_town_name: if (item->type != type_country_label) *************** *** 370,373 **** --- 378,382 ---- return NULL; switch (mr->search_type) { + case attr_town_postal: case attr_town_name: return town_search_get_item(mr); |
From: Martin S. <mar...@us...> - 2008-03-21 17:52:11
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23945/gui/gtk Modified Files: destination.c Log Message: Fix:data_mg:Fixed some search bugs Index: destination.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/destination.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** destination.c 23 Feb 2008 19:26:21 -0000 1.15 --- destination.c 21 Mar 2008 17:52:14 -0000 1.16 *************** *** 26,29 **** --- 26,30 ---- struct search_list *sl; struct attr attr; + int partial; GtkWidget *entry_country, *entry_postal, *entry_city, *entry_district; GtkWidget *entry_street, *entry_number; *************** *** 124,127 **** --- 125,183 ---- } + static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn *c, struct search_param *search) + { + GtkTreePath *path; + GtkTreeViewColumn *focus_column; + GtkTreeIter iter; + GtkWidget *entry_widget; + char *str; + int column; + + dbg(0,"enter\n"); + gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column); + gtk_tree_model_get_iter(search->liststore2, &iter, path); + switch(search->attr.type) { + case attr_country_all: + entry_widget=search->entry_country; + column=3; + break; + case attr_town_name: + entry_widget=search->entry_city; + column=2; + break; + case attr_street_name: + entry_widget=search->entry_street; + column=4; + break; + default: + dbg(0,"Unknown mode\n"); + return; + } + gtk_tree_model_get(search->liststore2, &iter, column, &str, -1); + dbg(0,"str=%s\n", str); + search->partial=0; + gtk_entry_set_text(GTK_ENTRY(entry_widget), str); + } + + static void tree_view_button_release(GtkWidget *widget, GdkEventButton *event, struct search_param *search) + { + GtkTreePath *path; + GtkTreeViewColumn *column; + gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &column); + gtk_tree_view_row_activated(GTK_TREE_VIEW(search->treeview), path, column); + + } + static void + next_focus(struct search_param *search, GtkWidget *widget) + { + if (widget == search->entry_country) + gtk_widget_grab_focus(search->entry_city); + if (widget == search->entry_city) + gtk_widget_grab_focus(search->entry_street); + if (widget == search->entry_street) + gtk_widget_grab_focus(search->entry_number); + + } + static void changed(GtkWidget *widget, struct search_param *search) { *************** *** 130,140 **** search->attr.u.str=(char *)gtk_entry_get_text(GTK_ENTRY(widget)); ! printf("changed %s\n", search->attr.u.str); if (widget == search->entry_country) { dbg(0,"country\n"); search->attr.type=attr_country_all; set_columns(search, 0); } if (widget == search->entry_city) { dbg(0,"town\n"); search->attr.type=attr_town_name; --- 186,206 ---- search->attr.u.str=(char *)gtk_entry_get_text(GTK_ENTRY(widget)); ! printf("changed %s partial %d\n", search->attr.u.str, search->partial); if (widget == search->entry_country) { + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 3, GTK_SORT_ASCENDING); dbg(0,"country\n"); search->attr.type=attr_country_all; set_columns(search, 0); } + if (widget == search->entry_postal) { + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 1, GTK_SORT_ASCENDING); + dbg(0,"postal\n"); + search->attr.type=attr_town_postal; + if (strlen(search->attr.u.str) < 2) + return; + set_columns(search, 1); + } if (widget == search->entry_city) { + gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 2, GTK_SORT_ASCENDING); dbg(0,"town\n"); search->attr.type=attr_town_name; *************** *** 150,154 **** ! search_list_search(search->sl, &search->attr, 1); gtk_list_store_clear(search->liststore); while((res=search_list_get_result(search->sl))) { --- 216,220 ---- ! search_list_search(search->sl, &search->attr, search->partial); gtk_list_store_clear(search->liststore); while((res=search_list_get_result(search->sl))) { *************** *** 170,174 **** gtk_list_store_set(search->liststore,&iter,1,res->town->postal,-1); gtk_list_store_set(search->liststore,&iter,2,res->town->name,-1); ! gtk_list_store_set(search->liststore,&iter,3,"",-1); } else { gtk_list_store_set(search->liststore,&iter,1,"",-1); --- 236,240 ---- gtk_list_store_set(search->liststore,&iter,1,res->town->postal,-1); gtk_list_store_set(search->liststore,&iter,2,res->town->name,-1); ! gtk_list_store_set(search->liststore,&iter,3,res->town->district,-1); } else { gtk_list_store_set(search->liststore,&iter,1,"",-1); *************** *** 183,186 **** --- 249,255 ---- } } + if (! search->partial) + next_focus(search, widget); + search->partial=1; } *************** *** 358,362 **** search->liststore=gtk_list_store_newv(COL_COUNT+1,types); search->liststore2=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->liststore)); ! gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 0, GTK_SORT_ASCENDING); gtk_tree_view_set_model (GTK_TREE_VIEW (search->treeview), GTK_TREE_MODEL(search->liststore2)); } --- 427,431 ---- search->liststore=gtk_list_store_newv(COL_COUNT+1,types); search->liststore2=gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(search->liststore)); ! gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 3, GTK_SORT_ASCENDING); gtk_tree_view_set_model (GTK_TREE_VIEW (search->treeview), GTK_TREE_MODEL(search->liststore2)); } *************** *** 401,404 **** --- 470,475 ---- g_signal_connect(G_OBJECT(button2), "clicked", G_CALLBACK(button_bookmark), search); g_signal_connect(G_OBJECT(button3), "clicked", G_CALLBACK(button_destination), search); + g_signal_connect(G_OBJECT(search->treeview), "button-release-event", G_CALLBACK(tree_view_button_release), search); + g_signal_connect(G_OBJECT(search->treeview), "row_activated", G_CALLBACK(row_activated), search); gtk_widget_grab_focus(search->entry_city); *************** *** 430,433 **** --- 501,505 ---- dbg(0,"warning: no default country found\n"); } + search->partial=1; return 0; } |
From: Martin S. <mar...@us...> - 2008-03-20 21:27:19
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9990 Modified Files: route.c Log Message: Add:Core:Added more information for debugging route coordinate overflow Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** route.c 22 Jan 2008 19:33:08 -0000 1.39 --- route.c 20 Mar 2008 21:27:21 -0000 1.40 *************** *** 1015,1018 **** --- 1015,1023 ---- count++; } + if (count >= maxcount) { + dbg(0, "count=%d maxcount=%d id_hi=0x%x id_lo=0x%x\n", count, maxcount, item->id_hi, item->id_lo); + if (item_attr_get(item, attr_debug, &attr)) + dbg(0,"debug='%s'\n", attr.u.str); + } g_assert(count < maxcount); ret=g_malloc(sizeof(struct street_data)+count*sizeof(struct coord)); |
From: Martin S. <mar...@us...> - 2008-03-18 23:39:26
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6102 Modified Files: navit.xml Log Message: Fix:Core:Disabled osd for now, switched vehicle back to gpsd Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** navit.xml 18 Mar 2008 08:49:13 -0000 1.44 --- navit.xml 18 Mar 2008 23:39:28 -0000 1.45 *************** *** 15,21 **** --- 15,23 ---- --> <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0"> + <!-- <osd type="compass" /> <osd type="eta" /> <osd type="navigation" /> + --> <gui type="gtk" menubar="1" toolbar="1" statusbar="1" /> <graphics type="gtk_drawing_area" /> *************** *** 25,29 **** --> ! <vehicle name="Meins" enabled="yes" active="1" source="demo://" gpsd_query="w+xjr+" color="#0000ff" color2="#ff000000"/> <!-- To improve visibility of the cursor in gtk, you may optionally add: color2="#rrggbb" - draws a second cursor inside the original, in the specified colour --- 27,31 ---- --> ! <vehicle name="Meins" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xjr+" color="#0000ff"/> <!-- To improve visibility of the cursor in gtk, you may optionally add: color2="#rrggbb" - draws a second cursor inside the original, in the specified colour *************** *** 34,38 **** --> ! <vehicle name="Demo" enabled="yes" source="demo://" color="#0000aa"/> <tracking> </tracking> --- 36,40 ---- --> ! <vehicle name="Demo" enabled="no" source="demo://" color="#0000aa"/> <tracking> </tracking> |
From: Michael F. <ho...@us...> - 2008-03-18 22:50:10
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12381 Modified Files: attr_def.h menu.c menu.h navit.c navit.h Log Message: Core:Cleanup:Add some more stuff to get closer to replacing menu and popup Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** attr_def.h 17 Mar 2008 23:46:37 -0000 1.35 --- attr_def.h 18 Mar 2008 22:50:11 -0000 1.36 *************** *** 118,121 **** --- 118,123 ---- ATTR(vehicle) ATTR(map) + ATTR(bookmark_map) + ATTR(former_destination_map) ATTR2(0x0008ffff,type_object_end) ATTR2(0x00090000,type_coord_begin) Index: menu.c =================================================================== RCS file: /cvsroot/navit/navit/src/menu.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** menu.c 12 Mar 2008 10:58:26 -0000 1.7 --- menu.c 18 Mar 2008 22:50:11 -0000 1.8 *************** *** 18,35 **** void - menu_set_toggle(struct menu *menu, int active) - { - if(*menu->meth.set_toggle){ - (*menu->meth.set_toggle)(menu->priv, active); - } - } - - int - menu_get_toggle(struct menu *menu) - { - return ((*menu->meth.get_toggle) && (*menu->meth.get_toggle)(menu->priv)); - } - - void menu_popup(struct menu *menu) { --- 18,21 ---- Index: navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/navit.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** navit.h 17 Mar 2008 23:46:38 -0000 1.30 --- navit.h 18 Mar 2008 22:50:11 -0000 1.31 *************** *** 44,48 **** struct graphics *navit_get_graphics(struct navit *this_); void navit_set_destination(struct navit *this_, struct pcoord *c, char *description); ! void navit_add_bookmark(struct navit *this_, struct pcoord *c, char *description); void navit_speak(struct navit *this_); void navit_window_roadbook_destroy(struct navit *this_); --- 44,48 ---- struct graphics *navit_get_graphics(struct navit *this_); void navit_set_destination(struct navit *this_, struct pcoord *c, char *description); ! void navit_add_bookmark(struct navit *this_, struct pcoord *c, const char *description); void navit_speak(struct navit *this_); void navit_window_roadbook_destroy(struct navit *this_); Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** navit.c 17 Mar 2008 23:46:37 -0000 1.88 --- navit.c 18 Mar 2008 22:50:11 -0000 1.89 *************** *** 43,49 **** struct navit_vehicle { - #if 0 - char *name; - #endif int update; int update_curr; --- 43,46 ---- *************** *** 55,59 **** struct color c; struct color *c2; - struct menu *menu; struct cursor *cursor; struct vehicle *vehicle; --- 52,55 ---- *************** *** 74,79 **** struct transformation *trans; struct compass *compass; - struct menu *menu; - struct menu *menubar; struct route *route; struct navigation *navigation; --- 70,73 ---- *************** *** 94,97 **** --- 88,93 ---- struct callback *roadbook_callback; struct datawindow *roadbook_window; + struct map *bookmark; + struct map *former_destination; struct menu *bookmarks; GHashTable *bookmarks_hash; *************** *** 408,412 **** } } - this_->menubar=gui_menubar_new(this_->gui); } --- 404,407 ---- *************** *** 597,601 **** */ void ! navit_add_bookmark(struct navit *this_, struct pcoord *c, char *description) { navit_append_coord(this_,"bookmark.txt", c, "bookmark", description, this_->bookmarks, this_->bookmarks_hash, callback_cast(navit_set_destination_from_bookmark)); --- 592,596 ---- */ void ! navit_add_bookmark(struct navit *this_, struct pcoord *c, const char *description) { navit_append_coord(this_,"bookmark.txt", c, "bookmark", description, this_->bookmarks, this_->bookmarks_hash, callback_cast(navit_set_destination_from_bookmark)); *************** *** 656,659 **** --- 651,673 ---- static void + navit_add_bookmarks_from_file(struct navit *this_) + { + struct attr type={attr_type, {"textfile"}}, data={attr_data, {"bookmark.txt"}}; + struct attr *attrs[]={&type, &data, NULL}; + + this_->bookmark=map_new("textfile", attrs); + } + + static void + navit_add_former_destinations_from_file(struct navit *this_) + { + struct attr type={attr_type, {"textfile"}}, data={attr_data, {"destination.txt"}}; + struct attr *attrs[]={&type, &data, NULL}; + + this_->former_destination=map_new("textfile", attrs); + } + + + static void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...) { *************** *** 969,973 **** navit_init(struct navit *this_) { - struct menu *men; struct mapset *ms; struct map *map; --- 983,986 ---- *************** *** 1025,1028 **** --- 1038,1043 ---- navigation_set_mapset(this_->navigation, ms); } + navit_add_bookmarks_from_file(this_); + navit_add_former_destinations_from_file(this_); navit_add_menu_former_destinations(this_, NULL, this_->route); } *************** *** 1031,1034 **** --- 1046,1050 ---- navigation_register_callback(this_->navigation, attr_navigation_speech, this_->nav_speech_cb); } + #if 0 if (this_->menubar) { men=menu_add(this_->menubar, "Data", menu_type_submenu, NULL); *************** *** 1037,1040 **** --- 1053,1057 ---- } } + #endif global_navit=this_; #if 0 *************** *** 1169,1172 **** --- 1186,1192 ---- { switch (type) { + case attr_bookmark_map: + attr->u.map=this_->bookmark; + break; case attr_cursor: attr->u.num=this_->cursor_flag; *************** *** 1177,1180 **** --- 1197,1203 ---- attr->u.pcoord=&this_->destination; break; + case attr_former_destination_map: + attr->u.map=this_->former_destination; + break; case attr_layout: if (iter) { Index: menu.h =================================================================== RCS file: /cvsroot/navit/navit/src/menu.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** menu.h 12 Mar 2008 10:58:26 -0000 1.7 --- menu.h 18 Mar 2008 22:50:11 -0000 1.8 *************** *** 26,31 **** /* prototypes */ struct menu *menu_add(struct menu *menu, char *name, enum menu_type type, struct callback *cb); - void menu_set_toggle(struct menu *menu, int active); - int menu_get_toggle(struct menu *menu); void menu_popup(struct menu *menu); /* end of prototypes */ --- 26,29 ---- |
From: Michael F. <ho...@us...> - 2008-03-18 22:50:07
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12381/gui/gtk Modified Files: gui_gtk_window.c Log Message: Core:Cleanup:Add some more stuff to get closer to replacing menu and popup Index: gui_gtk_window.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_window.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gui_gtk_window.c 18 Mar 2008 11:53:18 -0000 1.23 --- gui_gtk_window.c 18 Mar 2008 22:50:11 -0000 1.24 *************** *** 54,59 **** --- 54,61 ---- { int w,h; + #ifdef USE_HILDON GtkToggleAction *action; gboolean *fullscreen; + #endif /*HILDON*/ struct point p; if (event->type != GDK_KEY_PRESS) *************** *** 170,178 **** struct gui_methods gui_gtk_methods = { - #if 0 - gui_gtk_menubar_new, - #else NULL, - #endif gui_gtk_popup_new, gui_gtk_set_graphics, --- 172,176 ---- *************** *** 374,387 **** gui_gtk_destinations_init(struct gui_priv *this) { struct action_cb_data *data; ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=0x13a3e2; ! data->attr.u.pcoord->y=0x5d6d6a; ! gui_gtk_add_menu(this, "Destination 1", "Muenchen","/ui/MenuBar/Route/FormerDestinations/FormerDestinationMenuAdditions",data); } --- 372,388 ---- gui_gtk_destinations_init(struct gui_priv *this) { + struct attr attr; struct action_cb_data *data; ! if(navit_get_attr(this->nav, attr_former_destination_map, &attr, NULL) && attr.u.map) { ! data=g_new(struct action_cb_data, 1); ! data->gui=this; ! data->attr.type=attr_destination; ! data->attr.u.pcoord=g_new(struct pcoord, 1); ! data->attr.u.pcoord->pro=projection_mg; ! data->attr.u.pcoord->x=0x13a3e2; ! data->attr.u.pcoord->y=0x5d6d6a; ! gui_gtk_add_menu(this, "Destination 1", "Muenchen","/ui/MenuBar/Route/FormerDestinations/FormerDestinationMenuAdditions",data); ! } } |
From: Martin S. <mar...@us...> - 2008-03-18 11:53:29
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22207 Modified Files: gui_gtk_window.c Log Message: Fix:gui_gtk:Rearranged init sequence to keep the statusbar at the bottom Index: gui_gtk_window.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_window.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** gui_gtk_window.c 17 Mar 2008 23:46:41 -0000 1.22 --- gui_gtk_window.c 18 Mar 2008 11:53:18 -0000 1.23 *************** *** 404,427 **** gui_gtk_init(struct gui_priv *this, struct navit *nav) { - GtkWidget *widget; - gui_gtk_ui_init(this); gui_gtk_toggle_init(this); - if (this->menubar_enable) { - widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/MenuBar"); - GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); - gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); - gtk_widget_show (widget); - } - if (this->toolbar_enable) { - widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/ToolBar"); - GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); - gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); - gtk_widget_show (widget); - } - if (this->statusbar_enable) { - this->statusbar=gui_gtk_statusbar_new(this); - } gui_gtk_layouts_init(this); gui_gtk_projections_init(this); --- 404,410 ---- *************** *** 440,443 **** --- 423,427 ---- unsigned xid = 0; struct attr *attr; + GtkWidget *widget; if (cp) { *************** *** 479,482 **** --- 463,482 ---- gtk_window_set_title(GTK_WINDOW(this->win), "Navit"); gtk_widget_realize(this->win); + gui_gtk_ui_init(this); + if (this->menubar_enable) { + widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/MenuBar"); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); + gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + } + if (this->toolbar_enable) { + widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/ToolBar"); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); + gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + } + if (this->statusbar_enable) { + this->statusbar=gui_gtk_statusbar_new(this); + } gtk_container_add(GTK_CONTAINER(this->win), this->vbox); gtk_widget_show_all(this->win); |
From: Michael F. <ho...@us...> - 2008-03-18 08:49:10
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30495 Modified Files: gui.c navit.xml Removed Files: statusbar.h Log Message: Core:Cleanup:Remove statusbar.h. It's not needed anymore Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** navit.xml 17 Mar 2008 23:46:38 -0000 1.43 --- navit.xml 18 Mar 2008 08:49:13 -0000 1.44 *************** *** 15,18 **** --- 15,21 ---- --> <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0"> + <osd type="compass" /> + <osd type="eta" /> + <osd type="navigation" /> <gui type="gtk" menubar="1" toolbar="1" statusbar="1" /> <graphics type="gtk_drawing_area" /> *************** *** 22,26 **** --> ! <vehicle name="Meins" enabled="yes" active="1" source="gpsd://localhost" gpsd_query="w+xjr+" color="#0000ff"/> <!-- To improve visibility of the cursor in gtk, you may optionally add: color2="#rrggbb" - draws a second cursor inside the original, in the specified colour --- 25,29 ---- --> ! <vehicle name="Meins" enabled="yes" active="1" source="demo://" gpsd_query="w+xjr+" color="#0000ff" color2="#ff000000"/> <!-- To improve visibility of the cursor in gtk, you may optionally add: color2="#rrggbb" - draws a second cursor inside the original, in the specified colour --- statusbar.h DELETED --- Index: gui.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gui.c 17 Mar 2008 23:46:37 -0000 1.7 --- gui.c 18 Mar 2008 08:49:13 -0000 1.8 *************** *** 1,3 **** --- 1,4 ---- #include <glib.h> + #include <string.h> #include "debug.h" #include "gui.h" |
From: Michael F. <ho...@us...> - 2008-03-17 23:56:23
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20986 Added Files: projection.c Log Message: Core:Add:Add missing file --- NEW FILE: projection.c --- #include <string.h> #include <glib.h> #include "coord.h" #include "debug.h" #include "projection.h" struct projection_name { enum projection projection; char *name; }; struct projection_name projection_names[]={ {projection_none, ""}, {projection_mg, "mg"}, {projection_garmin, "garmin"}, }; enum projection projection_from_name(const char *name) { int i; for (i=0 ; i < sizeof(projection_names)/sizeof(struct projection_name) ; i++) { if (! strcmp(projection_names[i].name, name)) return projection_names[i].projection; } return projection_none; } char * projection_to_name(enum projection proj) { int i; for (i=0 ; i < sizeof(projection_names)/sizeof(struct projection_name) ; i++) { if (projection_names[i].projection == proj) return projection_names[i].name; } return NULL; } |
From: Michael F. <ho...@us...> - 2008-03-17 23:46:43
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16393/src Modified Files: Makefile.am attr.h attr_def.h cursor.c gui.c gui.h navit.c navit.h navit.xml projection.h vehicle.c vehicle.h Log Message: Core:Fix:Cleanup and reorganisation of gui_gtk centric code. Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** navit.xml 4 Mar 2008 06:11:13 -0000 1.42 --- navit.xml 17 Mar 2008 23:46:38 -0000 1.43 *************** *** 31,35 **** --> ! <vehicle name="Deins" enabled="no" source="gpsd://somehost" color="#0000aa"/> <tracking> </tracking> --- 31,35 ---- --> ! <vehicle name="Demo" enabled="yes" source="demo://" color="#0000aa"/> <tracking> </tracking> Index: attr.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** attr.h 27 Feb 2008 18:04:00 -0000 1.16 --- attr.h 17 Mar 2008 23:46:36 -0000 1.17 *************** *** 8,11 **** --- 8,13 ---- #define ATTR_H + #include "projection.h" + enum item_type; *************** *** 32,35 **** --- 34,38 ---- struct item *item; enum item_type item_type; + enum projection projection; double * numd; struct color *color; *************** *** 37,40 **** --- 40,46 ---- struct navit *navit; struct callback *callback; + struct vehicle *vehicle; + struct layout *layout; + struct map *map; struct log *log; struct route *route; Index: projection.h =================================================================== RCS file: /cvsroot/navit/navit/src/projection.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** projection.h 9 Oct 2007 16:48:40 -0000 1.3 --- projection.h 17 Mar 2008 23:46:39 -0000 1.4 *************** *** 6,9 **** --- 6,12 ---- }; + enum projection projection_from_name(const char *name); + char * projection_to_name(enum projection proj); + #endif Index: cursor.c =================================================================== RCS file: /cvsroot/navit/navit/src/cursor.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** cursor.c 4 Mar 2008 06:11:16 -0000 1.16 --- cursor.c 17 Mar 2008 23:46:37 -0000 1.17 *************** *** 12,17 **** #include "point.h" #include "graphics.h" - #include "statusbar.h" - #include "menu.h" #include "vehicle.h" #include "navit.h" --- 12,15 ---- Index: vehicle.c =================================================================== RCS file: /cvsroot/navit/navit/src/vehicle.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** vehicle.c 14 Feb 2008 11:45:49 -0000 1.32 --- vehicle.c 17 Mar 2008 23:46:39 -0000 1.33 *************** *** 12,15 **** --- 12,16 ---- struct vehicle { + char *name; struct vehicle_priv *priv; struct vehicle_methods meth; *************** *** 95,98 **** --- 96,100 ---- struct attr ** attrs); char *type, *colon; + struct attr *name; dbg(1, "enter\n"); *************** *** 125,139 **** dbg(1, "leave\n"); return this_; } int ! vehicle_position_attr_get(struct vehicle *this_, enum attr_type type, ! struct attr *attr) { ! if (this_->meth.position_attr_get) ! return this_->meth.position_attr_get(this_->priv, type, ! attr); ! return 0; } --- 127,154 ---- dbg(1, "leave\n"); + if ((name=attr_search(attrs, NULL, attr_name))) { + this_->name=g_strdup(name->u.str); + } else { + this_->name=g_strdup("Noname"); + } return this_; } int ! vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *attr) { ! switch (type) { ! case attr_name: ! attr->u.str=this_->name; ! break; ! default: ! if (this_->meth.position_attr_get) { ! return this_->meth.position_attr_get(this_->priv, type, attr); ! } else { ! return 0; ! } ! } ! attr->type=type; ! return 1; } *************** *** 180,183 **** --- 195,199 ---- { callback_list_destroy(this_->cbl); + if(this_->name) g_free(this_->name); g_free(this_); } Index: gui.h =================================================================== RCS file: /cvsroot/navit/navit/src/gui.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gui.h 25 Nov 2007 01:32:14 -0000 1.7 --- gui.h 17 Mar 2008 23:46:37 -0000 1.8 *************** *** 5,9 **** struct gui_priv; struct menu_methods; - struct statusbar_methods; struct datawindow_methods; struct callback; --- 5,8 ---- *************** *** 14,19 **** struct gui_methods { struct menu_priv *(*menubar_new)(struct gui_priv *priv, struct menu_methods *meth); - struct menu_priv *(*toolbar_new)(struct gui_priv *priv, struct menu_methods *meth); - struct statusbar_priv *(*statusbar_new)(struct gui_priv *priv, struct statusbar_methods *meth); struct menu_priv *(*popup_new)(struct gui_priv *priv, struct menu_methods *meth); int (*set_graphics)(struct gui_priv *priv, struct graphics *gra); --- 13,16 ---- *************** *** 38,46 **** struct menu; struct navit; - struct statusbar; struct gui *gui_new(struct navit *nav, const char *type, struct attr **attrs); - struct statusbar *gui_statusbar_new(struct gui *gui); struct menu *gui_menubar_new(struct gui *gui); - struct menu *gui_toolbar_new(struct gui *gui); struct menu *gui_popup_new(struct gui *gui); struct datawindow *gui_datawindow_new(struct gui *gui, char *name, struct callback *click, struct callback *close); --- 35,40 ---- Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/src/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Makefile.am 27 Feb 2008 22:07:12 -0000 1.33 --- Makefile.am 17 Mar 2008 23:46:36 -0000 1.34 *************** *** 17,26 **** file.c graphics.c gui.c item.c layout.c log.c main.c map.c \ mapset.c maptype.c menu.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \ ! profile.c route.c search.c speech.c transform.c track.c \ util.c vehicle.c xmlconfig.c attr.h attr_def.h callback.h color.h compass.h coord.h country.h \ cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h \ file.h graphics.h gtkext.h gui.h item.h item_def.h log.h layer.h layout.h main.h map-share.h map.h\ map_data.h mapset.h maptype.h menu.h navigation.h navit.h osd.h \ ! param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h search.h speech.h statusbar.h \ transform.h track.h util.h vehicle.h xmlconfig.h --- 17,26 ---- file.c graphics.c gui.c item.c layout.c log.c main.c map.c \ mapset.c maptype.c menu.c navit.c navigation.c osd.c param.c phrase.c plugin.c popup.c \ ! profile.c projection.c route.c search.c speech.c transform.c track.c \ util.c vehicle.c xmlconfig.c attr.h attr_def.h callback.h color.h compass.h coord.h country.h \ cursor.h data.h data_window.h data_window_int.h debug.h destination.h draw_info.h endianess.h \ file.h graphics.h gtkext.h gui.h item.h item_def.h log.h layer.h layout.h main.h map-share.h map.h\ map_data.h mapset.h maptype.h menu.h navigation.h navit.h osd.h \ ! param.h phrase.h plugin.h point.h plugin_def.h projection.h popup.h route.h profile.h search.h speech.h \ transform.h track.h util.h vehicle.h xmlconfig.h Index: navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/navit.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** navit.h 19 Feb 2008 13:04:13 -0000 1.29 --- navit.h 17 Mar 2008 23:46:38 -0000 1.30 *************** *** 10,13 **** --- 10,15 ---- enum attr_type; struct attr; + struct attr_iter; + struct attr_iter; struct callback; struct coord; *************** *** 43,55 **** void navit_set_destination(struct navit *this_, struct pcoord *c, char *description); void navit_add_bookmark(struct navit *this_, struct pcoord *c, char *description); - void navit_add_menu_layouts(struct navit *this_, struct menu *men); - void navit_add_menu_layout(struct navit *this_, struct menu *men); - void navit_add_menu_projections(struct navit *this_, struct menu *men); - void navit_add_menu_projection(struct navit *this_, struct menu *men); - void navit_add_menu_maps(struct navit *this_, struct mapset *ms, struct menu *men); - void navit_add_menu_former_destinations(struct navit *this_, struct menu *men, struct route *route); - void navit_add_menu_bookmarks(struct navit *this_, struct menu *men); - void navit_add_menu_vehicles(struct navit *this_, struct menu *men); - void navit_add_menu_vehicle(struct navit *this_, struct menu *men); void navit_speak(struct navit *this_); void navit_window_roadbook_destroy(struct navit *this_); --- 45,48 ---- *************** *** 58,68 **** void navit_window_items_add_item(struct navit_window_items *nwi, enum item_type type); void navit_add_window_items(struct navit *this_, struct navit_window_items *nwi); - void navit_add_menu_windows_items(struct navit *this_, struct menu *men); void navit_init(struct navit *this_); void navit_set_center(struct navit *this_, struct pcoord *center); void navit_set_center_screen(struct navit *this_, struct point *p); int navit_set_attr(struct navit *this_, struct attr *attr); ! int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr); int navit_add_attr(struct navit *this_, struct attr *attr, struct attr **attrs); void navit_add_callback(struct navit *this_, struct callback *cb); void navit_remove_callback(struct navit *this_, struct callback *cb); --- 51,62 ---- void navit_window_items_add_item(struct navit_window_items *nwi, enum item_type type); void navit_add_window_items(struct navit *this_, struct navit_window_items *nwi); void navit_init(struct navit *this_); void navit_set_center(struct navit *this_, struct pcoord *center); void navit_set_center_screen(struct navit *this_, struct point *p); int navit_set_attr(struct navit *this_, struct attr *attr); ! int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); int navit_add_attr(struct navit *this_, struct attr *attr, struct attr **attrs); + struct attr_iter *navit_attr_iter_new(void); + void navit_attr_iter_destroy(struct attr_iter *iter); void navit_add_callback(struct navit *this_, struct callback *cb); void navit_remove_callback(struct navit *this_, struct callback *cb); Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** attr_def.h 4 Mar 2008 06:11:19 -0000 1.34 --- attr_def.h 17 Mar 2008 23:46:37 -0000 1.35 *************** *** 38,41 **** --- 38,42 ---- ATTR(zoom) ATTR(retry_interval) + ATTR(projection) ATTR2(0x00028000,type_boolean_begin) /* boolean */ *************** *** 115,118 **** --- 116,121 ---- ATTR(route) ATTR(navigation) + ATTR(vehicle) + ATTR(map) ATTR2(0x0008ffff,type_object_end) ATTR2(0x00090000,type_coord_begin) Index: gui.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** gui.c 25 Nov 2007 01:32:14 -0000 1.6 --- gui.c 17 Mar 2008 23:46:37 -0000 1.7 *************** *** 2,6 **** #include "debug.h" #include "gui.h" - #include "statusbar.h" #include "menu.h" #include "data_window.h" --- 2,5 ---- *************** *** 22,40 **** } - struct statusbar * - gui_statusbar_new(struct gui *gui) - { - struct statusbar *this_; - if (! gui->meth.statusbar_new) - return NULL; - this_=g_new0(struct statusbar, 1); - this_->priv=gui->meth.statusbar_new(gui->priv, &this_->meth); - if (! this_->priv) { - g_free(this_); - return NULL; - } - return this_; - } - struct menu * gui_menubar_new(struct gui *gui) --- 21,24 ---- *************** *** 52,71 **** } - - struct menu * - gui_toolbar_new(struct gui *gui) - { - struct menu *this_; - if (! gui->meth.toolbar_new) - return NULL; - this_=g_new0(struct menu, 1); - this_->priv=gui->meth.toolbar_new(gui->priv, &this_->meth); - if (! this_->priv) { - g_free(this_); - return NULL; - } - return this_; - } - struct menu * gui_popup_new(struct gui *gui) --- 36,39 ---- Index: vehicle.h =================================================================== RCS file: /cvsroot/navit/navit/src/vehicle.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** vehicle.h 4 Jan 2008 08:34:31 -0000 1.19 --- vehicle.h 17 Mar 2008 23:46:39 -0000 1.20 *************** *** 19,23 **** /* prototypes */ struct vehicle *vehicle_new(struct attr **attrs); ! int vehicle_position_attr_get(struct vehicle *this_, enum attr_type type, struct attr *attr); int vehicle_set_attr(struct vehicle *this_, struct attr *attr, struct attr **attrs); int vehicle_add_attr(struct vehicle *this_, struct attr *attr, struct attr **attrs); --- 19,23 ---- /* prototypes */ struct vehicle *vehicle_new(struct attr **attrs); ! int vehicle_get_attr(struct vehicle *this_, enum attr_type type, struct attr *attr); int vehicle_set_attr(struct vehicle *this_, struct attr *attr, struct attr **attrs); int vehicle_add_attr(struct vehicle *this_, struct attr *attr, struct attr **attrs); Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** navit.c 4 Mar 2008 06:11:12 -0000 1.87 --- navit.c 17 Mar 2008 23:46:37 -0000 1.88 *************** *** 34,37 **** --- 34,38 ---- #include "layout.h" #include "log.h" + #include "attr.h" #define _(STRING) gettext(STRING) *************** *** 42,46 **** --- 43,49 ---- struct navit_vehicle { + #if 0 char *name; + #endif int update; int update_curr; *************** *** 72,77 **** struct compass *compass; struct menu *menu; - struct menu *toolbar; - struct statusbar *statusbar; struct menu *menubar; struct route *route; --- 75,78 ---- *************** *** 106,109 **** --- 107,117 ---- struct gui *main_loop_gui; + struct attr_iter { + union { + GList *list; + struct mapset_handle *mapset_handle; + } u; + }; + static void navit_vehicle_update(struct navit *this_, struct navit_vehicle *nv); static void navit_vehicle_draw(struct navit *this_, struct navit_vehicle *nv, struct point *pnt); *************** *** 401,406 **** } this_->menubar=gui_menubar_new(this_->gui); - this_->toolbar=gui_toolbar_new(this_->gui); - this_->statusbar=gui_statusbar_new(this_->gui); } --- 409,412 ---- *************** *** 422,434 **** static void - navit_map_toggle(struct menu *menu, struct navit *this_, struct map *map) - { - if ((menu_get_toggle(menu) != 0) != (map_get_active(map) != 0)) { - map_set_active(map, (menu_get_toggle(menu) != 0)); - navit_draw(this_); - } - } - - static void navit_projection_set(struct navit *this_, enum projection pro) { --- 428,431 ---- *************** *** 468,483 **** } - static const char * - navit_proj2str(enum projection pro) - { - switch (pro) { - case projection_mg: - return "mg"; - case projection_garmin: - return "garmin"; - default: - return ""; - } - } static void navit_append_coord(struct navit *this_, char *file, struct pcoord *c, char *type, char *description, struct menu *rmen, GHashTable *h, void (*cb_func)(void)) --- 465,468 ---- *************** *** 493,497 **** offset=ftell(f); if (c) { ! prostr = navit_proj2str(c->pro); fprintf(f,"%s%s0x%x 0x%x type=%s label=\"%s\"\n", prostr, *prostr ? ":" : "", c->x, c->y, type, description); --- 478,482 ---- offset=ftell(f); if (c) { ! prostr = projection_to_name(c->pro); fprintf(f,"%s%s0x%x 0x%x type=%s label=\"%s\"\n", prostr, *prostr ? ":" : "", c->x, c->y, type, description); *************** *** 619,680 **** struct navit *global_navit; - void - navit_add_menu_layouts(struct navit *this_, struct menu *men) - { - GList *layouts; - struct layout *l; - struct callback *cb; - - layouts = this_->layouts; - while (layouts) { - l=layouts->data; - cb=callback_new_2(callback_cast(navit_set_attr), this_, attr_new_from_text("layout",l->name)); - menu_add(men, l->name, menu_type_menu, cb); - layouts=g_list_next(layouts); - } - } - - void - navit_add_menu_layout(struct navit *this_, struct menu *men) - { - navit_add_menu_layouts(this_, menu_add(men, _("Layout"), menu_type_submenu, NULL)); - } - - void - navit_add_menu_projections(struct navit *this_, struct menu *men) - { - struct callback *cb; - cb=callback_new_2(callback_cast(navit_projection_set), this_, (void *)projection_mg); - menu_add(men, "M&G", menu_type_menu, cb); - cb=callback_new_2(callback_cast(navit_projection_set), this_, (void *)projection_garmin); - menu_add(men, "Garmin", menu_type_menu, cb); - } - - void - navit_add_menu_projection(struct navit *this_, struct menu *men) - { - navit_add_menu_projections(this_, menu_add(men, _("Projection"), menu_type_submenu, NULL)); - } - - void - navit_add_menu_maps(struct navit *this_, struct mapset *ms, struct menu *men) - { - struct mapset_handle *handle; - struct map *map; - struct menu *mmen; - struct callback *cb; - - handle=mapset_open(ms); - while ((map=mapset_next(handle,0))) { - char *s=g_strdup_printf("%s:%s", map_get_type(map), map_get_filename(map)); - cb=callback_new_3(callback_cast(navit_map_toggle), NULL, this_, map); - mmen=menu_add(men, s, menu_type_toggle, cb); - callback_set_arg(cb, 0, mmen); - menu_set_toggle(mmen, map_get_active(map)); - g_free(s); - } - mapset_close(handle); - } - static void navit_add_menu_destinations_from_file(struct navit *this_, char *file, struct menu *rmen, GHashTable *h, struct route *route, void (*cb_func)(void)) --- 604,607 ---- *************** *** 708,712 **** } ! void navit_add_menu_former_destinations(struct navit *this_, struct menu *men, struct route *route) { --- 635,639 ---- } ! static void navit_add_menu_former_destinations(struct navit *this_, struct menu *men, struct route *route) { *************** *** 718,722 **** } ! void navit_add_menu_bookmarks(struct navit *this_, struct menu *men) { --- 645,649 ---- } ! static void navit_add_menu_bookmarks(struct navit *this_, struct menu *men) { *************** *** 729,768 **** static void - navit_vehicle_toggle(struct navit *this_, struct navit_vehicle *nv) - { - if (menu_get_toggle(nv->menu)) { - if (this_->vehicle && this_->vehicle != nv) - menu_set_toggle(this_->vehicle->menu, 0); - this_->vehicle=nv; - } else { - if (this_->vehicle == nv) - this_->vehicle=NULL; - } - } - - void - navit_add_menu_vehicles(struct navit *this_, struct menu *men) - { - struct navit_vehicle *nv; - struct callback *cb; - GList *l; - l=this_->vehicles; - while (l) { - nv=l->data; - cb=callback_new_2(callback_cast(navit_vehicle_toggle), this_, nv); - nv->menu=menu_add(men, nv->name, menu_type_toggle, cb); - menu_set_toggle(nv->menu, this_->vehicle == nv); - l=g_list_next(l); - } - } - - void - navit_add_menu_vehicle(struct navit *this_, struct menu *men) - { - men=menu_add(men, _("Vehicle"), menu_type_submenu, NULL); - navit_add_menu_vehicles(this_, men); - } - - static void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...) { --- 656,659 ---- *************** *** 1060,1064 **** } ! void navit_add_menu_windows_items(struct navit *this_, struct menu *men) { --- 951,955 ---- } ! static void navit_add_menu_windows_items(struct navit *this_, struct menu *men) { *************** *** 1134,1152 **** navigation_set_mapset(this_->navigation, ms); } ! if (this_->menubar) { ! men=menu_add(this_->menubar, _("Map"), menu_type_submenu, NULL); ! if (men) { ! navit_add_menu_layout(this_, men); ! navit_add_menu_projection(this_, men); ! navit_add_menu_vehicle(this_, men); ! navit_add_menu_maps(this_, ms, men); ! } ! men=menu_add(this_->menubar, _("Route"), menu_type_submenu, NULL); ! if (men) { ! navit_add_menu_former_destinations(this_, men, this_->route); ! navit_add_menu_bookmarks(this_, men); ! } ! } else ! navit_add_menu_former_destinations(this_, NULL, this_->route); } if (this_->navigation && this_->speech) { --- 1025,1029 ---- navigation_set_mapset(this_->navigation, ms); } ! navit_add_menu_former_destinations(this_, NULL, this_->route); } if (this_->navigation && this_->speech) { *************** *** 1222,1227 **** navit_set_attr(struct navit *this_, struct attr *attr) { - GList *layouts; - struct layout *l; int dir=0, orient_old=0, attr_updated=0; --- 1099,1102 ---- *************** *** 1233,1239 **** } break; ! case attr_tracking: ! if (this_->tracking_flag != !!attr->u.num) { ! this_->tracking_flag=!!attr->u.num; attr_updated=1; } --- 1108,1115 ---- } break; ! case attr_layout: ! if(this_->layout_current!=attr->u.layout) { ! this_->layout_current=attr->u.layout; ! navit_draw(this_); attr_updated=1; } *************** *** 1255,1268 **** } break; ! case attr_layout: ! layouts = this_->layouts; ! while (layouts) { ! l=layouts->data; ! if(!strcmp(attr->u.str,l->name) && this_->layout_current!=l) { ! this_->layout_current=l; ! navit_draw(this_); ! attr_updated=1; } - layouts=g_list_next(layouts); } break; --- 1131,1157 ---- } break; ! case attr_projection: ! if(this_->trans && transform_get_projection(this_->trans) != attr->u.projection) { ! navit_projection_set(this_, attr->u.projection); ! attr_updated=1; ! } ! break; ! case attr_tracking: ! if (this_->tracking_flag != !!attr->u.num) { ! this_->tracking_flag=!!attr->u.num; ! attr_updated=1; ! } ! break; ! case attr_vehicle: ! if (this_->vehicle && this_->vehicle->vehicle != attr->u.vehicle) { ! GList *l; ! l=this_->vehicles; ! while(l) { ! if (((struct navit_vehicle *)l->data)->vehicle == attr->u.vehicle) { ! this_->vehicle=(struct navit_vehicle *)l; ! attr_updated=1; ! } ! l=g_list_next(l); } } break; *************** *** 1277,1281 **** int ! navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr) { switch (type) { --- 1166,1170 ---- int ! navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) { switch (type) { *************** *** 1283,1299 **** attr->u.num=this_->cursor_flag; break; ! case attr_tracking: ! attr->u.num=this_->tracking_flag; break; case attr_orientation: attr->u.num=this_->orient_north_flag; break; ! case attr_layout: ! attr->u.str=g_strdup(this_->layout_current->name); ! break; ! case attr_destination: ! if (! this_->destination_valid) return 0; ! attr->u.pcoord=&this_->destination; break; default: --- 1172,1238 ---- attr->u.num=this_->cursor_flag; break; ! case attr_destination: ! if (! this_->destination_valid) ! return 0; ! attr->u.pcoord=&this_->destination; ! break; ! case attr_layout: ! if (iter) { ! if (iter->u.list) { ! iter->u.list=g_list_next(iter->u.list); ! } else { ! iter->u.list=this_->layouts; ! } ! if (!iter->u.list) ! return 0; ! attr->u.layout=(struct layout *)iter->u.list->data; ! } else { ! attr->u.layout=this_->layout_current; ! } ! break; ! case attr_map: ! if (iter && this_->mapsets) { ! if (!iter->u.mapset_handle) { ! iter->u.mapset_handle=mapset_open((struct mapset *)this_->mapsets->data); ! } ! attr->u.map=mapset_next(iter->u.mapset_handle, 0); ! if(!attr->u.map) { ! mapset_close(iter->u.mapset_handle); ! return 0; ! } ! } else { ! return 0; ! } break; case attr_orientation: attr->u.num=this_->orient_north_flag; break; ! case attr_projection: ! if(this_->trans) { ! attr->u.num=transform_get_projection(this_->trans); ! } else { return 0; ! } ! break; ! case attr_tracking: ! attr->u.num=this_->tracking_flag; ! break; ! case attr_vehicle: ! if(iter) { ! if(iter->u.list) { ! iter->u.list=g_list_next(iter->u.list); ! } else { ! iter->u.list=this_->vehicles; ! } ! if(!iter->u.list) ! return 0; ! attr->u.vehicle=((struct navit_vehicle*)iter->u.list->data)->vehicle; ! } else { ! if(this_->vehicle) { ! attr->u.vehicle=this_->vehicle->vehicle; ! } else { ! return 0; ! } ! } break; default: *************** *** 1332,1335 **** --- 1271,1286 ---- } + struct attr_iter * + navit_attr_iter_new() + { + return g_new0(struct attr_iter, 1); + } + + void + navit_attr_iter_destroy(struct attr_iter *iter) + { + g_free(iter); + } + void navit_add_callback(struct navit *this_, struct callback *cb) *************** *** 1382,1388 **** return; ! if (! vehicle_position_attr_get(nv->vehicle, attr_position_direction, &attr_dir) || ! ! vehicle_position_attr_get(nv->vehicle, attr_position_speed, &attr_speed) || ! ! vehicle_position_attr_get(nv->vehicle, attr_position_coord_geo, &attr_pos)) return; nv->dir=*attr_dir.u.numd; --- 1333,1339 ---- return; ! if (! vehicle_get_attr(nv->vehicle, attr_position_direction, &attr_dir) || ! ! vehicle_get_attr(nv->vehicle, attr_position_speed, &attr_speed) || ! ! vehicle_get_attr(nv->vehicle, attr_position_coord_geo, &attr_pos)) return; nv->dir=*attr_dir.u.numd; *************** *** 1482,1493 **** { struct navit_vehicle *nv=g_new0(struct navit_vehicle, 1); ! struct attr *name,*update,*follow,*color,*active, *color2, *animate; nv->vehicle=v; nv->update=1; nv->follow=0; nv->animate_cursor=0; - nv->name="Noname"; - if ((name=attr_search(attrs, NULL, attr_name))) - nv->name=g_strdup(name->u.str); if ((update=attr_search(attrs, NULL, attr_update))) nv->update=nv->update=update->u.num; --- 1433,1441 ---- { struct navit_vehicle *nv=g_new0(struct navit_vehicle, 1); ! struct attr *update,*follow,*color,*active, *color2, *animate; nv->vehicle=v; nv->update=1; nv->follow=0; nv->animate_cursor=0; if ((update=attr_search(attrs, NULL, attr_update))) nv->update=nv->update=update->u.num; |
From: Michael F. <ho...@us...> - 2008-03-17 23:46:41
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16393/src/gui/gtk Modified Files: gui_gtk.h gui_gtk_action.c gui_gtk_statusbar.c gui_gtk_window.c Log Message: Core:Fix:Cleanup and reorganisation of gui_gtk centric code. Index: gui_gtk_action.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_action.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** gui_gtk_action.c 27 Feb 2008 19:31:52 -0000 1.31 --- gui_gtk_action.c 17 Mar 2008 23:46:40 -0000 1.32 *************** *** 139,143 **** } - static void quit_action (GtkWidget *w, struct gui_priv *gui, void *dummy) --- 139,142 ---- *************** *** 146,200 **** } - static void - visible_blocks_action(GtkWidget *w, struct container *co) - { - #if 0 - co->data_window[data_window_type_block]=data_window("Visible Blocks",co->win,NULL); - graphics_redraw(co); - #endif - } - - static void - visible_towns_action(GtkWidget *w, struct container *co) - { - #if 0 - co->data_window[data_window_type_town]=data_window("Visible Towns",co->win,NULL); - graphics_redraw(co); - #endif - } - - static void - visible_polys_action(GtkWidget *w, struct container *co) - { - #if 0 - co->data_window[data_window_type_street]=data_window("Visible Polys",co->win,NULL); - graphics_redraw(co); - #endif - } - - static void - visible_streets_action(GtkWidget *w, struct container *co) - { - #if 0 - co->data_window[data_window_type_street]=data_window("Visible Streets",co->win,NULL); - graphics_redraw(co); - #endif - } - - static void - visible_points_action(GtkWidget *w, struct container *co) - { - #if 0 - co->data_window[data_window_type_point]=data_window("Visible Points",co->win,NULL); - graphics_redraw(co); - #endif - } - static GtkActionEntry entries[] = { ! { "DisplayMenuAction", NULL, gettext_noop("Display") }, { "RouteMenuAction", NULL, _n("Route") }, ! { "Map", NULL, _n("Map") }, { "LayoutMenuAction", NULL, _n("Layout") }, { "ZoomOutAction", GTK_STOCK_ZOOM_OUT, _n("ZoomOut"), NULL, NULL, G_CALLBACK(zoom_out_action) }, { "ZoomInAction", GTK_STOCK_ZOOM_IN, _n("ZoomIn"), NULL, NULL, G_CALLBACK(zoom_in_action) }, --- 145,158 ---- } static GtkActionEntry entries[] = { ! { "DisplayMenuAction", NULL, _n("Display") }, { "RouteMenuAction", NULL, _n("Route") }, ! { "FormerDestinationMenuAction", NULL, _n("Former Destinations") }, ! { "BookmarkMenuAction", NULL, _n("Bookmarks") }, ! { "MapMenuAction", NULL, _n("Map") }, { "LayoutMenuAction", NULL, _n("Layout") }, + { "ProjectionMenuAction", NULL, _n("Projection") }, + { "VehicleMenuAction", NULL, _n("Vehicle") }, { "ZoomOutAction", GTK_STOCK_ZOOM_OUT, _n("ZoomOut"), NULL, NULL, G_CALLBACK(zoom_out_action) }, { "ZoomInAction", GTK_STOCK_ZOOM_IN, _n("ZoomIn"), NULL, NULL, G_CALLBACK(zoom_in_action) }, *************** *** 231,239 **** { { "DataMenuAction", NULL, _n("Data") }, - { "VisibleBlocksAction", NULL, _n("VisibleBlocks"), NULL, NULL, G_CALLBACK(visible_blocks_action) }, - { "VisibleTownsAction", NULL, _n("VisibleTowns"), NULL, NULL, G_CALLBACK(visible_towns_action) }, - { "VisiblePolysAction", NULL, _n("VisiblePolys"), NULL, NULL, G_CALLBACK(visible_polys_action) }, - { "VisibleStreetsAction", NULL, _n("VisibleStreets"), NULL, NULL, G_CALLBACK(visible_streets_action) }, - { "VisiblePointsAction", NULL, _n("VisiblePoints"), NULL, NULL, G_CALLBACK(visible_points_action) }, }; --- 189,192 ---- *************** *** 379,387 **** </menu>\ <menu name=\"Data\" action=\"DataMenuAction\">\ - <menuitem name=\"Visible Blocks\" action=\"VisibleBlocksAction\" />\ - <menuitem name=\"Visible Towns\" action=\"VisibleTownsAction\" />\ - <menuitem name=\"Visible Polys\" action=\"VisiblePolysAction\" />\ - <menuitem name=\"Visible Streets\" action=\"VisibleStreetsAction\" />\ - <menuitem name=\"Visible Points\" action=\"VisiblePointsAction\" />\ <placeholder name=\"DataMenuAdditions\" />\ </menu>\ --- 332,335 ---- *************** *** 390,395 **** --- 338,361 ---- <menuitem name=\"Destination\" action=\"DestinationAction\" />\ <menuitem name=\"Clear\" action=\"RouteClearAction\" />\ + <menu name=\"FormerDestinations\" action=\"FormerDestinationMenuAction\">\ + <placeholder name=\"FormerDestinationMenuAdditions\" />\ + </menu>\ + <menu name=\"Bookmarks\" action=\"BookmarkMenuAction\">\ + <placeholder name=\"BookmarkMenuAdditions\" />\ + </menu>\ <placeholder name=\"RouteMenuAdditions\" />\ </menu>\ + <menu name=\"Map\" action=\"MapMenuAction\">\ + <menu name=\"Layout\" action=\"LayoutMenuAction\">\ + <placeholder name=\"LayoutMenuAdditions\" />\ + </menu>\ + <menu name=\"Projection\" action=\"ProjectionMenuAction\">\ + <placeholder name=\"ProjectionMenuAdditions\" />\ + </menu>\ + <menu name=\"Vehicle\" action=\"VehicleMenuAction\">\ + <placeholder name=\"VehicleMenuAdditions\" />\ + </menu>\ + <placeholder name=\"MapMenuAdditions\" />\ + </menu>\ </menubar>\ <toolbar name=\"ToolBar\" action=\"BaseToolbar\" action=\"BaseToolbarAction\">\ *************** *** 443,448 **** ret->handler_id=g_signal_connect(ret->action, "activate", G_CALLBACK(activate), ret); gtk_action_group_add_action(menu->gui->dyn_group, ret->action); ! ret->merge_id=gtk_ui_manager_new_merge_id(menu->gui->menu_manager); ! gtk_ui_manager_add_ui( menu->gui->menu_manager, ret->merge_id, menu->path, dynname, dynname, type == menu_type_submenu ? GTK_UI_MANAGER_MENU : GTK_UI_MANAGER_MENUITEM, FALSE); } ret->gui=menu->gui; --- 409,414 ---- ret->handler_id=g_signal_connect(ret->action, "activate", G_CALLBACK(activate), ret); gtk_action_group_add_action(menu->gui->dyn_group, ret->action); ! ret->merge_id=gtk_ui_manager_new_merge_id(menu->gui->ui_manager); ! gtk_ui_manager_add_ui( menu->gui->ui_manager, ret->merge_id, menu->path, dynname, dynname, type == menu_type_submenu ? GTK_UI_MANAGER_MENU : GTK_UI_MANAGER_MENUITEM, FALSE); } ret->gui=menu->gui; *************** *** 470,474 **** } if (item->action) { ! gtk_ui_manager_remove_ui(item->gui->menu_manager, item->merge_id); gtk_action_group_remove_action(item->gui->dyn_group, item->action); #if 0 --- 436,440 ---- } if (item->action) { ! gtk_ui_manager_remove_ui(item->gui->ui_manager, item->merge_id); gtk_action_group_remove_action(item->gui->dyn_group, item->action); #if 0 *************** *** 495,501 **** --- 461,473 ---- static struct menu_methods menu_methods = { + #if 1 add_menu, set_toggle, get_toggle, + #else + NULL, + NULL, + NULL + #endif }; *************** *** 512,516 **** { #ifdef _WIN32 ! menu->widget=gtk_ui_manager_get_widget(menu->gui->menu_manager, menu->path ); #endif gtk_menu_popup(GTK_MENU(menu->widget), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ()); --- 484,488 ---- { #ifdef _WIN32 ! menu->widget=gtk_ui_manager_get_widget(menu->gui->ui_manager, menu->path ); #endif gtk_menu_popup(GTK_MENU(menu->widget), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ()); *************** *** 518,529 **** } static struct menu_priv * gui_gtk_ui_new (struct gui_priv *this, struct menu_methods *meth, char *path, int popup, GtkWidget **widget_ret) { struct menu_priv *ret; - GError *error; GtkWidget *widget; - struct attr attr; - GtkToggleAction *toggle_action; *meth=menu_methods; --- 490,538 ---- } + void + gui_gtk_ui_init(struct gui_priv *this) + { + GError *error = NULL; + struct attr attr; + GtkToggleAction *toggle_action; + + this->base_group = gtk_action_group_new ("BaseActions"); + this->debug_group = gtk_action_group_new ("DebugActions"); + this->dyn_group = gtk_action_group_new ("DynamicActions"); + register_my_stock_icons(); + this->ui_manager = gtk_ui_manager_new (); + gtk_action_group_set_translation_domain(this->base_group,"navit"); + gtk_action_group_set_translation_domain(this->debug_group,"navit"); + gtk_action_group_set_translation_domain(this->dyn_group,"navit"); + gtk_action_group_add_actions (this->base_group, entries, n_entries, this); + gtk_action_group_add_toggle_actions (this->base_group, toggleentries, n_toggleentries, this); + gtk_ui_manager_insert_action_group (this->ui_manager, this->base_group, 0); + gtk_action_group_add_actions (this->debug_group, debug_entries, n_debug_entries, this); + gtk_ui_manager_insert_action_group (this->ui_manager, this->debug_group, 0); + gtk_ui_manager_add_ui_from_string (this->ui_manager, layout, strlen(layout), &error); + gtk_ui_manager_insert_action_group (this->ui_manager, this->dyn_group, 0); + if (error) { + g_message ("building menus failed: %s", error->message); + g_error_free (error); + } + if (navit_get_attr(this->nav, attr_cursor, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } + if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } + if (navit_get_attr(this->nav, attr_tracking, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } + } + static struct menu_priv * gui_gtk_ui_new (struct gui_priv *this, struct menu_methods *meth, char *path, int popup, GtkWidget **widget_ret) { struct menu_priv *ret; GtkWidget *widget; *meth=menu_methods; *************** *** 531,575 **** ret->path=g_strdup(path); ret->gui=this; ! if (! this->menu_manager) { ! this->base_group = gtk_action_group_new ("BaseActions"); ! this->debug_group = gtk_action_group_new ("DebugActions"); ! this->dyn_group = gtk_action_group_new ("DynamicActions"); ! register_my_stock_icons(); ! this->menu_manager = gtk_ui_manager_new (); ! gtk_action_group_set_translation_domain(this->base_group,"navit"); ! gtk_action_group_set_translation_domain(this->debug_group,"navit"); ! gtk_action_group_set_translation_domain(this->dyn_group,"navit"); ! gtk_action_group_add_actions (this->base_group, entries, n_entries, this); ! gtk_action_group_add_toggle_actions (this->base_group, toggleentries, n_toggleentries, this); ! gtk_ui_manager_insert_action_group (this->menu_manager, this->base_group, 0); ! gtk_action_group_add_actions (this->debug_group, debug_entries, n_debug_entries, this); ! gtk_ui_manager_insert_action_group (this->menu_manager, this->debug_group, 0); ! gtk_ui_manager_add_ui_from_string (this->menu_manager, layout, strlen(layout), &error); ! gtk_ui_manager_insert_action_group (this->menu_manager, this->dyn_group, 0); ! error=NULL; ! if (error) { ! g_message ("building menus failed: %s", error->message); ! g_error_free (error); ! } ! if (navit_get_attr(this->nav, attr_cursor, &attr)) { ! toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction")); ! gtk_toggle_action_set_active(toggle_action, attr.u.num); ! } else { ! dbg(0, "Unable to locate CursorAction\n"); ! } ! if (navit_get_attr(this->nav, attr_orientation, &attr)) { ! toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction")); ! gtk_toggle_action_set_active(toggle_action, attr.u.num); ! } else { ! dbg(0, "Unable to locate OrientationAction\n"); ! } ! if (navit_get_attr(this->nav, attr_tracking, &attr)) { ! toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction")); ! gtk_toggle_action_set_active(toggle_action, attr.u.num); ! } else { ! dbg(0, "Unable to locate TrackingAction\n"); ! } ! } ! widget=gtk_ui_manager_get_widget(this->menu_manager, path); GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); if (widget_ret) --- 540,545 ---- ret->path=g_strdup(path); ret->gui=this; ! ! widget=gtk_ui_manager_get_widget(this->ui_manager, path); GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); if (widget_ret) *************** *** 585,594 **** } ! struct menu_priv * ! gui_gtk_toolbar_new(struct gui_priv *this, struct menu_methods *meth) ! { ! return gui_gtk_ui_new(this, meth, "/ui/ToolBar", 0, NULL); ! } ! struct menu_priv * gui_gtk_menubar_new(struct gui_priv *this, struct menu_methods *meth) --- 555,559 ---- } ! #if 0 struct menu_priv * gui_gtk_menubar_new(struct gui_priv *this, struct menu_methods *meth) *************** *** 596,599 **** --- 561,565 ---- return gui_gtk_ui_new(this, meth, "/ui/MenuBar", 0, &this->menubar); } + #endif struct menu_priv * Index: gui_gtk_statusbar.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_statusbar.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gui_gtk_statusbar.c 19 Feb 2008 13:04:14 -0000 1.13 --- gui_gtk_statusbar.c 17 Mar 2008 23:46:41 -0000 1.14 *************** *** 17,22 **** #include "gui_gtk.h" - #include "statusbar.h" - #define _(STRING) gettext(STRING) --- 17,20 ---- *************** *** 108,112 **** gtk_label_set_text(GTK_LABEL(this->route), this->route_text); } ! if (!vehicle_position_attr_get(v, attr_position_coord_geo, &attr)) return; lng=attr.u.coord_geo->lng; --- 106,110 ---- gtk_label_set_text(GTK_LABEL(this->route), this->route_text); } ! if (!vehicle_get_attr(v, attr_position_coord_geo, &attr)) return; lng=attr.u.coord_geo->lng; *************** *** 120,124 **** lat_c='S'; } ! if (vehicle_position_attr_get(v, attr_position_direction, &attr)) direction=*(attr.u.numd); direction=fmod(direction,360); --- 118,122 ---- lat_c='S'; } ! if (vehicle_get_attr(v, attr_position_direction, &attr)) direction=*(attr.u.numd); direction=fmod(direction,360); *************** *** 127,137 **** dir_idx=(direction+22.5)/45; dir=dirs[dir_idx]; ! if (vehicle_position_attr_get(v, attr_position_height, &attr)) height=*(attr.u.numd); ! if (vehicle_position_attr_get(v, attr_position_speed, &attr)) speed=*(attr.u.numd); ! if (vehicle_position_attr_get(v, attr_position_sats_used, &attr)) sats=attr.u.num; ! if (vehicle_position_attr_get(v, attr_position_qual, &attr)) qual=attr.u.num; sprintf(this->gps_text,"GPS %2d/%1d %02.0f%07.4f%c %03.0f%07.4f%c %4.0fm %3.0f°%-2s %3.0fkm/h", sats, qual, floor(lat), fmod(lat*60,60), lat_c, floor(lng), fmod(lng*60,60), lng_c, height, direction, dir, speed); --- 125,135 ---- dir_idx=(direction+22.5)/45; dir=dirs[dir_idx]; ! if (vehicle_get_attr(v, attr_position_height, &attr)) height=*(attr.u.numd); ! if (vehicle_get_attr(v, attr_position_speed, &attr)) speed=*(attr.u.numd); ! if (vehicle_get_attr(v, attr_position_sats_used, &attr)) sats=attr.u.num; ! if (vehicle_get_attr(v, attr_position_qual, &attr)) qual=attr.u.num; sprintf(this->gps_text,"GPS %2d/%1d %02.0f%07.4f%c %03.0f%07.4f%c %4.0fm %3.0f°%-2s %3.0fkm/h", sats, qual, floor(lat), fmod(lat*60,60), lat_c, floor(lng), fmod(lng*60,60), lng_c, height, direction, dir, speed); *************** *** 139,154 **** } - static struct statusbar_methods methods = { - statusbar_destroy, - }; - struct statusbar_priv * ! gui_gtk_statusbar_new(struct gui_priv *gui, struct statusbar_methods *meth) { struct statusbar_priv *this=g_new0(struct statusbar_priv, 1); this->gui=gui; - *meth=methods; - this->hbox=gtk_hbox_new(FALSE, 1); this->gps=gtk_label_new( "GPS 00/0 0000.0000N 00000.0000E 0000m 000°NO 000km/h" ); --- 137,146 ---- } struct statusbar_priv * ! gui_gtk_statusbar_new(struct gui_priv *gui) { struct statusbar_priv *this=g_new0(struct statusbar_priv, 1); this->gui=gui; this->hbox=gtk_hbox_new(FALSE, 1); this->gps=gtk_label_new( "GPS 00/0 0000.0000N 00000.0000E 0000m 000°NO 000km/h" ); Index: gui_gtk_window.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_window.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gui_gtk_window.c 7 Feb 2008 13:56:36 -0000 1.21 --- gui_gtk_window.c 17 Mar 2008 23:46:41 -0000 1.22 *************** *** 20,23 **** --- 20,27 ---- #include "transform.h" #include "config.h" + #include "callback.h" + #include "layout.h" + #include "vehicle.h" + #include "map.h" #ifdef USE_HILDON *************** *** 166,172 **** struct gui_methods gui_gtk_methods = { gui_gtk_menubar_new, ! gui_gtk_toolbar_new, ! gui_gtk_statusbar_new, gui_gtk_popup_new, gui_gtk_set_graphics, --- 170,178 ---- struct gui_methods gui_gtk_methods = { + #if 0 gui_gtk_menubar_new, ! #else ! NULL, ! #endif gui_gtk_popup_new, gui_gtk_set_graphics, *************** *** 179,182 **** --- 185,189 ---- gui_gtk_delete(GtkWidget *widget, GdkEvent *event, struct navit *nav) { + /* FIXME remove attr_navit callback */ navit_destroy(nav); *************** *** 184,187 **** --- 191,435 ---- } + static void + gui_gtk_toggle_init(struct gui_priv *this) + { + struct attr attr; + GtkToggleAction *toggle_action; + + if (navit_get_attr(this->nav, attr_cursor, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } else { + dbg(0, "Unable to locate CursorAction\n"); + } + if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } else { + dbg(0, "Unable to locate OrientationAction\n"); + } + if (navit_get_attr(this->nav, attr_tracking, &attr, NULL)) { + toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction")); + gtk_toggle_action_set_active(toggle_action, attr.u.num); + } else { + dbg(0, "Unable to locate TrackingAction\n"); + } + } + + struct action_cb_data { + struct gui_priv *gui; + struct attr attr; + }; + + static void + gui_gtk_action_activate(GtkToggleAction *action, struct action_cb_data *data) + { + } + static void + gui_gtk_add_menu(struct gui_priv *this, char *name, char *label, char *path, struct action_cb_data *data) + { + GtkAction *action; + guint merge_id; + + action=gtk_action_new(name, label, NULL, NULL); + g_signal_connect(action, "activate", G_CALLBACK(gui_gtk_action_activate), data); + gtk_action_group_add_action(this->dyn_group, action); + merge_id=gtk_ui_manager_new_merge_id(this->ui_manager); + gtk_ui_manager_add_ui(this->ui_manager, merge_id, path, name, name, GTK_UI_MANAGER_MENUITEM, FALSE); + } + + static void + gui_gtk_action_toggled(GtkToggleAction *action, struct action_cb_data *data) + { + map_set_active(data->attr.u.map, gtk_toggle_action_get_active(action)); + navit_draw(data->gui->nav); + } + + static void + gui_gtk_add_toggle_menu(struct gui_priv *this, char *name, char *label, char *path, struct action_cb_data *data, gboolean active) + { + GtkToggleAction *toggle_action; + guint merge_id; + + toggle_action=gtk_toggle_action_new(name, label, NULL, NULL); + gtk_toggle_action_set_active(toggle_action, active); + g_signal_connect(GTK_ACTION(toggle_action), "toggled", G_CALLBACK(gui_gtk_action_toggled), data); + gtk_action_group_add_action(this->dyn_group, GTK_ACTION(toggle_action)); + merge_id=gtk_ui_manager_new_merge_id(this->ui_manager); + gtk_ui_manager_add_ui(this->ui_manager, merge_id, path, name, name, GTK_UI_MANAGER_MENUITEM, FALSE); + } + + static void + gui_gtk_action_changed(GtkRadioAction *action, GtkRadioAction *current, struct action_cb_data *data) + { + if (action == current) { + navit_set_attr(data->gui->nav, &data->attr); + } + } + + static void + gui_gtk_add_radio_menu(struct gui_priv *this, char *name, char *label, char *path, struct action_cb_data *data, GSList **g) + { + GtkRadioAction *radio_action; + guint merge_id; + + radio_action=gtk_radio_action_new(name, label, NULL, NULL, 0); + gtk_radio_action_set_group(radio_action, *g); + *g=gtk_radio_action_get_group(radio_action); + g_signal_connect(GTK_ACTION(radio_action), "changed", G_CALLBACK(gui_gtk_action_changed), data); + gtk_action_group_add_action(this->dyn_group, GTK_ACTION(radio_action)); + merge_id=gtk_ui_manager_new_merge_id(this->ui_manager); + gtk_ui_manager_add_ui(this->ui_manager, merge_id, path, name, name, GTK_UI_MANAGER_MENUITEM, FALSE); + } + + static void + gui_gtk_layouts_init(struct gui_priv *this) + { + struct attr_iter *iter; + struct attr attr; + struct action_cb_data *data; + int count=0; + char *name; + + iter=navit_attr_iter_new(); + while(navit_get_attr(this->nav, attr_layout, &attr, iter)) { + name=g_strdup_printf("Layout %d", count++); + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_layout; + data->attr.u.layout=attr.u.layout; + gui_gtk_add_radio_menu(this, name, attr.u.layout->name, "/ui/MenuBar/Map/Layout/LayoutMenuAdditions", data, &this->layout_group); + g_free(name); + } + navit_attr_iter_destroy(iter); + } + + static void + gui_gtk_projections_init(struct gui_priv *this) + { + struct action_cb_data *data; + + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_projection; + data->attr.u.projection=projection_mg; + gui_gtk_add_radio_menu(this, "Projection mg", "Map & Guide", "/ui/MenuBar/Map/Projection/ProjectionMenuAdditions", data, &this->projection_group); + + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_projection; + data->attr.u.projection=projection_garmin; + gui_gtk_add_radio_menu(this, "Projection garmin", "Garmin", "/ui/MenuBar/Map/Projection/ProjectionMenuAdditions", data, &this->projection_group); + } + + static void + gui_gtk_vehicles_init(struct gui_priv *this) + { + struct attr_iter *iter; + struct attr attr,vattr; + struct action_cb_data *data; + int count=0; + char *name; + + iter=navit_attr_iter_new(); + while(navit_get_attr(this->nav, attr_vehicle, &attr, iter)) { + vehicle_get_attr(attr.u.vehicle, attr_name, &vattr); + name=g_strdup_printf("Vehicle %d", count++); + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_vehicle; + data->attr.u.vehicle=attr.u.vehicle; + gui_gtk_add_radio_menu(this, name, vattr.u.str, "/ui/MenuBar/Map/Vehicle/VehicleMenuAdditions", data, &this->vehicle_group); + g_free(name); + } + navit_attr_iter_destroy(iter); + } + + static void + gui_gtk_maps_init(struct gui_priv *this) + { + struct attr_iter *iter; + struct attr attr; + struct action_cb_data *data; + int count=0; + char *name, *label; + + iter=navit_attr_iter_new(); + while(navit_get_attr(this->nav, attr_map, &attr, iter)) { + name=g_strdup_printf("Map %d", count++); + label=g_strdup_printf("%s:%s", map_get_type(attr.u.map), map_get_filename(attr.u.map)); + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_map; + data->attr.u.map=attr.u.map; + gui_gtk_add_toggle_menu(this, name, label, "/ui/MenuBar/Map/MapMenuAdditions", data, map_get_active(attr.u.map)); + g_free(name); + g_free(label); + } + navit_attr_iter_destroy(iter); + + } + + static void + gui_gtk_destinations_init(struct gui_priv *this) + { + struct action_cb_data *data; + + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_destination; + data->attr.u.pcoord=g_new(struct pcoord, 1); + data->attr.u.pcoord->pro=projection_mg; + data->attr.u.pcoord->x=0x13a3e2; + data->attr.u.pcoord->y=0x5d6d6a; + gui_gtk_add_menu(this, "Destination 1", "Muenchen","/ui/MenuBar/Route/FormerDestinations/FormerDestinationMenuAdditions",data); + } + + static void + gui_gtk_bookmarks_init(struct gui_priv *this) + { + struct action_cb_data *data; + + data=g_new(struct action_cb_data, 1); + data->gui=this; + data->attr.type=attr_destination; + data->attr.u.pcoord=g_new(struct pcoord, 1); + data->attr.u.pcoord->pro=projection_mg; + data->attr.u.pcoord->x=0x13a3e2; + data->attr.u.pcoord->y=0x5d6d6a; + gui_gtk_add_menu(this, "Bookmark 1", "Muenchen","/ui/MenuBar/Route/Bookmarks/BookmarkMenuAdditions",data); + } + + static void + gui_gtk_init(struct gui_priv *this, struct navit *nav) + { + GtkWidget *widget; + + gui_gtk_ui_init(this); + + gui_gtk_toggle_init(this); + if (this->menubar_enable) { + widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/MenuBar"); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); + gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + } + if (this->toolbar_enable) { + widget=gtk_ui_manager_get_widget(this->ui_manager, "/ui/ToolBar"); + GTK_WIDGET_UNSET_FLAGS (widget, GTK_CAN_FOCUS); + gtk_box_pack_start (GTK_BOX(this->vbox), widget, FALSE, FALSE, 0); + gtk_widget_show (widget); + } + if (this->statusbar_enable) { + this->statusbar=gui_gtk_statusbar_new(this); + } + gui_gtk_layouts_init(this); + gui_gtk_projections_init(this); + gui_gtk_vehicles_init(this); + gui_gtk_maps_init(this); + gui_gtk_destinations_init(this); + gui_gtk_bookmarks_init(this); + } + static struct gui_priv * gui_gtk_new(struct navit *nav, struct gui_methods *meth, struct attr **attrs) *************** *** 191,195 **** char *cp = getenv("NAVIT_XID"); unsigned xid = 0; ! struct attr *menubar, *toolbar, *statusbar; if (cp) { --- 439,443 ---- char *cp = getenv("NAVIT_XID"); unsigned xid = 0; ! struct attr *attr; if (cp) { *************** *** 197,216 **** } ! menubar = attr_search(attrs, NULL, attr_menubar); ! if (menubar && menubar->u.num == 0) { ! gui_gtk_methods.menubar_new = NULL; } ! toolbar = attr_search(attrs, NULL, attr_toolbar); ! if (toolbar && toolbar->u.num == 0) { ! gui_gtk_methods.toolbar_new = NULL; } ! statusbar = attr_search(attrs, NULL, attr_statusbar); ! if (statusbar && statusbar->u.num == 0) { ! gui_gtk_methods.statusbar_new = NULL; } *meth=gui_gtk_methods; - this=g_new0(struct gui_priv, 1); - this->nav=nav; if (!xid) this->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); --- 445,472 ---- } ! this=g_new0(struct gui_priv, 1); ! this->nav=nav; ! ! attr = attr_search(attrs, NULL, attr_menubar); ! if (attr) { ! this->menubar_enable=attr->u.num; ! } else { ! this->menubar_enable=1; } ! attr=attr_search(attrs, NULL, attr_toolbar); ! if (attr) { ! this->toolbar_enable=attr->u.num; ! } else { ! this->toolbar_enable=1; } ! attr=attr_search(attrs, NULL, attr_statusbar); ! if (attr) { ! this->statusbar_enable=attr->u.num; ! } else { ! this->statusbar_enable=1; } + *meth=gui_gtk_methods; if (!xid) this->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); *************** *** 226,229 **** --- 482,487 ---- gtk_widget_show_all(this->win); + + navit_add_callback(nav, callback_new_attr_1(callback_cast(gui_gtk_init), attr_navit, this)); return this; } Index: gui_gtk.h =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gui_gtk.h 25 Nov 2007 01:32:14 -0000 1.8 --- gui_gtk.h 17 Mar 2008 23:46:40 -0000 1.9 *************** *** 1,9 **** #include "coord.h" - struct statusbar_methods; struct menu_methods; struct datawindow_methods; struct navit; struct callback; struct gui_priv { --- 1,9 ---- #include "coord.h" struct menu_methods; struct datawindow_methods; struct navit; struct callback; + struct statusbar_priv; struct gui_priv { *************** *** 18,29 **** GtkActionGroup *debug_group; GtkActionGroup *dyn_group; ! GtkUIManager *menu_manager; ! void *statusbar; int dyn_counter; }; struct menu_priv *gui_gtk_menubar_new(struct gui_priv *gui, struct menu_methods *meth); ! struct menu_priv *gui_gtk_toolbar_new(struct gui_priv *gui, struct menu_methods *meth); ! struct statusbar_priv *gui_gtk_statusbar_new(struct gui_priv *gui, struct statusbar_methods *meth); struct menu_priv *gui_gtk_popup_new(struct gui_priv *gui, struct menu_methods *meth); struct datawindow_priv *gui_gtk_datawindow_new(struct gui_priv *gui, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth); --- 18,36 ---- GtkActionGroup *debug_group; GtkActionGroup *dyn_group; ! GtkUIManager *ui_manager; ! GSList *layout_group; ! GSList *projection_group; ! GSList *vehicle_group; ! GtkUIManager *menu_manager; // old ! struct statusbar_priv *statusbar; ! int menubar_enable; ! int toolbar_enable; ! int statusbar_enable; int dyn_counter; }; + void gui_gtk_ui_init(struct gui_priv *this); struct menu_priv *gui_gtk_menubar_new(struct gui_priv *gui, struct menu_methods *meth); ! struct statusbar_priv *gui_gtk_statusbar_new(struct gui_priv *gui); struct menu_priv *gui_gtk_popup_new(struct gui_priv *gui, struct menu_methods *meth); struct datawindow_priv *gui_gtk_datawindow_new(struct gui_priv *gui, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth); |
From: Michael F. <ho...@us...> - 2008-03-17 23:46:40
|
Update of /cvsroot/navit/navit/src/gui/sdl In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16393/src/gui/sdl Modified Files: gui_sdl.h gui_sdl_window.cpp Log Message: Core:Fix:Cleanup and reorganisation of gui_gtk centric code. Index: gui_sdl.h =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/gui_sdl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gui_sdl.h 3 Dec 2007 20:50:17 -0000 1.4 --- gui_sdl.h 17 Mar 2008 23:46:41 -0000 1.5 *************** *** 5,9 **** - struct statusbar_methods; struct menu_methods; struct navit; --- 5,8 ---- *************** *** 16,27 **** struct gui_priv { - /* - GtkWidget *win; - GtkWidget *vbox; - GtkActionGroup *base_group; - GtkActionGroup *debug_group; - GtkActionGroup *dyn_group; - GtkUIManager *menu_manager; - void *statusbar;*/ struct navit *nav; int dyn_counter; --- 15,18 ---- Index: gui_sdl_window.cpp =================================================================== RCS file: /cvsroot/navit/navit/src/gui/sdl/gui_sdl_window.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** gui_sdl_window.cpp 19 Feb 2008 13:04:14 -0000 1.52 --- gui_sdl_window.cpp 17 Mar 2008 23:46:41 -0000 1.53 *************** *** 410,424 **** } - static struct menu_priv * - gui_sdl_toolbar_new(struct gui_priv *this_, struct menu_methods *meth) - { - return NULL; //gui_gtk_ui_new(this_, meth, "/ui/ToolBar", nav, 0); - } - - static struct statusbar_priv * - gui_sdl_statusbar_new(struct gui_priv *gui, struct statusbar_methods *meth) - { - return NULL; //gui_gtk_ui_new(this_, meth, "/ui/ToolBar", nav, 0); - } static struct menu_priv * --- 410,413 ---- *************** *** 437,442 **** struct gui_methods gui_sdl_methods = { gui_sdl_menubar_new, - gui_sdl_toolbar_new, - gui_sdl_statusbar_new, gui_sdl_popup_new, gui_sdl_set_graphics, --- 426,429 ---- *************** *** 751,755 **** int sats=0, sats_used=0; ! if (vehicle_position_attr_get(v, attr_position_speed, &attr)) sprintf (buffer, "%02.02f km/h", *attr.u.numd); else --- 738,742 ---- int sats=0, sats_used=0; ! if (vehicle_get_attr(v, attr_position_speed, &attr)) sprintf (buffer, "%02.02f km/h", *attr.u.numd); else *************** *** 757,761 **** CEGUI::WindowManager::getSingleton().getWindow("OSD/SpeedoMeter")->setText(buffer); ! if (vehicle_position_attr_get(v, attr_position_height, &attr)) sprintf (buffer, "%.f m", *attr.u.numd); else --- 744,748 ---- CEGUI::WindowManager::getSingleton().getWindow("OSD/SpeedoMeter")->setText(buffer); ! if (vehicle_get_attr(v, attr_position_height, &attr)) sprintf (buffer, "%.f m", *attr.u.numd); else *************** *** 763,769 **** CEGUI::WindowManager::getSingleton().getWindow("OSD/Altimeter")->setText(buffer); ! if (vehicle_position_attr_get(v, attr_position_sats, &attr)) sats=attr.u.num; ! if (vehicle_position_attr_get(v, attr_position_sats_used, &attr)) sats_used=attr.u.num; // printf(" sats : %i, used %i: \n",sats,sats_used); --- 750,756 ---- CEGUI::WindowManager::getSingleton().getWindow("OSD/Altimeter")->setText(buffer); ! if (vehicle_get_attr(v, attr_position_sats, &attr)) sats=attr.u.num; ! if (vehicle_get_attr(v, attr_position_sats_used, &attr)) sats_used=attr.u.num; // printf(" sats : %i, used %i: \n",sats,sats_used); |
From: Michael F. <ho...@us...> - 2008-03-17 23:46:40
|
Update of /cvsroot/navit/navit/src/osd/core In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16393/src/osd/core Modified Files: osd_core.c Log Message: Core:Fix:Cleanup and reorganisation of gui_gtk centric code. Index: osd_core.c =================================================================== RCS file: /cvsroot/navit/navit/src/osd/core/osd_core.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** osd_core.c 29 Feb 2008 12:58:43 -0000 1.9 --- osd_core.c 17 Mar 2008 23:46:41 -0000 1.10 *************** *** 101,109 **** p.y=30; graphics_draw_circle(this->gr, this->white, &p, 50); ! if (v && vehicle_position_attr_get(v, attr_position_direction, &attr_dir)) { vdir=*attr_dir.u.numd; handle(this->gr, this->white, &p, 20, -vdir); } ! if (navit_get_attr(nav, attr_destination, &destination_attr) && v && vehicle_position_attr_get(v, attr_position_coord_geo, &position_attr)) { pro=destination_attr.u.pcoord->pro; transform_from_geo(pro, position_attr.u.coord_geo, &c1); --- 101,109 ---- p.y=30; graphics_draw_circle(this->gr, this->white, &p, 50); ! if (v && vehicle_get_attr(v, attr_position_direction, &attr_dir)) { vdir=*attr_dir.u.numd; handle(this->gr, this->white, &p, 20, -vdir); } ! if (navit_get_attr(nav, attr_destination, &destination_attr, NULL) && v && vehicle_get_attr(v, attr_position_coord_geo, &position_attr)) { pro=destination_attr.u.pcoord->pro; transform_from_geo(pro, position_attr.u.coord_geo, &c1); |