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

Contents of /navit/navit/navit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 30 - (show annotations) (download)
Wed Aug 22 17:01:27 2012 UTC (11 years, 8 months ago) by zoff99
File MIME type: text/plain
File size: 9918 byte(s)
ZANavi 2.0, lots of changes, everything in its own thread, more performance
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
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47 extern struct gui *main_loop_gui;
48 // defined in glib.h.
49 #ifndef __G_LIST_H__
50 struct _GList;
51 typedef struct _GList GList;
52 #endif
53
54 extern int allow_gui_internal;
55 extern int draw_display_at_speed;
56 extern int routing_mode; // 0-> normal highway routing
57 // 1-> normal roads routing
58 // 2-> future use
59 extern int offline_search_filter_duplicates;
60 extern int offline_search_break_searching;
61 extern char *navit_maps_dir;
62 extern int cancel_drawing_global;
63 extern int disable_map_drawing;
64 extern int global_speak_streetnames;
65
66 extern int allow_large_mapfiles;
67 extern int cache_size_file; /* cache size in bytes */
68 extern int draw_polylines_fast; // 1 -> dont draw circles at the end of polylines 0-> do draw circles
69
70 extern int limit_order_corrected;
71 extern int shift_order;
72 extern int global_search_street_size_factor;
73 extern int enable_water_from_relations;
74 extern int hold_drawing;
75 extern int global_stop_demo_vehicle;
76
77 extern long long draw_lines_count_2;
78 extern long long draw_lines_count_3;
79 extern long long draw_lines_count_4;
80
81 extern int mapdraw_time[11 + 5];
82 extern int cur_mapdraw_time_index;
83
84 extern int route_status_previous;
85
86 /* prototypes */
87 enum attr_type;
88 struct attr;
89 struct attr_iter;
90 struct callback;
91 struct coord_rect;
92 struct displaylist;
93 struct graphics;
94 struct gui;
95 struct mapset;
96 struct message;
97 struct navigation;
98 struct navit;
99 struct pcoord;
100 struct point;
101 struct route;
102 struct tracking;
103 struct transformation;
104 struct vehicleprofile;
105 struct command_table;
106 void navit_add_mapset(struct navit *this_, struct mapset *ms);
107 struct mapset *navit_get_mapset(struct navit *this_);
108 struct tracking *navit_get_tracking(struct navit *this_);
109 char *navit_get_user_data_directory(int create);
110 void navit_draw_async(struct navit *this_, int async);
111 void navit_draw(struct navit *this_);
112 int navit_get_ready(struct navit *this_);
113 void navit_draw_displaylist(struct navit *this_);
114 void navit_handle_resize(struct navit *this_, int w, int h);
115 int navit_get_width(struct navit *this_);
116 int navit_get_height(struct navit *this_);
117 int navit_ignore_button(struct navit *this_);
118 void navit_ignore_graphics_events(struct navit *this_, int ignore);
119 void navit_set_timeout(struct navit *this_);
120 int navit_handle_button(struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback);
121 void navit_handle_motion(struct navit *this_, struct point *p);
122 void navit_zoom_in(struct navit *this_, int factor, struct point *p);
123 void navit_zoom_out(struct navit *this_, int factor, struct point *p);
124 void navit_zoom_in_cursor(struct navit *this_, int factor);
125 void navit_zoom_out_cursor(struct navit *this_, int factor);
126 struct navit *navit_new(struct attr *parent, struct attr **attrs);
127 void navit_add_message(struct navit *this_, char *message);
128 struct message *navit_get_messages(struct navit *this_);
129 struct graphics *navit_get_graphics(struct navit *this_);
130 struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
131 GList *navit_get_vehicleprofiles(struct navit *this_);
132 void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
133 void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
134 int navit_check_route(struct navit *this_);
135 void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
136 void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
137 int navit_speech_estimate(struct navit *this_, char *str);
138 void navit_say(struct navit *this_, char *text);
139 void navit_speak(struct navit *this_);
140 void navit_window_roadbook_destroy(struct navit *this_);
141 void navit_window_roadbook_new(struct navit *this_);
142 void navit_reload_maps(struct navit *this_);
143 void navit_init(struct navit *this_);
144 void navit_zoom_to_rect(struct navit *this_, struct coord_rect *r);
145 void navit_zoom_to_route(struct navit *this_, int orientation);
146 void navit_set_center(struct navit *this_, struct pcoord *center, int set_timeout);
147 void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation);
148 void navit_set_center_screen(struct navit *this_, struct point *p, int set_timeout);
149 int navit_set_attr(struct navit *this_, struct attr *attr);
150 int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
151 int navit_add_attr(struct navit *this_, struct attr *attr);
152 int navit_remove_attr(struct navit *this_, struct attr *attr);
153 struct attr_iter *navit_attr_iter_new(void);
154 void navit_attr_iter_destroy(struct attr_iter *iter);
155 void navit_add_callback(struct navit *this_, struct callback *cb);
156 void navit_remove_callback(struct navit *this_, struct callback *cb);
157 void navit_set_position(struct navit *this_, struct pcoord *c);
158 struct gui *navit_get_gui(struct navit *this_);
159 struct transformation *navit_get_trans(struct navit *this_);
160 struct route *navit_get_route(struct navit *this_);
161 struct navigation *navit_get_navigation(struct navit *this_);
162 struct displaylist *navit_get_displaylist(struct navit *this_);
163 void navit_layout_switch(struct navit *n);
164 int navit_set_vehicle_by_name(struct navit *n, const char *name);
165 void navit_layer_set_active(struct navit *this, char *name, int active, int draw);
166 void navit_motion(void *data, struct point *p);
167
168 void navit_set_cursors(struct navit *this_);
169
170 #include "vehicle.h"
171 int navit_add_vehicle(struct navit *this_, struct vehicle *v);
172
173 int navit_set_layout_by_name(struct navit *n, const char *name);
174 void navit_disable_suspend(void);
175 int navit_block(struct navit *this_, int block);
176 void navit_destroy(struct navit *this_);
177 void navit_command_add_table(struct navit*this_, struct command_table *commands, int count);
178 //
179 // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir);
180 int navit_get_cur_pnt(struct navit *this_, struct point *p);
181
182 #include "coord.h"
183 #include "point.h"
184 #include "item.h"
185 #include "attr.h"
186
187 struct coord global_vehicle_pos_onscreen;
188 struct coord_geo global_last_vehicle_pos_geo;
189
190 //! The navit_vehicule
191 struct navit_vehicle
192 {
193 int follow;
194 /*! Limit of the follow counter. See navit_add_vehicle */
195 int follow_curr;
196 /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/
197 struct coord coord;
198 int dir;
199 int speed;
200 struct coord last; /*< Position of the last update of this vehicle */
201 struct vehicle *vehicle;
202 struct attr callback;
203 int animate_cursor;
204 };
205
206 struct navit
207 {
208 struct attr self;
209 GList *mapsets;
210 GList *layouts;
211 struct gui *gui;
212 struct layout *layout_current;
213 struct graphics *gra;
214 struct action *action;
215 struct transformation *trans, *trans_cursor;
216 struct compass *compass;
217 struct route *route;
218 struct navigation *navigation;
219 struct speech *speech;
220 struct tracking *tracking;
221 int ready;
222 struct window *win;
223 struct displaylist *displaylist;
224 int tracking_flag;
225 int orientation;
226 int recentdest_count;
227 int osd_configuration;
228 GList *vehicles;
229 GList *windows_items;
230 struct navit_vehicle *vehicle;
231 struct callback_list *attr_cbl;
232 struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb;
233 struct datawindow *roadbook_window;
234 struct map *former_destination;
235 struct point pressed, last, current;
236 int button_pressed, moved, popped, zoomed;
237 int center_timeout;
238 int autozoom_secs;
239 int autozoom_min;
240 int autozoom_active;
241 struct event_timeout *button_timeout, *motion_timeout;
242 struct callback *motion_timeout_callback;
243 int ignore_button;
244 int ignore_graphics_events;
245 struct log *textfile_debug_log;
246 struct pcoord destination;
247 int destination_valid;
248 int blocked;
249 int w, h;
250 int drag_bitmap;
251 int use_mousewheel;
252 struct messagelist *messages;
253 struct callback *resize_callback, *button_callback, *motion_callback, *predraw_callback;
254 struct vehicleprofile *vehicleprofile;
255 GList *vehicleprofiles;
256 int pitch;
257 int follow_cursor;
258 int prevTs;
259 int graphics_flags;
260 int zoom_min, zoom_max;
261 int radius;
262 struct bookmarks *bookmarks;
263 int flags;
264 /* 1=No graphics ok */
265 /* 2=No gui ok */
266 int border;
267 int imperial;
268 };
269
270 // global navit struct, needed almost everywhere
271 struct navit *global_navit;
272
273 // dirty global var for waypoint bitmap
274 struct graphics_image *global_img_waypoint;
275
276 /* end of prototypes */
277 #ifdef __cplusplus
278 }
279 #endif
280
281 #endif
282

   
Visit the ZANavi Wiki