mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 10:00:45 -05:00
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.
This commit is contained in:
parent
dfab055443
commit
762053cd28
@ -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]);
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user