[gnome-photos/wip/rishi/edit-mode: 23/27] gegl-gtk-view, gegl-gtk-view-helper: Mark (x, y) as read-only



commit db8494b7c52028440ac22be2d8bd2cfe2de7584d
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.

 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 a0538a0..0ff3a2d 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;
@@ -530,19 +522,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
  *
@@ -557,19 +536,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 4642f6d..957f10f 100644
--- a/src/gegl-gtk-view.h
+++ b/src/gegl-gtk-view.h
@@ -62,10 +62,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]