[totem] backend: Remove unused "ratio" property



commit 4370dbeb8386385e942cea7fd884f5d740760356
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jun 27 11:48:32 2012 +0100

    backend: Remove unused "ratio" property

 src/backend/totem-aspect-frame.c |   56 ++++---------------------------------
 src/backend/totem-aspect-frame.h |    4 ---
 2 files changed, 6 insertions(+), 54 deletions(-)
---
diff --git a/src/backend/totem-aspect-frame.c b/src/backend/totem-aspect-frame.c
index 458d93f..157fac6 100644
--- a/src/backend/totem-aspect-frame.c
+++ b/src/backend/totem-aspect-frame.c
@@ -1,8 +1,11 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * mx-aspect-frame.c: A container that respect the aspect ratio of its child
+ * A container that respects the aspect ratio of its child
  *
  * Copyright 2010, 2011 Intel Corporation.
+ * Copyright 2012, Red Hat, Inc.
+ *
+ * Based upon mx-aspect-frame.c
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU Lesser General Public License,
@@ -33,14 +36,11 @@ enum
   PROP_0,
 
   PROP_EXPAND,
-  PROP_RATIO
 };
 
 struct _TotemAspectFramePrivate
 {
   guint expand : 1;
-
-  gfloat ratio;
 };
 
 
@@ -58,10 +58,6 @@ totem_aspect_frame_get_property (GObject    *object,
       g_value_set_boolean (value, totem_aspect_frame_get_expand (frame));
       break;
 
-    case PROP_RATIO:
-      g_value_set_float (value, totem_aspect_frame_get_ratio (frame));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -80,11 +76,6 @@ totem_aspect_frame_set_property (GObject      *object,
                                    g_value_get_boolean (value));
       break;
 
-    case PROP_RATIO:
-      totem_aspect_frame_set_ratio (TOTEM_ASPECT_FRAME (object),
-                                  g_value_get_float (value));
-      break;
-
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
     }
@@ -183,10 +174,7 @@ totem_aspect_frame_allocate (ClutterActor           *actor,
   clutter_actor_get_preferred_size (child, NULL, NULL, &width, &height);
 
   aspect = box_width / box_height;
-  if (priv->ratio >= 0.f)
-    child_aspect = priv->ratio;
-  else
-    child_aspect = width / height;
+  child_aspect = width / height;
 
   if ((aspect < child_aspect) ^ priv->expand)
     {
@@ -329,21 +317,12 @@ totem_aspect_frame_class_init (TotemAspectFrameClass *klass)
                                 FALSE,
                                 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
   g_object_class_install_property (object_class, PROP_EXPAND, pspec);
-
-  pspec = g_param_spec_float ("ratio",
-                              "Ratio",
-                              "Override the child's aspect ratio "
-                              "(width/height).",
-                              -1.f, G_MAXFLOAT, -1.f,
-                              G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-  g_object_class_install_property (object_class, PROP_RATIO, pspec);
 }
 
 static void
 totem_aspect_frame_init (TotemAspectFrame *self)
 {
-  TotemAspectFramePrivate *priv = self->priv = ASPECT_FRAME_PRIVATE (self);
-  priv->ratio = -1.f;
+  self->priv = ASPECT_FRAME_PRIVATE (self);
 }
 
 ClutterActor *
@@ -374,26 +353,3 @@ totem_aspect_frame_get_expand (TotemAspectFrame *frame)
   g_return_val_if_fail (TOTEM_IS_ASPECT_FRAME (frame), FALSE);
   return frame->priv->expand;
 }
-
-void
-totem_aspect_frame_set_ratio (TotemAspectFrame *frame, gfloat ratio)
-{
-  TotemAspectFramePrivate *priv;
-
-  g_return_if_fail (TOTEM_IS_ASPECT_FRAME (frame));
-
-  priv = frame->priv;
-  if (priv->ratio != ratio)
-    {
-      priv->ratio = ratio;
-      clutter_actor_queue_relayout (CLUTTER_ACTOR (frame));
-      g_object_notify (G_OBJECT (frame), "ratio");
-    }
-}
-
-gfloat
-totem_aspect_frame_get_ratio (TotemAspectFrame *frame)
-{
-  g_return_val_if_fail (TOTEM_IS_ASPECT_FRAME (frame), -1.f);
-  return frame->priv->ratio;
-}
diff --git a/src/backend/totem-aspect-frame.h b/src/backend/totem-aspect-frame.h
index 1a11418..e99cdc5 100644
--- a/src/backend/totem-aspect-frame.h
+++ b/src/backend/totem-aspect-frame.h
@@ -82,10 +82,6 @@ void            totem_aspect_frame_set_expand  (TotemAspectFrame *frame,
                                              gboolean       expand);
 gboolean        totem_aspect_frame_get_expand  (TotemAspectFrame *frame);
 
-void            totem_aspect_frame_set_ratio   (TotemAspectFrame *frame,
-                                             gfloat         ratio);
-gfloat          totem_aspect_frame_get_ratio   (TotemAspectFrame *frame);
-
 G_END_DECLS
 
 #endif /* __TOTEM_ASPECT_FRAME_H__ */



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