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 gboolean map_key_zoom_timeout();
73 int map_zoom(gint zdir);
74 void map_set_autozoom(gboolean az);
75 void map_render_path(Path * path, GdkGC ** gc);
76 void map_pan(gint delta_unitx, gint delta_unity);
77 void map_move_mark(void);
78 void map_set_mark(void);
80 void map_center_unit(guint new_center_unitx, guint new_center_unity);
81 void map_center_latlon(gdouble lat, gdouble lon);
82 gboolean map_goto_position(Position *pos);
84 gboolean map_cb_configure(GtkWidget * widget, GdkEventConfigure * event);
85 gboolean map_cb_expose(GtkWidget * widget, GdkEventExpose * event);
86 gboolean map_cb_button_press(GtkWidget * widget, GdkEventButton * event);
87 gboolean map_cb_button_release(GtkWidget * widget, GdkEventButton * event);
88 gboolean map_cb_scroll_event(GtkWidget * widget, GdkEventScroll * event);