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