mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
clutter: Remove some unused deprecated clutter_state API
https://gitlab.gnome.org/GNOME/mutter/merge_requests/921
This commit is contained in:
parent
24b38a5059
commit
293ec0a1cb
@ -1217,143 +1217,6 @@ clutter_state_get_states (ClutterState *state)
|
|||||||
return g_hash_table_get_keys (state->priv->states);
|
return g_hash_table_get_keys (state->priv->states);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_get_keys:
|
|
||||||
* @state: a #ClutterState instance.
|
|
||||||
* @source_state_name: (allow-none): the source transition name to query,
|
|
||||||
* or %NULL for all source states
|
|
||||||
* @target_state_name: (allow-none): the target transition name to query,
|
|
||||||
* or %NULL for all target states
|
|
||||||
* @object: (allow-none): the specific object instance to list keys for,
|
|
||||||
* or %NULL for all managed objects
|
|
||||||
* @property_name: (allow-none): the property name to search for, or %NULL
|
|
||||||
* for all properties.
|
|
||||||
*
|
|
||||||
* Returns a list of pointers to opaque structures with accessor functions
|
|
||||||
* that describe the keys added to an animator.
|
|
||||||
*
|
|
||||||
* Return value: (transfer container) (element-type Clutter.StateKey): a
|
|
||||||
* newly allocated #GList of #ClutterStateKey<!-- -->s. The contents of
|
|
||||||
* the returned list are owned by the #ClutterState and should not be
|
|
||||||
* modified or freed. Use g_list_free() to free the resources allocated
|
|
||||||
* by the returned list when done using it
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
GList *
|
|
||||||
clutter_state_get_keys (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name)
|
|
||||||
{
|
|
||||||
GList *s, *state_list;
|
|
||||||
GList *targets = NULL;
|
|
||||||
State *source_state = NULL;
|
|
||||||
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL);
|
|
||||||
|
|
||||||
source_state_name = g_intern_string (source_state_name);
|
|
||||||
target_state_name = g_intern_string (target_state_name);
|
|
||||||
property_name = g_intern_string (property_name);
|
|
||||||
|
|
||||||
if (target_state_name != NULL)
|
|
||||||
state_list = g_list_append (NULL, (gpointer) target_state_name);
|
|
||||||
else
|
|
||||||
state_list = clutter_state_get_states (state);
|
|
||||||
|
|
||||||
if (source_state_name)
|
|
||||||
source_state = clutter_state_fetch_state (state, source_state_name, FALSE);
|
|
||||||
|
|
||||||
for (s = state_list; s != NULL; s = s->next)
|
|
||||||
{
|
|
||||||
State *target_state;
|
|
||||||
|
|
||||||
target_state = clutter_state_fetch_state (state, s->data, FALSE);
|
|
||||||
if (target_state != NULL)
|
|
||||||
{
|
|
||||||
GList *k;
|
|
||||||
|
|
||||||
for (k = target_state->keys; k; k = k->next)
|
|
||||||
{
|
|
||||||
ClutterStateKey *key = k->data;
|
|
||||||
|
|
||||||
if ((object == NULL || (object == key->object)) &&
|
|
||||||
(source_state_name == NULL ||
|
|
||||||
source_state == key->source_state) &&
|
|
||||||
(property_name == NULL ||
|
|
||||||
(property_name == key->property_name)))
|
|
||||||
{
|
|
||||||
targets = g_list_prepend (targets, key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_list_free (state_list);
|
|
||||||
|
|
||||||
return g_list_reverse (targets);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_remove_key:
|
|
||||||
* @state: a #ClutterState instance.
|
|
||||||
* @source_state_name: (allow-none): the source state name to query,
|
|
||||||
* or %NULL for all source states
|
|
||||||
* @target_state_name: (allow-none): the target state name to query,
|
|
||||||
* or %NULL for all target states
|
|
||||||
* @object: (allow-none): the specific object instance to list keys for,
|
|
||||||
* or %NULL for all managed objects
|
|
||||||
* @property_name: (allow-none): the property name to search for,
|
|
||||||
* or %NULL for all properties.
|
|
||||||
*
|
|
||||||
* Removes all keys matching the search criteria passed in arguments.
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
clutter_state_remove_key (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name)
|
|
||||||
{
|
|
||||||
g_return_if_fail (CLUTTER_IS_STATE (state));
|
|
||||||
|
|
||||||
clutter_state_remove_key_internal (state,
|
|
||||||
source_state_name, target_state_name,
|
|
||||||
object, property_name,
|
|
||||||
FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_get_timeline:
|
|
||||||
* @state: a #ClutterState
|
|
||||||
*
|
|
||||||
* Gets the timeline driving the #ClutterState
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): the #ClutterTimeline that drives
|
|
||||||
* the state change animations. The returned timeline is owned
|
|
||||||
* by the #ClutterState and it should not be unreferenced directly
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
ClutterTimeline *
|
|
||||||
clutter_state_get_timeline (ClutterState *state)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL);
|
|
||||||
|
|
||||||
return state->priv->timeline;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_state_set_property (GObject *object,
|
clutter_state_set_property (GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@ -1510,227 +1373,12 @@ G_DEFINE_BOXED_TYPE (ClutterStateKey, clutter_state_key,
|
|||||||
clutter_state_key_copy,
|
clutter_state_key_copy,
|
||||||
clutter_state_key_free);
|
clutter_state_key_free);
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_pre_delay:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the pause before transitioning starts as a fraction of
|
|
||||||
* the total transition time.
|
|
||||||
*
|
|
||||||
* Return value: the pre delay used before starting the transition.
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_state_key_get_pre_delay (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key != NULL, 0.0);
|
|
||||||
|
|
||||||
return state_key->pre_delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_post_delay:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the duration of the pause after transitioning is complete
|
|
||||||
* as a fraction of the total transition time.
|
|
||||||
*
|
|
||||||
* Return value: the post delay, used after doing the transition.
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
gdouble
|
|
||||||
clutter_state_key_get_post_delay (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key != NULL, 0.0);
|
|
||||||
|
|
||||||
return state_key->post_delay;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_mode:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the easing mode used for @state_key.
|
|
||||||
*
|
|
||||||
* Return value: the mode of a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
gulong
|
|
||||||
clutter_state_key_get_mode (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key != NULL, 0);
|
|
||||||
|
|
||||||
return state_key->mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_value:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
* @value: a #GValue initialized with the correct type for the @state_key
|
|
||||||
*
|
|
||||||
* Retrieves a copy of the value for a #ClutterStateKey.
|
|
||||||
*
|
|
||||||
* The #GValue needs to be already initialized for the value type
|
|
||||||
* of the property or to a type that allow transformation from the value
|
|
||||||
* type of the key.
|
|
||||||
*
|
|
||||||
* Use g_value_unset() when done.
|
|
||||||
*
|
|
||||||
* Return value: %TRUE if the value was successfully retrieved,
|
|
||||||
* and %FALSE otherwise
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
gboolean
|
|
||||||
clutter_state_key_get_value (const ClutterStateKey *state_key,
|
|
||||||
GValue *value)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key != NULL, FALSE);
|
|
||||||
g_return_val_if_fail (value != NULL, FALSE);
|
|
||||||
g_return_val_if_fail (G_VALUE_TYPE (value) != G_TYPE_INVALID, FALSE);
|
|
||||||
|
|
||||||
if (!g_type_is_a (G_VALUE_TYPE (&state_key->value), G_VALUE_TYPE (value)))
|
|
||||||
{
|
|
||||||
if (g_value_type_compatible (G_VALUE_TYPE (&state_key->value),
|
|
||||||
G_VALUE_TYPE (value)))
|
|
||||||
{
|
|
||||||
g_value_copy (&state_key->value, value);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_value_type_transformable (G_VALUE_TYPE (&state_key->value),
|
|
||||||
G_VALUE_TYPE (value)))
|
|
||||||
{
|
|
||||||
if (g_value_transform (&state_key->value, value))
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_warning ("%s: Unable to convert from %s to %s for the "
|
|
||||||
"property '%s' of object %s in the state key",
|
|
||||||
G_STRLOC,
|
|
||||||
g_type_name (G_VALUE_TYPE (&state_key->value)),
|
|
||||||
g_type_name (G_VALUE_TYPE (value)),
|
|
||||||
state_key->property_name,
|
|
||||||
G_OBJECT_TYPE_NAME (state_key->object));
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
g_value_copy (&state_key->value, value);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_object:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the object instance this #ClutterStateKey applies to.
|
|
||||||
*
|
|
||||||
* Return value: (transfer none): the object this state key applies to.
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
GObject *
|
|
||||||
clutter_state_key_get_object (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key, NULL);
|
|
||||||
|
|
||||||
return state_key->object;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_property_name:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the name of the property this #ClutterStateKey applies to
|
|
||||||
*
|
|
||||||
* Return value: the name of the property. The returned string is owned
|
|
||||||
* by the #ClutterStateKey and should never be modified or freed
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
const gchar *
|
|
||||||
clutter_state_key_get_property_name (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key, NULL);
|
|
||||||
|
|
||||||
return state_key->property_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_source_state_name:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Retrieves the name of the source state of the @state_key
|
|
||||||
*
|
|
||||||
* Return value: the name of the source state for this key, or %NULL
|
|
||||||
* if this is the generic state key for the given property when
|
|
||||||
* transitioning to the target state. The returned string is owned
|
|
||||||
* by the #ClutterStateKey and should never be modified or freed
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
const gchar *
|
|
||||||
clutter_state_key_get_source_state_name (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key, NULL);
|
|
||||||
|
|
||||||
if (state_key->source_state != NULL)
|
|
||||||
return state_key->source_state->name;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* clutter_state_key_get_target_state_name:
|
|
||||||
* @state_key: a #ClutterStateKey
|
|
||||||
*
|
|
||||||
* Get the name of the source state this #ClutterStateKey contains,
|
|
||||||
* or NULL if this is the generic state key for the given property
|
|
||||||
* when transitioning to the target state.
|
|
||||||
*
|
|
||||||
* Return value: the name of the source state for this key, or NULL if
|
|
||||||
* the key is generic
|
|
||||||
*
|
|
||||||
* Since: 1.4
|
|
||||||
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
|
|
||||||
* #ClutterTransitionGroup instead
|
|
||||||
*/
|
|
||||||
const gchar *
|
|
||||||
clutter_state_key_get_target_state_name (const ClutterStateKey *state_key)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (state_key, NULL);
|
|
||||||
|
|
||||||
return state_key->target_state->name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_state_key_get_property_type:
|
* clutter_state_key_get_property_type:
|
||||||
* @key: a #ClutterStateKey
|
* @key: a #ClutterStateKey
|
||||||
*
|
*
|
||||||
* Retrieves the #GType of the property a key applies to
|
* Retrieves the #GType of the property a key applies to
|
||||||
*
|
*
|
||||||
* You can use this type to initialize the #GValue to pass to
|
|
||||||
* clutter_state_key_get_value()
|
|
||||||
*
|
|
||||||
* Return value: the #GType of the property
|
* Return value: the #GType of the property
|
||||||
*
|
*
|
||||||
* Since: 1.4
|
* Since: 1.4
|
||||||
|
@ -131,20 +131,6 @@ void clutter_state_set (ClutterState *state,
|
|||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
GList * clutter_state_get_states (ClutterState *state);
|
GList * clutter_state_get_states (ClutterState *state);
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
GList * clutter_state_get_keys (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
void clutter_state_remove_key (ClutterState *state,
|
|
||||||
const gchar *source_state_name,
|
|
||||||
const gchar *target_state_name,
|
|
||||||
GObject *object,
|
|
||||||
const gchar *property_name);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
ClutterTimeline * clutter_state_get_timeline (ClutterState *state);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_state_get_state (ClutterState *state);
|
const gchar * clutter_state_get_state (ClutterState *state);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -154,24 +140,7 @@ const gchar * clutter_state_get_state (ClutterState *state);
|
|||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
GType clutter_state_key_get_type (void) G_GNUC_CONST;
|
GType clutter_state_key_get_type (void) G_GNUC_CONST;
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
gdouble clutter_state_key_get_pre_delay (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gdouble clutter_state_key_get_post_delay (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gulong clutter_state_key_get_mode (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
gboolean clutter_state_key_get_value (const ClutterStateKey *state_key,
|
|
||||||
GValue *value);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GType clutter_state_key_get_property_type (const ClutterStateKey *key);
|
GType clutter_state_key_get_property_type (const ClutterStateKey *key);
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
GObject * clutter_state_key_get_object (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_state_key_get_property_name (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_state_key_get_source_state_name (const ClutterStateKey *state_key);
|
|
||||||
CLUTTER_DEPRECATED
|
|
||||||
const gchar * clutter_state_key_get_target_state_name (const ClutterStateKey *state_key);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user