1 |
/**
|
2 |
* Navit, a modular navigation system.
|
3 |
* Copyright (C) 2005-2008 Navit Team
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU Library 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 Library General Public License for more details.
|
13 |
*
|
14 |
* You should have received a copy of the GNU Library General Public
|
15 |
* License 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 |
#ifndef NAVIT_NAVIT_H
|
21 |
#define NAVIT_NAVIT_H
|
22 |
|
23 |
#ifdef __cplusplus
|
24 |
extern "C" {
|
25 |
#endif
|
26 |
extern struct gui *main_loop_gui;
|
27 |
// defined in glib.h.
|
28 |
#ifndef __G_LIST_H__
|
29 |
struct _GList;
|
30 |
typedef struct _GList GList;
|
31 |
#endif
|
32 |
|
33 |
extern int allow_gui_internal;
|
34 |
extern int draw_display_at_speed;
|
35 |
extern int routing_mode; // 0-> normal highway rounting
|
36 |
// 1-> normal roads routing
|
37 |
// 2-> future use
|
38 |
|
39 |
/* prototypes */
|
40 |
enum attr_type;
|
41 |
struct attr;
|
42 |
struct attr_iter;
|
43 |
struct callback;
|
44 |
struct coord_rect;
|
45 |
struct displaylist;
|
46 |
struct graphics;
|
47 |
struct gui;
|
48 |
struct mapset;
|
49 |
struct message;
|
50 |
struct navigation;
|
51 |
struct navit;
|
52 |
struct pcoord;
|
53 |
struct point;
|
54 |
struct route;
|
55 |
struct tracking;
|
56 |
struct transformation;
|
57 |
struct vehicleprofile;
|
58 |
struct command_table;
|
59 |
void navit_add_mapset(struct navit *this_, struct mapset *ms);
|
60 |
struct mapset *navit_get_mapset(struct navit *this_);
|
61 |
struct tracking *navit_get_tracking(struct navit *this_);
|
62 |
char *navit_get_user_data_directory(int create);
|
63 |
void navit_draw_async(struct navit *this_, int async);
|
64 |
void navit_draw(struct navit *this_);
|
65 |
int navit_get_ready(struct navit *this_);
|
66 |
void navit_draw_displaylist(struct navit *this_);
|
67 |
void navit_handle_resize(struct navit *this_, int w, int h);
|
68 |
int navit_get_width(struct navit *this_);
|
69 |
int navit_get_height(struct navit *this_);
|
70 |
int navit_ignore_button(struct navit *this_);
|
71 |
void navit_ignore_graphics_events(struct navit *this_, int ignore);
|
72 |
void navit_set_timeout(struct navit *this_);
|
73 |
int navit_handle_button(struct navit *this_, int pressed, int button, struct point *p, struct callback *popup_callback);
|
74 |
void navit_handle_motion(struct navit *this_, struct point *p);
|
75 |
void navit_zoom_in(struct navit *this_, int factor, struct point *p);
|
76 |
void navit_zoom_out(struct navit *this_, int factor, struct point *p);
|
77 |
void navit_zoom_in_cursor(struct navit *this_, int factor);
|
78 |
void navit_zoom_out_cursor(struct navit *this_, int factor);
|
79 |
struct navit *navit_new(struct attr *parent, struct attr **attrs);
|
80 |
void navit_add_message(struct navit *this_, char *message);
|
81 |
struct message *navit_get_messages(struct navit *this_);
|
82 |
struct graphics *navit_get_graphics(struct navit *this_);
|
83 |
struct vehicleprofile *navit_get_vehicleprofile(struct navit *this_);
|
84 |
GList *navit_get_vehicleprofiles(struct navit *this_);
|
85 |
void navit_set_destination(struct navit *this_, struct pcoord *c, const char *description, int async);
|
86 |
void navit_set_destinations(struct navit *this_, struct pcoord *c, int count, const char *description, int async);
|
87 |
int navit_check_route(struct navit *this_);
|
88 |
void navit_textfile_debug_log(struct navit *this_, const char *fmt, ...);
|
89 |
void navit_textfile_debug_log_at(struct navit *this_, struct pcoord *pc, const char *fmt, ...);
|
90 |
int navit_speech_estimate(struct navit *this_, char *str);
|
91 |
void navit_say(struct navit *this_, char *text);
|
92 |
void navit_speak(struct navit *this_);
|
93 |
void navit_window_roadbook_destroy(struct navit *this_);
|
94 |
void navit_window_roadbook_new(struct navit *this_);
|
95 |
void navit_reload_maps(struct navit *this_);
|
96 |
void navit_init(struct navit *this_);
|
97 |
void navit_zoom_to_rect(struct navit *this_, struct coord_rect *r);
|
98 |
void navit_zoom_to_route(struct navit *this_, int orientation);
|
99 |
void navit_set_center(struct navit *this_, struct pcoord *center, int set_timeout);
|
100 |
void navit_set_center_cursor(struct navit *this_, int autozoom, int keep_orientation);
|
101 |
void navit_set_center_screen(struct navit *this_, struct point *p, int set_timeout);
|
102 |
int navit_set_attr(struct navit *this_, struct attr *attr);
|
103 |
int navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
|
104 |
int navit_add_attr(struct navit *this_, struct attr *attr);
|
105 |
int navit_remove_attr(struct navit *this_, struct attr *attr);
|
106 |
struct attr_iter *navit_attr_iter_new(void);
|
107 |
void navit_attr_iter_destroy(struct attr_iter *iter);
|
108 |
void navit_add_callback(struct navit *this_, struct callback *cb);
|
109 |
void navit_remove_callback(struct navit *this_, struct callback *cb);
|
110 |
void navit_set_position(struct navit *this_, struct pcoord *c);
|
111 |
struct gui *navit_get_gui(struct navit *this_);
|
112 |
struct transformation *navit_get_trans(struct navit *this_);
|
113 |
struct route *navit_get_route(struct navit *this_);
|
114 |
struct navigation *navit_get_navigation(struct navit *this_);
|
115 |
struct displaylist *navit_get_displaylist(struct navit *this_);
|
116 |
void navit_layout_switch(struct navit *n);
|
117 |
int navit_set_vehicle_by_name(struct navit *n, const char *name);
|
118 |
int navit_set_layout_by_name(struct navit *n, const char *name);
|
119 |
void navit_disable_suspend(void);
|
120 |
int navit_block(struct navit *this_, int block);
|
121 |
void navit_destroy(struct navit *this_);
|
122 |
void navit_command_add_table(struct navit*this_, struct command_table *commands, int count);
|
123 |
//
|
124 |
// extern static int navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation, int *dir);
|
125 |
int navit_get_cur_pnt(struct navit *this_, struct point *p);
|
126 |
|
127 |
|
128 |
|
129 |
|
130 |
|
131 |
#include "coord.h"
|
132 |
#include "point.h"
|
133 |
#include "item.h"
|
134 |
#include "attr.h"
|
135 |
|
136 |
struct coord global_vehicle_pos_onscreen;
|
137 |
|
138 |
//! The navit_vehicule
|
139 |
struct navit_vehicle {
|
140 |
int follow;
|
141 |
/*! Limit of the follow counter. See navit_add_vehicle */
|
142 |
int follow_curr;
|
143 |
/*! Deprecated : follow counter itself. When it reaches 'update' counts, map is recentered*/
|
144 |
struct coord coord;
|
145 |
int dir;
|
146 |
int speed;
|
147 |
struct coord last; /*< Position of the last update of this vehicle */
|
148 |
struct vehicle *vehicle;
|
149 |
struct attr callback;
|
150 |
int animate_cursor;
|
151 |
};
|
152 |
|
153 |
struct navit {
|
154 |
struct attr self;
|
155 |
GList *mapsets;
|
156 |
GList *layouts;
|
157 |
struct gui *gui;
|
158 |
struct layout *layout_current;
|
159 |
struct graphics *gra;
|
160 |
struct action *action;
|
161 |
struct transformation *trans, *trans_cursor;
|
162 |
struct compass *compass;
|
163 |
struct route *route;
|
164 |
struct navigation *navigation;
|
165 |
struct speech *speech;
|
166 |
struct tracking *tracking;
|
167 |
int ready;
|
168 |
struct window *win;
|
169 |
struct displaylist *displaylist;
|
170 |
int tracking_flag;
|
171 |
int orientation;
|
172 |
int recentdest_count;
|
173 |
int osd_configuration;
|
174 |
GList *vehicles;
|
175 |
GList *windows_items;
|
176 |
struct navit_vehicle *vehicle;
|
177 |
struct callback_list *attr_cbl;
|
178 |
struct callback *nav_speech_cb, *roadbook_callback, *popup_callback, *route_cb, *progress_cb;
|
179 |
struct datawindow *roadbook_window;
|
180 |
struct map *former_destination;
|
181 |
struct point pressed, last, current;
|
182 |
int button_pressed,moved,popped,zoomed;
|
183 |
int center_timeout;
|
184 |
int autozoom_secs;
|
185 |
int autozoom_min;
|
186 |
int autozoom_active;
|
187 |
struct event_timeout *button_timeout, *motion_timeout;
|
188 |
struct callback *motion_timeout_callback;
|
189 |
int ignore_button;
|
190 |
int ignore_graphics_events;
|
191 |
struct log *textfile_debug_log;
|
192 |
struct pcoord destination;
|
193 |
int destination_valid;
|
194 |
int blocked;
|
195 |
int w,h;
|
196 |
int drag_bitmap;
|
197 |
int use_mousewheel;
|
198 |
struct messagelist *messages;
|
199 |
struct callback *resize_callback,*button_callback,*motion_callback,*predraw_callback;
|
200 |
struct vehicleprofile *vehicleprofile;
|
201 |
GList *vehicleprofiles;
|
202 |
int pitch;
|
203 |
int follow_cursor;
|
204 |
int prevTs;
|
205 |
int graphics_flags;
|
206 |
int zoom_min, zoom_max;
|
207 |
int radius;
|
208 |
struct bookmarks *bookmarks;
|
209 |
int flags;
|
210 |
/* 1=No graphics ok */
|
211 |
/* 2=No gui ok */
|
212 |
int border;
|
213 |
int imperial;
|
214 |
};
|
215 |
|
216 |
|
217 |
|
218 |
/* end of prototypes */
|
219 |
#ifdef __cplusplus
|
220 |
}
|
221 |
#endif
|
222 |
|
223 |
#endif
|
224 |
|