|
|
1 | /** |
|
|
2 | * ZANavi, Zoff Android Navigation system. |
|
|
3 | * Copyright (C) 2011-2012 Zoff <zoff@zoff.cc> |
|
|
4 | * |
|
|
5 | * This program is free software; you can redistribute it and/or |
|
|
6 | * modify it under the terms of the GNU 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 General Public License for more details. |
|
|
13 | * |
|
|
14 | * You should have received a copy of the GNU General Public License |
|
|
15 | * 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 | |
1 | /** |
20 | /** |
2 | * Navit, a modular navigation system. |
21 | * Navit, a modular navigation system. |
3 | * Copyright (C) 2005-2008 Navit Team |
22 | * Copyright (C) 2005-2008 Navit Team |
4 | * |
23 | * |
5 | * This program is free software; you can redistribute it and/or |
24 | * This program is free software; you can redistribute it and/or |
… | |
… | |
19 | |
38 | |
20 | #ifndef NAVIT_NAVIT_H |
39 | #ifndef NAVIT_NAVIT_H |
21 | #define NAVIT_NAVIT_H |
40 | #define NAVIT_NAVIT_H |
22 | |
41 | |
23 | #ifdef __cplusplus |
42 | #ifdef __cplusplus |
24 | extern "C" { |
43 | extern "C" |
|
|
44 | { |
25 | #endif |
45 | #endif |
26 | extern struct gui *main_loop_gui; |
46 | extern struct gui *main_loop_gui; |
27 | // defined in glib.h. |
47 | // defined in glib.h. |
28 | #ifndef __G_LIST_H__ |
48 | #ifndef __G_LIST_H__ |
29 | struct _GList; |
49 | struct _GList; |
30 | typedef struct _GList GList; |
50 | typedef struct _GList GList; |
31 | #endif |
51 | #endif |
32 | |
52 | |
33 | extern int allow_gui_internal; |
53 | extern int allow_gui_internal; |
34 | extern int draw_display_at_speed; |
54 | extern int draw_display_at_speed; |
35 | extern int routing_mode; // 0-> normal highway rounting |
55 | extern int routing_mode; // 0-> normal highway rounting |
36 | // 1-> normal roads routing |
56 | // 1-> normal roads routing |
37 | // 2-> future use |
57 | // 2-> future use |
38 | extern int offline_search_filter_duplicates; |
58 | extern int offline_search_filter_duplicates; |
39 | extern int offline_search_break_searching; |
59 | extern int offline_search_break_searching; |
|
|
60 | extern char *navit_maps_dir; |
|
|
61 | extern int cancel_drawing_global; |
|
|
62 | extern int global_speak_streetnames; |
40 | |
63 | |
|
|
64 | extern int allow_large_mapfiles; |
|
|
65 | extern int cache_size_file; /* cache size in bytes */ |
|
|
66 | extern int draw_polylines_fast; // 1 -> dont draw circles at the end of polylines 0-> do draw circles |
|
|
67 | |
|
|
68 | extern int limit_order_corrected; |
|
|
69 | extern int global_search_street_size_factor; |
41 | |
70 | |
42 | /* prototypes */ |
71 | /* prototypes */ |
43 | enum attr_type; |
72 | enum attr_type; |
44 | struct attr; |
73 | struct attr; |
45 | struct attr_iter; |
74 | struct attr_iter; |
… | |
… | |
116 | struct route *navit_get_route(struct navit *this_); |
145 | struct route *navit_get_route(struct navit *this_); |
117 | struct navigation *navit_get_navigation(struct navit *this_); |
146 | struct navigation *navit_get_navigation(struct navit *this_); |
118 | struct displaylist *navit_get_displaylist(struct navit *this_); |
147 | struct displaylist *navit_get_displaylist(struct navit *this_); |
119 | void navit_layout_switch(struct navit *n); |
148 | void navit_layout_switch(struct navit *n); |
120 | int navit_set_vehicle_by_name(struct navit *n, const char *name); |
149 | int navit_set_vehicle_by_name(struct navit *n, const char *name); |
|
|
150 | |
|
|
151 | void navit_set_cursors(struct navit *this_); |
|
|
152 | |
|
|
153 | #include "vehicle.h" |
|
|
154 | int navit_add_vehicle(struct navit *this_, struct vehicle *v); |
|
|
155 | |
121 | int navit_set_layout_by_name(struct navit *n, const char *name); |
156 | int navit_set_layout_by_name(struct navit *n, const char *name); |
122 | void navit_disable_suspend(void); |
157 | void navit_disable_suspend(void); |
123 | int navit_block(struct navit *this_, int block); |
158 | int navit_block(struct navit *this_, int block); |
124 | void navit_destroy(struct navit *this_); |
159 | void navit_destroy(struct navit *this_); |
125 | void navit_command_add_table(struct navit*this_, struct command_table *commands, int count); |
160 | void navit_command_add_table(struct navit*this_, struct command_table *commands, int count); |
126 | // |
161 | // |
127 | // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir); |
162 | // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir); |
128 | int navit_get_cur_pnt(struct navit *this_, struct point *p); |
163 | int navit_get_cur_pnt(struct navit *this_, struct point *p); |
129 | |
164 | |
130 | |
|
|
131 | |
|
|
132 | |
|
|
133 | |
|
|
134 | #include "coord.h" |
165 | #include "coord.h" |
135 | #include "point.h" |
166 | #include "point.h" |
136 | #include "item.h" |
167 | #include "item.h" |
137 | #include "attr.h" |
168 | #include "attr.h" |
138 | |
169 | |
139 | struct coord global_vehicle_pos_onscreen; |
170 | struct coord global_vehicle_pos_onscreen; |
140 | |
171 | |
141 | //! The navit_vehicule |
172 | //! The navit_vehicule |
142 | struct navit_vehicle { |
173 | struct navit_vehicle |
|
|
174 | { |
143 | int follow; |
175 | int follow; |
144 | /*! Limit of the follow counter. See navit_add_vehicle */ |
176 | /*! Limit of the follow counter. See navit_add_vehicle */ |
145 | int follow_curr; |
177 | int follow_curr; |
146 | /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/ |
178 | /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/ |
147 | struct coord coord; |
179 | struct coord coord; |
… | |
… | |
151 | struct vehicle *vehicle; |
183 | struct vehicle *vehicle; |
152 | struct attr callback; |
184 | struct attr callback; |
153 | int animate_cursor; |
185 | int animate_cursor; |
154 | }; |
186 | }; |
155 | |
187 | |
156 | struct navit { |
188 | struct navit |
|
|
189 | { |
157 | struct attr self; |
190 | struct attr self; |
158 | GList *mapsets; |
191 | GList *mapsets; |
159 | GList *layouts; |
192 | GList *layouts; |
160 | struct gui *gui; |
193 | struct gui *gui; |
161 | struct layout *layout_current; |
194 | struct layout *layout_current; |
… | |
… | |
180 | struct callback_list *attr_cbl; |
213 | struct callback_list *attr_cbl; |
181 | struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb; |
214 | struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb; |
182 | struct datawindow *roadbook_window; |
215 | struct datawindow *roadbook_window; |
183 | struct map *former_destination; |
216 | struct map *former_destination; |
184 | struct point pressed, last, current; |
217 | struct point pressed, last, current; |
185 | int button_pressed,moved,popped,zoomed; |
218 | int button_pressed, moved, popped, zoomed; |
186 | int center_timeout; |
219 | int center_timeout; |
187 | int autozoom_secs; |
220 | int autozoom_secs; |
188 | int autozoom_min; |
221 | int autozoom_min; |
189 | int autozoom_active; |
222 | int autozoom_active; |
190 | struct event_timeout *button_timeout, *motion_timeout; |
223 | struct event_timeout *button_timeout, *motion_timeout; |
… | |
… | |
193 | int ignore_graphics_events; |
226 | int ignore_graphics_events; |
194 | struct log *textfile_debug_log; |
227 | struct log *textfile_debug_log; |
195 | struct pcoord destination; |
228 | struct pcoord destination; |
196 | int destination_valid; |
229 | int destination_valid; |
197 | int blocked; |
230 | int blocked; |
198 | int w,h; |
231 | int w, h; |
199 | int drag_bitmap; |
232 | int drag_bitmap; |
200 | int use_mousewheel; |
233 | int use_mousewheel; |
201 | struct messagelist *messages; |
234 | struct messagelist *messages; |
202 | struct callback *resize_callback,*button_callback,*motion_callback,*predraw_callback; |
235 | struct callback *resize_callback, *button_callback, *motion_callback, *predraw_callback; |
203 | struct vehicleprofile *vehicleprofile; |
236 | struct vehicleprofile *vehicleprofile; |
204 | GList *vehicleprofiles; |
237 | GList *vehicleprofiles; |
205 | int pitch; |
238 | int pitch; |
206 | int follow_cursor; |
239 | int follow_cursor; |
207 | int prevTs; |
240 | int prevTs; |
208 | int graphics_flags; |
241 | int graphics_flags; |
209 | int zoom_min, zoom_max; |
242 | int zoom_min, zoom_max; |
210 | int radius; |
243 | int radius; |
211 | struct bookmarks *bookmarks; |
244 | struct bookmarks *bookmarks; |
212 | int flags; |
245 | int flags; |
213 | /* 1=No graphics ok */ |
246 | /* 1=No graphics ok */ |
214 | /* 2=No gui ok */ |
247 | /* 2=No gui ok */ |
215 | int border; |
248 | int border; |
216 | int imperial; |
249 | int imperial; |
217 | }; |
250 | }; |
218 | |
251 | |
|
|
252 | // global navit struct, needed almost everywhere |
|
|
253 | struct navit *global_navit; |
219 | |
254 | |
|
|
255 | // dirty global var for waypoint bitmap |
|
|
256 | struct graphics_image *global_img_waypoint; |
220 | |
257 | |
221 | /* end of prototypes */ |
258 | /* end of prototypes */ |
222 | #ifdef __cplusplus |
259 | #ifdef __cplusplus |
223 | } |
260 | } |
224 | #endif |
261 | #endif |