/[zanavi_public1]/navit/navit/navit.h
ZANavi

Contents of /navit/navit/navit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34 - (show annotations) (download)
Sat Dec 14 12:13:17 2013 UTC (10 years, 4 months ago) by zoff99
File MIME type: text/plain
File size: 11486 byte(s)
lots of fixes and changes, new world map
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
20 /**
21 * Navit, a modular navigation system.
22 * Copyright (C) 2005-2008 Navit Team
23 *
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU Library General Public License
26 * version 2 as published by the Free Software Foundation.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU Library General Public License for more details.
32 *
33 * You should have received a copy of the GNU Library General Public
34 * License along with this program; if not, write to the
35 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
36 * Boston, MA 02110-1301, USA.
37 */
38
39 #ifndef NAVIT_NAVIT_H
40 #define NAVIT_NAVIT_H
41
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 extern struct gui *main_loop_gui;
47 // defined in glib.h.
48 #ifndef __G_LIST_H__
49 struct _GList;
50 typedef struct _GList GList;
51 #endif
52
53
54 // color codes for colour attribute in OS;
55 #define __c_black "000000"
56 #define __c_gray "808080"
57 #define __c_maroon "800000"
58 #define __c_olive "808000"
59 #define __c_green "008000"
60 #define __c_teal "008080"
61 #define __c_navy "000080"
62 #define __c_purple "800080"
63
64 #define __c_white "FFFFFF"
65 #define __c_silver "C0C0C0"
66 #define __c_red "FF0000"
67 #define __c_yellow "FFFF00"
68 #define __c_lime "00FF00"
69 #define __c_aqua "00FFFF"
70 #define __c_blue "0000FF"
71 #define __c_fuchsia "FF00FF"
72
73 #define __c_brown "A52A2A"
74
75
76 // --------------------------------------------
77 // --
78 // minimum binfile map version needed for this version of ZANavi to work
79 #define NEED_MIN_BINFILE_MAPVERSION 2
80 // --
81 // --------------------------------------------
82
83
84
85 extern int allow_gui_internal;
86 extern int draw_display_at_speed;
87 extern int routing_mode; // 0-> normal highway routing
88 // 1-> normal roads routing
89 // 2-> future use
90 extern int offline_search_filter_duplicates;
91 extern int offline_search_break_searching;
92 extern char *navit_maps_dir;
93 extern char *navit_share_dir;
94 extern char* navit_data_dir;
95 extern int cancel_drawing_global;
96 extern int disable_map_drawing;
97 extern int global_speak_streetnames;
98
99 extern int allow_large_mapfiles;
100 extern int cache_size_file; /* cache size in bytes */
101 extern int draw_polylines_fast; // 1 -> dont draw circles at the end of polylines 0-> do draw circles
102
103 extern int limit_order_corrected;
104 extern int shift_order;
105 extern int global_search_street_size_factor;
106 extern int hold_drawing;
107 extern int global_stop_demo_vehicle;
108 extern int global_show_route_rectangles;
109 extern int global_traffic_light_delay;
110 extern int global_draw_multipolygons;
111 extern int global_have_dpi_value;
112 extern float global_dpi_factor;
113 extern int global_order_level_for_fast_draw;
114 extern int global_show_english_labels;
115
116 extern long long draw_lines_count_2;
117 extern long long draw_lines_count_3;
118 extern long long draw_lines_count_4;
119 extern int poi_on_map_count;
120 extern int label_on_map_count;
121 extern int label_district_on_map_count;
122 extern int label_major_on_map_count;
123 extern int poi_icon_on_map_count;
124
125
126 extern int mapdraw_time[11 + 5];
127 extern int cur_mapdraw_time_index;
128
129 extern int route_status_previous;
130 extern long long global_route_memory_size;
131 extern int global_old_vehicle_speed;
132 extern int global_old_vehicle_speed_for_autozoom;
133
134 extern GHashTable *global_transform_hash;
135 extern GHashTable *global_transform_hash2;
136
137 /* prototypes */
138 enum attr_type;
139 struct attr;
140 struct attr_iter;
141 struct callback;
142 struct coord_rect;
143 struct displaylist;
144 struct graphics;
145 struct gui;
146 struct mapset;
147 struct message;
148 struct navigation;
149 struct navit;
150 struct pcoord;
151 struct point;
152 struct route;
153 struct tracking;
154 struct transformation;
155 struct vehicleprofile;
156 struct command_table;
157 void navit_add_mapset(struct navit *this_, struct mapset *ms);
158 struct mapset *navit_get_mapset(struct navit *this_);
159 struct tracking *navit_get_tracking(struct navit *this_);
160 char *navit_get_user_data_directory(int create);
161 void navit_draw_async(struct navit *this_, int async);
162 void navit_draw(struct navit *this_);
163 int navit_get_ready(struct navit *this_);
164 void navit_draw_displaylist(struct navit *this_);
165 void navit_handle_resize(struct navit *this_, int w, int h);
166 int navit_get_width(struct navit *this_);
167 int navit_get_height(struct navit *this_);
168 int navit_ignore_button(struct navit *this_);
169 void navit_ignore_graphics_events(struct navit *this_, int ignore);
170 void navit_set_timeout(struct navit *this_);
171 int navit_handle_button(struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback);
172 void navit_handle_motion(struct navit *this_, struct point *p);
173 void navit_zoom_in(struct navit *this_, int factor, struct point *p);
174 void navit_zoom_out(struct navit *this_, int factor, struct point *p);
175 void navit_zoom_in_cursor(struct navit *this_, int factor);
176 void navit_zoom_out_cursor(struct navit *this_, int factor);
177 struct navit *navit_new(struct attr *parent, struct attr **attrs);
178 void navit_add_message(struct navit *this_, char *message);
179 struct message *navit_get_messages(struct navit *this_);
180 struct graphics *navit_get_graphics(struct navit *this_);
181 struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
182 GList *navit_get_vehicleprofiles(struct navit *this_);
183 void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
184 void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
185 int navit_check_route(struct navit *this_);
186 void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
187 void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
188 int navit_speech_estimate(struct navit *this_, char *str);
189 void navit_say(struct navit *this_, char *text);
190 void navit_speak(struct navit *this_);
191 void navit_window_roadbook_destroy(struct navit *this_);
192 void navit_window_roadbook_new(struct navit *this_);
193 void navit_reload_maps(struct navit *this_);
194 void navit_init(struct navit *this_);
195 void navit_zoom_to_rect(struct navit *this_, struct coord_rect *r);
196 void navit_zoom_to_route(struct navit *this_, int orientation);
197 void navit_set_center(struct navit *this_, struct pcoord *center, int set_timeout);
198 void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation);
199 void navit_set_center_screen(struct navit *this_, struct point *p, int set_timeout);
200 int navit_set_attr(struct navit *this_, struct attr *attr);
201 int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
202 int navit_add_attr(struct navit *this_, struct attr *attr);
203 int navit_remove_attr(struct navit *this_, struct attr *attr);
204 struct attr_iter *navit_attr_iter_new(void);
205 void navit_attr_iter_destroy(struct attr_iter *iter);
206 void navit_add_callback(struct navit *this_, struct callback *cb);
207 void navit_remove_callback(struct navit *this_, struct callback *cb);
208 void navit_set_position(struct navit *this_, struct pcoord *c);
209 struct gui *navit_get_gui(struct navit *this_);
210 struct transformation *navit_get_trans(struct navit *this_);
211 struct route *navit_get_route(struct navit *this_);
212 struct navigation *navit_get_navigation(struct navit *this_);
213 struct displaylist *navit_get_displaylist(struct navit *this_);
214 void navit_layout_switch(struct navit *n);
215 int navit_set_vehicle_by_name(struct navit *n, const char *name);
216 void navit_layer_set_active(struct navit *this, char *name, int active, int draw);
217 void navit_motion(void *data, struct point *p);
218 void displaylist_shift_order_in_map_layers(struct navit *this_, int shift_value);
219 void displaylist_shift_for_dpi_value_in_layers(struct navit *this_, double factor);
220
221 void navit_set_cursors(struct navit *this_);
222
223 #include "vehicle.h"
224 int navit_add_vehicle(struct navit *this_, struct vehicle *v);
225
226 int navit_set_layout_by_name(struct navit *n, const char *name);
227 void navit_disable_suspend(void);
228 int navit_block(struct navit *this_, int block);
229 void navit_destroy(struct navit *this_);
230 void navit_command_add_table(struct navit*this_, struct command_table *commands, int count);
231 //
232 // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir);
233 int navit_get_cur_pnt(struct navit *this_, struct point *p);
234
235 #include "coord.h"
236 #include "point.h"
237 #include "item.h"
238 #include "attr.h"
239
240 struct coord global_vehicle_pos_onscreen;
241 struct coord_geo global_last_vehicle_pos_geo;
242
243 //! The navit_vehicule
244 struct navit_vehicle
245 {
246 int follow;
247 /*! Limit of the follow counter. See navit_add_vehicle */
248 int follow_curr;
249 /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/
250 struct coord coord;
251 int dir;
252 int speed;
253 struct coord last; /*< Position of the last update of this vehicle */
254 struct vehicle *vehicle;
255 struct attr callback;
256 int animate_cursor;
257 };
258
259 struct navit
260 {
261 struct attr self;
262 GList *mapsets;
263 GList *layouts;
264 struct gui *gui;
265 struct layout *layout_current;
266 struct graphics *gra;
267 struct action *action;
268 struct transformation *trans, *trans_cursor;
269 struct compass *compass;
270 struct route *route;
271 struct navigation *navigation;
272 struct speech *speech;
273 struct tracking *tracking;
274 int ready;
275 struct window *win;
276 struct displaylist *displaylist;
277 int tracking_flag;
278 int orientation;
279 int recentdest_count;
280 int osd_configuration;
281 GList *vehicles;
282 GList *windows_items;
283 struct navit_vehicle *vehicle;
284 struct callback_list *attr_cbl;
285 struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb;
286 struct datawindow *roadbook_window;
287 struct map *former_destination;
288 struct point pressed, last, current;
289 int button_pressed, moved, popped, zoomed;
290 int center_timeout;
291 int autozoom_secs;
292 int autozoom_min;
293 int autozoom_active;
294 struct event_timeout *button_timeout, *motion_timeout;
295 struct callback *motion_timeout_callback;
296 int ignore_button;
297 int ignore_graphics_events;
298 struct log *textfile_debug_log;
299 struct pcoord destination;
300 int destination_valid;
301 int blocked;
302 int w, h;
303 int drag_bitmap;
304 int use_mousewheel;
305 struct messagelist *messages;
306 struct callback *resize_callback, *button_callback, *motion_callback, *predraw_callback;
307 struct vehicleprofile *vehicleprofile;
308 GList *vehicleprofiles;
309 int pitch;
310 int follow_cursor;
311 int prevTs;
312 int graphics_flags;
313 int zoom_min, zoom_max;
314 int radius;
315 struct bookmarks *bookmarks;
316 int flags;
317 /* 1=No graphics ok */
318 /* 2=No gui ok */
319 int border;
320 int imperial;
321 };
322
323 // global navit struct, needed almost everywhere
324 struct navit *global_navit;
325
326 // dirty global var for waypoint bitmap
327 struct graphics_image *global_img_waypoint;
328
329 /* end of prototypes */
330 #ifdef __cplusplus
331 }
332 #endif
333
334 #endif
335

   
Visit the ZANavi Wiki