*
* Rotates the map view around the current center point.
*
- * Returns TRUE if rotation was possible, otherwise FALSE.
+ * Returns: TRUE if rotation was possible, otherwise FALSE.
*/
gboolean
gtk_map_rotate(GtkWidget *widget, gfloat angle)
/******************************************************************************/
+/**
+ * gtk_map_get_zoom:
+ *
+ * Returns: Current zoom value
+ */
gint
gtk_map_get_zoom(GtkWidget *widget)
{
return priv->zoom;
}
+/**
+ * gtk_map_set_autozoom:
+ *
+ * Enable or disable autozoom. Currently not implemented.
+ *
+ * Returns: TRUE if autozoom was enabled, FALSE if autozoom can't be enabled.
+ */
gboolean
gtk_map_set_autozoom(GtkWidget *widget, gboolean az)
{
return TRUE;
}
+/**
+ * gtk_map_set_zoom:
+ * @new_zoom: Zoom value to set
+ *
+ * Set map view zoom value, 0 is close zoom, larger values zoom out.
+ *
+ * Returns: TRUE is zoom could be set, FALSE if not.
+ */
gboolean
gtk_map_set_zoom(GtkWidget *widget, gint new_zoom)
{
return TRUE;
}
+/**
+ * gtk_map_zoom:
+ * zdir: Relative zoom direction
+ *
+ * Zooms map view relative to current zoom value.
+ *
+ * Returns: The new zoom value
+ */
gint
gtk_map_zoom(GtkWidget *widget, gint zdir)
{
/**
* gtk_map_set_context_menu:
- * @menu: A #GtkMenu to add as context menu
+ * @menu: A #GtkMenu to add as context menu or NULL to clear context menu
*
* Add a context menu to display when the map is clicked on with the right mouse button.
* On hildon build the context menu is set with gtk_widget_tap_and_hold_setup().
map=GTK_MAP(widget);
priv=GTK_MAP_GET_PRIVATE(map);
+if (menu) {
#ifdef WITH_DEVICE_770
-gtk_widget_tap_and_hold_setup(widget, GTK_WIDGET(menu), NULL, 0);
+ gtk_widget_tap_and_hold_setup(widget, GTK_WIDGET(menu), NULL, 0);
#else
-g_object_ref(menu);
-priv->menu=menu;
+ g_object_ref(menu);
+ priv->menu=menu;
#endif
-}
-
-void
-gtk_map_clear_context_menu(GtkWidget *widget)
-{
-GtkMap *map;
-GtkMapPriv *priv;
-
-g_return_if_fail(GTK_IS_MAP(widget));
-map=GTK_MAP(widget);
-priv=GTK_MAP_GET_PRIVATE(map);
-
-g_return_if_fail(priv->menu);
-
+ priv->menu=menu;
+} else if (priv->menu) {
#ifdef WITH_DEVICE_770
-gtk_widget_tap_and_hold_setup(widget, NULL, NULL, 0);
+ gtk_widget_tap_and_hold_setup(widget, NULL, NULL, 0);
#else
-g_object_unref(priv->menu);
+ g_object_unref(priv->menu);
#endif
-priv->menu=NULL;
+ priv->menu=NULL;
+}
}
/**
#include "position.h"
#include "map-tile-repo.h"
+/**
+ * GtkMapCenterMode:
+ * @CENTER_MANUAL: View center is set by user or from code
+ * @CENTER_LATLAT: Center on active track last point
+ * @CENTER_LEAD: Center on active track last point+speed offset
+ *
+ * Map centering mode.
+ *
+ */
typedef enum {
CENTER_WAS_LATLON = -2,
CENTER_WAS_LEAD = -1,
CENTER_LATLON = 2
} GtkMapCenterMode;
+/**
+ * GtkMapMarkerType:
+ * @MAP_MARKER_TYPE_POI: Marker is a Point of Interest
+ * @MAP_MARKER_TYPE_POSITION: Marker is a special Position (Home, Destination)
+ * @MAP_MARKER_TYPE_BOOKMARK: Marker is a bookmark Position
+ * @MAP_MARKER_TYPE_CACHE: Marker is a GeoCache
+ *
+ * Map marker types.
+ *
+ */
typedef enum {
MAP_MARKER_TYPE_POI=0,
MAP_MARKER_TYPE_POSITION,
MAP_MARKER_TYPE_CACHE,
} GtkMapMarkerType;
+/**
+ * GtkMapMarkerStoreID:
+ * @MAP_MARKER_ID: Marker ID number
+ * @MAP_MARKER_TYPE: Marker type, must be one from #GtkMapMarkerType
+ * @MAP_MARKER_LAT: Marker latitude
+ * @MAP_MARKER_LON: Marker longitude
+ * @MAP_MARKER_LABEL: Marker name or label to display on a #GtkMap
+ * @MAP_MARKER_ICON: Icon to display on a #GtkMap
+ * @MAP_MARKER_COLOR: Color to use for marker arc if no icon is given or found
+ * @MAP_MARKER_CACHE_X: Internal cache widget x coordinate for marker
+ * @MAP_MARKER_CACHE_Y: Internal cache widget y coordinate for marker
+ *
+ * #GtkListStore ID numbers for marker store.
+ */
typedef enum {
MAP_MARKER_ID=0,
MAP_MARKER_TYPE,
#define GTK_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_MAP_TYPE, GtkMapClass))
#define GTK_IS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_MAP_TYPE))
-typedef struct _GtkMap GtkMap;
-typedef struct _GtkMapClass GtkMapClass;
+typedef struct _GtkMap GtkMap;
struct _GtkMap {
GtkDrawingArea map;
- guint size;
- gfloat heading;
- gfloat speed;
};
+typedef struct _GtkMapClass GtkMapClass;
struct _GtkMapClass {
GtkDrawingAreaClass parent_class;
void (* zoom_changed) (GtkWidget *widget, int zoom);
/* Menu and mouse related */
void gtk_map_set_context_menu(GtkWidget *widget, GtkMenu *menu);
-void gtk_map_clear_context_menu(GtkWidget *widget);
void gtk_map_get_menu_latlon(GtkWidget *map, gdouble *lat, gdouble *lon);
G_END_DECLS