17 #include <glib/gstdio.h>
19 #include <dbus/dbus-glib.h>
22 #include "mapper-types.h"
28 MAP_MODE_SET_ROUTE_FROM,
29 MAP_MODE_SET_ROUTE_POINT,
30 MAP_MODE_SET_ROUTE_TO,
34 /** VARIABLES FOR MAINTAINING STATE OF THE CURRENT VIEW. */
36 /** The "zoom" level defines the resolution of a pixel, from 0 to MAX_ZOOM.
37 * Each pixel in the current view is exactly (1 << _zoom) "units" wide. */
43 /** The "base tile" is the upper-left tile in the pixmap. */
47 guint _zoom; /* zoom level, from 0 to MAX_ZOOM. */
48 Point _center; /* current center location, X. */
50 /** The "offset" defines the upper-left corner of the visible portion of the
55 /** CACHED SCREEN INFORMATION THAT IS DEPENDENT ON THE CURRENT VIEW. */
56 guint _screen_grids_halfwidth;
57 guint _screen_grids_halfheight;
58 guint _screen_width_pixels;
59 guint _screen_height_pixels;
61 guint _focus_unitwidth;
62 guint _focus_unitheight;
63 guint _world_size_tiles;
66 guint _key_zoom_timeout_sid;
68 gboolean _map_location_known;
69 gdouble _map_location_dist;
71 /** The widget that provides the visual display of the map. */
72 GtkWidget *_map_widget;
74 /** The backing pixmap of _map_widget. */
75 GdkPixmap *_map_pixmap;
77 GtkWidget *map_new(void);
79 gboolean map_key_zoom_timeout();
81 int map_zoom(gint zdir);
82 void map_set_autozoom(gboolean az);
83 void map_render_path(Path * path, GdkGC ** gc);
84 void map_pan(gint delta_unitx, gint delta_unity);
85 void map_move_mark(void);
86 void map_set_mark(void);
87 void map_render_data(void);
89 void map_render_tile(guint tilex, guint tiley, guint destx, guint desty, gboolean fast_fail);
91 void map_center_unit(guint new_center_unitx, guint new_center_unity);
92 void map_center_latlon(gdouble lat, gdouble lon);
94 gboolean map_goto_position(Position *pos);
95 gboolean map_update_location_from_center(void);