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

Contents of /navit/navit/navit.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 46 - (hide annotations) (download)
Mon Aug 24 18:55:43 2015 UTC (8 years, 7 months ago) by zoff99
File MIME type: text/plain
File size: 15107 byte(s)
v2.0.47
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 zoff99 34
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 zoff99 41 #define NEED_MIN_BINFILE_MAPVERSION 4
80 zoff99 34 // --
81     // --------------------------------------------
82    
83 zoff99 40 #define ROAD_ANGLE_IS_STRAIGHT_ABS 10
84     #define ROAD_ANGLE_DISTANCE_FOR_STRAIGHT 78
85 zoff99 34
86 zoff99 40 // --------------------------------------------
87     // --
88     // if the turn angle is greater than this (in degrees) in bicycle mode, then speak a turn command
89     #define ROAD_ANGLE_MIN_FOR_TURN_BICYCLEMODE 65
90 zoff99 41 #define ROAD_ANGLE_MIN__FOR_TURN_BICYCLEMODE_ONLY_1_POSSIBILITY 25
91 zoff99 34
92 zoff99 41 #define ROAD_ANGLE_MIN_FOR_TURN_BICYCLEMODE_CYC_2_CYC 65
93     #define ROAD_ANGLE_MIN_FOR_TURN_BICYCLEMODE_CYC_2_CYC__2 25
94 zoff99 40 // --
95     // --------------------------------------------
96    
97    
98 zoff99 2 extern int allow_gui_internal;
99     extern int draw_display_at_speed;
100 zoff99 28 extern int routing_mode; // 0-> normal highway routing
101 zoff99 27 // 1-> normal roads routing
102     // 2-> future use
103 zoff99 14 extern int offline_search_filter_duplicates;
104     extern int offline_search_break_searching;
105 zoff99 27 extern char *navit_maps_dir;
106 zoff99 34 extern char *navit_share_dir;
107     extern char* navit_data_dir;
108 zoff99 27 extern int cancel_drawing_global;
109 zoff99 28 extern int disable_map_drawing;
110 zoff99 27 extern int global_speak_streetnames;
111 zoff99 2
112 zoff99 27 extern int allow_large_mapfiles;
113     extern int cache_size_file; /* cache size in bytes */
114     extern int draw_polylines_fast; // 1 -> dont draw circles at the end of polylines 0-> do draw circles
115 zoff99 14
116 zoff99 27 extern int limit_order_corrected;
117 zoff99 28 extern int shift_order;
118 zoff99 27 extern int global_search_street_size_factor;
119 zoff99 28 extern int hold_drawing;
120 zoff99 30 extern int global_stop_demo_vehicle;
121 zoff99 31 extern int global_show_route_rectangles;
122     extern int global_traffic_light_delay;
123 zoff99 40 extern int global_clinedrawing_active;
124 zoff99 31 extern int global_draw_multipolygons;
125 zoff99 34 extern int global_have_dpi_value;
126     extern float global_dpi_factor;
127     extern int global_order_level_for_fast_draw;
128     extern int global_show_english_labels;
129 zoff99 41 extern int global_routing_engine;
130     extern float global_overspill_factor;
131 zoff99 27
132 zoff99 28 extern long long draw_lines_count_2;
133     extern long long draw_lines_count_3;
134     extern long long draw_lines_count_4;
135 zoff99 34 extern int poi_on_map_count;
136     extern int label_on_map_count;
137     extern int label_district_on_map_count;
138     extern int label_major_on_map_count;
139     extern int poi_icon_on_map_count;
140 zoff99 28
141 zoff99 34
142 zoff99 28 extern int mapdraw_time[11 + 5];
143     extern int cur_mapdraw_time_index;
144    
145 zoff99 30 extern int route_status_previous;
146 zoff99 31 extern long long global_route_memory_size;
147 zoff99 34 extern int global_old_vehicle_speed;
148     extern int global_old_vehicle_speed_for_autozoom;
149 zoff99 30
150 zoff99 40 extern int global_avoid_sharp_turns_flag;
151     extern int global_avoid_sharp_turns_min_angle;
152     extern int global_avoid_sharp_turns_min_penalty;
153    
154     extern int global_search_radius_for_housenumbers;
155     extern int global_vehicle_profile;
156     extern int global_cycle_lanes_prio;
157     extern int global_cycle_track_prio;
158    
159     extern double global_v_pos_lat;
160     extern double global_v_pos_lng;
161     extern double global_v_pos_dir;
162    
163     extern int global_demo_vehicle;
164     extern int global_demo_vehicle_short_switch;
165     extern long global_last_spoken;
166     extern long global_last_spoken_base;
167 zoff99 41 extern float global_road_speed_factor;
168 zoff99 40
169 zoff99 41 extern float global_level0_announcement;
170     extern float global_level1_announcement;
171     extern float global_level2_announcement;
172     extern float global_levelx_announcement_factor;
173     extern float global_b_level0_announcement;
174     extern float global_b_level1_announcement;
175     extern float global_b_level2_announcement;
176     extern float global_b_levelx_announcement_factor;
177 zoff99 40
178 zoff99 41 extern int global_driven_away_from_route;
179    
180     extern int global_enhance_cycleway;
181     extern int global_tracking_show_real_gps_pos;
182 zoff99 46 extern int global_show_maps_debug_view;
183 zoff99 41
184    
185 zoff99 40 #define MAX_DEBUG_COORDS 100
186    
187     extern struct coord global_debug_route_seg_winner_start;
188     extern struct coord global_debug_route_seg_winner_end;
189     extern struct coord global_debug_seg_winner_start;
190     extern struct coord global_debug_seg_winner_end;
191     extern struct coord global_debug_route_seg_winner_p_start;
192     extern struct coord global_debug_seg_winner_p_start;
193     extern struct coord global_debug_seg_route_start;
194     extern struct coord global_debug_seg_route_end;
195     extern struct coord global_debug_trlast_start;
196     extern struct coord global_debug_trlast_end;
197     extern struct coord *global_debug_coord_list;
198     extern int global_debug_coord_list_items;
199     extern int global_has_gpsfix;
200     extern int global_pos_is_underground;
201    
202     extern GList *global_all_cbs;
203    
204     #include "coord.h"
205    
206    
207     #define MAX_SHARP_TURN_LIST_ENTRIES 500
208    
209     struct global_sharp_turn
210     {
211     int dir;
212     int angle;
213     struct coord c1;
214     struct coord cs;
215     struct coord ce;
216     };
217    
218    
219     extern int global_sharp_turn_list_count;
220     extern struct global_sharp_turn *global_sharp_turn_list;
221    
222    
223    
224    
225     #define MAX_FREETEXT_LIST_ENTRIES 500
226     #define MAX_FREETEXT_ENTRY_LEN 300
227    
228     struct global_freetext
229     {
230     struct coord c1;
231     char text[MAX_FREETEXT_ENTRY_LEN];
232     };
233    
234    
235     extern int global_freetext_list_count;
236     extern struct global_freetext *global_freetext_list;
237    
238    
239    
240 zoff99 46 // #ifndef MAPTOOL
241 zoff99 31 extern GHashTable *global_transform_hash;
242     extern GHashTable *global_transform_hash2;
243 zoff99 46 // #endif
244 zoff99 31
245 zoff99 46
246 zoff99 2 /* prototypes */
247     enum attr_type;
248     struct attr;
249     struct attr_iter;
250     struct callback;
251     struct coord_rect;
252     struct displaylist;
253     struct graphics;
254     struct gui;
255     struct mapset;
256     struct message;
257     struct navigation;
258     struct navit;
259     struct pcoord;
260     struct point;
261     struct route;
262     struct tracking;
263     struct transformation;
264     struct vehicleprofile;
265     struct command_table;
266     void navit_add_mapset(struct navit *this_, struct mapset *ms);
267     struct mapset *navit_get_mapset(struct navit *this_);
268     struct tracking *navit_get_tracking(struct navit *this_);
269     char *navit_get_user_data_directory(int create);
270     void navit_draw_async(struct navit *this_, int async);
271     void navit_draw(struct navit *this_);
272     int navit_get_ready(struct navit *this_);
273     void navit_draw_displaylist(struct navit *this_);
274     void navit_handle_resize(struct navit *this_, int w, int h);
275     int navit_get_width(struct navit *this_);
276     int navit_get_height(struct navit *this_);
277     int navit_ignore_button(struct navit *this_);
278     void navit_ignore_graphics_events(struct navit *this_, int ignore);
279     void navit_set_timeout(struct navit *this_);
280     int navit_handle_button(struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback);
281     void navit_handle_motion(struct navit *this_, struct point *p);
282     void navit_zoom_in(struct navit *this_, int factor, struct point *p);
283     void navit_zoom_out(struct navit *this_, int factor, struct point *p);
284     void navit_zoom_in_cursor(struct navit *this_, int factor);
285     void navit_zoom_out_cursor(struct navit *this_, int factor);
286     struct navit *navit_new(struct attr *parent, struct attr **attrs);
287     void navit_add_message(struct navit *this_, char *message);
288     struct message *navit_get_messages(struct navit *this_);
289     struct graphics *navit_get_graphics(struct navit *this_);
290     struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
291     GList *navit_get_vehicleprofiles(struct navit *this_);
292     void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
293     void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
294     int navit_check_route(struct navit *this_);
295     void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
296     void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
297     int navit_speech_estimate(struct navit *this_, char *str);
298     void navit_say(struct navit *this_, char *text);
299     void navit_speak(struct navit *this_);
300     void navit_window_roadbook_destroy(struct navit *this_);
301     void navit_window_roadbook_new(struct navit *this_);
302     void navit_reload_maps(struct navit *this_);
303 zoff99 40 void navit_predraw(struct navit *this_);
304 zoff99 2 void navit_init(struct navit *this_);
305     void navit_zoom_to_rect(struct navit *this_, struct coord_rect *r);
306     void navit_zoom_to_route(struct navit *this_, int orientation);
307 zoff99 41 void navit_set_center_no_draw(struct navit *this_, struct pcoord *center, int set_timeout);
308 zoff99 2 void navit_set_center(struct navit *this_, struct pcoord *center, int set_timeout);
309     void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation);
310     void navit_set_center_screen(struct navit *this_, struct point *p, int set_timeout);
311     int navit_set_attr(struct navit *this_, struct attr *attr);
312     int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
313     int navit_add_attr(struct navit *this_, struct attr *attr);
314     int navit_remove_attr(struct navit *this_, struct attr *attr);
315     struct attr_iter *navit_attr_iter_new(void);
316     void navit_attr_iter_destroy(struct attr_iter *iter);
317     void navit_add_callback(struct navit *this_, struct callback *cb);
318     void navit_remove_callback(struct navit *this_, struct callback *cb);
319     void navit_set_position(struct navit *this_, struct pcoord *c);
320     struct gui *navit_get_gui(struct navit *this_);
321     struct transformation *navit_get_trans(struct navit *this_);
322     struct route *navit_get_route(struct navit *this_);
323     struct navigation *navit_get_navigation(struct navit *this_);
324     struct displaylist *navit_get_displaylist(struct navit *this_);
325     void navit_layout_switch(struct navit *n);
326     int navit_set_vehicle_by_name(struct navit *n, const char *name);
327 zoff99 28 void navit_layer_set_active(struct navit *this, char *name, int active, int draw);
328     void navit_motion(void *data, struct point *p);
329 zoff99 31 void displaylist_shift_order_in_map_layers(struct navit *this_, int shift_value);
330 zoff99 34 void displaylist_shift_for_dpi_value_in_layers(struct navit *this_, double factor);
331 zoff99 40 int navit_is_demo_vehicle();
332 zoff99 41 void navit_zoom_to_scale_no_draw(struct navit *this_, int new_scale);
333     void navit_zoom_to_scale(struct navit *this_, int new_scale);
334 zoff99 27
335 zoff99 41
336 zoff99 27 void navit_set_cursors(struct navit *this_);
337    
338     #include "vehicle.h"
339     int navit_add_vehicle(struct navit *this_, struct vehicle *v);
340    
341 zoff99 2 int navit_set_layout_by_name(struct navit *n, const char *name);
342     void navit_disable_suspend(void);
343     int navit_block(struct navit *this_, int block);
344     void navit_destroy(struct navit *this_);
345     void navit_command_add_table(struct navit*this_, struct command_table *commands, int count);
346     //
347     // extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir);
348     int navit_get_cur_pnt(struct navit *this_, struct point *p);
349    
350 zoff99 40
351 zoff99 2 #include "point.h"
352     #include "item.h"
353     #include "attr.h"
354    
355 zoff99 41 extern struct coord global_vehicle_pos_onscreen;
356     extern struct coord_geo global_last_vehicle_pos_geo;
357     // extern struct coord_geo global_cur_vehicle_pos_geo;
358     extern double ggggg_lat;
359     extern double ggggg_lon;
360 zoff99 2
361 zoff99 41
362 zoff99 2 //! The navit_vehicule
363 zoff99 27 struct navit_vehicle
364     {
365 zoff99 2 int follow;
366     /*! Limit of the follow counter. See navit_add_vehicle */
367     int follow_curr;
368     /*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/
369     struct coord coord;
370     int dir;
371     int speed;
372     struct coord last; /*< Position of the last update of this vehicle */
373     struct vehicle *vehicle;
374     struct attr callback;
375     int animate_cursor;
376     };
377    
378 zoff99 27 struct navit
379     {
380 zoff99 2 struct attr self;
381     GList *mapsets;
382     GList *layouts;
383     struct gui *gui;
384     struct layout *layout_current;
385     struct graphics *gra;
386     struct action *action;
387     struct transformation *trans, *trans_cursor;
388     struct compass *compass;
389     struct route *route;
390     struct navigation *navigation;
391     struct speech *speech;
392     struct tracking *tracking;
393     int ready;
394     struct window *win;
395     struct displaylist *displaylist;
396     int tracking_flag;
397     int orientation;
398     int recentdest_count;
399     int osd_configuration;
400     GList *vehicles;
401     GList *windows_items;
402     struct navit_vehicle *vehicle;
403     struct callback_list *attr_cbl;
404     struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb;
405     struct datawindow *roadbook_window;
406     struct map *former_destination;
407     struct point pressed, last, current;
408 zoff99 27 int button_pressed, moved, popped, zoomed;
409 zoff99 2 int center_timeout;
410     int autozoom_secs;
411     int autozoom_min;
412     int autozoom_active;
413     struct event_timeout *button_timeout, *motion_timeout;
414     struct callback *motion_timeout_callback;
415     int ignore_button;
416     int ignore_graphics_events;
417     struct log *textfile_debug_log;
418     struct pcoord destination;
419     int destination_valid;
420     int blocked;
421 zoff99 27 int w, h;
422 zoff99 2 int drag_bitmap;
423     int use_mousewheel;
424     struct messagelist *messages;
425 zoff99 27 struct callback *resize_callback, *button_callback, *motion_callback, *predraw_callback;
426 zoff99 2 struct vehicleprofile *vehicleprofile;
427     GList *vehicleprofiles;
428     int pitch;
429     int follow_cursor;
430     int prevTs;
431     int graphics_flags;
432     int zoom_min, zoom_max;
433     int radius;
434     struct bookmarks *bookmarks;
435     int flags;
436 zoff99 27 /* 1=No graphics ok */
437     /* 2=No gui ok */
438 zoff99 2 int border;
439     int imperial;
440     };
441    
442 zoff99 27 // global navit struct, needed almost everywhere
443     struct navit *global_navit;
444 zoff99 2
445 zoff99 27 // dirty global var for waypoint bitmap
446     struct graphics_image *global_img_waypoint;
447 zoff99 2
448 zoff99 40 char* g_strdup_printf_4_str(const char *format, const char *str1, const char *str2, const char *str3, const char *str4);
449     char* g_strdup_printf_2_str(const char *format, const char *str1, const char *str2);
450    
451 zoff99 2 /* end of prototypes */
452     #ifdef __cplusplus
453     }
454     #endif
455    
456     #endif
457    

   
Visit the ZANavi Wiki