2010-10-21 13:13:00 +01:00
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Intel Corporation.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-10-21 12:16:05 +01:00
|
|
|
#ifndef __CLUTTER_ACTOR_PRIVATE_H__
|
|
|
|
#define __CLUTTER_ACTOR_PRIVATE_H__
|
|
|
|
|
|
|
|
#include <clutter/clutter-actor.h>
|
2021-10-28 14:04:58 +02:00
|
|
|
#include <clutter/clutter-grab.h>
|
2010-10-21 12:16:05 +01:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2010-12-09 15:06:12 +00:00
|
|
|
/*< private >
|
|
|
|
* ClutterActorTraverseFlags:
|
2010-10-20 15:40:30 +01:00
|
|
|
* CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST: Traverse the graph in
|
|
|
|
* a depth first order.
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST: Traverse the graph in a
|
|
|
|
* breadth first order.
|
2010-10-21 12:16:05 +01:00
|
|
|
*
|
|
|
|
* Controls some options for how clutter_actor_traverse() iterates
|
|
|
|
* through the graph.
|
|
|
|
*/
|
2018-12-19 09:04:25 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
2010-10-20 15:40:30 +01:00
|
|
|
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST = 1L<<0,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_BREADTH_FIRST = 1L<<1
|
2010-10-21 12:16:05 +01:00
|
|
|
} ClutterActorTraverseFlags;
|
|
|
|
|
2010-12-09 15:06:12 +00:00
|
|
|
/*< private >
|
2010-10-20 15:40:30 +01:00
|
|
|
* ClutterActorTraverseVisitFlags:
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE: Continue traversing as
|
|
|
|
* normal
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN: Don't traverse the
|
|
|
|
* children of the last visited actor. (Not applicable when using
|
2010-12-09 15:06:12 +00:00
|
|
|
* %CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST_POST_ORDER since the children
|
2010-10-20 15:40:30 +01:00
|
|
|
* are visited before having an opportunity to bail out)
|
|
|
|
* CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK: Immediately bail out without
|
|
|
|
* visiting any more actors.
|
|
|
|
*
|
|
|
|
* Each time an actor is visited during a scenegraph traversal the
|
|
|
|
* ClutterTraverseCallback can return a set of flags that may affect
|
|
|
|
* the continuing traversal. It may stop traversal completely, just
|
|
|
|
* skip over children for the current actor or continue as normal.
|
|
|
|
*/
|
2018-12-19 09:04:25 +01:00
|
|
|
typedef enum
|
|
|
|
{
|
2010-10-20 15:40:30 +01:00
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE = 1L<<0,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_SKIP_CHILDREN = 1L<<1,
|
|
|
|
CLUTTER_ACTOR_TRAVERSE_VISIT_BREAK = 1L<<2
|
|
|
|
} ClutterActorTraverseVisitFlags;
|
|
|
|
|
2010-12-09 15:06:12 +00:00
|
|
|
/*< private >
|
2010-10-20 15:40:30 +01:00
|
|
|
* ClutterTraverseCallback:
|
|
|
|
*
|
|
|
|
* The callback prototype used with clutter_actor_traverse. The
|
|
|
|
* returned flags can be used to affect the continuing traversal
|
|
|
|
* either by continuing as normal, skipping over children of an
|
|
|
|
* actor or bailing out completely.
|
|
|
|
*/
|
|
|
|
typedef ClutterActorTraverseVisitFlags (*ClutterTraverseCallback) (ClutterActor *actor,
|
2010-12-09 15:06:12 +00:00
|
|
|
gint depth,
|
|
|
|
gpointer user_data);
|
2010-10-20 15:40:30 +01:00
|
|
|
|
2010-12-09 15:06:12 +00:00
|
|
|
/*< private >
|
|
|
|
* ClutterForeachCallback:
|
2010-10-21 12:16:05 +01:00
|
|
|
* @actor: The actor being iterated
|
|
|
|
* @user_data: The private data specified when starting the iteration
|
|
|
|
*
|
|
|
|
* A generic callback for iterating over actor, such as with
|
|
|
|
* _clutter_actor_foreach_child. The difference when compared to
|
|
|
|
* #ClutterCallback is that it returns a boolean so it is possible to break
|
|
|
|
* out of an iteration early.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE to continue iterating or %FALSE to break iteration
|
|
|
|
* early.
|
|
|
|
*/
|
|
|
|
typedef gboolean (*ClutterForeachCallback) (ClutterActor *actor,
|
2010-12-09 15:06:12 +00:00
|
|
|
gpointer user_data);
|
2010-10-21 12:16:05 +01:00
|
|
|
|
2011-12-09 14:38:25 +00:00
|
|
|
typedef struct _SizeRequest SizeRequest;
|
|
|
|
|
2011-11-23 18:16:29 +00:00
|
|
|
typedef struct _ClutterLayoutInfo ClutterLayoutInfo;
|
2011-12-09 14:38:25 +00:00
|
|
|
typedef struct _ClutterTransformInfo ClutterTransformInfo;
|
actor: Implement implicit animatable properties
Clutter is meant to be, and I quote from the README, a toolkit:
for creating fast, compelling, portable, and dynamic graphical
user interfaces
and yet the default mode of operation for setting an actor's state on
the scene graph (position, size, opacity, rotation, scaling, depth,
etc.) is *not* dynamic. We assume a static UI, and then animate it.
This is the wrong way to design an API for a toolkit meant to be used to
create animated user interfaces. The default mode of operation should be
to implicitly animate every state transition, and only allow skipping
the animation if the user consciously decides to do so — i.e. the design
tenet of the API should be to make The Right Thing™ by default, and make
it really hard (or even impossible) to do The Wrong Thing™.
So we should identify "animatable" properties, i.e. those properties
that should be implicitly animated by ClutterActor, and use the
animation framework we provide to tween the transitions between the
current state and the desired state; the implicit animation should
happen when setting these properties using the public accessors, and not
through some added functionality. For instance, the following:
clutter_actor_set_position (actor, newX, newY);
should not make the actor jump to the (newX, newY) point; it should
tween the actor's position between the current point and the desired
point.
Since we have to maintain backward compatibility with existing
applications, we still need to mark the transitions explicitly, but we
can be smart about it, and treat transition states as a stack that can
be pushed and popped, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_restore_easing_state (actor);
And we can even start stacking animations, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_set_depth (actor, newDepth);
clutter_actor_restore_easing_state (actor);
clutter_actor_restore_easing_state (actor);
And so on, and so forth.
The implementation takes advantage of the newly added Transition API,
which uses only ClutterTimeline sub-classes and ClutterInterval, to cut
down the amount of signal emissions and memory management of object
instances; as well of using the ClutterAnimatable interface for custom
properties and interpolation of values.
2012-03-15 11:09:11 +00:00
|
|
|
typedef struct _ClutterAnimationInfo ClutterAnimationInfo;
|
2011-12-09 14:38:25 +00:00
|
|
|
|
|
|
|
struct _SizeRequest
|
|
|
|
{
|
|
|
|
guint age;
|
|
|
|
gfloat for_size;
|
|
|
|
gfloat min_size;
|
|
|
|
gfloat natural_size;
|
|
|
|
};
|
2011-11-23 18:16:29 +00:00
|
|
|
|
|
|
|
/*< private >
|
|
|
|
* ClutterLayoutInfo:
|
2012-03-27 14:53:27 +01:00
|
|
|
* @fixed_pos: the fixed position of the actor
|
2011-11-23 18:16:29 +00:00
|
|
|
* @margin: the composed margin of the actor
|
|
|
|
* @x_align: the horizontal alignment, if the actor expands horizontally
|
|
|
|
* @y_align: the vertical alignment, if the actor expands vertically
|
2012-03-27 14:53:27 +01:00
|
|
|
* @x_expand: whether the actor should expand horizontally
|
|
|
|
* @y_expand: whether the actor should expand vertically
|
|
|
|
* @minimum: the fixed minimum size
|
|
|
|
* @natural: the fixed natural size
|
2011-11-23 18:16:29 +00:00
|
|
|
*
|
|
|
|
* Ancillary layout information for an actor.
|
|
|
|
*/
|
|
|
|
struct _ClutterLayoutInfo
|
|
|
|
{
|
|
|
|
/* fixed position coordinates */
|
2019-02-20 11:53:44 -03:00
|
|
|
graphene_point_t fixed_pos;
|
2011-11-23 18:16:29 +00:00
|
|
|
|
|
|
|
ClutterMargin margin;
|
|
|
|
|
|
|
|
guint x_align : 4;
|
|
|
|
guint y_align : 4;
|
2011-11-24 14:13:29 +00:00
|
|
|
|
2012-03-27 14:53:27 +01:00
|
|
|
guint x_expand : 1;
|
|
|
|
guint y_expand : 1;
|
|
|
|
|
2019-02-20 11:27:00 -03:00
|
|
|
graphene_size_t minimum;
|
|
|
|
graphene_size_t natural;
|
2011-11-23 18:16:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const ClutterLayoutInfo * _clutter_actor_get_layout_info_or_defaults (ClutterActor *self);
|
|
|
|
ClutterLayoutInfo * _clutter_actor_get_layout_info (ClutterActor *self);
|
2012-06-07 16:31:22 +02:00
|
|
|
ClutterLayoutInfo * _clutter_actor_peek_layout_info (ClutterActor *self);
|
2011-11-23 18:16:29 +00:00
|
|
|
|
2011-12-09 14:38:25 +00:00
|
|
|
struct _ClutterTransformInfo
|
|
|
|
{
|
2020-06-26 18:39:14 -03:00
|
|
|
/* rotation */
|
2011-12-09 14:38:25 +00:00
|
|
|
gdouble rx_angle;
|
|
|
|
gdouble ry_angle;
|
|
|
|
gdouble rz_angle;
|
|
|
|
|
|
|
|
/* scaling */
|
|
|
|
gdouble scale_x;
|
|
|
|
gdouble scale_y;
|
2012-07-09 10:59:13 +01:00
|
|
|
gdouble scale_z;
|
2011-12-09 14:38:25 +00:00
|
|
|
|
2012-07-06 17:31:52 +01:00
|
|
|
/* translation */
|
2019-02-20 10:18:48 -03:00
|
|
|
graphene_point3d_t translation;
|
2012-07-06 17:31:52 +01:00
|
|
|
|
2012-07-05 18:57:38 +01:00
|
|
|
/* z_position */
|
|
|
|
gfloat z_position;
|
2012-07-06 10:35:13 +01:00
|
|
|
|
|
|
|
/* transformation center */
|
2019-02-20 11:53:44 -03:00
|
|
|
graphene_point_t pivot;
|
2012-07-06 14:28:48 +01:00
|
|
|
gfloat pivot_z;
|
2012-07-20 16:56:43 -04:00
|
|
|
|
2020-09-11 15:57:28 -03:00
|
|
|
graphene_matrix_t transform;
|
2012-07-20 16:56:43 -04:00
|
|
|
guint transform_set : 1;
|
2012-08-16 17:10:50 +01:00
|
|
|
|
2020-09-11 15:57:28 -03:00
|
|
|
graphene_matrix_t child_transform;
|
2012-08-16 17:10:50 +01:00
|
|
|
guint child_transform_set : 1;
|
2011-12-09 14:38:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const ClutterTransformInfo * _clutter_actor_get_transform_info_or_defaults (ClutterActor *self);
|
|
|
|
ClutterTransformInfo * _clutter_actor_get_transform_info (ClutterActor *self);
|
|
|
|
|
actor: Implement implicit animatable properties
Clutter is meant to be, and I quote from the README, a toolkit:
for creating fast, compelling, portable, and dynamic graphical
user interfaces
and yet the default mode of operation for setting an actor's state on
the scene graph (position, size, opacity, rotation, scaling, depth,
etc.) is *not* dynamic. We assume a static UI, and then animate it.
This is the wrong way to design an API for a toolkit meant to be used to
create animated user interfaces. The default mode of operation should be
to implicitly animate every state transition, and only allow skipping
the animation if the user consciously decides to do so — i.e. the design
tenet of the API should be to make The Right Thing™ by default, and make
it really hard (or even impossible) to do The Wrong Thing™.
So we should identify "animatable" properties, i.e. those properties
that should be implicitly animated by ClutterActor, and use the
animation framework we provide to tween the transitions between the
current state and the desired state; the implicit animation should
happen when setting these properties using the public accessors, and not
through some added functionality. For instance, the following:
clutter_actor_set_position (actor, newX, newY);
should not make the actor jump to the (newX, newY) point; it should
tween the actor's position between the current point and the desired
point.
Since we have to maintain backward compatibility with existing
applications, we still need to mark the transitions explicitly, but we
can be smart about it, and treat transition states as a stack that can
be pushed and popped, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_restore_easing_state (actor);
And we can even start stacking animations, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_set_depth (actor, newDepth);
clutter_actor_restore_easing_state (actor);
clutter_actor_restore_easing_state (actor);
And so on, and so forth.
The implementation takes advantage of the newly added Transition API,
which uses only ClutterTimeline sub-classes and ClutterInterval, to cut
down the amount of signal emissions and memory management of object
instances; as well of using the ClutterAnimatable interface for custom
properties and interpolation of values.
2012-03-15 11:09:11 +00:00
|
|
|
typedef struct _AState {
|
|
|
|
guint easing_duration;
|
2012-03-15 12:24:02 +00:00
|
|
|
guint easing_delay;
|
actor: Implement implicit animatable properties
Clutter is meant to be, and I quote from the README, a toolkit:
for creating fast, compelling, portable, and dynamic graphical
user interfaces
and yet the default mode of operation for setting an actor's state on
the scene graph (position, size, opacity, rotation, scaling, depth,
etc.) is *not* dynamic. We assume a static UI, and then animate it.
This is the wrong way to design an API for a toolkit meant to be used to
create animated user interfaces. The default mode of operation should be
to implicitly animate every state transition, and only allow skipping
the animation if the user consciously decides to do so — i.e. the design
tenet of the API should be to make The Right Thing™ by default, and make
it really hard (or even impossible) to do The Wrong Thing™.
So we should identify "animatable" properties, i.e. those properties
that should be implicitly animated by ClutterActor, and use the
animation framework we provide to tween the transitions between the
current state and the desired state; the implicit animation should
happen when setting these properties using the public accessors, and not
through some added functionality. For instance, the following:
clutter_actor_set_position (actor, newX, newY);
should not make the actor jump to the (newX, newY) point; it should
tween the actor's position between the current point and the desired
point.
Since we have to maintain backward compatibility with existing
applications, we still need to mark the transitions explicitly, but we
can be smart about it, and treat transition states as a stack that can
be pushed and popped, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_restore_easing_state (actor);
And we can even start stacking animations, e.g.:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_position (actor, newX, newY);
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
clutter_actor_set_opacity (actor, newOpacity);
clutter_actor_set_depth (actor, newDepth);
clutter_actor_restore_easing_state (actor);
clutter_actor_restore_easing_state (actor);
And so on, and so forth.
The implementation takes advantage of the newly added Transition API,
which uses only ClutterTimeline sub-classes and ClutterInterval, to cut
down the amount of signal emissions and memory management of object
instances; as well of using the ClutterAnimatable interface for custom
properties and interpolation of values.
2012-03-15 11:09:11 +00:00
|
|
|
ClutterAnimationMode easing_mode;
|
|
|
|
} AState;
|
|
|
|
|
|
|
|
struct _ClutterAnimationInfo
|
|
|
|
{
|
|
|
|
GArray *states;
|
|
|
|
AState *cur_state;
|
|
|
|
|
|
|
|
GHashTable *transitions;
|
|
|
|
};
|
|
|
|
|
2013-03-07 11:23:39 +00:00
|
|
|
const ClutterAnimationInfo * _clutter_actor_get_animation_info_or_defaults (ClutterActor *self);
|
|
|
|
ClutterAnimationInfo * _clutter_actor_get_animation_info (ClutterActor *self);
|
|
|
|
|
|
|
|
ClutterTransition * _clutter_actor_create_transition (ClutterActor *self,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
...);
|
|
|
|
gboolean _clutter_actor_foreach_child (ClutterActor *self,
|
|
|
|
ClutterForeachCallback callback,
|
|
|
|
gpointer user_data);
|
|
|
|
void _clutter_actor_traverse (ClutterActor *actor,
|
|
|
|
ClutterActorTraverseFlags flags,
|
|
|
|
ClutterTraverseCallback before_children_callback,
|
|
|
|
ClutterTraverseCallback after_children_callback,
|
|
|
|
gpointer user_data);
|
|
|
|
ClutterActor * _clutter_actor_get_stage_internal (ClutterActor *actor);
|
|
|
|
|
2020-09-11 15:57:28 -03:00
|
|
|
void _clutter_actor_apply_modelview_transform (ClutterActor *self,
|
|
|
|
graphene_matrix_t *matrix);
|
|
|
|
void _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
|
|
|
|
ClutterActor *ancestor,
|
|
|
|
graphene_matrix_t *matrix);
|
2013-03-07 11:23:39 +00:00
|
|
|
|
|
|
|
void _clutter_actor_rerealize (ClutterActor *self,
|
|
|
|
ClutterCallback callback,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
void _clutter_actor_set_in_clone_paint (ClutterActor *self,
|
|
|
|
gboolean is_in_clone_paint);
|
|
|
|
|
|
|
|
void _clutter_actor_set_enable_model_view_transform (ClutterActor *self,
|
|
|
|
gboolean enable);
|
|
|
|
|
|
|
|
void _clutter_actor_set_enable_paint_unmapped (ClutterActor *self,
|
|
|
|
gboolean enable);
|
|
|
|
|
|
|
|
void _clutter_actor_set_has_pointer (ClutterActor *self,
|
|
|
|
gboolean has_pointer);
|
|
|
|
|
2019-10-10 18:11:20 +02:00
|
|
|
void _clutter_actor_set_has_key_focus (ClutterActor *self,
|
|
|
|
gboolean has_key_focus);
|
|
|
|
|
2018-08-15 01:12:49 +02:00
|
|
|
void _clutter_actor_queue_redraw_full (ClutterActor *self,
|
|
|
|
const ClutterPaintVolume *volume,
|
|
|
|
ClutterEffect *effect);
|
2013-03-07 11:23:39 +00:00
|
|
|
|
2020-10-19 12:21:39 +02:00
|
|
|
void _clutter_actor_finish_queue_redraw (ClutterActor *self);
|
2013-03-07 11:23:39 +00:00
|
|
|
|
|
|
|
gboolean _clutter_actor_set_default_paint_volume (ClutterActor *self,
|
|
|
|
GType check_gtype,
|
|
|
|
ClutterPaintVolume *volume);
|
|
|
|
|
2021-02-04 08:50:49 +01:00
|
|
|
const char * _clutter_actor_get_debug_name (ClutterActor *self);
|
2013-03-07 11:23:39 +00:00
|
|
|
|
|
|
|
void _clutter_actor_push_clone_paint (void);
|
|
|
|
void _clutter_actor_pop_clone_paint (void);
|
|
|
|
|
|
|
|
ClutterActorAlign _clutter_actor_get_effective_x_align (ClutterActor *self);
|
|
|
|
|
2013-03-07 18:09:33 +00:00
|
|
|
void _clutter_actor_attach_clone (ClutterActor *actor,
|
|
|
|
ClutterActor *clone);
|
|
|
|
void _clutter_actor_detach_clone (ClutterActor *actor,
|
|
|
|
ClutterActor *clone);
|
2013-11-22 10:30:21 -05:00
|
|
|
void _clutter_actor_queue_only_relayout (ClutterActor *actor);
|
2022-11-24 16:18:04 +01:00
|
|
|
void clutter_actor_clear_stage_views_recursive (ClutterActor *actor,
|
|
|
|
gboolean stop_transitions);
|
2013-03-07 18:09:33 +00:00
|
|
|
|
2020-04-10 11:41:58 +02:00
|
|
|
float clutter_actor_get_real_resource_scale (ClutterActor *actor);
|
2013-12-03 12:11:43 +00:00
|
|
|
|
2015-08-24 09:59:16 +01:00
|
|
|
ClutterPaintNode * clutter_actor_create_texture_paint_node (ClutterActor *self,
|
|
|
|
CoglTexture *texture);
|
|
|
|
|
2021-03-13 20:43:13 +01:00
|
|
|
void clutter_actor_finish_layout (ClutterActor *self,
|
|
|
|
int phase);
|
2020-04-10 14:54:11 +02:00
|
|
|
|
|
|
|
void clutter_actor_queue_immediate_relayout (ClutterActor *self);
|
clutter/actor: Add API to get the stage-views an actor is painted on
There are certain rendering techniques and optimizations, for example
the unredirection of non-fullscreen windows, where information about the
output/stage-view an actor is on is needed to determine whether the
optimization can be enabled.
So add a new method to ClutterActor that allows listing the stage-views
the actor is being painted on: clutter_actor_peek_stage_views()
With the way Clutter works, the only point where we can reliably get
this information is during or right before the paint phase, when the
layout phase of the stage has been completed and no more changes to the
actors transformation matrices happen. So to get the stage views the
actor is on, introduce a new step that's done on every master clock tick
between layout and paint cycle: Traversing through the actor tree and
updating the stage-views the mapped actors are going to be painted on.
We're doing this in a separate step instead of inside
clutter_actor_paint() itself for a few reasons: It keeps the code
separate from the painting code, making profiling easier and issues
easier to track down (hopefully), it allows for a new
"stage-views-changed" signal that doesn't interfere with painting, and
finally, it will make it very easy to update the resource scales in the
same step in the future.
Currently, this list is only invalidated on allocation changes of
actors, but not on changes to the transformation matrices. That's
because there's no proper API to invalidate the transformation matrices
ClutterActor implementations can apply through the apply_transform()
vfunc.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1196
2020-04-10 00:34:49 +02:00
|
|
|
|
2020-07-11 12:18:59 +02:00
|
|
|
gboolean clutter_actor_is_painting_unmapped (ClutterActor *self);
|
|
|
|
|
2021-10-28 14:04:58 +02:00
|
|
|
void clutter_actor_attach_grab (ClutterActor *actor,
|
|
|
|
ClutterGrab *grab);
|
|
|
|
void clutter_actor_detach_grab (ClutterActor *actor,
|
|
|
|
ClutterGrab *grab);
|
|
|
|
|
2022-08-03 17:47:01 +02:00
|
|
|
void clutter_actor_collect_event_actors (ClutterActor *self,
|
|
|
|
ClutterActor *deepmost,
|
|
|
|
GPtrArray *actors);
|
|
|
|
|
2022-08-03 18:39:44 +02:00
|
|
|
const GList * clutter_actor_peek_actions (ClutterActor *self);
|
|
|
|
|
2022-08-03 17:57:13 +02:00
|
|
|
void clutter_actor_set_implicitly_grabbed (ClutterActor *actor,
|
|
|
|
gboolean is_implicitly_grabbed);
|
|
|
|
|
2010-10-21 12:16:05 +01:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __CLUTTER_ACTOR_PRIVATE_H__ */
|