[gnome-photos] gegl-gtk-view, gegl-gtk-view-helper: Mark (x, y) as read-only



commit d7fc2060788f6b20ababaea0933f62b55693cdb0
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Jun 16 09:05:36 2015 +0200

    gegl-gtk-view, gegl-gtk-view-helper: Mark (x, y) as read-only
    
    We always want the image to be centred. Therefore, there is no need to
    let the application change the origin.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747446

 src/gegl-gtk-view-helper.c |   22 ----------------------
 src/gegl-gtk-view-helper.h |    2 --
 src/gegl-gtk-view.c        |   38 ++------------------------------------
 src/gegl-gtk-view.h        |    2 --
 4 files changed, 2 insertions(+), 62 deletions(-)
---
diff --git a/src/gegl-gtk-view-helper.c b/src/gegl-gtk-view-helper.c
index 7a052c2..6370bc6 100644
--- a/src/gegl-gtk-view-helper.c
+++ b/src/gegl-gtk-view-helper.c
@@ -297,34 +297,12 @@ view_helper_get_scale(ViewHelper *self)
     return self->scale;
 }
 
-void
-view_helper_set_x(ViewHelper *self, float x)
-{
-    if (self->x == x)
-        return;
-
-    self->x = x;
-    update_autoscale(self);
-    trigger_redraw(self, NULL);
-}
-
 float
 view_helper_get_x(ViewHelper *self)
 {
     return self->x;
 }
 
-void
-view_helper_set_y(ViewHelper *self, float y)
-{
-    if (self->y == y)
-        return;
-
-    self->y = y;
-    update_autoscale(self);
-    trigger_redraw(self, NULL);
-}
-
 float
 view_helper_get_y(ViewHelper *self)
 {
diff --git a/src/gegl-gtk-view-helper.h b/src/gegl-gtk-view-helper.h
index 7bbc029..583abee 100644
--- a/src/gegl-gtk-view-helper.h
+++ b/src/gegl-gtk-view-helper.h
@@ -71,10 +71,8 @@ GeglNode *view_helper_get_node(ViewHelper *self);
 void view_helper_set_scale(ViewHelper *self, float scale);
 float view_helper_get_scale(ViewHelper *self);
 
-void view_helper_set_x(ViewHelper *self, float x);
 float view_helper_get_x(ViewHelper *self);
 
-void view_helper_set_y(ViewHelper *self, float y);
 float view_helper_get_y(ViewHelper *self);
 
 void view_helper_get_transformation(ViewHelper *self, GeglMatrix3 *matrix);
diff --git a/src/gegl-gtk-view.c b/src/gegl-gtk-view.c
index 7124041..8f1d471 100644
--- a/src/gegl-gtk-view.c
+++ b/src/gegl-gtk-view.c
@@ -160,15 +160,13 @@ gegl_gtk_view_class_init(GeglGtkViewClass *klass)
                                             "X",
                                             "X origin",
                                             -G_MAXFLOAT, G_MAXFLOAT, 0.0,
-                                            G_PARAM_CONSTRUCT |
-                                            G_PARAM_READWRITE));
+                                            G_PARAM_READABLE));
     g_object_class_install_property(gobject_class, PROP_Y,
                                     g_param_spec_float("y",
                                             "Y",
                                             "Y origin",
                                             -G_MAXFLOAT, G_MAXFLOAT, 0.0,
-                                            G_PARAM_CONSTRUCT |
-                                            G_PARAM_READWRITE));
+                                            G_PARAM_READABLE));
     g_object_class_install_property(gobject_class, PROP_SCALE,
                                     g_param_spec_double("scale",
                                             "Scale",
@@ -287,15 +285,9 @@ set_property(GObject      *gobject,
     case PROP_NODE:
         gegl_gtk_view_set_node(self, GEGL_NODE(g_value_get_object(value)));
         break;
-    case PROP_X:
-        gegl_gtk_view_set_x(self, g_value_get_float(value));
-        break;
     case PROP_BLOCK:
         priv->block = g_value_get_boolean(value);
         break;
-    case PROP_Y:
-        gegl_gtk_view_set_y(self, g_value_get_float(value));
-        break;
     case PROP_SCALE:
         gegl_gtk_view_set_scale(self, g_value_get_double(value));
         break;
@@ -538,19 +530,6 @@ gegl_gtk_view_get_scale(GeglGtkView *self)
 }
 
 /**
- * gegl_gtk_view_set_x:
- * @self: A #GeglGtkView
- * @x:
- *
- * Setter for the :x property
- **/
-void
-gegl_gtk_view_set_x(GeglGtkView *self, float x)
-{
-    view_helper_set_x(GET_PRIVATE(self), x);
-}
-
-/**
  * gegl_gtk_view_get_x:
  * @self: A #GeglGtkView
  *
@@ -565,19 +544,6 @@ gegl_gtk_view_get_x(GeglGtkView *self)
 }
 
 /**
- * gegl_gtk_view_set_y:
- * @self: A #GeglGtkView
- * @y:
- *
- * Setter for the :y property
- **/
-void
-gegl_gtk_view_set_y(GeglGtkView *self, float y)
-{
-    view_helper_set_y(GET_PRIVATE(self), y);
-}
-
-/**
  * gegl_gtk_view_get_y:
  * @self: A #GeglGtkView
  *
diff --git a/src/gegl-gtk-view.h b/src/gegl-gtk-view.h
index d6611c7..cf2fac7 100644
--- a/src/gegl-gtk-view.h
+++ b/src/gegl-gtk-view.h
@@ -63,10 +63,8 @@ GeglNode *gegl_gtk_view_get_node(GeglGtkView *self);
 void gegl_gtk_view_set_scale(GeglGtkView *self, float scale);
 float gegl_gtk_view_get_scale(GeglGtkView *self);
 
-void gegl_gtk_view_set_x(GeglGtkView *self, float x);
 float gegl_gtk_view_get_x(GeglGtkView *self);
 
-void gegl_gtk_view_set_y(GeglGtkView *self, float y);
 float gegl_gtk_view_get_y(GeglGtkView *self);
 
 void gegl_gtk_view_get_transformation(GeglGtkView *self, GeglMatrix3 *matrix);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]