[clutter] interval: Add is_valid() method



commit 762053cd28058bc93d4d2d71b1da1a5599042c0a
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Jun 8 17:32:51 2012 +0100

    interval: Add is_valid() method
    
    The is_valid() method checks if the Interval has an initial and final
    values and it's not still uninitialized.

 clutter/clutter-interval.c |   24 ++++++++++++++++++++++++
 clutter/clutter-interval.h |    3 +++
 clutter/clutter.symbols    |    1 +
 3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-interval.c b/clutter/clutter-interval.c
index 1524667..00db42f 100644
--- a/clutter/clutter-interval.c
+++ b/clutter/clutter-interval.c
@@ -1065,3 +1065,27 @@ clutter_interval_compute (ClutterInterval *interval,
 
   return NULL;
 }
+
+/**
+ * clutter_interval_is_valid:
+ * @interval: a #ClutterInterval
+ *
+ * Checks if the @interval has a valid initial and final values.
+ *
+ * Return value: %TRUE if the #ClutterInterval has an initial and
+ *   final values, and %FALSE otherwise
+ *
+ * Since: 1.12
+ */
+gboolean
+clutter_interval_is_valid (ClutterInterval *interval)
+{
+  ClutterIntervalPrivate *priv;
+
+  g_return_val_if_fail (CLUTTER_IS_INTERVAL (interval), FALSE);
+
+  priv = interval->priv;
+
+  return G_IS_VALUE (&priv->values[INITIAL]) &&
+         G_IS_VALUE (&priv->values[FINAL]);
+}
diff --git a/clutter/clutter-interval.h b/clutter/clutter-interval.h
index a994e27..b0c3714 100644
--- a/clutter/clutter-interval.h
+++ b/clutter/clutter-interval.h
@@ -133,6 +133,9 @@ gboolean         clutter_interval_compute_value      (ClutterInterval *interval,
 const GValue *   clutter_interval_compute            (ClutterInterval *interval,
                                                       gdouble          factor);
 
+CLUTTER_AVAILABLE_IN_1_12
+gboolean         clutter_interval_is_valid           (ClutterInterval *interval);
+
 G_END_DECLS
 
 #endif /* __CLUTTER_INTERVAL_H__ */
diff --git a/clutter/clutter.symbols b/clutter/clutter.symbols
index f509e5e..65c7e2a 100644
--- a/clutter/clutter.symbols
+++ b/clutter/clutter.symbols
@@ -794,6 +794,7 @@ clutter_interval_get_initial_value
 clutter_interval_get_interval
 clutter_interval_get_type
 clutter_interval_get_value_type
+clutter_interval_is_valid
 clutter_interval_new
 clutter_interval_new_with_values
 clutter_interval_peek_final_value



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