summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-13 17:43:46 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-04-13 17:43:46 +0000
commita1e11be4e1b6c0c657fd507b63c0be5dc6339144 (patch)
tree263bbe665b6813e39856897905f6b8bde9b76bad
parent7b95b0f2364a14a4bc6f5727244441828b94b4c6 (diff)
downloadnavit-a1e11be4e1b6c0c657fd507b63c0be5dc6339144.tar.gz
Add:Core:Intermix waypoints with route segments in route map for easier identification
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5438 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r--navit/navit/gui/internal/gui_internal.c6
-rw-r--r--navit/navit/navit_shipped.xml132
-rw-r--r--navit/navit/route.c25
3 files changed, 80 insertions, 83 deletions
diff --git a/navit/navit/gui/internal/gui_internal.c b/navit/navit/gui/internal/gui_internal.c
index b7194e8e1..0a52621f4 100644
--- a/navit/navit/gui/internal/gui_internal.c
+++ b/navit/navit/gui/internal/gui_internal.c
@@ -653,7 +653,7 @@ gui_internal_select_waypoint(struct gui_priv *this, char *title, char *hint, str
i=0;
while((item = map_rect_get_item(mr))!=NULL) {
struct attr attr;
- if(item->type!=type_waypoint)
+ if(item->type!=type_waypoint && item->type!=type_route_end)
continue;
if (item_attr_get(item, attr_label, &attr)) {
label=map_convert_string(item->map, attr.u.str);
@@ -1052,7 +1052,7 @@ gui_internal_cmd_delete_waypoint(struct gui_priv *this, struct widget *wm, void
i=0;
while((item=map_rect_get_item(mr))!=NULL) {
struct coord c;
- if(item->type!=type_waypoint)
+ if(item->type!=type_waypoint && item->type!=type_route_end)
continue;
if(item_is_equal_id(*item,wm->item))
continue;
@@ -1341,7 +1341,7 @@ gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct
wbc->text=g_strdup(wm->text);
}
- if (wm && wm->item.type==type_waypoint) {
+ if (wm && (wm->item.type==type_waypoint || wm->item.type==type_route_end)) {
gui_internal_widget_append(wtable,row=gui_internal_widget_table_row_new(this,gravity_left|orientation_horizontal|flags_fill));
gui_internal_widget_append(row,
wbc=gui_internal_button_new_with_callback(this, _("Delete waypoint"),
diff --git a/navit/navit/navit_shipped.xml b/navit/navit/navit_shipped.xml
index f7ea414e2..ba27e91b8 100644
--- a/navit/navit/navit_shipped.xml
+++ b/navit/navit/navit_shipped.xml
@@ -1907,43 +1907,43 @@ Waypoint</text></img>
<circle color="#FF089C" radius="10" text_size="7"/>
</itemgra>
- <itemgra item_types="waypoint" order="2">
+ <itemgra item_types="waypoint,route_end" order="2">
<circle color="#008080" radius="4" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="3-5">
+ <itemgra item_types="waypoint,route_end" order="3-5">
<circle color="#008080" radius="8" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="6">
+ <itemgra item_types="waypoint,route_end" order="6">
<circle color="#008080" radius="10" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="7-8">
+ <itemgra item_types="waypoint,route_end" order="7-8">
<circle color="#008080" radius="16" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="9-10">
+ <itemgra item_types="waypoint,route_end" order="9-10">
<circle color="#008080" radius="20" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="11">
+ <itemgra item_types="waypoint,route_end" order="11">
<circle color="#008080" radius="28" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="12">
+ <itemgra item_types="waypoint,route_end" order="12">
<circle color="#008080" radius="32" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="13">
+ <itemgra item_types="waypoint,route_end" order="13">
<circle color="#008080" radius="52" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="14">
+ <itemgra item_types="waypoint,route_end" order="14">
<circle color="#008080" radius="64" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="15">
+ <itemgra item_types="waypoint,route_end" order="15">
<circle color="#008080" radius="68" width="6" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="16">
+ <itemgra item_types="waypoint,route_end" order="16">
<circle color="#008080" radius="132" width="8" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="17">
+ <itemgra item_types="waypoint,route_end" order="17">
<circle color="#008080" radius="268" width="8" text_size="48"/>
</itemgra>
- <itemgra item_types="waypoint" order="18">
+ <itemgra item_types="waypoint,route_end" order="18">
<circle color="#008080" radius="530" width="8" text_size="48"/>
</itemgra>
</layer>
@@ -3365,43 +3365,43 @@ Waypoint</text></img>
<circle color="#FF089C" radius="10" background_color="#000000" text_size="7"/>
</itemgra>
- <itemgra item_types="waypoint" order="2">
+ <itemgra item_types="waypoint,route_end" order="2">
<circle color="#00a0a0" radius="4" width="2" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="3-5">
+ <itemgra item_types="waypoint,route_end" order="3-5">
<circle color="#00a0a0" radius="8" width="2" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="6">
+ <itemgra item_types="waypoint,route_end" order="6">
<circle color="#00a0a0" radius="10" width="2" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="7-8">
+ <itemgra item_types="waypoint,route_end" order="7-8">
<circle color="#00a0a0" radius="16" width="2" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="9-10">
+ <itemgra item_types="waypoint,route_end" order="9-10">
<circle color="#00a0a0" radius="20" width="4" background_color="#000000" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="11">
+ <itemgra item_types="waypoint,route_end" order="11">
<circle color="#00a0a0" radius="28" width="4" background_color="#000000" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="12">
+ <itemgra item_types="waypoint,route_end" order="12">
<circle color="#00a0a0" radius="32" width="4" background_color="#000000" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="13">
+ <itemgra item_types="waypoint,route_end" order="13">
<circle color="#00a0a0" radius="52" width="4" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="14">
+ <itemgra item_types="waypoint,route_end" order="14">
<circle color="#00a0a0" radius="64" width="4" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="15">
+ <itemgra item_types="waypoint,route_end" order="15">
<circle color="#00a0a0" radius="68" width="6" background_color="#000000" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="16">
+ <itemgra item_types="waypoint,route_end" order="16">
<circle color="#00a0a0" radius="132" width="8" background_color="#000000" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="17">
+ <itemgra item_types="waypoint,route_end" order="17">
<circle color="#00a0a0" radius="268" width="8" background_color="#000000" text_size="48"/>
</itemgra>
- <itemgra item_types="waypoint" order="18">
+ <itemgra item_types="waypoint,route_end" order="18">
<circle color="#00a0a0" radius="530" width="8" background_color="#000000" text_size="48"/>
</itemgra>
</layer>
@@ -4681,43 +4681,43 @@ Waypoint</text></img>
<icon src="nav_destination_bk.png" w="32" h="32" x="4" y="30"/>
</itemgra>
- <itemgra item_types="waypoint" order="2">
+ <itemgra item_types="waypoint,route_end" order="2">
<circle color="#000000" radius="4" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="3-5">
+ <itemgra item_types="waypoint,route_end" order="3-5">
<circle color="#000000" radius="8" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="6">
+ <itemgra item_types="waypoint,route_end" order="6">
<circle color="#000000" radius="10" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="7-8">
+ <itemgra item_types="waypoint,route_end" order="7-8">
<circle color="#000000" radius="16" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="9-10">
+ <itemgra item_types="waypoint,route_end" order="9-10">
<circle color="#000000" radius="20" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="11">
+ <itemgra item_types="waypoint,route_end" order="11">
<circle color="#000000" radius="28" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="12">
+ <itemgra item_types="waypoint,route_end" order="12">
<circle color="#000000" radius="32" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="13">
+ <itemgra item_types="waypoint,route_end" order="13">
<circle color="#000000" radius="52" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="14">
+ <itemgra item_types="waypoint,route_end" order="14">
<circle color="#000000" radius="64" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="15">
+ <itemgra item_types="waypoint,route_end" order="15">
<circle color="#000000" radius="68" width="6" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="16">
+ <itemgra item_types="waypoint,route_end" order="16">
<circle color="#000000" radius="132" width="8" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="17">
+ <itemgra item_types="waypoint,route_end" order="17">
<circle color="#000000" radius="268" width="8" text_size="48"/>
</itemgra>
- <itemgra item_types="waypoint" order="18">
+ <itemgra item_types="waypoint,route_end" order="18">
<circle color="#000000" radius="530" width="8" text_size="48"/>
</itemgra>
@@ -5387,7 +5387,7 @@ Waypoint</text></img>
<polyline width="9" color="#ffffff" />
</itemgra>
- <itemgra item_types="waypoint" >
+ <itemgra item_types="waypoint,route_end" >
<circle color="#000000" radius="8" width="2" text_size="24"/>
</itemgra>
</layer>
@@ -6329,43 +6329,43 @@ Waypoint</text></img>
<icon src="nav_destination_bk.svg" w="32" h="32" x="4" y="30"/>
</itemgra>
- <itemgra item_types="waypoint" order="2">
+ <itemgra item_types="waypoint,route_end" order="2">
<circle color="#000000" radius="4" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="3-5">
+ <itemgra item_types="waypoint,route_end" order="3-5">
<circle color="#000000" radius="8" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="6">
+ <itemgra item_types="waypoint,route_end" order="6">
<circle color="#000000" radius="10" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="7-8">
+ <itemgra item_types="waypoint,route_end" order="7-8">
<circle color="#000000" radius="16" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="9-10">
+ <itemgra item_types="waypoint,route_end" order="9-10">
<circle color="#000000" radius="20" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="11">
+ <itemgra item_types="waypoint,route_end" order="11">
<circle color="#000000" radius="28" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="12">
+ <itemgra item_types="waypoint,route_end" order="12">
<circle color="#000000" radius="32" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="13">
+ <itemgra item_types="waypoint,route_end" order="13">
<circle color="#000000" radius="52" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="14">
+ <itemgra item_types="waypoint,route_end" order="14">
<circle color="#000000" radius="64" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="15">
+ <itemgra item_types="waypoint,route_end" order="15">
<circle color="#000000" radius="68" width="6" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="16">
+ <itemgra item_types="waypoint,route_end" order="16">
<circle color="#000000" radius="132" width="8" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="17">
+ <itemgra item_types="waypoint,route_end" order="17">
<circle color="#000000" radius="268" width="8" text_size="48"/>
</itemgra>
- <itemgra item_types="waypoint" order="18">
+ <itemgra item_types="waypoint,route_end" order="18">
<circle color="#000000" radius="530" width="8" text_size="48"/>
</itemgra>
@@ -6926,43 +6926,43 @@ Waypoint</text></img>
<circle color="#FF089C" radius="10"/>
</itemgra>
- <itemgra item_types="waypoint" order="2">
+ <itemgra item_types="waypoint,route_end" order="2">
<circle color="#008080" radius="4" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="3-5">
+ <itemgra item_types="waypoint,route_end" order="3-5">
<circle color="#008080" radius="8" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="6">
+ <itemgra item_types="waypoint,route_end" order="6">
<circle color="#008080" radius="10" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="7-8">
+ <itemgra item_types="waypoint,route_end" order="7-8">
<circle color="#008080" radius="16" width="2" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="9-10">
+ <itemgra item_types="waypoint,route_end" order="9-10">
<circle color="#008080" radius="20" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="11">
+ <itemgra item_types="waypoint,route_end" order="11">
<circle color="#008080" radius="28" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="12">
+ <itemgra item_types="waypoint,route_end" order="12">
<circle color="#008080" radius="32" width="4" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="13">
+ <itemgra item_types="waypoint,route_end" order="13">
<circle color="#008080" radius="52" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="14">
+ <itemgra item_types="waypoint,route_end" order="14">
<circle color="#008080" radius="64" width="4" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="15">
+ <itemgra item_types="waypoint,route_end" order="15">
<circle color="#008080" radius="68" width="6" text_size="24"/>
</itemgra>
- <itemgra item_types="waypoint" order="16">
+ <itemgra item_types="waypoint,route_end" order="16">
<circle color="#008080" radius="132" width="8" text_size="32"/>
</itemgra>
- <itemgra item_types="waypoint" order="17">
+ <itemgra item_types="waypoint,route_end" order="17">
<circle color="#008080" radius="268" width="8" text_size="48"/>
</itemgra>
- <itemgra item_types="waypoint" order="18">
+ <itemgra item_types="waypoint,route_end" order="18">
<circle color="#008080" radius="530" width="8" text_size="48"/>
</itemgra>
diff --git a/navit/navit/route.c b/navit/navit/route.c
index 6513d5086..d520d8c0d 100644
--- a/navit/navit/route.c
+++ b/navit/navit/route.c
@@ -3040,7 +3040,7 @@ rm_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
struct map_rect_priv *mr = priv_data;
struct route_path_segment *seg=mr->seg;
struct route *route=mr->mpriv->route;
- if (mr->item.type != type_street_route && mr->item.type != type_waypoint)
+ if (mr->item.type != type_street_route && mr->item.type != type_waypoint && mr->item.type != type_route_end)
return 0;
attr->type=attr_type;
switch (attr_type) {
@@ -3100,7 +3100,7 @@ rm_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
return 1;
case attr_label:
mr->attr_next=attr_none;
- if(mr->item.type==type_waypoint) {
+ if(mr->item.type==type_waypoint || mr->item.type == type_route_end) {
if(mr->str)
g_free(mr->str);
mr->str=g_strdup_printf("%d",route->reached_destinations_count+g_list_position(route->destinations,mr->dest)+1);
@@ -3545,20 +3545,11 @@ rm_get_item(struct map_rect_priv *mr)
case type_route_start:
case type_route_start_reverse:
- case type_waypoint:
- mr->item.type=type_waypoint;
mr->seg=NULL;
- if(!mr->dest)
- mr->dest=mr->mpriv->route->destinations;
- else
- mr->dest=g_list_next(mr->dest);
-
- if(mr->dest) {
- id=mr->dest;
- break;
- }
-
+ mr->dest=mr->mpriv->route->destinations;
default:
+ if (mr->item.type == type_waypoint)
+ mr->dest=g_list_next(mr->dest);
mr->item.type=type_street_route;
mr->seg=mr->seg_next;
if (!mr->seg && mr->path && mr->path->next) {
@@ -3571,6 +3562,12 @@ rm_get_item(struct map_rect_priv *mr)
mr->seg=mr->path->path;
if (p)
g_free(p);
+ if (mr->dest) {
+ id=mr->dest;
+ mr->item.type=type_waypoint;
+ mr->seg_next=mr->seg;
+ break;
+ }
}
if (mr->seg) {
mr->seg_next=mr->seg->next;