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

Contents of /navit/navit/navit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27 - (show annotations) (download)
Mon Apr 9 21:27:36 2012 UTC (10 years, 7 months ago) by zoff99
File MIME type: text/plain
File size: 9367 byte(s)
lots of new stuff, tranlsations, bug fixes ...
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 extern int allow_gui_internal;
54 extern int draw_display_at_speed;
55 extern int routing_mode; // 0-> normal highway rounting
56 // 1-> normal roads routing
57 // 2-> future use
58 extern int offline_search_filter_duplicates;
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;
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;
70
71 /* prototypes */
72 enum attr_type;
73 struct attr;
74 struct attr_iter;
75 struct callback;
76 struct coord_rect;
77 struct displaylist;
78 struct graphics;
79 struct gui;
80 struct mapset;
81 struct message;
82 struct navigation;
83 struct navit;
84 struct pcoord;
85 struct point;
86 struct route;
87 struct tracking;
88 struct transformation;
89 struct vehicleprofile;
90 struct command_table;
91 void navit_add_mapset(struct navit *this_, struct mapset *ms);
92 struct mapset *navit_get_mapset(struct navit *this_);
93 struct tracking *navit_get_tracking(struct navit *this_);
94 char *navit_get_user_data_directory(int create);
95 void navit_draw_async(struct navit *this_, int async);
96 void navit_draw(struct navit *this_);
97 int navit_get_ready(struct navit *this_);
98 void navit_draw_displaylist(struct navit *this_);
99 void navit_handle_resize(struct navit *this_, int w, int h);
100 int navit_get_width(struct navit *this_);
101 int navit_get_height(struct navit *this_);
102 int navit_ignore_button(struct navit *this_);
103 void navit_ignore_graphics_events(struct navit *this_, int ignore);
104 void navit_set_timeout(struct navit *this_);
105 int navit_handle_button(struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback);
106 void navit_handle_motion(struct navit *this_, struct point *p);
107 void navit_zoom_in(struct navit *this_, int factor, struct point *p);
108 void navit_zoom_out(struct navit *this_, int factor, struct point *p);
109 void navit_zoom_in_cursor(struct navit *this_, int factor);
110 void navit_zoom_out_cursor(struct navit *this_, int factor);
111 struct navit *navit_new(struct attr *parent, struct attr **attrs);
112 void navit_add_message(struct navit *this_, char *message);
113 struct message *navit_get_messages(struct navit *this_);
114 struct graphics *navit_get_graphics(struct navit *this_);
115 struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
116 GList *navit_get_vehicleprofiles(struct navit *this_);
117 void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
118 void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
119 int navit_check_route(struct navit *this_);
120 void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
121 void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
122 int navit_speech_estimate(struct navit *this_, char *str);
123 void navit_say(struct navit *this_, char *text);
124 void navit_speak(struct navit *this_);
125 void navit_window_roadbook_destroy(struct navit *this_);
126 void navit_window_roadbook_new(struct navit *this_);
127 void navit_reload_maps(struct navit *this_);
128 void navit_init(struct navit *this_);
129 void navit_zoom_to_rect(struct navit *this_, struct coord_rect *r);
130 void navit_zoom_to_route(struct navit *this_, int orientation);
131 void navit_set_center(struct navit *this_, struct pcoord *center, int set_timeout);
132 void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation);
133 void navit_set_center_screen(struct navit *this_, struct point *p, int set_timeout);
134 int navit_set_attr(struct navit *this_, struct attr *attr);
135 int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
136 int navit_add_attr(struct navit *this_, struct attr *attr);
137 int navit_remove_attr(struct navit *this_, struct attr *attr);
138 struct attr_iter *navit_attr_iter_new(void);
139 void navit_attr_iter_destroy(struct attr_iter *iter);
140 void navit_add_callback(struct navit *this_, struct callback *cb);
141 void navit_remove_callback(struct navit *this_, struct callback *cb);
142 void navit_set_position(struct navit *this_, struct pcoord *c);
143 struct gui *navit_get_gui(struct navit *this_);
144 struct transformation *navit_get_trans(struct navit *this_);
145 struct route *navit_get_route(struct navit *this_);
146 struct navigation *navit_get_navigation(struct navit *this_);
147 struct displaylist *navit_get_displaylist(struct navit *this_);
148 void navit_layout_switch(struct navit *n);
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
156 int navit_set_layout_by_name(struct navit *n, const char *name);
157 void navit_disable_suspend(void);
158 int navit_block(struct navit *this_, int block);
159 void navit_destroy(struct navit *this_);
160 void navit_command_add_table(struct navit*this_, struct command_table *commands, int count);
161 //
162 // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir);
163 int navit_get_cur_pnt(struct navit *this_, struct point *p);
164
165 #include "coord.h"
166 #include "point.h"
167 #include "item.h"
168 #include "attr.h"
169
170 struct coord global_vehicle_pos_onscreen;
171
172 //! The navit_vehicule
173 struct navit_vehicle
174 {
175 int follow;
176 /*! Limit of the follow counter. See navit_add_vehicle */
177 int follow_curr;
178 /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/
179 struct coord coord;
180 int dir;
181 int speed;
182 struct coord last; /*< Position of the last update of this vehicle */
183 struct vehicle *vehicle;
184 struct attr callback;
185 int animate_cursor;
186 };
187
188 struct navit
189 {
190 struct attr self;
191 GList *mapsets;
192 GList *layouts;
193 struct gui *gui;
194 struct layout *layout_current;
195 struct graphics *gra;
196 struct action *action;
197 struct transformation *trans, *trans_cursor;
198 struct compass *compass;
199 struct route *route;
200 struct navigation *navigation;
201 struct speech *speech;
202 struct tracking *tracking;
203 int ready;
204 struct window *win;
205 struct displaylist *displaylist;
206 int tracking_flag;
207 int orientation;
208 int recentdest_count;
209 int osd_configuration;
210 GList *vehicles;
211 GList *windows_items;
212 struct navit_vehicle *vehicle;
213 struct callback_list *attr_cbl;
214 struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb;
215 struct datawindow *roadbook_window;
216 struct map *former_destination;
217 struct point pressed, last, current;
218 int button_pressed, moved, popped, zoomed;
219 int center_timeout;
220 int autozoom_secs;
221 int autozoom_min;
222 int autozoom_active;
223 struct event_timeout *button_timeout, *motion_timeout;
224 struct callback *motion_timeout_callback;
225 int ignore_button;
226 int ignore_graphics_events;
227 struct log *textfile_debug_log;
228 struct pcoord destination;
229 int destination_valid;
230 int blocked;
231 int w, h;
232 int drag_bitmap;
233 int use_mousewheel;
234 struct messagelist *messages;
235 struct callback *resize_callback, *button_callback, *motion_callback, *predraw_callback;
236 struct vehicleprofile *vehicleprofile;
237 GList *vehicleprofiles;
238 int pitch;
239 int follow_cursor;
240 int prevTs;
241 int graphics_flags;
242 int zoom_min, zoom_max;
243 int radius;
244 struct bookmarks *bookmarks;
245 int flags;
246 /* 1=No graphics ok */
247 /* 2=No gui ok */
248 int border;
249 int imperial;
250 };
251
252 // global navit struct, needed almost everywhere
253 struct navit *global_navit;
254
255 // dirty global var for waypoint bitmap
256 struct graphics_image *global_img_waypoint;
257
258 /* end of prototypes */
259 #ifdef __cplusplus
260 }
261 #endif
262
263 #endif
264

   
Visit the ZANavi Wiki