]> err.no Git - mapper/commitdiff
MapWidget: add _get_center_mode, fix some warnings
authorKaj-Michael Lang <milang@tal.org>
Fri, 6 Jun 2008 15:25:21 +0000 (18:25 +0300)
committerKaj-Michael Lang <milang@tal.org>
Fri, 6 Jun 2008 15:25:21 +0000 (18:25 +0300)
libs/libgtkmap/gtkmap.c
libs/libgtkmap/gtkmap.h

index 5681ab09ba4aae2d0ae9dddf2accfbd6804e50fa..bfb09917b36198ec29ad9704d5e9553a2dc71f89 100644 (file)
@@ -595,7 +595,7 @@ priv=GTK_MAP_GET_PRIVATE(map);
 
 switch (prop_id) {
        case PROP_CENTER_MODE:
-               gtk_map_set_center_mode(map, g_value_get_int(value));
+               gtk_map_set_center_mode(GTK_WIDGET(map), g_value_get_int(value));
        break;
        case PROP_SHOW_VELVEC:
                priv->show_velvec=g_value_get_boolean(value);
@@ -1808,7 +1808,7 @@ if (tilex > priv->world_size_tiles || tiley > priv->world_size_tiles)
        return FALSE;
 
 for (zoff = (priv->curr_repo->double_size ? 1 : 0); !pixbuf && (priv->zoom + zoff) <= priv->max_zoom && zoff <= GTK_MAP_TILE_SIZE_P2; zoff += 1) {
-       pixbuf=gtk_map_tile_load(map, tilex, tiley, zoff, !fast_fail);
+       pixbuf=gtk_map_tile_load(GTK_WIDGET(map), tilex, tiley, zoff, !fast_fail);
        if (!pixbuf) {
                if (!fast_fail)
                        fast_fail=TRUE;
@@ -1843,6 +1843,20 @@ return TRUE;
 
 /******************************************************************************/
 
+GtkMapCenterMode 
+gtk_map_get_center_mode(GtkWidget *widget)
+{
+GtkMap *map;
+GtkMapPriv *priv;
+
+g_return_val_if_fail(GTK_IS_MAP(widget), CENTER_MANUAL);
+
+map=GTK_MAP(widget);
+priv=GTK_MAP_GET_PRIVATE(map);
+
+return priv->center_mode;
+}
+
 /**
  * gtk_map_set_center_mode:
  * @mode: Centering mode
@@ -2059,7 +2073,8 @@ gtk_map_rotate(GtkWidget *widget, gfloat angle)
 GtkMap *map;
 GtkMapPriv *priv;
 
-g_return_if_fail(GTK_IS_MAP(widget));
+g_return_val_if_fail(GTK_IS_MAP(widget), FALSE);
+
 map=GTK_MAP(widget);
 priv=GTK_MAP_GET_PRIVATE(map);
 
index 755ca287354ce983a8567245c6dad64ed5f6b14a..3c851995ff4102d96981ff7994b76d294777939a 100644 (file)
@@ -146,6 +146,7 @@ void gtk_map_set_center_latlon(GtkWidget *map, gdouble lat, gdouble lon);
 void gtk_map_get_center_latlon(GtkWidget *map, gdouble *lat, gdouble *lon);
 
 gboolean gtk_map_set_center_mode(GtkWidget *widget, GtkMapCenterMode mode);
+GtkMapCenterMode gtk_map_get_center_mode(GtkWidget *widget);
 
 void gtk_map_pan(GtkWidget *map, gint delta_unitx, gint delta_unity);