Add license files and headers
[navit-package] / navit / route.h
1 /**
2  * Navit, a modular navigation system.
3  * Copyright (C) 2005-2008 Navit Team
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public License
7  * version 2 as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA  02110-1301, USA.
18  */
19
20 #ifndef NAVIT_ROUTE_H
21 #define NAVIT_ROUTE_H
22
23 struct route_crossing {
24         long segid;
25         int dir;
26 };
27
28 struct route_crossings {
29         int count;
30         struct route_crossing crossing[0];
31 };
32
33 struct street_data {
34         struct item item;
35         int count;
36         int flags;
37         struct coord c[0];
38 };
39
40 #define route_item_first type_street_0
41 #define route_item_last type_ferry
42
43 /* prototypes */
44 enum item_type;
45 struct coord;
46 struct displaylist;
47 struct item;
48 struct map_selection;
49 struct mapset;
50 struct route;
51 struct route_info;
52 struct route_info_handle;
53 struct route_path_coord_handle;
54 struct route_path_handle;
55 struct route_path_segment;
56 struct street_data;
57 struct tracking;
58 struct transformation;
59 struct route *route_new(struct attr **attrs);
60 void route_set_mapset(struct route *this, struct mapset *ms);
61 struct mapset *route_get_mapset(struct route *this);
62 struct route_info *route_get_pos(struct route *this);
63 struct route_info *route_get_dst(struct route *this);
64 int *route_get_speedlist(struct route *this);
65 int route_get_path_set(struct route *this);
66 int route_set_speed(struct route *this, enum item_type type, int value);
67 int route_contains(struct route *this, struct item *item);
68 void route_set_position(struct route *this, struct pcoord *pos);
69 void route_set_position_from_tracking(struct route *this, struct tracking *tracking);
70 struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs);
71 void route_set_destination(struct route *this, struct pcoord *dst);
72 struct route_path_handle *route_path_open(struct route *this);
73 struct route_path_segment *route_path_get_segment(struct route_path_handle *h);
74 struct coord *route_path_segment_get_start(struct route_path_segment *s);
75 struct coord *route_path_segment_get_end(struct route_path_segment *s);
76 struct item *route_path_segment_get_item(struct route_path_segment *s);
77 int route_path_segment_get_length(struct route_path_segment *s);
78 int route_path_segment_get_time(struct route_path_segment *s);
79 void route_path_close(struct route_path_handle *h);
80 struct route_path_coord_handle *route_path_coord_open(struct route *this);
81 struct coord *route_path_coord_get(struct route_path_coord_handle *h);
82 void route_path_coord_close(struct route_path_coord_handle *h);
83 int route_time(int *speedlist, struct item *item, int len);
84 int route_info_length(struct route_info *pos, struct route_info *dst, int dir);
85 struct street_data *street_get_data(struct item *item);
86 struct street_data *street_data_dup(struct street_data *orig);
87 void street_data_free(struct street_data *sd);
88 void route_info_free(struct route_info *inf);
89 struct street_data *route_info_street(struct route_info *rinf);
90 struct coord *route_info_point(struct route_info *rinf, int point);
91 struct route_info_handle *route_info_open(struct route_info *start, struct route_info *end, int dir);
92 struct coord *route_info_get(struct route_info_handle *h);
93 void route_info_close(struct route_info_handle *h);
94 void route_draw(struct route *this, struct transformation *t, struct displaylist *dsp);
95 struct map *route_get_map(struct route *route);
96 struct map *route_get_graph_map(struct route *route);
97 void route_toggle_routegraph_display(struct route *route);
98 void route_set_projection(struct route *this_, enum projection pro);
99 void route_init(void);
100 /* end of prototypes */
101
102 #endif
103