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-01-02 20:43:48
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21053/gui/gtk Modified Files: gui_gtk_action.c Log Message: Add:Gtk:Use navit_set_attr instead of navit_toggle_* Index: gui_gtk_action.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_action.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** gui_gtk_action.c 2 Jan 2008 19:31:17 -0000 1.26 --- gui_gtk_action.c 2 Jan 2008 20:43:52 -0000 1.27 *************** *** 56,60 **** cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! navit_toggle_cursor(gui->nav); } --- 56,66 ---- cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! struct attr attr; ! ! attr.type=attr_cursor; ! attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); ! if(!navit_set_attr(gui->nav, &attr)) { ! dbg(0, "Failed to set attr_cursor\n"); ! } } *************** *** 62,66 **** tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! navit_toggle_tracking(gui->nav); } --- 68,78 ---- tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! struct attr attr; ! ! attr.type=attr_tracking; ! attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); ! if(!navit_set_attr(gui->nav, &attr)) { ! dbg(0, "Failed to set attr_tracking\n"); ! } } *************** *** 68,72 **** orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! navit_toggle_orient_north(gui->nav); } --- 80,90 ---- orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy) { ! struct attr attr; ! ! attr.type=attr_orientation; ! attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); ! if(!navit_set_attr(gui->nav, &attr)) { ! dbg(0, "Failed to set attr_orientation\n"); ! } } |
From: Michael F. <ho...@us...> - 2008-01-02 19:31:16
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21372 Modified Files: navit.c Log Message: Fix:Gtk:Set ToggleActions acording to attributes. Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** navit.c 2 Jan 2008 15:33:41 -0000 1.64 --- navit.c 2 Jan 2008 19:31:17 -0000 1.65 *************** *** 1183,1187 **** --- 1183,1190 ---- } transform_set_angle(this_->trans, dir); + #if 0 + /* FIXME check if we are ready for this. */ navit_draw(this_); + #endif } |
From: Michael F. <ho...@us...> - 2008-01-02 19:31:14
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21372/gui/gtk Modified Files: gui_gtk_action.c Log Message: Fix:Gtk:Set ToggleActions acording to attributes. Index: gui_gtk_action.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_action.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** gui_gtk_action.c 28 Dec 2007 10:03:42 -0000 1.25 --- gui_gtk_action.c 2 Jan 2008 19:31:17 -0000 1.26 *************** *** 5,8 **** --- 5,10 ---- #include "menu.h" #include "coord.h" + #include "item.h" + #include "attr.h" #include "callback.h" #include "debug.h" *************** *** 494,497 **** --- 496,501 ---- GError *error; GtkWidget *widget; + struct attr attr; + GtkToggleAction *toggle_action; *meth=menu_methods; *************** *** 520,523 **** --- 524,545 ---- 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); |
From: Michael F. <ho...@us...> - 2008-01-02 15:33:43
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29500 Modified Files: navit.c Log Message: Fix:Core:Only redraw map in navit_set_attr when orientation was actually changed Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** navit.c 2 Jan 2008 00:16:25 -0000 1.63 --- navit.c 2 Jan 2008 15:33:41 -0000 1.64 *************** *** 1189,1193 **** navit_set_attr(struct navit *this_, struct attr *attr) { ! int dir = 0; switch (attr->type) { --- 1189,1193 ---- navit_set_attr(struct navit *this_, struct attr *attr) { ! int dir=0, orient_old=0; switch (attr->type) { *************** *** 1199,1202 **** --- 1199,1203 ---- break; case attr_orientation: + orient_old=this_->orient_north_flag; this_->orient_north_flag=!!attr->u.num; if (this_->orient_north_flag) { *************** *** 1208,1212 **** } transform_set_angle(this_->trans, dir); ! navit_draw(this_); break; default: --- 1209,1215 ---- } transform_set_angle(this_->trans, dir); ! if (orient_old != this_->orient_north_flag) { ! navit_draw(this_); ! } break; default: |
From: Martin S. <mar...@us...> - 2008-01-02 13:47:30
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26505 Modified Files: osm2navit.c Log Message: Fix:Tools:Open files in binary mode for win32 Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** osm2navit.c 1 Jan 2008 23:08:39 -0000 1.21 --- osm2navit.c 2 Jan 2008 13:47:33 -0000 1.22 *************** *** 721,725 **** { FILE *f; ! f=fopen64(filename,"w+"); fwrite(b->base, b->size, 1, f); fclose(f); --- 721,725 ---- { FILE *f; ! f=fopen64(filename,"wb+"); fwrite(b->base, b->size, 1, f); fclose(f); *************** *** 733,737 **** free(b->base); b->malloced=0; ! f=fopen64(filename,"r"); fseek(f, 0, SEEK_END); b->size=b->malloced=ftell(f); --- 733,737 ---- free(b->base); b->malloced=0; ! f=fopen64(filename,"rb"); fseek(f, 0, SEEK_END); b->size=b->malloced=ftell(f); *************** *** 1034,1038 **** strcat(buffer,".bin"); #endif ! f=fopen64(buffer, "w+"); while (th) { fwrite(th->data, th->size, 1, f); --- 1034,1038 ---- strcat(buffer,".bin"); #endif ! f=fopen64(buffer, "wb+"); while (th) { fwrite(th->data, th->size, 1, f); *************** *** 1761,1767 **** if (start == 1) { if (process_ways) ! ways=fopen64("ways.tmp","w+"); if (process_nodes) ! nodes=fopen64("nodes.tmp","w+"); phase=1; fprintf(stderr,"PROGRESS: Phase 1: collecting data\n"); --- 1761,1767 ---- if (start == 1) { if (process_ways) ! ways=fopen64("ways.tmp","wb+"); if (process_nodes) ! nodes=fopen64("nodes.tmp","wb+"); phase=1; fprintf(stderr,"PROGRESS: Phase 1: collecting data\n"); *************** *** 1780,1785 **** if (start <= 2) { if (process_ways) { ! ways=fopen64("ways.tmp","r"); ! ways_split=fopen64("ways_split.tmp","w+"); phase=2; fprintf(stderr,"PROGRESS: Phase 2: finding intersections\n"); --- 1780,1785 ---- if (start <= 2) { if (process_ways) { ! ways=fopen64("ways.tmp","rb"); ! ways_split=fopen64("ways_split.tmp","wb+"); phase=2; fprintf(stderr,"PROGRESS: Phase 2: finding intersections\n"); *************** *** 1802,1809 **** fprintf(stderr,"PROGRESS: Phase 3: generating tiles\n"); if (process_ways) ! ways_split=fopen64("ways_split.tmp","r"); if (process_nodes) ! nodes=fopen64("nodes.tmp","r"); ! tilesdir=fopen64("tilesdir.tmp","w+"); phase3(ways_split,nodes,tilesdir); fclose(tilesdir); --- 1802,1809 ---- fprintf(stderr,"PROGRESS: Phase 3: generating tiles\n"); if (process_ways) ! ways_split=fopen64("ways_split.tmp","rb"); if (process_nodes) ! nodes=fopen64("nodes.tmp","rb"); ! tilesdir=fopen64("tilesdir.tmp","wb+"); phase3(ways_split,nodes,tilesdir); fclose(tilesdir); *************** *** 1819,1827 **** fprintf(stderr,"PROGRESS: Phase 4: assembling map\n"); if (process_ways) ! ways_split=fopen64("ways_split.tmp","r"); if (process_nodes) ! nodes=fopen64("nodes.tmp","r"); ! res=fopen64(result,"w+"); ! zipdir=fopen64("zipdir.tmp","w+"); phase4(ways_split,nodes,res,zipdir,compression_level); fclose(zipdir); --- 1819,1827 ---- fprintf(stderr,"PROGRESS: Phase 4: assembling map\n"); if (process_ways) ! ways_split=fopen64("ways_split.tmp","rb"); if (process_nodes) ! nodes=fopen64("nodes.tmp","rb"); ! res=fopen64(result,"wb+"); ! zipdir=fopen64("zipdir.tmp","wb+"); phase4(ways_split,nodes,res,zipdir,compression_level); fclose(zipdir); |
From: Michael F. <ho...@us...> - 2008-01-02 00:16:22
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15269/src Modified Files: attr_def.h navit.c navit.h navit.xml Log Message: Add:Core:Incomplete support for attributes instead of toggle flags Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** navit.xml 20 Dec 2007 21:17:44 -0000 1.21 --- navit.xml 2 Jan 2008 00:16:25 -0000 1.22 *************** *** 13,17 **** Change to your home coordinates. --> ! <navit center="4808 N 1134 E" zoom="256" > <gui type="gtk" /> <graphics type="gtk_drawing_area" /> --- 13,17 ---- Change to your home coordinates. --> ! <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0"> <gui type="gtk" /> <graphics type="gtk_drawing_area" /> Index: navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/navit.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** navit.h 1 Jan 2008 20:44:40 -0000 1.24 --- navit.h 2 Jan 2008 00:16:25 -0000 1.25 *************** *** 8,11 **** --- 8,12 ---- /* prototypes */ enum item_type; + enum attr_type; struct attr; struct callback; *************** *** 64,67 **** --- 65,70 ---- void navit_toggle_tracking(struct navit *this_); void navit_toggle_orient_north(struct navit *this_); + int navit_set_attr(struct navit *this_, struct attr *attr); + int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr); void navit_set_position(struct navit *this_, struct pcoord *c); struct navit_vehicle *navit_add_vehicle(struct navit *this_, struct vehicle *v, struct attr **attrs); Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** navit.c 1 Jan 2008 22:13:02 -0000 1.62 --- navit.c 2 Jan 2008 00:16:25 -0000 1.63 *************** *** 337,353 **** this_->bookmarks_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); ! for (;*attrs; attrs++) { ! switch((*attrs)->type) { case attr_zoom: ! zoom = (*attrs)->u.num; ! break; case attr_center: ! g=*((*attrs)->u.coord_geo); ! break; default: ! dbg(0, "Unexpected attribute %x\n",(*attrs)->type); ! break; ! } } transform_from_geo(pro, &g, &co); --- 337,365 ---- this_->bookmarks_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); ! this_->cursor_flag=1; ! this_->orient_north_flag=0; ! this_->tracking_flag=1; ! for (;*attrs; attrs++) { ! switch((*attrs)->type) { case attr_zoom: ! zoom=(*attrs)->u.num; ! break; case attr_center: ! g=*((*attrs)->u.coord_geo); ! break; ! case attr_cursor: ! this_->cursor_flag=!!(*attrs)->u.num; ! break; ! case attr_orientation: ! this_->orient_north_flag=!!(*attrs)->u.num; ! break; ! case attr_tracking: ! this_->tracking_flag=!!(*attrs)->u.num; ! break; default: ! dbg(0, "Unexpected attribute %x\n",(*attrs)->type); ! break; ! } } transform_from_geo(pro, &g, &co); *************** *** 356,362 **** center.pro = pro; - dbg(0,"zoom=%d, coords x=%d, y=%d\n",zoom, center.x, center.y); - this_->cursor_flag=1; - this_->tracking_flag=1; this_->trans=transform_new(); transform_setup(this_->trans, ¢er, zoom, 0); --- 368,371 ---- *************** *** 1177,1180 **** --- 1186,1239 ---- } + int + navit_set_attr(struct navit *this_, struct attr *attr) + { + int dir = 0; + + switch (attr->type) { + case attr_cursor: + this_->cursor_flag=!!attr->u.num; + break; + case attr_tracking: + this_->tracking_flag=!!attr->u.num; + break; + case attr_orientation: + this_->orient_north_flag=!!attr->u.num; + if (this_->orient_north_flag) { + dir = 0; + } else { + if (this_->vehicle) { + dir = this_->vehicle->dir; + } + } + transform_set_angle(this_->trans, dir); + navit_draw(this_); + break; + default: + return 0; + } + return 1; + } + + int + navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr) + { + switch (type) { + case attr_cursor: + 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; + default: + return 0; + } + attr->type=type; + return 1; + } + /** * Toggle the cursor update : refresh the map each time the cursor has moved (instead of only when it reaches a border) Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** attr_def.h 1 Jan 2008 22:13:02 -0000 1.23 --- attr_def.h 2 Jan 2008 00:16:25 -0000 1.24 *************** *** 41,44 **** --- 41,47 ---- ATTR(overwrite) ATTR(active) + ATTR(cursor) + ATTR(orientation) + ATTR(tracking) ATTR2(0x0002ffff,type_int_end) ATTR2(0x00030000,type_string_begin) |
From: Martin S. <mar...@us...> - 2008-01-01 23:23:33
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29373 Modified Files: configure.in Log Message: Add:Core:Incomplete support for statically linked modules Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** configure.in 25 Dec 2007 13:38:31 -0000 1.64 --- configure.in 1 Jan 2008 23:23:37 -0000 1.65 *************** *** 21,25 **** PKG_CHECK_EXISTS ! AC_DISABLE_STATIC AC_PROG_LIBTOOL --- 21,39 ---- PKG_CHECK_EXISTS ! AC_ARG_ENABLE(plugins, [ --disable-plugins disable plugins], ! [ ! AC_DISABLE_SHARED ! AC_ENABLE_STATIC ! ], ! [ ! AC_ENABLE_SHARED ! AC_DISABLE_STATIC ! AC_DEFINE( ! [HAVE_PLUGIN], ! [], ! Define to 1 if you have plugins. ! ) ! ] ! ) AC_PROG_LIBTOOL |
From: Martin S. <mar...@us...> - 2008-01-01 23:08:35
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22858 Modified Files: osm2navit.c Log Message: Fix:Tools:Fixed a buffer overflow with relations in osm2navit Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** osm2navit.c 1 Jan 2008 22:32:02 -0000 1.20 --- osm2navit.c 1 Jan 2008 23:08:39 -0000 1.21 *************** *** 613,616 **** --- 613,623 ---- } + static int + parse_relation(char *p) + { + debug_attr_buffer[0]='\0'; + return 1; + } + static void write_attr(FILE *out, struct attr_bin *attr, void *buffer) *************** *** 771,774 **** --- 778,783 ---- } else if (!strncmp(p, "<relation ",10)) { in_relation=1; + if (!parse_relation(p)) + fprintf(stderr,"WARNING: failed to parse %s\n", buffer); processed_relations++; } else if (!strncmp(p, "<member ",8)) { |
From: Martin S. <mar...@us...> - 2008-01-01 22:32:00
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6655 Modified Files: osm2navit.c Log Message: Fix:Tools:Added patch from afaber (Thanks!) about wrong usage of hash table Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** osm2navit.c 17 Dec 2007 21:47:19 -0000 1.19 --- osm2navit.c 1 Jan 2008 22:32:02 -0000 1.20 *************** *** 385,389 **** fprintf(stderr,"Unknown %s %d value of '%s' '%s'\n", in_way ? "way" : "node", in_way ? wayid:nodeid, k, v); type=in_way ? type_street_unkn : type_point_unkn; ! g_hash_table_insert(value_hash, v, (gpointer)item.type); } if (type != type_street_unkn && type != type_point_unkn) --- 385,389 ---- fprintf(stderr,"Unknown %s %d value of '%s' '%s'\n", in_way ? "way" : "node", in_way ? wayid:nodeid, k, v); type=in_way ? type_street_unkn : type_point_unkn; ! g_hash_table_insert(value_hash, g_strdup(v), (gpointer)item.type); } if (type != type_street_unkn && type != type_point_unkn) |
From: Martin S. <mar...@us...> - 2008-01-01 22:13:00
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31334 Modified Files: attr.c attr_def.h callback.c main.c navit.c route.c route.h Log Message: Fix:Core:Improved some internal stuff Index: attr.c =================================================================== RCS file: /cvsroot/navit/navit/src/attr.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** attr.c 26 Dec 2007 10:39:48 -0000 1.12 --- attr.c 1 Jan 2008 22:13:02 -0000 1.13 *************** *** 64,73 **** ret->u.item_type=item_from_name(value); break; - case attr_position_coord_geo: - g=g_new(struct coord_geo, 1); - ret->u.coord_geo=g; - coord_parse(value, projection_mg, &c); - transform_to_geo(projection_mg, &c, g); - break; default: if (attr >= attr_type_string_begin && attr <= attr_type_string_end) { --- 64,67 ---- *************** *** 100,103 **** --- 94,104 ---- break; } + if (attr >= attr_type_coord_geo_start && attr <= attr_type_coord_geo_end) { + g=g_new(struct coord_geo, 1); + ret->u.coord_geo=g; + coord_parse(value, projection_mg, &c); + transform_to_geo(projection_mg, &c, g); + break; + } dbg(1,"default\n"); g_free(ret); Index: route.h =================================================================== RCS file: /cvsroot/navit/navit/src/route.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** route.h 29 Dec 2007 10:55:13 -0000 1.16 --- route.h 1 Jan 2008 22:13:02 -0000 1.17 *************** *** 75,78 **** --- 75,79 ---- void route_draw(struct route *this, struct transformation *t, struct displaylist *dsp); struct map *route_get_map(struct route *route); + struct map *route_get_graph_map(struct route *route); void route_toggle_routegraph_display(struct route *route); void route_init(void); Index: callback.c =================================================================== RCS file: /cvsroot/navit/navit/src/callback.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** callback.c 1 Jan 2008 20:06:24 -0000 1.8 --- callback.c 1 Jan 2008 22:13:02 -0000 1.9 *************** *** 145,149 **** while (cbi) { cb=cbi->data; ! if (type == attr_any || cb->type == type) callback_call(cb, pcount, p); cbi=g_list_next(cbi); --- 145,149 ---- while (cbi) { cb=cbi->data; ! if (type == attr_any || cb->type == attr_any || cb->type == type) callback_call(cb, pcount, p); cbi=g_list_next(cbi); Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** route.c 29 Dec 2007 15:25:51 -0000 1.35 --- route.c 1 Jan 2008 22:13:02 -0000 1.36 *************** *** 100,103 **** --- 100,105 ---- struct route_graph *graph; struct route_path *path2; + struct map *map; + struct map *graph_map; int speedlist[route_item_last-route_item_first+1]; }; *************** *** 1651,1654 **** --- 1653,1681 ---- } + static struct map * + route_get_map_helper(struct route *this_, struct map **map, char *type) + { + struct attr route_attr={.type=attr_route,.u.route=this_}; + struct attr data_attr={.type=attr_data,.u.str=""}; + struct attr *attrs_route[]={&route_attr, &data_attr, NULL}; + + if (! *map) + *map=map_new(type,attrs_route); + return *map; + } + + struct map * + route_get_map(struct route *this_) + { + return route_get_map_helper(this_, &this_->map, "route"); + } + + + struct map * + route_get_graph_map(struct route *this_) + { + return route_get_map_helper(this_, &this_->graph_map, "route_graph"); + } + Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** attr_def.h 1 Jan 2008 20:44:40 -0000 1.22 --- attr_def.h 1 Jan 2008 22:13:02 -0000 1.23 *************** *** 11,15 **** ATTR(street_item) ATTR(street_number_item) ! ATTR(item_type) ATTR2(0x0001ffff,type_item_end) --- 11,15 ---- ATTR(street_item) ATTR(street_number_item) ! ATTR(item_type) /* fixme */ ATTR2(0x0001ffff,type_item_end) *************** *** 65,69 **** ATTR(skin) ATTR(fullscreen) - ATTR(center) ATTR(view_mode) ATTR(tilt) --- 65,68 ---- *************** *** 90,93 **** --- 89,93 ---- ATTR2(0x00060000,type_coord_geo_start) ATTR(position_coord_geo) + ATTR(center) ATTR2(0x0006ffff,type_coord_geo_end) ATTR2(0x00070000,type_color_begin) Index: main.c =================================================================== RCS file: /cvsroot/navit/navit/src/main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** main.c 28 Dec 2007 10:04:39 -0000 1.20 --- main.c 1 Jan 2008 22:13:02 -0000 1.21 *************** *** 3,6 **** --- 3,7 ---- #include <stdio.h> #include <string.h> + #include <signal.h> #include <glib.h> #include <sys/types.h> Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** navit.c 1 Jan 2008 20:44:40 -0000 1.61 --- navit.c 1 Jan 2008 22:13:02 -0000 1.62 *************** *** 72,77 **** struct menu *menubar; struct route *route; - struct map *route_map; - struct map *route_graph_map; struct navigation *navigation; struct speech *speech; --- 72,75 ---- *************** *** 317,323 **** --- 315,324 ---- struct pcoord center; struct coord co; + struct coord_geo g; enum projection pro=projection_mg; int zoom = 256; FILE *f; + g.lat=53.13; + g.lng=11.70; main_add_navit(this_); *************** *** 337,343 **** - center.x=1300000; - center.y=7000000; - center.pro = pro; for (;*attrs; attrs++) { switch((*attrs)->type) { --- 338,341 ---- *************** *** 346,353 **** break; case attr_center: ! if (coord_parse((*attrs)->u.str, center.pro, &co)) { ! center.x=co.x; ! center.y=co.y; ! } break; default: --- 344,348 ---- break; case attr_center: ! g=*((*attrs)->u.coord_geo); break; default: *************** *** 356,359 **** --- 351,358 ---- } } + transform_from_geo(pro, &g, &co); + center.x=co.x; + center.y=co.y; + center.pro = pro; dbg(0,"zoom=%d, coords x=%d, y=%d\n",zoom, center.x, center.y); *************** *** 1014,1017 **** --- 1013,1017 ---- struct menu *men; struct mapset *ms; + struct map *map; GList *l; struct navit_vehicle *nv; *************** *** 1049,1058 **** if (this_->mapsets) { ms=this_->mapsets->data; ! if (this_->route_map) ! mapset_add(ms, this_->route_map); ! if (this_->route_graph_map) ! mapset_add(ms, this_->route_graph_map); ! if (this_->route) route_set_mapset(this_->route, ms); if (this_->tracking) tracking_set_mapset(this_->tracking, ms); --- 1049,1061 ---- if (this_->mapsets) { ms=this_->mapsets->data; ! if (this_->route) { ! if ((map=route_get_map(this_->route))) ! mapset_add(ms, map); ! if ((map=route_get_graph_map(this_->route))) { ! mapset_add(ms, map); ! map_set_active(map, 0); ! } route_set_mapset(this_->route, ms); + } if (this_->tracking) tracking_set_mapset(this_->tracking, ms); *************** *** 1371,1388 **** navit_route_add(struct navit *this_, struct route *route) { - struct attr route_attr={.type=attr_route,.u.route=route}; - struct attr data_attr={.type=attr_data,.u.str=""}; - struct attr *attrs_route[]={&route_attr, &data_attr, NULL}; - struct attr *attrs_route_graph[]={&route_attr, &data_attr, NULL}; this_->route=route; - this_->route_map=map_new("route",attrs_route); - this_->route_graph_map=map_new("route_graph",attrs_route_graph); - map_set_active(this_->route_graph_map, 0); - } - - struct map * - navit_get_route_map(struct navit *this_) - { - return this_->route_map; } --- 1374,1378 ---- |
From: Martin S. <mar...@us...> - 2008-01-01 22:13:00
|
Update of /cvsroot/navit/navit/src/vehicle/demo In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31334/vehicle/demo Modified Files: vehicle_demo.c Log Message: Fix:Core:Improved some internal stuff Index: vehicle_demo.c =================================================================== RCS file: /cvsroot/navit/navit/src/vehicle/demo/vehicle_demo.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** vehicle_demo.c 29 Dec 2007 10:23:48 -0000 1.7 --- vehicle_demo.c 1 Jan 2008 22:13:02 -0000 1.8 *************** *** 72,75 **** --- 72,76 ---- struct coord c, c2, pos, ci; int slen, len, dx, dy; + struct route *route=NULL; struct map *route_map=NULL; struct map_rect *mr=NULL; *************** *** 78,86 **** len = (priv->config_speed * priv->interval / 1000)/ 3.6; dbg(1, "###### Entering simulation loop\n"); ! if (!priv->navit) { ! dbg(1, "vehicle->navit is not set. Can't simulate\n"); ! return 1; ! } ! route_map=navit_get_route_map(priv->navit); if (route_map) mr=map_rect_new(route_map, NULL); --- 79,86 ---- len = (priv->config_speed * priv->interval / 1000)/ 3.6; dbg(1, "###### Entering simulation loop\n"); ! if (priv->navit) ! route=navit_get_route(priv->navit); ! if (route) ! route_map=route_get_map(route); if (route_map) mr=map_rect_new(route_map, NULL); |
From: Michael F. <ho...@us...> - 2008-01-01 20:44:39
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28660 Modified Files: attr_def.h navit.c navit.h xmlconfig.c Log Message: Change navit_new to use attributes Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** attr_def.h 28 Dec 2007 10:45:39 -0000 1.21 --- attr_def.h 1 Jan 2008 20:44:40 -0000 1.22 *************** *** 36,39 **** --- 36,40 ---- ATTR(interval) ATTR(position_qual) + ATTR(zoom) ATTR2(0x00028000,type_boolean_begin) /* boolean */ *************** *** 64,67 **** --- 65,69 ---- ATTR(skin) ATTR(fullscreen) + ATTR(center) ATTR(view_mode) ATTR(tilt) Index: navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/navit.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** navit.h 28 Dec 2007 10:04:39 -0000 1.23 --- navit.h 1 Jan 2008 20:44:40 -0000 1.24 *************** *** 36,40 **** void navit_zoom_in(struct navit *this_, int factor, struct point *p); void navit_zoom_out(struct navit *this_, int factor, struct point *p); ! struct navit *navit_new(struct pcoord *center, int zoom); void navit_set_gui(struct navit *this_, struct gui *gui, char *type); void navit_set_graphics(struct navit *this_, struct graphics *gra, char *type); --- 36,40 ---- void navit_zoom_in(struct navit *this_, int factor, struct point *p); void navit_zoom_out(struct navit *this_, int factor, struct point *p); ! struct navit *navit_new(struct attr **attrs); void navit_set_gui(struct navit *this_, struct gui *gui, char *type); void navit_set_graphics(struct navit *this_, struct graphics *gra, char *type); Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** navit.c 1 Jan 2008 13:59:42 -0000 1.60 --- navit.c 1 Jan 2008 20:44:40 -0000 1.61 *************** *** 312,318 **** struct navit * ! navit_new(struct pcoord *center, int zoom) { struct navit *this_=g_new0(struct navit, 1); FILE *f; --- 312,322 ---- struct navit * ! navit_new(struct attr **attrs) { struct navit *this_=g_new0(struct navit, 1); + struct pcoord center; + struct coord co; + enum projection pro=projection_mg; + int zoom = 256; FILE *f; *************** *** 331,338 **** this_->bookmarks_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); this_->cursor_flag=1; this_->tracking_flag=1; this_->trans=transform_new(); ! transform_setup(this_->trans, center, zoom, 0); this_->displaylist=graphics_displaylist_new(); return this_; --- 335,365 ---- this_->bookmarks_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + + + center.x=1300000; + center.y=7000000; + center.pro = pro; + for (;*attrs; attrs++) { + switch((*attrs)->type) { + case attr_zoom: + zoom = (*attrs)->u.num; + break; + case attr_center: + if (coord_parse((*attrs)->u.str, center.pro, &co)) { + center.x=co.x; + center.y=co.y; + } + break; + default: + dbg(0, "Unexpected attribute %x\n",(*attrs)->type); + break; + } + } + + dbg(0,"zoom=%d, coords x=%d, y=%d\n",zoom, center.x, center.y); this_->cursor_flag=1; this_->tracking_flag=1; this_->trans=transform_new(); ! transform_setup(this_->trans, ¢er, zoom, 0); this_->displaylist=graphics_displaylist_new(); return this_; Index: xmlconfig.c =================================================================== RCS file: /cvsroot/navit/navit/src/xmlconfig.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** xmlconfig.c 18 Dec 2007 19:36:57 -0000 1.21 --- xmlconfig.c 1 Jan 2008 20:44:41 -0000 1.22 *************** *** 202,225 **** xmlconfig_navit(struct xmlstate *state) { ! const char *value; ! int zoom=0; ! struct pcoord c; ! struct coord co; ! enum projection pro=projection_mg; ! value=find_attribute(state, "zoom", 0); ! if (value) ! zoom=convert_number(value); ! if (! zoom) ! zoom=256; ! value=find_attribute(state, "center", 0); ! if (! value || ! coord_parse(value, pro, &co)) { ! c.x=1300000; ! c.y=7000000; ! } ! c.x = co.x; ! c.y = co.y; ! c.pro = pro; ! state->element_object = navit_new(&c, zoom); if (! state->element_object) return 0; --- 202,209 ---- xmlconfig_navit(struct xmlstate *state) { ! struct attr **attrs; ! attrs=convert_to_attrs(state); ! state->element_object = navit_new(attrs); if (! state->element_object) return 0; |
From: Martin S. <mar...@us...> - 2008-01-01 20:06:29
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13027 Modified Files: callback.c Log Message: Add:Core:Added support for attribute-dependant callbacks Index: callback.c =================================================================== RCS file: /cvsroot/navit/navit/src/callback.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** callback.c 3 Dec 2007 13:17:19 -0000 1.7 --- callback.c 1 Jan 2008 20:06:24 -0000 1.8 *************** *** 1,3 **** --- 1,4 ---- #include <glib.h> + #include "item.h" #include "debug.h" #include "callback.h" *************** *** 6,9 **** --- 7,11 ---- void (*func)(); int pcount; + enum attr_type type; void *p[0]; *************** *** 23,27 **** struct callback * ! callback_new(void (*func)(), int pcount, void **p) { struct callback *ret; --- 25,29 ---- struct callback * ! callback_new_attr(void (*func)(), enum attr_type type, int pcount, void **p) { struct callback *ret; *************** *** 31,34 **** --- 33,37 ---- ret->func=func; ret->pcount=pcount; + ret->type=type; for (i = 0 ; i < pcount ; i++) { ret->p[i]=p[i]; *************** *** 37,40 **** --- 40,49 ---- } + struct callback * + callback_new(void (*func)(), int pcount, void **p) + { + return callback_new_attr(func, attr_none, pcount, p); + } + void callback_set_arg(struct callback *cb, int arg, void *p) *************** *** 127,133 **** } - void ! callback_list_call(struct callback_list *l, int pcount, void **p) { GList *cbi; --- 136,141 ---- } void ! callback_list_call_attr(struct callback_list *l, enum attr_type type, int pcount, void **p) { GList *cbi; *************** *** 137,141 **** while (cbi) { cb=cbi->data; ! callback_call(cb, pcount, p); cbi=g_list_next(cbi); } --- 145,150 ---- while (cbi) { cb=cbi->data; ! if (type == attr_any || cb->type == type) ! callback_call(cb, pcount, p); cbi=g_list_next(cbi); } *************** *** 143,146 **** --- 152,161 ---- } + void + callback_list_call(struct callback_list *l, int pcount, void **p) + { + callback_list_call_attr(l, attr_any, pcount, p); + } + void |
From: Michael F. <ho...@us...> - 2008-01-01 13:59:41
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20911 Modified Files: navit.c Log Message: Fix: Actually update map orientation when map orientation is toggled Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** navit.c 29 Dec 2007 10:55:13 -0000 1.59 --- navit.c 1 Jan 2008 13:59:42 -0000 1.60 *************** *** 1133,1137 **** --- 1133,1148 ---- navit_toggle_orient_north(struct navit *this_) { + int dir = 0; + this_->orient_north_flag=1-this_->orient_north_flag; + if (this_->orient_north_flag) { + dir = 0; + } else { + if (this_->vehicle) { + dir = this_->vehicle->dir; + } + } + transform_set_angle(this_->trans, dir); + navit_draw(this_); } |
From: Martin S. <mar...@us...> - 2007-12-29 15:25:49
|
Update of /cvsroot/navit/navit/src/data/binfile In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25865/data/binfile Modified Files: binfile.c Log Message: Fix:data_binfile:Fixed label handling Index: binfile.c =================================================================== RCS file: /cvsroot/navit/navit/src/data/binfile/binfile.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** binfile.c 17 Dec 2007 10:05:29 -0000 1.11 --- binfile.c 29 Dec 2007 15:25:52 -0000 1.12 *************** *** 44,47 **** --- 44,50 ---- int *end; 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; *************** *** 111,116 **** size=*(t->pos_attr++); type=t->pos_attr[0]; ! if (type == attr_street_name || type == attr_street_name_systematic) ! type = attr_label; if (type == attr_type || attr_type == attr_any) { if (attr_type == attr_any) { --- 114,123 ---- size=*(t->pos_attr++); type=t->pos_attr[0]; ! 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) { *************** *** 125,128 **** --- 132,141 ---- } } + 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; } *************** *** 287,290 **** --- 300,306 ---- mr->item.id_hi=t->zipfile_num; 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) { *************** *** 316,319 **** --- 332,338 ---- mr->item.id_hi=id_hi; 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; |
From: Martin S. <mar...@us...> - 2007-12-29 15:25:49
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25865 Modified Files: navigation.c route.c Log Message: Fix:data_binfile:Fixed label handling Index: navigation.c =================================================================== RCS file: /cvsroot/navit/navit/src/navigation.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** navigation.c 26 Dec 2007 10:39:48 -0000 1.31 --- navigation.c 29 Dec 2007 15:25:51 -0000 1.32 *************** *** 233,236 **** --- 233,237 ---- if (item) { + dbg(1, "start 0x%x 0x%x\n", start->x, start->y); ret->item=*item; item_hash_insert(this_->hash, item, ret); Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** route.c 29 Dec 2007 10:55:13 -0000 1.34 --- route.c 29 Dec 2007 15:25:51 -0000 1.35 *************** *** 1169,1173 **** case -1: case 2: ! dir=point == 2 ? rinf->dir : -rinf->dir; if (dir > 0) return &sd->c[sd->count-1]; --- 1169,1173 ---- case -1: case 2: ! dir=(point == 2) ? rinf->dir : -rinf->dir; if (dir > 0) return &sd->c[sd->count-1]; |
From: Martin S. <mar...@us...> - 2007-12-29 10:55:13
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30293 Modified Files: navit.c route.c route.h Log Message: Fix:Core:Redraw map if route is created after vehicle update Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** navit.c 28 Dec 2007 10:04:39 -0000 1.58 --- navit.c 29 Dec 2007 10:55:13 -0000 1.59 *************** *** 1169,1172 **** --- 1169,1173 ---- enum projection pro; int border=16; + int route_path_set=0; if (! this_->ready) *************** *** 1185,1188 **** --- 1186,1191 ---- return; } + if (this_->route) + route_path_set=route_get_path_set(this_->route); if (this_->tracking && this_->tracking_flag) { if (tracking_update(this_->tracking, &nv->coord, nv->dir)) { *************** *** 1198,1202 **** } } - transform(this_->trans, pro, &nv->coord, &cursor_pnt, 1, 0); if (!transform_within_border(this_->trans, &cursor_pnt, border)) { --- 1201,1204 ---- *************** *** 1220,1223 **** --- 1222,1227 ---- pnt=NULL; } + if (pnt && this_->route && !route_path_set && route_get_path_set(this_->route)) + navit_draw(this_); if (nv->follow_curr > 1) nv->follow_curr--; Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** route.c 28 Dec 2007 10:04:39 -0000 1.33 --- route.c 29 Dec 2007 10:55:13 -0000 1.34 *************** *** 189,192 **** --- 189,198 ---- int + route_get_path_set(struct route *this) + { + return this->path2 != NULL; + } + + int route_set_speed(struct route *this, enum item_type type, int value) { Index: route.h =================================================================== RCS file: /cvsroot/navit/navit/src/route.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** route.h 28 Dec 2007 10:04:39 -0000 1.15 --- route.h 29 Dec 2007 10:55:13 -0000 1.16 *************** *** 44,47 **** --- 44,48 ---- struct route_info *route_get_dst(struct route *this); int *route_get_speedlist(struct route *this); + int route_get_path_set(struct route *this); int route_set_speed(struct route *this, enum item_type type, int value); int route_contains(struct route *this, struct item *item); |
From: Martin S. <mar...@us...> - 2007-12-29 10:23:47
|
Update of /cvsroot/navit/navit/src/vehicle/demo In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23855 Modified Files: vehicle_demo.c Log Message: Fix:vehicle_demo:Made vehicle stop at destination Index: vehicle_demo.c =================================================================== RCS file: /cvsroot/navit/navit/src/vehicle/demo/vehicle_demo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** vehicle_demo.c 28 Dec 2007 10:04:39 -0000 1.6 --- vehicle_demo.c 29 Dec 2007 10:23:48 -0000 1.7 *************** *** 18,21 **** --- 18,22 ---- struct coord_geo geo; struct coord last; + double config_speed; double speed; double direction; *************** *** 69,73 **** vehicle_demo_timer(struct vehicle_priv *priv) { ! struct coord c, pos, ci; int slen, len, dx, dy; struct map *route_map=NULL; --- 70,74 ---- vehicle_demo_timer(struct vehicle_priv *priv) { ! struct coord c, c2, pos, ci; int slen, len, dx, dy; struct map *route_map=NULL; *************** *** 75,79 **** struct item *item=NULL; ! len = (priv->speed * priv->interval / 1000)/ 3.6; dbg(1, "###### Entering simulation loop\n"); if (!priv->navit) { --- 76,80 ---- struct item *item=NULL; ! len = (priv->config_speed * priv->interval / 1000)/ 3.6; dbg(1, "###### Entering simulation loop\n"); if (!priv->navit) { *************** *** 106,115 **** pos = c; } else { ! dx = c.x - pos.x; ! dy = c.y - pos.y; ! ci.x = pos.x + dx * len / slen; ! ci.y = pos.y + dy * len / slen; ! priv->direction = ! transform_get_angle_delta(&pos, &c, 0); dbg(1, "ci=0x%x,0x%x\n", ci.x, ci.y); transform_to_geo(projection_mg, &ci, --- 107,124 ---- pos = c; } else { ! if (item_coord_get(item, &c2, 1) || map_rect_get_item(mr)) { ! dx = c.x - pos.x; ! dy = c.y - pos.y; ! ci.x = pos.x + dx * len / slen; ! ci.y = pos.y + dy * len / slen; ! priv->direction = ! transform_get_angle_delta(&pos, &c, 0); ! priv->speed=priv->config_speed; ! } else { ! ci.x = pos.x; ! ci.y = pos.y; ! priv->speed=0; ! dbg(0,"destination reached\n"); ! } dbg(1, "ci=0x%x,0x%x\n", ci.x, ci.y); transform_to_geo(projection_mg, &ci, *************** *** 142,148 **** ret->cbl = cbl; ret->interval=1000; ! ret->speed=40; ! if ((speed=attr_search(attrs, NULL, attr_speed))) ! ret->speed=speed->u.num; if ((interval=attr_search(attrs, NULL, attr_interval))) ret->interval=speed->u.num; --- 151,158 ---- ret->cbl = cbl; ret->interval=1000; ! ret->config_speed=40; ! if ((speed=attr_search(attrs, NULL, attr_speed))) { ! ret->config_speed=speed->u.num; ! } if ((interval=attr_search(attrs, NULL, attr_interval))) ret->interval=speed->u.num; |
From: Martin S. <mar...@us...> - 2007-12-28 17:00:23
|
Update of /cvsroot/navit/navit/po In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12821 Modified Files: Makefile.am Log Message: Fix:Translations:Added missing file Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/po/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 3 Oct 2007 20:15:56 -0000 1.8 --- Makefile.am 28 Dec 2007 17:00:24 -0000 1.9 *************** *** 10,13 **** --- 10,14 ---- $(top_srcdir)/src/navigation.c \ $(top_srcdir)/src/navit.c \ + $(top_srcdir)/src/popup.c \ $(top_srcdir)/src/country.c \ $(top_srcdir)/src/gui/gtk/destination.c \ |
From: Martin S. <mar...@us...> - 2007-12-28 10:45:37
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15938/gui/gtk Modified Files: gui_gtk_statusbar.c Log Message: Fix:GTK:Fixed gps position in statusbar Index: gui_gtk_statusbar.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_statusbar.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gui_gtk_statusbar.c 28 Dec 2007 10:03:42 -0000 1.5 --- gui_gtk_statusbar.c 28 Dec 2007 10:45:39 -0000 1.6 *************** *** 20,25 **** struct gui_priv *gui; GtkWidget *hbox; - char mouse_text[128]; - GtkWidget *mouse; char gps_text[128]; GtkWidget *gps; --- 20,23 ---- *************** *** 37,56 **** static void - statusbar_mouse_update(struct statusbar_priv *this, struct transformation *tr, struct point *p) - { - #if 0 - struct coord c; - struct coord_geo g; - char buffer[128]; - - transform_reverse(tr, p, &c); - transform_lng_lat(&c, &g); - transform_geo_text(&g, buffer); - sprintf(this->mouse_text,"M: %s", buffer); - gtk_label_set_text(GTK_LABEL(this->mouse), this->mouse_text); - #endif - } - - static void statusbar_gps_update(struct statusbar_priv *this, int sats, int qual, double lng, double lat, double height, double direction, double speed) { --- 35,38 ---- *************** *** 72,76 **** dir_idx=(direction+22.5)/45; dir=dirs[dir_idx]; ! 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); utf8=g_locale_to_utf8(this->gps_text,-1,NULL,NULL,NULL); gtk_label_set_text(GTK_LABEL(this->gps), utf8); --- 54,58 ---- dir_idx=(direction+22.5)/45; dir=dirs[dir_idx]; ! 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); utf8=g_locale_to_utf8(this->gps_text,-1,NULL,NULL,NULL); gtk_label_set_text(GTK_LABEL(this->gps), utf8); *************** *** 90,93 **** --- 72,83 ---- struct tm *eta_tm; char buffer[128]; + char *utf8; + double lng, lat, direction=0, height=0, speed=0; + int sats=0, qual=0; + char lat_c='N'; + char lng_c='E'; + char *dirs[]={"N","NO","O","SO","S","SW","W","NW","N"}; + char *dir; + int dir_idx; navig=navit_get_navigation(nav); *************** *** 113,123 **** gtk_label_set_text(GTK_LABEL(this->route), this->route_text); } } static struct statusbar_methods methods = { statusbar_destroy, - statusbar_mouse_update, - NULL, - statusbar_gps_update, }; --- 103,138 ---- 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; + lat=attr.u.coord_geo->lat; + if (lng < 0) { + lng=-lng; + lng_c='W'; + } + if (lat < 0) { + lat=-lat; + lat_c='S'; + } + if (vehicle_position_attr_get(v, attr_position_direction, &attr)) + direction=*(attr.u.numd); + 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); + utf8=g_locale_to_utf8(this->gps_text,-1,NULL,NULL,NULL); + gtk_label_set_text(GTK_LABEL(this->gps), utf8); + g_free(utf8); } static struct statusbar_methods methods = { statusbar_destroy, }; *************** *** 132,138 **** this->hbox=gtk_hbox_new(FALSE, 1); ! this->mouse=gtk_label_new("M: 0000.0000N 00000.0000E"); ! gtk_label_set_justify(GTK_LABEL(this->mouse), GTK_JUSTIFY_LEFT); ! utf8=g_locale_to_utf8("GPS 00/0 0000.0000N 00000.0000E 0000m 000°NO 000km/h",-1,NULL,NULL,NULL); this->gps=gtk_label_new(utf8); g_free(utf8); --- 147,151 ---- this->hbox=gtk_hbox_new(FALSE, 1); ! utf8=g_locale_to_utf8("GPS 00/0 0000.0000N 00000.0000E 0000m 000°NO 000km/h",-1,NULL,NULL,NULL); this->gps=gtk_label_new(utf8); g_free(utf8); *************** *** 140,145 **** this->route=gtk_label_new("Route 0000km 0+00:00 ETA"); gtk_label_set_justify(GTK_LABEL(this->route), GTK_JUSTIFY_LEFT); - gtk_box_pack_start(GTK_BOX(this->hbox), this->mouse, FALSE, FALSE, 2); - gtk_box_pack_start(GTK_BOX(this->hbox), gtk_vseparator_new(), TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(this->hbox), this->gps, TRUE, TRUE, 2); gtk_box_pack_start(GTK_BOX(this->hbox), gtk_vseparator_new(), TRUE, TRUE, 2); --- 153,156 ---- *************** *** 151,158 **** this->vehicle_cb=callback_new_1(callback_cast(statusbar_route_update), this); navit_add_vehicle_cb(gui->nav, this->vehicle_cb); - - #if 0 - *widget=this->gui->hbox; - #endif return this; } --- 162,165 ---- |
From: Martin S. <mar...@us...> - 2007-12-28 10:45:37
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15938 Modified Files: attr_def.h Log Message: Fix:GTK:Fixed gps position in statusbar Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** attr_def.h 28 Dec 2007 10:04:38 -0000 1.20 --- attr_def.h 28 Dec 2007 10:45:39 -0000 1.21 *************** *** 35,38 **** --- 35,39 ---- ATTR(speed) ATTR(interval) + ATTR(position_qual) ATTR2(0x00028000,type_boolean_begin) /* boolean */ |
From: Martin S. <mar...@us...> - 2007-12-28 10:04:39
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31540 Modified Files: attr.h attr_def.h graphics.c graphics.h main.c map.c map.h navit.c navit.h route.c route.h track.c Log Message: Add:Core:Better support for route map Index: graphics.h =================================================================== RCS file: /cvsroot/navit/navit/src/graphics.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** graphics.h 18 Dec 2007 19:36:56 -0000 1.11 --- graphics.h 28 Dec 2007 10:04:38 -0000 1.12 *************** *** 118,122 **** --- 118,124 ---- void display_add(struct displaylist *displaylist, struct item *item, int count, struct point *pnt, char *label); int graphics_ready(struct graphics *this_); + void graphics_displaylist_draw(struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, GList *layouts); void graphics_displaylist_move(struct displaylist *displaylist, int dx, int dy); + void graphics_draw(struct graphics *gra, struct displaylist *displaylist, GList *mapsets, struct transformation *trans, GList *layouts); struct displaylist_handle *graphics_displaylist_open(struct displaylist *displaylist); struct displayitem *graphics_displaylist_next(struct displaylist_handle *dlh); Index: route.h =================================================================== RCS file: /cvsroot/navit/navit/src/route.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** route.h 24 Nov 2007 12:40:25 -0000 1.14 --- route.h 28 Dec 2007 10:04:39 -0000 1.15 *************** *** 75,78 **** --- 75,79 ---- struct map *route_get_map(struct route *route); void route_toggle_routegraph_display(struct route *route); + void route_init(void); /* end of prototypes */ Index: map.c =================================================================== RCS file: /cvsroot/navit/navit/src/map.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** map.c 20 Dec 2007 20:39:48 -0000 1.10 --- map.c 28 Dec 2007 10:04:39 -0000 1.11 *************** *** 11,14 **** --- 11,23 ---- #include "country.h" + + struct map { + struct map_methods meth; + struct map_priv *priv; + char *type; + char *filename; + int active; + }; + struct map_rect { struct map *m; *************** *** 107,110 **** --- 116,123 ---- mr->m=m; mr->priv=m->meth.map_rect_new(m->priv, sel); + if (! mr->priv) { + g_free(mr); + mr=NULL; + } return mr; Index: attr.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** attr.h 18 Dec 2007 19:36:56 -0000 1.12 --- attr.h 28 Dec 2007 10:04:38 -0000 1.13 *************** *** 38,41 **** --- 38,42 ---- struct callback *callback; struct log *log; + struct route *route; } u; }; Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** route.c 27 Dec 2007 17:58:23 -0000 1.32 --- route.c 28 Dec 2007 10:04:39 -0000 1.33 *************** *** 22,45 **** #include "graphics.h" #include "transform.h" #include "fib.h" ! #if 0 ! static int speed_list[]={ ! 10, /* street_0 */ ! 10, /* street_1_city */ ! 30, /* street_2_city */ ! 40, /* street_3_city */ ! 50, /* street_4_city */ ! 80, /* highway_city */ ! 60, /* street_1_land */ ! 65, /* street_2_land */ ! 70, /* street_3_land */ ! 80, /* street_4_land */ ! 120, /* street_n_lanes */ ! 120, /* highway_land */ ! 40, /* ramp */ ! 30, /* ferry */ }; - #endif int debug_route=0; --- 22,32 ---- #include "graphics.h" #include "transform.h" + #include "plugin.h" #include "fib.h" ! ! struct map_priv { ! struct route *route; }; int debug_route=0; *************** *** 107,111 **** int version; struct mapset *ms; - struct map route_map; unsigned flags; struct route_info *pos; --- 94,97 ---- *************** *** 254,257 **** --- 240,244 ---- if (this->pos) route_info_free(this->pos); + this->pos=NULL; this->pos=route_find_nearest_street(this->ms, pos); dbg(1,"this->pos=%p\n", this->pos); *************** *** 277,280 **** --- 264,268 ---- if (this->pos) route_info_free(this->pos); + this->pos=NULL; ret->c=*c; ret->lp=*c; *************** *** 647,757 **** } - struct route_path_coord_handle { - struct route *route; - int pos; /* -1 = Begin, 0 = Middle, 1 = End */ - int dir; - int spos; - struct coord last; - struct route_info_handle *ri; - struct route_path_handle *rp; - struct street_data *street_data; - }; - - struct route_path_coord_handle * - route_path_coord_open(struct route *this) - { - struct route_path_coord_handle *ret; - - if (! route_get_pos(this) || ! route_get_dst(this)) - return NULL; - - ret=g_new0(struct route_path_coord_handle, 1); - if (!ret) { - printf("%s:Out of memory\n", __FUNCTION__); - return ret; - } - ret->route=this; - ret->ri=route_info_open(route_get_pos(this), route_get_dst(this), 0); - if (!ret->ri) { - ret->ri=route_info_open(route_get_pos(this), NULL, 0); - ret->pos=-1; - } - else - ret->pos=1; - return ret; - } - - struct coord * - route_path_coord_get(struct route_path_coord_handle *h) - { - struct coord *c; - struct route_path_segment *seg; - struct item *item, *item2; - struct map_rect *mr; - - switch(h->pos) { - case -1: - c=route_info_get(h->ri); - if (c) { - h->last=*c; - return c; - } - h->pos=0; - h->rp=route_path_open(h->route); - case 0: - if (! h->street_data && h->rp) { - seg=route_path_get_segment(h->rp); - if (seg) { - item=route_path_segment_get_item(seg); - mr=map_rect_new(item->map,NULL); - item2=map_rect_get_item_byid(mr, item->id_hi, item->id_lo); - h->street_data=street_get_data(item2); - map_rect_destroy(mr); - if (h->street_data->c[0].x == h->last.x && h->street_data->c[0].y == h->last.y) { - h->spos=1; - h->dir=1; - } else { - h->spos=h->street_data->count-2; - h->dir=-1; - } - } - } - if (h->street_data) { - c=&h->street_data->c[h->spos]; - h->last=*c; - h->spos+=h->dir; - if (h->spos < 0 || h->spos >= h->street_data->count) { - street_data_free(h->street_data); - h->street_data=NULL; - } - return c; - } - h->pos=1; - case 1: - c=route_info_get(h->ri); - if (c) { - h->last=*c; - return c; - } - h->pos=2; - default: - return NULL; - } - - } - - void - route_path_coord_close(struct route_path_coord_handle *h) - { - if (h->street_data) - street_data_free(h->street_data); - if (h->rp) - route_path_close(h->rp); - if (h->ri) - route_info_close(h->ri); - g_free(h); - } - - static void route_graph_free_segments(struct route_graph *this) --- 635,638 ---- *************** *** 1117,1120 **** --- 998,1003 ---- while ((m=mapset_next(h,1))) { mr=map_rect_new(m, sel); + if (! mr) + continue; while ((item=map_rect_get_item(mr))) { if (item->type >= type_street_0 && item->type <= type_ferry) { *************** *** 1219,1222 **** --- 1102,1107 ---- } mr=map_rect_new(m, sel); + if (! mr) + continue; while ((item=map_rect_get_item(mr))) { if (item->type >= type_street_0 && item->type <= type_ferry) { *************** *** 1455,1463 **** int pos_next; int pos; ! struct route *mpriv; struct item item; unsigned int last_coord; struct route_path_segment *seg; - int segsdone; struct route_graph_point *point; char *label; --- 1340,1347 ---- int pos_next; int pos; ! struct map_priv *mpriv; struct item item; unsigned int last_coord; struct route_path_segment *seg; struct route_graph_point *point; char *label; *************** *** 1576,1593 **** rm_destroy(struct map_priv *priv) { } static struct map_rect_priv * ! rm_rect_new(struct map_priv *map, struct map_selection *sel) { - struct route *route=(struct route *)map; struct map_rect_priv * mr; dbg(1,"enter\n"); mr=g_new0(struct map_rect_priv, 1); ! mr->mpriv = route; ! mr->ri=route_info_open(route_get_pos(route), route_get_dst(route), 0); mr->pos_next=1; if (!mr->ri) { ! mr->ri=route_info_open(route_get_pos(route), NULL, 0); mr->pos_next=-1; } --- 1460,1483 ---- rm_destroy(struct map_priv *priv) { + g_free(priv); } static struct map_rect_priv * ! rm_rect_new(struct map_priv *priv, struct map_selection *sel) { struct map_rect_priv * mr; dbg(1,"enter\n"); + if (! route_get_pos(priv->route)) + return NULL; + if (! route_get_dst(priv->route)) + return NULL; + if (! priv->route->path2) + return NULL; mr=g_new0(struct map_rect_priv, 1); ! mr->mpriv = priv; ! mr->ri=route_info_open(route_get_pos(priv->route), route_get_dst(priv->route), 0); mr->pos_next=1; if (!mr->ri) { ! mr->ri=route_info_open(route_get_pos(priv->route), NULL, 0); mr->pos_next=-1; } *************** *** 1595,1598 **** --- 1485,1500 ---- } + static struct map_rect_priv * + rp_rect_new(struct map_priv *priv, struct map_selection *sel) + { + struct map_rect_priv * mr; + dbg(1,"enter\n"); + if (! priv->route->graph || ! priv->route->graph->route_points) + return NULL; + mr=g_new0(struct map_rect_priv, 1); + mr->mpriv = priv; + return mr; + } + static void rm_rect_destroy(struct map_rect_priv *mr) *************** *** 1606,1640 **** static struct item * rm_get_item(struct map_rect_priv *mr) { ! struct route *r = mr->mpriv; struct route_path_segment *seg = mr->seg; dbg(1,"enter\n", mr->pos); - rep: - if (mr->segsdone) { - if (!(r->flags & RF_SHOWGRAPH)) - return NULL; - else { - struct route_graph_point *p = mr->point; - if (!p) - p = r->graph->route_points; - else - p = p->next; - if (!p) - return NULL; - mr->point = p; - mr->last_coord = 0; - mr->item.id_hi = 0; - mr->item.id_lo = 0; - mr->item.map = NULL; - // mr->item = NULL; - mr->item.priv_data = mr; - mr->item.type = type_rg_point; - mr->item.meth = &methods_point_item; - return &mr->item; - } - } - mr->pos=mr->pos_next; switch(mr->pos) { --- 1508,1540 ---- static struct item * + rp_get_item(struct map_rect_priv *mr) + { + struct route *r = mr->mpriv->route; + struct route_graph_point *p = mr->point; + + if (!p) + p = r->graph->route_points; + else + p = p->next; + if (!p) + return NULL; + mr->point = p; + mr->last_coord = 0; + mr->item.id_hi = 0; + mr->item.id_lo = 0; + mr->item.map = NULL; + mr->item.priv_data = mr; + mr->item.type = type_rg_point; + mr->item.meth = &methods_point_item; + return &mr->item; + } + + static struct item * rm_get_item(struct map_rect_priv *mr) { ! struct route *r = mr->mpriv->route; struct route_path_segment *seg = mr->seg; dbg(1,"enter\n", mr->pos); mr->pos=mr->pos_next; switch(mr->pos) { *************** *** 1658,1664 **** break; case 2: - mr->segsdone = 1; - if (r->flags & RF_SHOWGRAPH) - goto rep; return NULL; } --- 1558,1561 ---- *************** *** 1677,1686 **** rm_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo) { ! printf("%s called on Route map\n", __FUNCTION__); return NULL; } static struct map_methods route_meth = { ! projection_none, NULL, rm_destroy, --- 1574,1583 ---- rm_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo) { ! dbg(0,"called on Route map\n"); return NULL; } static struct map_methods route_meth = { ! projection_mg, NULL, rm_destroy, *************** *** 1694,1718 **** }; ! static void ! route_init_map(struct route *route) ! { ! struct map *m = &route->route_map; ! m->priv = (struct map_priv *)route; ! m->type = "Route"; ! m->filename = NULL; ! m->active = 0; ! m->meth = route_meth; ! m->meth.pro = route_projection(route); ! } ! ! struct map * ! route_get_map(struct route *route) ! { ! if (route->pos && route->dst && route->path2) { ! route_init_map(route); ! return &route->route_map; ! } ! return NULL; ! } void --- 1591,1606 ---- }; ! static struct map_methods route_graph_meth = { ! projection_mg, ! NULL, ! rm_destroy, ! rp_rect_new, ! rm_rect_destroy, ! rp_get_item, ! rm_get_item_byid, ! NULL, ! NULL, ! NULL, ! }; void *************** *** 1725,1726 **** --- 1613,1654 ---- } } + + static struct map_priv * + route_map_new_helper(struct map_methods *meth, struct attr **attrs, int graph) + { + struct map_priv *ret; + struct attr *route_attr; + + route_attr=attr_search(attrs, NULL, attr_route); + if (! route_attr) + return NULL; + ret=g_new0(struct map_priv, 1); + if (graph) + *meth=route_graph_meth; + else + *meth=route_meth; + ret->route=route_attr->u.route; + + return ret; + } + + static struct map_priv * + route_map_new(struct map_methods *meth, struct attr **attrs) + { + return route_map_new_helper(meth, attrs, 0); + } + + static struct map_priv * + route_graph_map_new(struct map_methods *meth, struct attr **attrs) + { + return route_map_new_helper(meth, attrs, 1); + } + + + + void + route_init(void) + { + plugin_register_map_type("route", route_map_new); + plugin_register_map_type("route_graph", route_graph_map_new); + } Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** attr_def.h 25 Dec 2007 21:01:58 -0000 1.19 --- attr_def.h 28 Dec 2007 10:04:38 -0000 1.20 *************** *** 95,97 **** --- 95,98 ---- ATTR(log) ATTR(callback) + ATTR(route) ATTR2(0x0008ffff,type_object_end) Index: graphics.c =================================================================== RCS file: /cvsroot/navit/navit/src/graphics.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** graphics.c 27 Dec 2007 17:58:23 -0000 1.26 --- graphics.c 28 Dec 2007 10:04:38 -0000 1.27 *************** *** 476,479 **** --- 476,483 ---- else mr=map_rect_new(m, sel); + if (! mr) { + map_selection_destroy(sel); + return; + } while ((item=map_rect_get_item(mr))) { count=item_coord_get(item, ca, item->type < type_line ? 1: max); *************** *** 519,523 **** static void ! do_draw(struct displaylist *displaylist, struct transformation *t, GList *mapsets, int order, struct route *route) { struct mapset *ms; --- 523,527 ---- static void ! do_draw(struct displaylist *displaylist, struct transformation *t, GList *mapsets, int order) { struct mapset *ms; *************** *** 533,541 **** } mapset_close(h); - if (route) { - m = route_get_map(route); - if (m) - do_draw_map(displaylist, t, m, order); - } } --- 537,540 ---- *************** *** 547,551 **** void ! graphics_displaylist_draw(struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, GList *layouts, struct route *route) { int order=transform_get_order(trans); --- 546,550 ---- void ! graphics_displaylist_draw(struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, GList *layouts) { int order=transform_get_order(trans); *************** *** 574,578 **** void ! graphics_draw(struct graphics *gra, struct displaylist *displaylist, GList *mapsets, struct transformation *trans, GList *layouts, struct route *route) { int order=transform_get_order(trans); --- 573,577 ---- void ! graphics_draw(struct graphics *gra, struct displaylist *displaylist, GList *mapsets, struct transformation *trans, GList *layouts) { int order=transform_get_order(trans); *************** *** 594,600 **** #endif profile(0,NULL); ! do_draw(displaylist, trans, mapsets, order, route); profile(1,"do_draw"); ! graphics_displaylist_draw(gra, displaylist, trans, layouts, route); profile(1,"xdisplay_draw"); profile(0,"end"); --- 593,599 ---- #endif profile(0,NULL); ! do_draw(displaylist, trans, mapsets, order); profile(1,"do_draw"); ! graphics_displaylist_draw(gra, displaylist, trans, layouts); profile(1,"xdisplay_draw"); profile(0,"end"); Index: map.h =================================================================== RCS file: /cvsroot/navit/navit/src/map.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** map.h 21 Dec 2007 14:10:10 -0000 1.11 --- map.h 28 Dec 2007 10:04:39 -0000 1.12 *************** *** 30,41 **** }; - struct map { - struct map_methods meth; - struct map_priv *priv; - char *type; - char *filename; - int active; - }; - static inline int map_selection_contains_point(struct map_selection *sel, struct coord *c) --- 30,33 ---- Index: track.c =================================================================== RCS file: /cvsroot/navit/navit/src/track.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** track.c 25 Nov 2007 01:32:14 -0000 1.18 --- track.c 28 Dec 2007 10:04:39 -0000 1.19 *************** *** 124,127 **** --- 124,129 ---- while ((m=mapset_next(h,1))) { mr=map_rect_new(m, sel); + if (! mr) + continue; while ((item=map_rect_get_item(mr))) { if (item->type >= type_street_0 && item->type <= type_ferry) { Index: main.c =================================================================== RCS file: /cvsroot/navit/navit/src/main.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** main.c 17 Dec 2007 15:13:45 -0000 1.19 --- main.c 28 Dec 2007 10:04:39 -0000 1.20 *************** *** 138,141 **** --- 138,142 ---- setenv("SDL_WINDOWID", s, 0); } + route_init(); config_file=NULL; if (argc > 1) Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** navit.c 25 Dec 2007 17:25:37 -0000 1.57 --- navit.c 28 Dec 2007 10:04:39 -0000 1.58 *************** *** 72,75 **** --- 72,77 ---- struct menu *menubar; struct route *route; + struct map *route_map; + struct map *route_graph_map; struct navigation *navigation; struct speech *speech; *************** *** 134,138 **** transform_setup_source_rect(this_->trans); ! graphics_draw(this_->gra, this_->displaylist, this_->mapsets, this_->trans, this_->layouts, this_->route); l=this_->vehicles; while (l) { --- 136,140 ---- transform_setup_source_rect(this_->trans); ! graphics_draw(this_->gra, this_->displaylist, this_->mapsets, this_->trans, this_->layouts); l=this_->vehicles; while (l) { *************** *** 147,153 **** navit_draw_displaylist(struct navit *this_) { ! if (this_->ready) { ! graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layouts, this_->route); ! } } --- 149,154 ---- navit_draw_displaylist(struct navit *this_) { ! if (this_->ready) ! graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layouts); } *************** *** 234,238 **** this_->last=this_->current; graphics_displaylist_move(this_->displaylist, dx, dy); ! graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layouts, this_->route); this_->moved=1; } --- 235,239 ---- this_->last=this_->current; graphics_displaylist_move(this_->displaylist, dx, dy); ! graphics_displaylist_draw(this_->gra, this_->displaylist, this_->trans, this_->layouts); this_->moved=1; } *************** *** 1021,1024 **** --- 1022,1029 ---- if (this_->mapsets) { ms=this_->mapsets->data; + if (this_->route_map) + mapset_add(ms, this_->route_map); + if (this_->route_graph_map) + mapset_add(ms, this_->route_graph_map); if (this_->route) route_set_mapset(this_->route, ms); *************** *** 1324,1328 **** --- 1329,1346 ---- navit_route_add(struct navit *this_, struct route *route) { + struct attr route_attr={.type=attr_route,.u.route=route}; + struct attr data_attr={.type=attr_data,.u.str=""}; + struct attr *attrs_route[]={&route_attr, &data_attr, NULL}; + struct attr *attrs_route_graph[]={&route_attr, &data_attr, NULL}; this_->route=route; + this_->route_map=map_new("route",attrs_route); + this_->route_graph_map=map_new("route_graph",attrs_route_graph); + map_set_active(this_->route_graph_map, 0); + } + + struct map * + navit_get_route_map(struct navit *this_) + { + return this_->route_map; } *************** *** 1378,1389 **** } - void - navit_toggle_routegraph_display(struct navit *nav) - { - if (!nav->route) - return; - route_toggle_routegraph_display(nav->route); - navit_draw(nav); - } - /** @} */ --- 1396,1398 ---- Index: navit.h =================================================================== RCS file: /cvsroot/navit/navit/src/navit.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** navit.h 18 Dec 2007 19:36:57 -0000 1.22 --- navit.h 28 Dec 2007 10:04:39 -0000 1.23 *************** *** 73,76 **** --- 73,77 ---- void navit_tracking_add(struct navit *this_, struct tracking *tracking); void navit_route_add(struct navit *this_, struct route *route); + struct map *navit_get_route_map(struct navit *this_); void navit_navigation_add(struct navit *this_, struct navigation *navigation); void navit_set_speech(struct navit *this_, struct speech *speech); |
From: Martin S. <mar...@us...> - 2007-12-28 10:04:37
|
Update of /cvsroot/navit/navit/src/vehicle/demo In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31540/vehicle/demo Modified Files: vehicle_demo.c Log Message: Add:Core:Better support for route map Index: vehicle_demo.c =================================================================== RCS file: /cvsroot/navit/navit/src/vehicle/demo/vehicle_demo.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** vehicle_demo.c 26 Dec 2007 10:39:48 -0000 1.5 --- vehicle_demo.c 28 Dec 2007 10:04:39 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- #include "item.h" #include "navit.h" + #include "map.h" #include "route.h" #include "callback.h" *************** *** 68,74 **** vehicle_demo_timer(struct vehicle_priv *priv) { ! struct route_path_coord_handle *h=NULL; ! struct coord *c, *pos=NULL, ci; int slen, len, dx, dy; len = (priv->speed * priv->interval / 1000)/ 3.6; --- 69,77 ---- vehicle_demo_timer(struct vehicle_priv *priv) { ! struct coord c, pos, ci; int slen, len, dx, dy; + struct map *route_map=NULL; + struct map_rect *mr=NULL; + struct item *item=NULL; len = (priv->speed * priv->interval / 1000)/ 3.6; *************** *** 78,102 **** return 1; } ! struct route *vehicle_route = navit_get_route(priv->navit); ! if (vehicle_route) ! h = route_path_coord_open(vehicle_route); ! if (h) ! pos = route_path_coord_get(h); ! dbg(1, "current pos=%p\n", pos); ! if (pos) { priv->position_set=0; ! dbg(1, "current pos=0x%x,0x%x\n", pos->x, pos->y); dbg(1, "last pos=0x%x,0x%x\n", priv->last.x, priv->last.y); ! if (priv->last.x == pos->x && priv->last.y == pos->y) { dbg(1, "endless loop\n"); } ! priv->last = *pos; ! for (;;) { ! c = route_path_coord_get(h); ! dbg(1, "next pos=%p\n", c); ! if (!c) ! break; ! dbg(1, "next pos=0x%x,0x%x\n", c->x, c->y); ! slen = transform_distance(projection_mg, pos, c); dbg(1, "len=%d slen=%d\n", len, slen); if (slen < len) { --- 81,104 ---- return 1; } ! route_map=navit_get_route_map(priv->navit); ! if (route_map) ! mr=map_rect_new(route_map, NULL); ! if (mr) ! item=map_rect_get_item(mr); ! if (mr && item_coord_get(item, &pos, 1)) { priv->position_set=0; ! dbg(1, "current pos=0x%x,0x%x\n", pos.x, pos.y); dbg(1, "last pos=0x%x,0x%x\n", priv->last.x, priv->last.y); ! if (priv->last.x == pos.x && priv->last.y == pos.y) { dbg(1, "endless loop\n"); } ! priv->last = pos; ! while (item) { ! if (!item_coord_get(item, &c, 1)) { ! item=map_rect_get_item(mr); ! continue; ! } ! dbg(1, "next pos=0x%x,0x%x\n", c.x, c.y); ! slen = transform_distance(projection_mg, &pos, &c); dbg(1, "len=%d slen=%d\n", len, slen); if (slen < len) { *************** *** 104,113 **** pos = c; } else { ! dx = c->x - pos->x; ! dy = c->y - pos->y; ! ci.x = pos->x + dx * len / slen; ! ci.y = pos->y + dy * len / slen; priv->direction = ! transform_get_angle_delta(pos, c, 0); dbg(1, "ci=0x%x,0x%x\n", ci.x, ci.y); transform_to_geo(projection_mg, &ci, --- 106,115 ---- pos = c; } else { ! dx = c.x - pos.x; ! dy = c.y - pos.y; ! ci.x = pos.x + dx * len / slen; ! ci.y = pos.y + dy * len / slen; priv->direction = ! transform_get_angle_delta(&pos, &c, 0); dbg(1, "ci=0x%x,0x%x\n", ci.x, ci.y); transform_to_geo(projection_mg, &ci, *************** *** 121,124 **** --- 123,128 ---- callback_list_call_0(priv->cbl); } + if (mr) + map_rect_destroy(mr); return 1; } |
From: Martin S. <mar...@us...> - 2007-12-28 10:03:39
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31129 Modified Files: gui_gtk_action.c gui_gtk_statusbar.c Log Message: Fix:GTK:Set ETA and distance on statusbar Index: gui_gtk_action.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_action.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gui_gtk_action.c 18 Dec 2007 19:36:57 -0000 1.24 --- gui_gtk_action.c 28 Dec 2007 10:03:42 -0000 1.25 *************** *** 170,181 **** } - static void - visible_routegraph_action(GtkWidget *w, struct gui_priv *gui, void *dummy) - { - navit_toggle_routegraph_display(gui->nav); - } - - - static GtkActionEntry entries[] = { --- 170,173 ---- *************** *** 223,227 **** { "VisibleStreetsAction", NULL, _n("VisibleStreets"), NULL, NULL, G_CALLBACK(visible_streets_action) }, { "VisiblePointsAction", NULL, _n("VisiblePoints"), NULL, NULL, G_CALLBACK(visible_points_action) }, - { "VisibleRouteGraphAction", NULL, _n("RouteGraph"), NULL, NULL, G_CALLBACK(visible_routegraph_action) } }; --- 215,218 ---- Index: gui_gtk_statusbar.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_statusbar.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gui_gtk_statusbar.c 9 Oct 2007 17:04:43 -0000 1.4 --- gui_gtk_statusbar.c 28 Dec 2007 10:03:42 -0000 1.5 *************** *** 6,11 **** --- 6,16 ---- #include "item.h" #include "coord.h" + #include "debug.h" + #include "vehicle.h" + #include "callback.h" #include "route.h" #include "transform.h" + #include "navit.h" + #include "navigation.h" #include "gui_gtk.h" *************** *** 21,24 **** --- 26,30 ---- char route_text[128]; GtkWidget *route; + struct callback *vehicle_cb; }; *************** *** 74,89 **** static void ! statusbar_route_update(struct statusbar_priv *this, struct route *route) { ! #if 0 /* FIXME */ ! struct tm *eta_tm; double route_len; ! eta_tm=route_get_eta(route); ! route_len=route_get_len(route); ! ! sprintf(this->route_text,"Route %4.0fkm %02d:%02d ETA",route_len/1000, eta_tm->tm_hour, eta_tm->tm_min); ! gtk_label_set_text(GTK_LABEL(this->route), this->route_text); ! #endif } --- 80,116 ---- static void ! statusbar_route_update(struct statusbar_priv *this, struct navit *nav, struct vehicle *v) { ! struct navigation *navig; ! struct navigation_list *list; ! struct item *item; ! struct attr attr; double route_len; + time_t eta; + struct tm *eta_tm; + char buffer[128]; ! navig=navit_get_navigation(nav); ! if (! navig) ! return; ! list=navigation_list_new(navig); ! if (! list) ! return; ! item=navigation_list_get_item(list); ! if (! item) ! return; ! if (!item_attr_get(item, attr_destination_length, &attr)) ! return; ! route_len=attr.u.num; ! if (!item_attr_get(item, attr_destination_time, &attr)) ! return; ! eta=time(NULL)+attr.u.num; ! eta_tm=localtime(&eta); ! navigation_list_destroy(list); ! sprintf(buffer,"Route %4.0fkm %02d:%02d ETA",route_len/1000, eta_tm->tm_hour, eta_tm->tm_min); ! if (strcmp(buffer, this->route_text)) { ! strcpy(this->route_text, buffer); ! gtk_label_set_text(GTK_LABEL(this->route), this->route_text); ! } } *************** *** 91,95 **** statusbar_destroy, statusbar_mouse_update, ! statusbar_route_update, statusbar_gps_update, }; --- 118,122 ---- statusbar_destroy, statusbar_mouse_update, ! NULL, statusbar_gps_update, }; *************** *** 122,125 **** --- 149,154 ---- gtk_box_pack_end(GTK_BOX(gui->vbox), this->hbox, FALSE, FALSE, 0); gtk_widget_show_all(this->hbox); + this->vehicle_cb=callback_new_1(callback_cast(statusbar_route_update), this); + navit_add_vehicle_cb(gui->nav, this->vehicle_cb); #if 0 |
From: Martin S. <mar...@us...> - 2007-12-27 17:58:30
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30155 Modified Files: graphics.c route.c Log Message: Fix:Core:Improved route drawing Index: graphics.c =================================================================== RCS file: /cvsroot/navit/navit/src/graphics.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** graphics.c 21 Dec 2007 14:10:10 -0000 1.25 --- graphics.c 27 Dec 2007 17:58:23 -0000 1.26 *************** *** 551,556 **** int order=transform_get_order(trans); gra->meth.draw_mode(gra->priv, draw_mode_begin); - if (route) - route_draw(route, trans, displaylist); xdisplay_draw(displaylist->dl, gra, layouts, order); gra->meth.draw_mode(gra->priv, draw_mode_end); --- 551,554 ---- Index: route.c =================================================================== RCS file: /cvsroot/navit/navit/src/route.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** route.c 26 Dec 2007 10:39:48 -0000 1.31 --- route.c 27 Dec 2007 17:58:23 -0000 1.32 *************** *** 154,158 **** while (c) { n=c->next; ! free(c); c=n; } --- 154,158 ---- while (c) { n=c->next; ! g_free(c); c=n; } *************** *** 450,454 **** { struct route_graph_segment *s; ! s = calloc(1, sizeof(*s)); if (!s) { printf("%s:Out of memory\n", __FUNCTION__); --- 450,454 ---- { struct route_graph_segment *s; ! s = g_new0(struct route_graph_segment, 1); if (!s) { printf("%s:Out of memory\n", __FUNCTION__); *************** *** 548,552 **** ccnt = get_item_seg_coords(&rgs->item, ca, 2047, rgs); ! segment= calloc(1, sizeof(*segment) + sizeof(struct coord) * ccnt); if (!segment) { printf("%s:Out of memory\n", __FUNCTION__); --- 548,552 ---- ccnt = get_item_seg_coords(&rgs->item, ca, 2047, rgs); ! segment= g_malloc0(sizeof(*segment) + sizeof(struct coord) * ccnt); if (!segment) { printf("%s:Out of memory\n", __FUNCTION__); *************** *** 761,765 **** while (curr) { next=curr->next; ! free(curr); curr=next; } --- 761,765 ---- while (curr) { next=curr->next; ! g_free(curr); curr=next; } *************** *** 1422,1478 **** - static int - route_draw_route_info(struct route_info *pos, struct route_info *dst, struct transformation *t, struct displaylist *dsp) - { - struct route_info_handle *h; - struct coord *cp; - struct item item; - int max=100; - struct coord c[max]; - struct point pnt[max]; - int count=0; - struct street_data *street; - enum projection pro = projection_mg; - - item.id_lo=0; - item.id_hi=0; - item.map=NULL; - item.type=type_street_route; - - dbg(1, "enter\n"); - h=route_info_open(pos, dst, 0); - dbg(1,"h=%p\n", h); - if (! h) { - dbg(1, "return 0\n"); - return 0; - } - street = pos ? pos->street : dst->street; - pro = map_projection(street->item.map); - if (pos) - dbg(1, "pos=%p pos->dir=%d pos->pos=%d\n", pos, pos->dir, pos->pos); - while ((cp=route_info_get(h)) && count < max) - c[count++]=*cp; - if (count) - count=transform(t, pro, c, pnt, count, 1); - if (count) - display_add(dsp, &item, count, pnt, "Route"); - route_info_close(h); - dbg(1, "return 1\n"); - return 1; - } - - void - route_draw(struct route *this, struct transformation *t, struct displaylist *dsp) - { - dbg(1,"enter\n"); - if (! this->pos || ! this->dst) - return; - if (! route_draw_route_info(this->pos, this->dst, t, dsp)) { - route_draw_route_info(this->pos, NULL, t, dsp); - route_draw_route_info(NULL, this->dst, t, dsp); - } - dbg(1,"exit\n"); - } - #if 0 struct route_crossings * --- 1422,1425 ---- *************** *** 1505,1508 **** --- 1452,1458 ---- struct map_rect_priv { + struct route_info_handle *ri; + int pos_next; + int pos; struct route *mpriv; struct item item; *************** *** 1537,1549 **** struct map_rect_priv *mr = priv_data; struct route_path_segment *seg = mr->seg; int rc = 0,i; ! for (i=0; i < count; i++) { ! if (mr->last_coord >= seg->ncoords) ! break; ! if (i >= seg->ncoords) ! break; ! c[i] = seg->c[mr->last_coord++]; ! rc++; } return rc; } --- 1487,1524 ---- struct map_rect_priv *mr = priv_data; struct route_path_segment *seg = mr->seg; + struct coord *c1; int rc = 0,i; ! dbg(1,"pos=%d seg=%p\n", mr->pos, seg); ! switch (mr->pos) { ! case -1: ! for (i=0; i < count; i++) { ! if ((c1=route_info_get(mr->ri))) { ! c[i]=*c1; ! rc++; ! } ! } ! break; ! case 0: ! for (i=0; i < count; i++) { ! if (mr->last_coord >= seg->ncoords) ! break; ! if (i >= seg->ncoords) ! break; ! c[i] = seg->c[mr->last_coord++]; ! rc++; ! } ! break; ! case 1: ! for (i=0; i < count; i++) { ! if ((c1=route_info_get(mr->ri))) { ! c[i]=*c1; ! rc++; ! } ! } ! break; ! default: ! rc=0; } + dbg(1,"return %d\n",rc); return rc; } *************** *** 1561,1573 **** struct map_rect_priv *mr = priv_data; struct route_graph_point *p = mr->point; - char buf[1024]; switch (attr_type) { case attr_any: case attr_label: attr->type = attr_label; - sprintf(buf, "x=%d y=%d", p->c.x, p->c.y); if (mr->label) ! free(mr->label); ! mr->label=strdup(buf); attr->u.str = mr->label; return 1; --- 1536,1546 ---- struct map_rect_priv *mr = priv_data; struct route_graph_point *p = mr->point; switch (attr_type) { case attr_any: case attr_label: attr->type = attr_label; if (mr->label) ! g_free(mr->label); ! mr->label=g_strdup_printf("x=%d y=%d", p->c.x, p->c.y); attr->u.str = mr->label; return 1; *************** *** 1608,1616 **** rm_rect_new(struct map_priv *map, struct map_selection *sel) { struct map_rect_priv * mr; ! mr = calloc(1, sizeof(*mr)); ! if (!mr) ! return mr; ! mr->mpriv = (struct route *)map; return mr; } --- 1581,1595 ---- rm_rect_new(struct map_priv *map, struct map_selection *sel) { + struct route *route=(struct route *)map; struct map_rect_priv * mr; ! dbg(1,"enter\n"); ! mr=g_new0(struct map_rect_priv, 1); ! mr->mpriv = route; ! mr->ri=route_info_open(route_get_pos(route), route_get_dst(route), 0); ! mr->pos_next=1; ! if (!mr->ri) { ! mr->ri=route_info_open(route_get_pos(route), NULL, 0); ! mr->pos_next=-1; ! } return mr; } *************** *** 1619,1625 **** rm_rect_destroy(struct map_rect_priv *mr) { if (mr->label) ! free(mr->label); ! free(mr); } --- 1598,1606 ---- rm_rect_destroy(struct map_rect_priv *mr) { + if (mr->ri) + route_info_close(mr->ri); if (mr->label) ! g_free(mr->label); ! g_free(mr); } *************** *** 1629,1632 **** --- 1610,1614 ---- struct route *r = mr->mpriv; struct route_path_segment *seg = mr->seg; + dbg(1,"enter\n", mr->pos); rep: *************** *** 1655,1664 **** } ! /* FIXME: Generate items for segstart-dst/pos */ ! if (!seg) ! seg = r->path2->path; ! else ! seg = seg->next; ! if (!seg) { mr->segsdone = 1; if (r->flags & RF_SHOWGRAPH) --- 1637,1661 ---- } ! mr->pos=mr->pos_next; ! switch(mr->pos) { ! case -1: ! mr->pos_next=0; ! break; ! case 0: ! if (!seg) ! seg = r->path2->path; ! else ! seg = seg->next; ! if (seg) { ! mr->item = seg->item; ! break; ! } ! mr->pos=1; ! route_info_close(mr->ri); ! mr->ri=route_info_open(NULL, route_get_dst(r), 0); ! case 1: ! mr->pos_next=2; ! break; ! case 2: mr->segsdone = 1; if (r->flags & RF_SHOWGRAPH) *************** *** 1671,1675 **** mr->item.id_lo = 0; mr->item.map = NULL; - mr->item = seg->item; mr->item.priv_data = mr; mr->item.type = type_street_route; --- 1668,1671 ---- |