2 * Copyright (C) 2006, 2007 John Costigan.
4 * POI and GPS-Info code originally written by Cezary Jackiewicz.
6 * Default map data provided by http://www.openstreetmap.org/
8 * This file is part of Maemo Mapper.
10 * Maemo Mapper is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * Maemo Mapper is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Maemo Mapper. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef MAEMO_MAPPER_TYPES_H
25 #define MAEMO_MAPPER_TYPES_H
30 #include <libgnomevfs/gnome-vfs.h>
32 #define _(String) gettext(String)
34 /* #define MAPDB_SQLITE */
40 /** This enumerated type defines the possible connection states. */
43 /** The receiver is "off", meaning that either the bluetooth radio is
44 * off or the user has requested not to connect to the GPS receiver.
45 * No gtk_banner is visible. */
48 /** The connection with the receiver is down. A gtk_banner is visible with
49 * the text, "Connecting to GPS receiver". */
52 /** The connection with the receiver is up, but a GPS fix is not available.
53 * A gtk_banner is visible with the text, "(Re-)Establishing GPS fix". */
56 /** The connection with the receiver is up and a GPS fix IS available.
57 * No gtk_banner is visible. */
61 /** This enumerated type defines the supported types of repositories. */
64 REPOTYPE_NONE, /* No URL set. */
65 REPOTYPE_XYZ, /* x=%d, y=%d, and zoom=%d */
66 REPOTYPE_XYZ_SIGNED, /* x=%d, y=%d, and zoom=%d-2 */
67 REPOTYPE_XYZ_INV, /* zoom=%0d, x=%d, y=%d */
68 REPOTYPE_QUAD_QRST, /* t=%s (%s = {qrst}*) */
69 REPOTYPE_QUAD_ZERO, /* t=%0s (%0s = {0123}*) */
70 REPOTYPE_WMS /* "service=wms" */
73 /** Possible center modes. The "WAS" modes imply no current center mode;
74 * they only hint at what the last center mode was, so that it can be
78 CENTER_WAS_LATLON = -2,
84 /** POI dialog action **/
119 /** This enum defines the possible units we can use. */
138 /** This enum defines the possible font sizes. */
151 /** This enum defines the possible font sizes. */
158 ROTATE_DIR_ENUM_COUNT
161 /** This enum defines all of the key-customizable actions. */
164 CUSTOM_ACTION_PAN_NORTH,
165 CUSTOM_ACTION_PAN_WEST,
166 CUSTOM_ACTION_PAN_SOUTH,
167 CUSTOM_ACTION_PAN_EAST,
168 CUSTOM_ACTION_PAN_UP,
169 CUSTOM_ACTION_PAN_DOWN,
170 CUSTOM_ACTION_PAN_LEFT,
171 CUSTOM_ACTION_PAN_RIGHT,
172 CUSTOM_ACTION_RESET_VIEW_ANGLE,
173 CUSTOM_ACTION_ROTATE_CLOCKWISE,
174 CUSTOM_ACTION_ROTATE_COUNTERCLOCKWISE,
175 CUSTOM_ACTION_TOGGLE_AUTOCENTER,
176 CUSTOM_ACTION_TOGGLE_AUTOROTATE,
177 CUSTOM_ACTION_ZOOM_IN,
178 CUSTOM_ACTION_ZOOM_OUT,
179 CUSTOM_ACTION_TOGGLE_FULLSCREEN,
180 CUSTOM_ACTION_TOGGLE_TRACKING,
181 CUSTOM_ACTION_TOGGLE_TRACKS,
182 CUSTOM_ACTION_TOGGLE_SCALE,
183 CUSTOM_ACTION_TOGGLE_POI,
184 CUSTOM_ACTION_CHANGE_REPO,
185 CUSTOM_ACTION_ROUTE_DISTNEXT,
186 CUSTOM_ACTION_ROUTE_DISTLAST,
187 CUSTOM_ACTION_TRACK_BREAK,
188 CUSTOM_ACTION_TRACK_CLEAR,
189 CUSTOM_ACTION_TRACK_DISTLAST,
190 CUSTOM_ACTION_TRACK_DISTFIRST,
191 CUSTOM_ACTION_TOGGLE_GPS,
192 CUSTOM_ACTION_TOGGLE_GPSINFO,
193 CUSTOM_ACTION_TOGGLE_SPEEDLIMIT,
194 CUSTOM_ACTION_RESET_BLUETOOTH,
195 CUSTOM_ACTION_TOGGLE_LAYERS,
196 CUSTOM_ACTION_ENUM_COUNT
199 /** This enum defines all of the customizable keys. */
209 CUSTOM_KEY_FULLSCREEN,
211 CUSTOM_KEY_ENUM_COUNT
214 /** This enum defines all of the colorable objects. */
218 COLORABLE_MARK_VELOCITY,
221 COLORABLE_TRACK_MARK,
222 COLORABLE_TRACK_BREAK,
225 COLORABLE_ROUTE_BREAK,
241 DEG_FORMAT_ENUM_COUNT
246 SPEED_LOCATION_BOTTOM_LEFT,
247 SPEED_LOCATION_BOTTOM_RIGHT,
248 SPEED_LOCATION_TOP_RIGHT,
249 SPEED_LOCATION_TOP_LEFT,
250 SPEED_LOCATION_ENUM_COUNT
256 MAP_UPDATE_OVERWRITE,
259 MAP_UPDATE_ENUM_COUNT
270 /** A general definition of a point in the Maemo Mapper unit system. */
271 typedef struct _Point Point;
279 /** A WayPoint, which is a Point with a description. */
280 typedef struct _WayPoint WayPoint;
286 /** A Path is a set of PathPoints and WayPoints. */
287 typedef struct _Path Path;
289 Point *head; /* points to first element in array; NULL if empty. */
290 Point *tail; /* points to last element in array. */
291 Point *cap; /* points after last slot in array. */
292 WayPoint *whead; /* points to first element in array; NULL if empty. */
293 WayPoint *wtail; /* points to last element in array. */
294 WayPoint *wcap; /* points after last slot in array. */
297 /** Data to describe a POI. */
298 typedef struct _PoiInfo PoiInfo;
309 /** Data regarding a map repository. */
310 typedef struct _RepoData RepoData;
317 gint view_zoom_steps;
318 gboolean double_size;
325 gboolean layer_enabled;
326 gboolean layer_was_enabled; /* needed for ability to temporarily toggle layers on and off */
327 gint layer_refresh_interval;
328 gint layer_refresh_countdown;
331 sqlite3_stmt *stmt_map_select;
332 sqlite3_stmt *stmt_map_exists;
333 sqlite3_stmt *stmt_map_update;
334 sqlite3_stmt *stmt_map_insert;
335 sqlite3_stmt *stmt_map_delete;
336 sqlite3_stmt *stmt_dup_select;
337 sqlite3_stmt *stmt_dup_exists;
338 sqlite3_stmt *stmt_dup_insert;
339 sqlite3_stmt *stmt_dup_increm;
340 sqlite3_stmt *stmt_dup_decrem;
341 sqlite3_stmt *stmt_dup_delete;
342 sqlite3_stmt *stmt_trans_begin;
343 sqlite3_stmt *stmt_trans_commit;
344 sqlite3_stmt *stmt_trans_rollback;
348 GtkWidget *menu_item;
351 /** GPS Data and Satellite **/
352 typedef struct _GpsData GpsData;
358 gfloat speed; /* in knots */
359 gfloat maxspeed; /* in knots */
369 typedef struct _GpsSatelliteData GpsSatelliteData;
370 struct _GpsSatelliteData {
377 /** Data used for rendering the entire screen. */
378 typedef struct _MapRenderTask MapRenderTask;
379 struct _MapRenderTask
385 gint screen_width_pixels;
386 gint screen_height_pixels;
393 /** Data used for rendering the entire screen. */
394 typedef struct _MapOffsetArgs MapOffsetArgs;
395 struct _MapOffsetArgs
397 gfloat old_center_offset_devx;
398 gfloat old_center_offset_devy;
399 gfloat new_center_offset_devx;
400 gfloat new_center_offset_devy;
402 gfloat percent_complete;
405 typedef struct _ThreadLatch ThreadLatch;
409 gboolean is_done_adding_tasks;
416 /** Data used during the asynchronous progress update phase of automatic map
418 typedef struct _MapUpdateTask MapUpdateTask;
419 struct _MapUpdateTask
424 ThreadLatch *refresh_latch;
434 /** Data used during the asynchronous automatic route downloading operation. */
435 typedef struct _AutoRouteDownloadData AutoRouteDownloadData;
436 struct _AutoRouteDownloadData {
438 gboolean in_progress;
441 gboolean avoid_highways;
444 /** Data to describe the GPS connection. */
445 typedef struct _GpsRcvrInfo GpsRcvrInfo;
446 struct _GpsRcvrInfo {
454 typedef struct _BrowseInfo BrowseInfo;
460 #endif /* ifndef MAEMO_MAPPER_TYPES_H */