[clutter/wip/base-types: 3/6] actor: Use ClutterPoint for the fixed position



commit adbf334d0bfaf10ef6b98526134f58ffe3db85d7
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Mar 30 18:43:59 2012 +0100

    actor: Use ClutterPoint for the fixed position

 clutter/clutter-actor-private.h |    3 +--
 clutter/clutter-actor.c         |   23 +++++++++++------------
 2 files changed, 12 insertions(+), 14 deletions(-)
---
diff --git a/clutter/clutter-actor-private.h b/clutter/clutter-actor-private.h
index ac207b1..e9ece6e 100644
--- a/clutter/clutter-actor-private.h
+++ b/clutter/clutter-actor-private.h
@@ -162,8 +162,7 @@ struct _SizeRequest
 struct _ClutterLayoutInfo
 {
   /* fixed position coordinates */
-  float fixed_x;
-  float fixed_y;
+  ClutterPoint fixed_pos;
 
   ClutterMargin margin;
 
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index cbec881..70a60df 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -4623,7 +4623,7 @@ clutter_actor_get_property (GObject    *object,
         const ClutterLayoutInfo *info;
 
         info = _clutter_actor_get_layout_info_or_defaults (actor);
-        g_value_set_float (value, info->fixed_x);
+        g_value_set_float (value, info->fixed_pos.x);
       }
       break;
 
@@ -4632,7 +4632,7 @@ clutter_actor_get_property (GObject    *object,
         const ClutterLayoutInfo *info;
 
         info = _clutter_actor_get_layout_info_or_defaults (actor);
-        g_value_set_float (value, info->fixed_y);
+        g_value_set_float (value, info->fixed_pos.y);
       }
       break;
 
@@ -8787,8 +8787,8 @@ clutter_actor_move_by (ClutterActor *self,
   g_return_if_fail (CLUTTER_IS_ACTOR (self));
 
   info = _clutter_actor_get_layout_info_or_defaults (self);
-  x = info->fixed_x;
-  y = info->fixed_y;
+  x = info->fixed_pos.x;
+  y = info->fixed_pos.y;
 
   clutter_actor_set_position (self, x + dx, y + dy);
 }
@@ -9569,12 +9569,12 @@ clutter_actor_set_x_internal (ClutterActor *self,
 
   linfo = _clutter_actor_get_layout_info (self);
 
-  if (priv->position_set && linfo->fixed_x == x)
+  if (priv->position_set && linfo->fixed_pos.x == x)
     return;
 
   clutter_actor_store_old_geometry (self, &old);
 
-  linfo->fixed_x = x;
+  linfo->fixed_pos.x = x;
   clutter_actor_set_fixed_position_set (self, TRUE);
 
   clutter_actor_notify_if_geometry_changed (self, &old);
@@ -9592,12 +9592,12 @@ clutter_actor_set_y_internal (ClutterActor *self,
 
   linfo = _clutter_actor_get_layout_info (self);
 
-  if (priv->position_set && linfo->fixed_y == y)
+  if (priv->position_set && linfo->fixed_pos.y == y)
     return;
 
   clutter_actor_store_old_geometry (self, &old);
 
-  linfo->fixed_y = y;
+  linfo->fixed_pos.y = y;
   clutter_actor_set_fixed_position_set (self, TRUE);
 
   clutter_actor_notify_if_geometry_changed (self, &old);
@@ -9708,7 +9708,7 @@ clutter_actor_get_x (ClutterActor *self)
 
           info = _clutter_actor_get_layout_info_or_defaults (self);
 
-          return info->fixed_x;
+          return info->fixed_pos.x;
         }
       else
         return 0;
@@ -9756,7 +9756,7 @@ clutter_actor_get_y (ClutterActor *self)
 
           info = _clutter_actor_get_layout_info_or_defaults (self);
 
-          return info->fixed_y;
+          return info->fixed_pos.y;
         }
       else
         return 0;
@@ -15796,8 +15796,7 @@ clutter_actor_get_layout_manager (ClutterActor *self)
 }
 
 static const ClutterLayoutInfo default_layout_info = {
-  0.f,                          /* fixed-x */
-  0.f,                          /* fixed-y */
+  CLUTTER_POINT_INIT_ZERO,      /* fixed-pos */
   { 0, 0, 0, 0 },               /* margin */
   CLUTTER_ACTOR_ALIGN_FILL,     /* x-align */
   CLUTTER_ACTOR_ALIGN_FILL,     /* y-align */



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