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

Contents of /navit/navit/navit.h

Parent Directory Parent Directory | Revision Log Revision Log


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

   
Visit the ZANavi Wiki