mirror of
https://github.com/brl/mutter.git
synced 2025-01-22 17:38:56 +00:00
ClutterActor: Add clutter_actor_has_effects
Adds an efficent way to query whether an actor has any applied effects. https://bugzilla.gnome.org/show_bug.cgi?id=660471
This commit is contained in:
parent
e058cd4c5f
commit
bed2d9e787
@ -75,6 +75,8 @@ void _clutter_meta_group_clear_metas (ClutterMetaGroup *group
|
||||
ClutterActorMeta * _clutter_meta_group_get_meta (ClutterMetaGroup *group,
|
||||
const gchar *name);
|
||||
|
||||
gboolean _clutter_meta_group_has_metas_no_internal (ClutterMetaGroup *group);
|
||||
|
||||
GList * _clutter_meta_group_get_metas_no_internal (ClutterMetaGroup *group);
|
||||
void _clutter_meta_group_clear_metas_no_internal (ClutterMetaGroup *group);
|
||||
|
||||
|
@ -552,6 +552,27 @@ _clutter_meta_group_get_metas_no_internal (ClutterMetaGroup *group)
|
||||
return g_list_reverse (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_meta_group_has_metas_no_internal:
|
||||
* @group: a #ClutterMetaGroup
|
||||
*
|
||||
* Returns whether the group has any metas that have an internal priority.
|
||||
*
|
||||
* Return value: %TRUE if metas with internal priority exist
|
||||
* %FALSE otherwise
|
||||
*/
|
||||
gboolean
|
||||
_clutter_meta_group_has_metas_no_internal (ClutterMetaGroup *group)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = group->meta; l; l = l->next)
|
||||
if (_clutter_actor_meta_is_internal (l->data))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* _clutter_meta_group_clear_metas:
|
||||
* @group: a #ClutterMetaGroup
|
||||
|
@ -12452,6 +12452,28 @@ clutter_actor_has_overlaps (ClutterActor *self)
|
||||
return CLUTTER_ACTOR_GET_CLASS (self)->has_overlaps (self);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_has_effects:
|
||||
* @self: A #ClutterActor
|
||||
*
|
||||
* Returns whether the actor has any effects applied.
|
||||
*
|
||||
* Return value: %TRUE if the actor has any effects,
|
||||
* %FALSE otherwise
|
||||
*
|
||||
* Since: 1.10
|
||||
*/
|
||||
gboolean
|
||||
clutter_actor_has_effects (ClutterActor *self)
|
||||
{
|
||||
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), TRUE);
|
||||
|
||||
if (self->priv->effects == NULL)
|
||||
return FALSE;
|
||||
|
||||
return _clutter_meta_group_has_metas_no_internal (self->priv->effects);
|
||||
}
|
||||
|
||||
gint
|
||||
_clutter_actor_get_n_children (ClutterActor *self)
|
||||
{
|
||||
|
@ -126,6 +126,8 @@ ClutterEffect *clutter_actor_get_effect (ClutterActor *self,
|
||||
const gchar *name);
|
||||
void clutter_actor_clear_effects (ClutterActor *self);
|
||||
|
||||
gboolean clutter_actor_has_effects (ClutterActor *self);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_EFFECT_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user