static void map_update_location(gint x, gint y, gboolean force);
void map_draw_position_icon(Position *pos);
+/******************************************************************************/
+
gboolean
map_cb_configure(GtkWidget * widget, GdkEventConfigure * event)
{
* _map_widget. This method does not queue the draw area.
*/
static void
-map_draw_mark()
+map_draw_mark(void)
{
gdk_draw_arc(_map_widget->window,
_conn_state == RCVR_FIXED ? _gc[COLORABLE_MARK] : _gc[COLORABLE_MARK_OLD], FALSE,
* background maps from disk and redrawing the tracks on top of them.
*/
void
-map_force_redraw()
+map_force_redraw(void)
{
guint new_x, new_y;
map_center_unit(_center.unitx + delta_unitx, _center.unity + delta_unity);
}
+/**
+ * Helper to center map on given lat/lon
+ */
+map_center_latlon(gdouble lat, gdouble lon)
+{
+guint unitx, unity;
+
+latlon2unit(lat, lon, unitx, unity);
+map_center_unit(unitx, unity);
+}
+
+/**
+ * Helper to goto given point and update location
+ *
+ */
+gboolean
+map_goto_position(Position *pos)
+{
+if (pos->valid==FALSE) {
+ return FALSE;
+}
+
+_center_mode=CENTER_MANUAL;
+map_center_latlon(pos->lat, pos->lon);
+map_set_autozoom(FALSE);
+map_update_location_from_center();
+return TRUE;
+}
+
/**
* Initiate a move of the mark from the old location to the current
* location. This function queues the draw area of the old mark (to force
}
gboolean
-map_update_location_from_gps()
+map_update_location_from_gps(void)
{
map_update_location(_pos.unitx, _pos.unity, FALSE);
return FALSE;
}
gboolean
-map_update_location_from_center()
+map_update_location_from_center(void)
{
/* Force re-validation of place if user is clicking around */
map_loc.valid=FALSE;
* the view if the mark is appropriately close to the edge of the view.
*/
void
-map_refresh_mark()
+map_refresh_mark(void)
{
guint new_center_unitx;
guint new_center_unity;
}
void
-map_render_paths()
+map_render_paths(void)
{
if ((_show_tracks & ROUTES_MASK) && _route.head != _route.tail) {
map_render_path(&_route, _gc + COLORABLE_ROUTE);
}
gboolean
-map_key_zoom_timeout()
+map_key_zoom_timeout(void)
{
if (_key_zoom_new < _zoom) {
/* We're currently zooming in (_zoom is decreasing). */
}
static gboolean
-map_autozoomer()
+map_autozoomer(void)
{
static gfloat z=5.0;
static gint last=5;
inp=FALSE;
}
+/**
+ * Mouse scroller zoom in/out callback
+ */
gboolean
map_cb_scroll_event(GtkWidget * widget, GdkEventScroll * event)
{
return FALSE;
}
+/**
+ * Start map drag operation
+ */
static void
map_drag_start(gint x,gint y)
{
map_drag_id=g_signal_connect(G_OBJECT(_map_widget), "motion_notify_event", G_CALLBACK(map_follow_move), NULL);
}
+/**
+ * Stop map drag operation
+ */
static void
map_drag_stop(gint x, gint y)
{