Class
ClutterActor
Description [src]
class Clutter.Actor : GObject.InitiallyUnowned
implements Atk.ImplementorIface, Clutter.Animatable {
flags: guint32,
accessible_role: AtkRole
}
The basic element of the scene graph
The ClutterActor class is the basic element of the scene graph in Clutter, and it encapsulates the position, size, and transformations of a node in the graph.
Actor transformations
Each actor can be transformed using methods like clutter_actor_set_scale()
or clutter_actor_set_rotation_angle()
. The order in which the transformations are
applied is decided by Clutter and it is the following:
- translation by the origin of the
ClutterActor:allocation
property - translation by the actor’s
ClutterActor:z-position
property - translation by the actor’s
ClutterActor:pivot-point
property - scaling by the
ClutterActor:scale-x
andClutterActor:scale-y
factors - rotation around the
ClutterActor:rotation-angle-x
- rotation around the
ClutterActor:rotation-angle-y
- rotation around the
ClutterActor:rotation-angle-z
- negative translation by the actor’s
ClutterActor:pivot-point
Modifying an actor's geometry
Each actor has a bounding box, called ClutterActor:allocation
which is either set by its parent or explicitly through the
clutter_actor_set_position()
and clutter_actor_set_size()
methods.
Each actor also has an implicit preferred size.
An actor’s preferred size can be defined by any subclass by
overriding the Clutter.ActorClass.get_preferred_width
and the
Clutter.ActorClass.get_preferred_height
virtual functions, or it can
be explicitly set by using clutter_actor_set_width()
and
clutter_actor_set_height()
.
An actor’s position can be set explicitly by using
clutter_actor_set_x()
and clutter_actor_set_y()
; the coordinates are
relative to the origin of the actor’s parent.
Managing actor children
Each actor can have multiple children, by calling
clutter_actor_add_child()
to add a new child actor, and
clutter_actor_remove_child()
to remove an existing child. ClutterActor
will hold a reference on each child actor, which will be released when
the child is removed from its parent, or destroyed using
clutter_actor_destroy()
.
ClutterActor *actor = clutter_actor_new ();
// set the bounding box of the actor
clutter_actor_set_position (actor, 0, 0);
clutter_actor_set_size (actor, 480, 640);
// set the background color of the actor
clutter_actor_set_background_color (actor, &COGL_COLOR_INIT (0xf5, 0x79, 0x00, 0xff));
// set the bounding box of the child, relative to the parent
ClutterActor *child = clutter_actor_new ();
clutter_actor_set_position (child, 20, 20);
clutter_actor_set_size (child, 80, 240);
// set the background color of the child
clutter_actor_set_background_color (child, &COGL_COLOR_INIT (0x00, 0x00, 0xff, 0xff));
// add the child to the actor
clutter_actor_add_child (actor, child);
Children can be inserted at a given index, or above and below
another child actor. The order of insertion determines the order of the
children when iterating over them. Iterating over children is performed
by using clutter_actor_get_first_child()
, clutter_actor_get_previous_sibling()
,
clutter_actor_get_next_sibling()
, and clutter_actor_get_last_child()
. It is
also possible to retrieve a list of children by using
clutter_actor_get_children()
, as well as retrieving a specific child at a
given index by using clutter_actor_get_child_at_index()
.
If you need to track additions of children to a ClutterActor
, use
the ClutterActor::child-added
signal; similarly, to track
removals of children from a ClutterActor, use the
ClutterActor::child-removed
signal.
Painting an actor
There are three ways to paint an actor:
- set a delegate
ClutterContent
as the value for theClutterActor:content
property of the actor - subclass
ClutterActor
and override theClutter.ActorClass.paint_node
virtual function - subclass
ClutterActor
and override theClutter.ActorClass.paint
virtual function.
A ClutterContent
is a delegate object that takes over the painting
operations of one, or more actors. The ClutterContent
painting will
be performed on top of the ClutterActor:background-color
of the actor,
and before calling the actor’s own implementation of the
Clutter.ActorClass.paint_node
virtual function.
ClutterActor *actor = clutter_actor_new ();
// set the bounding box
clutter_actor_set_position (actor, 50, 50);
clutter_actor_set_size (actor, 100, 100);
// set the content; the image_content variable is set elsewhere
clutter_actor_set_content (actor, image_content);
The Clutter.ActorClass.paint_node
virtual function is invoked whenever
an actor needs to be painted. The implementation of the virtual function
must only paint the contents of the actor itself, and not the contents of
its children, if the actor has any.
The ClutterPaintNode
passed to the virtual function is the local root of
the render tree; any node added to it will be rendered at the correct
position, as defined by the actor’s ClutterActor:allocation
.
static void
my_actor_paint_node (ClutterActor *actor,
ClutterPaintNode *root)
{
ClutterPaintNode *node;
ClutterActorBox box;
// where the content of the actor should be painted
clutter_actor_get_allocation_box (actor, &box);
// the cogl_texture variable is set elsewhere
node = clutter_texture_node_new (cogl_texture, &COGL_COLOR_INIT (255, 255, 255, 255),
CLUTTER_SCALING_FILTER_TRILINEAR,
CLUTTER_SCALING_FILTER_LINEAR);
// paint the content of the node using the allocation
clutter_paint_node_add_rectangle (node, &box);
// add the node, and transfer ownership
clutter_paint_node_add_child (root, node);
clutter_paint_node_unref (node);
}
The Clutter.ActorClass.paint
virtual function function gives total
control to the paint sequence of the actor itself, including the
children of the actor, if any. It is strongly discouraged to override
the Clutter.ActorClass.paint
virtual function and it will be removed
when the Clutter API changes.
Handling events on an actor
A ClutterActor
can receive and handle input device events, for
instance pointer events and key events, as long as its
ClutterActor:reactive
property is set to TRUE
.
Once an actor has been determined to be the source of an event,
Clutter will traverse the scene graph from the top-level actor towards the
event source, emitting the ClutterActor::captured-event
signal on each
ancestor until it reaches the source; this phase is also called
the “capture” phase. If the event propagation was not stopped, the graph
is walked backwards, from the source actor to the top-level, and the
[signal@Clutter.Actor::event signal] is emitted, alongside eventual event-specific
signals like ClutterActor::button-press-event
or ClutterActor::motion-event
;
this phase is also called the “bubble” phase.
At any point of the signal emission, signal handlers can stop the propagation
through the scene graph by returning CLUTTER_EVENT_STOP
; otherwise, they can
continue the propagation by returning CLUTTER_EVENT_PROPAGATE
.
Animation
Animation is a core concept of modern user interfaces; Clutter provides a complete and powerful animation framework that automatically tweens the actor’s state without requiring direct, frame by frame manipulation from your application code. You have two models at your disposal:
- an implicit animation model
- an explicit animation model
The implicit animation model of Clutter assumes that all the changes in an actor state should be gradual and asynchronous; Clutter will automatically transition an actor’s property change between the current state and the desired one without manual intervention, if the property is defined to be animatable in its documentation.
By default, in the 1.0 API series, the transition happens with a duration of zero milliseconds, and the implicit animation is an opt in feature to retain backwards compatibility.
Implicit animations depend on the current easing state; in order to use
the default easing state for an actor you should call the
clutter_actor_save_easing_state()
function:
// assume that the actor is currently positioned at (100, 100)
// store the current easing state and reset the new easing state to
// its default values
clutter_actor_save_easing_state (actor);
// change the actor's position
clutter_actor_set_position (actor, 500, 500);
// restore the previously saved easing state
clutter_actor_restore_easing_state (actor);
The example above will trigger an implicit animation of the actor between its current position to a new position.
Implicit animations use a default duration of 250 milliseconds,
and a default easing mode of CLUTTER_EASE_OUT_CUBIC
, unless you call
clutter_actor_set_easing_mode()
and clutter_actor_set_easing_duration()
after changing the easing state of the actor.
It is possible to animate multiple properties of an actor at the same time, and you can animate multiple actors at the same time as well, for instance:
clutter_actor_save_easing_state (actor);
// animate the actor's opacity and depth
clutter_actor_set_opacity (actor, 0);
clutter_actor_set_z_position (actor, -100);
clutter_actor_restore_easing_state (actor);
clutter_actor_save_easing_state (another_actor);
// animate another actor's opacity
clutter_actor_set_opacity (another_actor, 255);
clutter_actor_set_z_position (another_actor, 100);
clutter_actor_restore_easing_state (another_actor);
Changing the easing state will affect all the following property transitions, but will not affect existing transitions.
It is important to note that if you modify the state on an animatable property while a transition is in flight, the transition’s final value will be updated, as well as its duration and progress mode by using the current easing state; for instance, in the following example:
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 1000);
clutter_actor_set_x (actor, 200);
clutter_actor_restore_easing_state (actor);
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 500);
clutter_actor_set_x (actor, 100);
clutter_actor_restore_easing_state (actor);
the first call to clutter_actor_set_x()
will begin a transition
of the ClutterActor:x
property from the current value to the value of
200 over a duration of one second; the second call to clutter_actor_set_x()
will change the transition’s final value to 100 and the duration to 500 milliseconds.
It is possible to receive a notification of the completion of an
implicit transition by using the ClutterActor::transition-stopped
signal, decorated with the name of the property. In case you want to
know when all the currently in flight transitions are complete, use
the ClutterActor::transitions-completed
signal instead.
It is possible to retrieve the ClutterTransition
used by the
animatable properties by using clutter_actor_get_transition()
and using
the property name as the transition name.
The explicit animation model supported by Clutter requires that
you create a ClutterTransition
object, and optionally set the initial
and final values. The transition will not start unless you add it to the
ClutterActor
.
ClutterTransition *transition;
transition = clutter_property_transition_new_for_actor (actor, "opacity");
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition), 3000);
clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), 2);
clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
clutter_transition_set_from (transition, G_TYPE_UINT, 255);
clutter_transition_set_to (transition, G_TYPE_UINT, 0);
clutter_actor_add_transition (actor, "animate-opacity", transition);
The example above will animate the ClutterActor:opacity
property
of an actor between fully opaque and fully transparent, and back, over
a span of 3 seconds. The animation does not begin until it is added to
the actor.
The explicit animation API applies to all GObject
properties,
as well as the custom properties defined through the ClutterAnimatable
interface, regardless of whether they are defined as implicitly
animatable or not.
The explicit animation API should also be used when using custom
animatable properties for ClutterAction
, ClutterConstraint
, and
ClutterEffect
instances associated to an actor; see the section on
custom animatable properties below for an example.
Finally, explicit animations are useful for creating animations that run continuously, for instance:
// this animation will pulse the actor's opacity continuously
ClutterTransition *transition;
ClutterInterval *interval;
transition = clutter_property_transition_new_for_actor (actor, "opacity");
// we want to animate the opacity between 0 and 255
clutter_transition_set_from (transition, G_TYPE_UINT, 0);
clutter_transition_set_to (transition, G_TYPE_UINT, 255);
// over a one second duration, running an infinite amount of times
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition), 1000);
clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), -1);
// we want to fade in and out, so we need to auto-reverse the transition
clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
// and we want to use an easing function that eases both in and out
clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (transition),
CLUTTER_EASE_IN_OUT_CUBIC);
// add the transition to the desired actor to start it
clutter_actor_add_transition (actor, "opacityAnimation", transition);
Implementing an actor
Careful consideration should be given when deciding to implement
a ClutterActor
sub-class. It is generally recommended to implement a
sub-class of ClutterActor
only for actors that should be used as leaf
nodes of a scene graph.
By overriding the Clutter.ActorClass.get_preferred_width
and
Clutter.ActorClass.get_preferred_height
virtual functions it is
possible to change or provide the preferred size of an actor; similarly,
by overriding the Clutter.ActorClass.allocate
virtual function it is
possible to control the layout of the children of an actor. Make sure to
always chain up to the parent implementation of the
Clutter.ActorClass.allocate
virtual function.
In general, it is strongly encouraged to use delegation and composition instead of direct subclassing.
Custom animatable properties
ClutterActor
allows accessing properties of ClutterAction
,
ClutterEffect
, and ClutterConstraint
instances associated to an actor
instance for animation purposes, as well as its ClutterLayoutManager
.
In order to access a specific ClutterAction
or a ClutterConstraint
property it is necessary to set the ClutterActorMeta:name
property on the
given action or constraint.
The property can be accessed using the following syntax:
@<section>.<meta-name>.<property-name>
- the initial
@
is mandatory - the
section
fragment can be one between “actions”, “constraints”, “content”, and “effects” - the
meta-name
fragment is the name of the action, effect, or constraint, as specified by theClutterActorMeta:name
property ofClutterActorMeta
- the
property-name
fragment is the name of the action, effect, or constraint property to be animated.
The example below animates a ClutterBindConstraint
applied to an actor
using an explicit transition. The rect
actor has a binding constraint
on the origin
actor, and in its initial state is overlapping the actor
to which is bound to.
As the actor has only one ClutterLayoutManager
, the syntax for accessing its
properties is simpler:
@layout.<property-name>
constraint = clutter_bind_constraint_new (origin, CLUTTER_BIND_X, 0.0);
clutter_actor_meta_set_name (CLUTTER_ACTOR_META (constraint), "bind-x");
clutter_actor_add_constraint (rect, constraint);
constraint = clutter_bind_constraint_new (origin, CLUTTER_BIND_Y, 0.0);
clutter_actor_meta_set_name (CLUTTER_ACTOR_META (constraint), "bind-y");
clutter_actor_add_constraint (rect, constraint);
clutter_actor_set_reactive (origin, TRUE);
g_signal_connect (origin, "button-press-event",
G_CALLBACK (on_button_press),
rect);
On button press, the rectangle “slides” from behind the actor to
which is bound to, using the ClutterBindConstraint:offset
property to
achieve the effect:
gboolean
on_button_press (ClutterActor *origin,
ClutterEvent *event,
ClutterActor *rect)
{
ClutterTransition *transition;
// the offset that we want to apply; this will make the actor
// slide in from behind the origin and rest at the right of
// the origin, plus a padding value
float new_offset = clutter_actor_get_width (origin) + h_padding;
// the property we wish to animate; the "@constraints" section
// tells Clutter to check inside the constraints associated
// with the actor; the "bind-x" section is the name of the
// constraint; and the "offset" is the name of the property
// on the constraint
const char *prop = "@constraints.bind-x.offset";
// create a new transition for the given property
transition = clutter_property_transition_new_for_actor (rect, prop);
// set the easing mode and duration
clutter_timeline_set_progress_mode (CLUTTER_TIMELINE (transition),
CLUTTER_EASE_OUT_CUBIC);
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition), 500);
// create the interval with the initial and final values
clutter_transition_set_from (transition, G_TYPE_FLOAT, 0.f);
clutter_transition_set_to (transition, G_TYPE_FLOAT, new_offset);
// add the transition to the actor; this causes the animation
// to start. the name "offsetAnimation" can be used to retrieve
// the transition later
clutter_actor_add_transition (rect, "offsetAnimation", transition);
// we handled the event
return CLUTTER_EVENT_STOP;
}
Instance methods
clutter_actor_add_action_with_name
A convenience function for setting the name of a ClutterAction
while adding it to the list of actions applied to self
.
clutter_actor_add_constraint_with_name
A convenience function for setting the name of a ClutterConstraint
while adding it to the list of constraints applied to self
.
clutter_actor_add_effect_with_name
A convenience function for setting the name of a ClutterEffect
while adding it to the list of effectss applied to self
.
clutter_actor_allocate_align_fill
Allocates self
by taking into consideration the available allocation
area; an alignment factor on either axis; and whether the actor should
fill the allocation on either axis.
clutter_actor_allocate_available_size
Allocates self
taking into account the ClutterActor
‘s
preferred size, but limiting it to the maximum available width
and height provided.
clutter_actor_apply_relative_transform_to_point
Transforms point
in coordinates relative to the actor into
ancestor-relative coordinates using the relevant transform
stack (i.e. scale, rotation, etc).
clutter_actor_apply_transform_to_point
Transforms point
in coordinates relative to the actor
into screen-relative coordinates with the current actor
transformation (i.e. scale, rotation, etc).
clutter_actor_contains
Determines if descendant
is contained inside self
(either as an
immediate child, or as a deeper descendant). If self
and
descendant
point to the same actor then it will also return TRUE
.
clutter_actor_continue_paint
Run the next stage of the paint sequence. This function should only
be called within the implementation of the ‘run’ virtual of a
ClutterEffect
. It will cause the run method of the next effect to
be applied, or it will paint the actual actor if the current effect
is the last effect in the chain.
clutter_actor_continue_pick
Run the next stage of the pick sequence. This function should only
be called within the implementation of the ‘pick’ virtual of a
ClutterEffect
. It will cause the run method of the next effect to
be applied, or it will pick the actual actor if the current effect
is the last effect in the chain.
clutter_actor_create_pango_context
Creates a PangoContext
for the given actor. The PangoContext
is already configured using the appropriate font map, resolution
and font options.
clutter_actor_create_pango_layout
Creates a new PangoLayout
from the same PangoContext
used
by the ClutterActor
. The PangoLayout
is already configured
with the font map, resolution and font options, and the
given text
.
clutter_actor_create_texture_paint_node
Creates a ClutterPaintNode
initialized using the state of the
given ClutterActor
, ready to be used inside the implementation
of the ClutterActorClass
.paint_node virtual function.
clutter_actor_destroy
Destroys an actor. When an actor is destroyed, it will break any references it holds to other objects. If the actor is inside a container, the actor will be removed.
clutter_actor_event
This function is used to emit an event on the main stage. You should rarely need to use this function, except for synthetising events.
clutter_actor_get_abs_allocation_vertices
Calculates the transformed screen coordinates of the four corners of
the actor; the returned vertices relate to the ClutterActorBox
coordinates as follows:.
clutter_actor_get_accessible
Returns the accessible object that describes the actor to an assistive technology.
clutter_actor_get_accessible_name
Gets the accessible name for this widget. See
clutter_actor_set_accessible_name()
for more information.
clutter_actor_get_accessible_role
Gets the AtkRole
for this widget. See
clutter_actor_set_accessible_role()
for more information.
clutter_actor_get_action
Retrieves the ClutterAction
with the given name in the list
of actions applied to self
.
clutter_actor_get_allocation_box
Gets the layout box an actor has been assigned. The allocation can
only be assumed valid inside a paint()
method; anywhere else, it
may be out-of-date.
clutter_actor_get_background_color
Retrieves the color set using clutter_actor_set_background_color()
.
clutter_actor_get_child_at_index
Retrieves the actor at the given index_
inside the list of
children of self
.
clutter_actor_get_child_transform
Retrieves the child transformation matrix set using
clutter_actor_set_child_transform()
; if none is currently set,
the transform
matrix will be initialized to the identity matrix.
clutter_actor_get_clip_to_allocation
Retrieves the value set using clutter_actor_set_clip_to_allocation().
clutter_actor_get_color_state
Retrieves the color_state of a ClutterActor
set by
clutter_actor_set_color_state()
.
clutter_actor_get_constraint
Retrieves the ClutterConstraint
with the given name in the list
of constraints applied to self
.
clutter_actor_get_content_gravity
Retrieves the content gravity as set using
clutter_actor_set_content_gravity()
.
clutter_actor_get_content_repeat
Retrieves the repeat policy for a ClutterActor
set by
clutter_actor_set_content_repeat()
.
clutter_actor_get_content_scaling_filters
Retrieves the values set using clutter_actor_set_content_scaling_filters()
.
clutter_actor_get_easing_delay
Retrieves the delay that should be applied when tweening animatable properties.
clutter_actor_get_easing_duration
Retrieves the duration of the tweening for animatable
properties of self
for the current easing state.
clutter_actor_get_easing_mode
Retrieves the easing mode for the tweening of animatable properties
of self
for the current easing state.
clutter_actor_get_effect
Retrieves the ClutterEffect
with the given name in the list
of effects applied to self
.
clutter_actor_get_fixed_position
This function gets the fixed position of the actor, if set. If there
is no fixed position set, this function returns FALSE
and doesn’t set
the x and y coordinates.
clutter_actor_get_fixed_position_set
Checks whether an actor has a fixed position set (and will thus be unaffected by any layout manager).
clutter_actor_get_next_sibling
Retrieves the sibling of self
that comes after it in the list
of children of self
‘s parent.
clutter_actor_get_offscreen_redirect
Retrieves whether to redirect the actor to an offscreen buffer, as set by clutter_actor_set_offscreen_redirect().
clutter_actor_get_opacity
Retrieves the opacity value of an actor, as set by clutter_actor_set_opacity().
clutter_actor_get_paint_box
Retrieves the paint volume of the passed ClutterActor
, and
transforms it into a 2D bounding box in stage coordinates.
clutter_actor_get_paint_opacity
Retrieves the absolute opacity of the actor, as it appears on the stage.
clutter_actor_get_paint_visibility
Retrieves the ‘paint’ visibility of an actor recursively checking for non visible parents.
clutter_actor_get_paint_volume
Retrieves the paint volume of the passed ClutterActor
, or NULL
when a paint volume can’t be determined.
clutter_actor_get_pango_context
Retrieves the PangoContext
for self
. The actor’s PangoContext
is already configured using the appropriate font map, resolution
and font options.
clutter_actor_get_position
This function tries to “do what you mean” and tell you where the actor is, prior to any transformations. Retrieves the fixed position of an actor in pixels, if one has been set; otherwise, if the allocation is valid, returns the actor’s allocated position; otherwise, returns 0,0.
clutter_actor_get_preferred_height
Computes the requested minimum and natural heights for an actor, or if they are already computed, returns the cached values.
clutter_actor_get_preferred_size
Computes the preferred minimum and natural size of an actor, taking into account the actor’s geometry management (either height-for-width or width-for-height).
clutter_actor_get_preferred_width
Computes the requested minimum and natural widths for an actor, optionally depending on the specified height, or if they are already computed, returns the cached values.
clutter_actor_get_previous_sibling
Retrieves the sibling of self
that comes before it in the list
of children of self
‘s parent.
clutter_actor_get_relative_transformation_matrix
This gets a transformation matrix
that will transform coordinates from the
coordinate space of self
into the coordinate space of ancestor
.
clutter_actor_get_rotation_angle
Retrieves the angle of rotation set by clutter_actor_set_rotation_angle().
clutter_actor_get_scale_z
Retrieves the scaling factor along the Z axis, as set using
clutter_actor_set_scale_z()
.
clutter_actor_get_size
This function tries to “do what you mean” and return the size an actor will have. If the actor has a valid allocation, the allocation will be returned; otherwise, the actors natural size request will be returned.
clutter_actor_get_transformed_extents
Gets the transformed bounding rect of an actor, in pixels relative to the stage.
clutter_actor_get_transformed_paint_volume
Retrieves the 3D paint volume of an actor like
clutter_actor_get_paint_volume()
does and it additionally
transforms the paint volume into the coordinate
space of relative_to_ancestor
. (Or the stage if NULL
is passed for relative_to_ancestor
).
clutter_actor_get_transformed_position
Gets the absolute position of an actor, in pixels relative to the stage.
clutter_actor_get_transformed_size
Gets the absolute size of an actor in pixels, taking into account the scaling factors.
clutter_actor_get_transition
Retrieves the ClutterTransition
of a ClutterActor
by using the
transition name
.
clutter_actor_get_x_align
Retrieves the horizontal alignment policy set using
clutter_actor_set_x_align()
.
clutter_actor_get_y_align
Retrieves the vertical alignment policy set using
clutter_actor_set_y_align()
.
clutter_actor_grab_key_focus
Sets the key focus of the ClutterStage
including self
to this ClutterActor
.
clutter_actor_has_allocation
Checks if the actor has an up-to-date allocation assigned to it. This means that the actor should have an allocation: it’s visible and has a parent. It also means that there is no outstanding relayout request in progress for the actor or its children (There might be other outstanding layout requests in progress that will cause the actor to get a new allocation when the stage is laid out, however).
clutter_actor_has_mapped_clones
Returns whether a ClutterActor
or any parent actors have mapped clones
that are clone-painting self
.
clutter_actor_has_overlaps
Asks the actor’s implementation whether it may contain overlapping primitives.
clutter_actor_inhibit_culling
Increases the culling inhibitor counter. Inhibiting culling forces the actor to be painted even when outside the visible bounds of the stage view.
clutter_actor_insert_child_above
Inserts child
into the list of children of self
, above another
child of self
or, if sibling
is NULL
, above all the children
of self
.
clutter_actor_insert_child_at_index
Inserts child
into the list of children of self
, using the
given index_
. If index_
is greater than the number of children
in self
, or is less than 0, then the new child is added at the end.
clutter_actor_insert_child_below
Inserts child
into the list of children of self
, below another
child of self
or, if sibling
is NULL
, below all the children
of self
.
clutter_actor_invalidate_paint_volume
Invalidates the cached paint volume of self
. This is needed for
implementations overriding the Clutter.ActorClass.get_paint_volume
virtual function and has to be called every time the paint volume
returned by that function would change.
clutter_actor_invalidate_transform
Invalidate the cached transformation matrix of self
.
This is needed for implementations overriding the apply_transform()
vfunc and has to be called if the matrix returned by apply_transform()
would change.
clutter_actor_map
Sets the CLUTTER_ACTOR_MAPPED
flag on the actor and possibly maps
and realizes its children if they are visible. Does nothing if the
actor is not visible.
clutter_actor_move_by
Moves an actor by the specified distance relative to its current position in pixels.
clutter_actor_needs_expand
Checks whether an actor, or any of its children, is set to expand horizontally or vertically.
clutter_actor_notify_transform_invalid
Invalidate the cached transformation matrix of self
and queue a redraw
if the transformation matrix has changed.
This is needed for implementations overriding the apply_transform()
vfunc and has to be called if the matrix returned by apply_transform()
would change due to state outside of the object itself.
clutter_actor_peek_stage_views
Retrieves the list of ClutterStageView
s the actor is being
painted on.
clutter_actor_pick_box
Logs (does a virtual paint of) a rectangle for picking. Note that box
is
in the actor’s own local coordinates, so is usually {0,0,width,height}
to include the whole actor. That is unless the actor has a shaped input
region in which case you may wish to log the (multiple) smaller rectangles
that make up the input region.
clutter_actor_pick_frame_clock
Pick the most suitable frame clock for driving animations for this actor.
clutter_actor_queue_redraw
Queues up a redraw of an actor and any children. The redraw occurs once the main loop becomes idle (after the current batch of events has been processed, roughly).
clutter_actor_queue_redraw_with_clip
Queues a redraw on self
limited to a specific, actor-relative
rectangular area.
clutter_actor_queue_relayout
Indicates that the actor’s size request or other layout-affecting
properties may have changed. This function is used inside ClutterActor
subclass implementations, not by applications directly.
clutter_actor_realize
Realization informs the actor that it is attached to a stage. It can use this to allocate resources if it wanted to delay allocation until it would be rendered. However it is perfectly acceptable for an actor to create resources before being realized because Clutter only ever has a single rendering context so that actor is free to be moved from one stage to another.
deprecated: 1.16
clutter_actor_remove_action_by_name
Removes the ClutterAction
with the given name from the list
of actions applied to self
.
clutter_actor_remove_constraint_by_name
Removes the ClutterConstraint
with the given name from the list
of constraints applied to self
.
clutter_actor_remove_effect_by_name
Removes the ClutterEffect
with the given name from the list
of effects applied to self
.
clutter_actor_remove_transition
Removes the transition stored inside a ClutterActor
using name
identifier.
clutter_actor_restore_easing_state
Restores the easing state as it was prior to a call to
clutter_actor_save_easing_state()
.
clutter_actor_save_easing_state
Saves the current easing state for animatable properties, and creates a new state with the default values for easing mode and duration.
clutter_actor_set_accessible
This method allows to set a customly created accessible object to this widget.
clutter_actor_set_accessible_role
This method sets role
as the accessible role for self
. This
role describes what kind of user interface element self
is and
is provided so that assistive technologies know how to present
self
to the user.
clutter_actor_set_child_above_sibling
Sets child
to be above sibling
in the list of children of self
.
clutter_actor_set_child_below_sibling
Sets child
to be below sibling
in the list of children of self
.
clutter_actor_set_child_transform
Sets the transformation matrix to be applied to all the children
of self
prior to their own transformations. The default child
transformation is the identity matrix.
clutter_actor_set_clip
Sets clip area for self
. The clip area is always computed from the
upper left corner of the actor.
clutter_actor_set_clip_to_allocation
Sets whether self
should be clipped to the same size as its allocation.
clutter_actor_set_content_repeat
Sets the policy for repeating the ClutterActor:content
of a
ClutterActor
. The behaviour is deferred to the ClutterContent
implementation.
clutter_actor_set_content_scaling_filters
Sets the minification and magnification filter to be applied when
scaling the ClutterActor:content
of a ClutterActor
.
clutter_actor_set_easing_delay
Sets the delay that should be applied before tweening animatable properties.
clutter_actor_set_easing_duration
Sets the duration of the tweening for animatable properties
of self
for the current easing state.
clutter_actor_set_easing_mode
Sets the easing mode for the tweening of animatable properties
of self
.
clutter_actor_set_fixed_position_set
Sets whether an actor has a fixed position set (and will thus be unaffected by any layout manager).
clutter_actor_set_height
Forces a height on an actor, causing the actor’s preferred width and height (if any) to be ignored.
clutter_actor_set_layout_manager
Sets the ClutterLayoutManager
delegate object that will be used to
lay out the children of self
.
clutter_actor_set_name
Sets the given name to self
. The name can be used to identify
a ClutterActor
.
clutter_actor_set_offscreen_redirect
Defines the circumstances where the actor should be redirected into an offscreen image. The offscreen image is used to flatten the actor into a single image while painting for two main reasons. Firstly, when the actor is painted a second time without any of its contents changing it can simply repaint the cached image without descending further down the actor hierarchy. Secondly, it will make the opacity look correct even if there are overlapping primitives in the actor.
clutter_actor_set_opacity
Sets the actor’s opacity, with zero being completely transparent and 255 (0xff) being fully opaque.
clutter_actor_set_opacity_override
Allows overriding the calculated paint opacity (as returned by clutter_actor_get_paint_opacity()). This is used internally by ClutterClone and ClutterOffscreenEffect, and should be used by actors that need to mimic those.
clutter_actor_set_pivot_point
Sets the position of the ClutterActor:pivot-point
around which the
scaling and rotation transformations occur.
clutter_actor_set_pivot_point_z
Sets the component on the Z axis of the ClutterActor:pivot-point
around
which the scaling and rotation transformations occur.
clutter_actor_set_size
Sets the actor’s size request in pixels. This overrides any “normal” size request the actor would have. For example a text actor might normally request the size of the text; this function would force a specific size instead.
clutter_actor_set_transform
Overrides the transformations of a ClutterActor
with a custom
matrix, which will be applied relative to the origin of the
actor’s allocation and to the actor’s pivot point.
clutter_actor_set_translation
Sets an additional translation transformation on a ClutterActor
,
relative to the ClutterActor:pivot-point
.
clutter_actor_set_width
Forces a width on an actor, causing the actor’s preferred width and height (if any) to be ignored.
clutter_actor_set_x_align
Sets the horizontal alignment policy of a ClutterActor
, in case the
actor received extra horizontal space.
clutter_actor_set_x_expand
Sets whether a ClutterActor
should expand horizontally; this means
that layout manager should allocate extra space for the actor, if possible.
clutter_actor_set_y_align
Sets the vertical alignment policy of a ClutterActor
, in case the
actor received extra vertical space.
clutter_actor_set_y_expand
Sets whether a ClutterActor
should expand horizontally; this means
that layout manager should allocate extra space for the actor, if possible.
clutter_actor_should_pick
Should be called inside the implementation of the
Clutter.ActorClass.pick
virtual function in order to check whether
the actor should be picked or not.
clutter_actor_show
Flags an actor to be displayed. An actor that isn’t shown will not be rendered on the stage.
clutter_actor_transform_stage_point
This function translates screen coordinates (x
, y
) to
coordinates relative to the actor. For example, it can be used to translate
screen events from global screen coordinates into actor-local coordinates.
clutter_actor_uninhibit_culling
Decreases the culling inhibitor counter. See clutter_actor_inhibit_culling()
for when inhibit culling is necessary.
clutter_actor_unmap
Unsets the CLUTTER_ACTOR_MAPPED
flag on the actor and possibly
unmaps its children if they were mapped.
clutter_actor_unrealize
Unrealization informs the actor that it may be being destroyed or moved to another stage. The actor may want to destroy any underlying graphics resources at this point. However it is perfectly acceptable for it to retain the resources until the actor is destroyed because Clutter only ever uses a single rendering context and all of the graphics resources are valid on any stage.
deprecated: 1.16
Methods inherited from ClutterAnimatable (5)
clutter_animatable_find_property
Finds the GParamSpec
for property_name
.
clutter_animatable_get_actor
Get animated actor.
clutter_animatable_get_initial_state
Retrieves the current state of property_name
and sets value
with it.
clutter_animatable_interpolate_value
Asks a ClutterAnimatable
implementation to interpolate a
a named property between the initial and final values of
a ClutterInterval
, using progress
as the interpolation
value, and store the result inside value
.
clutter_animatable_set_final_state
Sets the current state of property_name
to value
.
Properties
Clutter.Actor:background-color
Paints a solid fill of the actor’s allocation using the specified color.
Clutter.Actor:clip-rect
The visible region of the actor, in actor-relative coordinates, expressed as a #graphene_rect_t.
Clutter.Actor:clip-to-allocation
Whether the clip region should track the allocated area of the actor.
Clutter.Actor:color-state
The ClutterColorState
contains the properties like colorspace for each actors.
Clutter.Actor:content-gravity
The alignment that should be honoured by the ClutterContent
set with the ClutterActor:content
property.
Clutter.Actor:fixed-position-set
This flag controls whether the ClutterActor:fixed-x
and
ClutterActor:fixed-y
properties are used.
Clutter.Actor:height
Height of the actor (in pixels). If written, forces the minimum and natural size request of the actor to the given height. If read, returns the allocated height if available, otherwise the height request.
Clutter.Actor:layout-manager
A delegate object for controlling the layout of the children of an actor.
Clutter.Actor:mapped
Whether the actor is mapped (will be painted when the stage to which it belongs is mapped).
Clutter.Actor:min-height-set
This flag controls whether the ClutterActor:min-height
property
is used.
Clutter.Actor:natural-height-set
This flag controls whether the ClutterActor:natural-height
property
is used.
Clutter.Actor:natural-width-set
This flag controls whether the ClutterActor:natural-width
property
is used.
Clutter.Actor:offscreen-redirect
Determines the conditions in which the actor will be redirected
to an offscreen framebuffer while being painted. For example this
can be used to cache an actor in a framebuffer or for improved
handling of transparent actors. See
clutter_actor_set_offscreen_redirect()
for details.
Clutter.Actor:pivot-point-z
The Z component of the ClutterActor:pivot-point
, expressed as a value
along the Z axis.
Clutter.Actor:request-mode
Request mode for the ClutterActor
. The request mode determines the
type of geometry management used by the actor, either height for width
(the default) or width for height.
Clutter.Actor:translation-x
An additional translation applied along the X axis, relative
to the actor’s ClutterActor:pivot-point
.
Clutter.Actor:translation-y
An additional translation applied along the Y axis, relative
to the actor’s ClutterActor:pivot-point
.
Clutter.Actor:translation-z
An additional translation applied along the Z axis, relative
to the actor’s ClutterActor:pivot-point
.
Clutter.Actor:width
Width of the actor (in pixels). If written, forces the minimum and natural size request of the actor to the given width. If read, returns the allocated width if available, otherwise the width request.
Clutter.Actor:x
X coordinate of the actor in pixels. If written, forces a fixed position for the actor. If read, returns the fixed position if any, otherwise the allocation if available, otherwise 0.
Clutter.Actor:x-align
The alignment of an actor on the X axis, if the actor has been given
extra space for its allocation. See also the ClutterActor:x-expand
property.
Clutter.Actor:x-expand
Whether a layout manager should assign more space to the actor on the X axis.
Clutter.Actor:y
Y coordinate of the actor in pixels. If written, forces a fixed position for the actor. If read, returns the fixed position if any, otherwise the allocation if available, otherwise 0.
Clutter.Actor:y-align
The alignment of an actor on the Y axis, if the actor has been given extra space for its allocation.
Clutter.Actor:y-expand
Whether a layout manager should assign more space to the actor on the Y axis.
Clutter.Actor:z-position
The actor’s position on the Z axis, relative to the parent’s transformations.
Signals
Clutter.Actor::button-press-event
The signal is emitted each time a mouse button
is pressed on actor
.
Clutter.Actor::button-release-event
The signal is emitted each time a mouse button
is released on actor
.
Clutter.Actor::captured-event
The signal is emitted when an event is captured
by Clutter. This signal will be emitted starting from the top-level
container (the ClutterStage
) to the actor which received the event
going down the hierarchy. This signal can be used to intercept every
event before the specialized events (like
ClutterActor::button-press-event
or
ClutterActor::button-release-event
) are emitted.
Clutter.Actor::destroy
The signal notifies that all references held on the actor which emitted it should be released.
Clutter.Actor::event
The signal is emitted each time an event is received
by the actor
. This signal will be emitted on every actor,
following the hierarchy chain, until it reaches the top-level
container (the ClutterStage
).
Clutter.Actor::key-press-event
The signal is emitted each time a keyboard button
is pressed while actor
has key focus (see clutter_stage_set_key_focus()).
Clutter.Actor::key-release-event
The signal is emitted each time a keyboard button
is released while actor
has key focus (see clutter_stage_set_key_focus()).
Clutter.Actor::pick
The signal is emitted each time an actor is being painted
in “pick mode”. The pick mode is used to identify the actor during
the event handling phase, or by clutter_stage_get_actor_at_pos()
.
deprecated: 1.12
Clutter.Actor::queue-relayout
The signal is emitted when clutter_actor_queue_relayout()
is called on an actor.
Clutter.Actor::resource-scale-changed
The signal is emitted when the resource scale
value returned by clutter_actor_get_resource_scale()
changes.
Clutter.Actor::stage-views-changed
The signal is emitted when the position or size an actor is being painted at have changed so that it’s visible on different stage views.
Clutter.Actor::transition-stopped
The signal is emitted once a transition
is stopped; a transition is stopped once it reached its total
duration (including eventual repeats), it has been stopped
using clutter_timeline_stop()
, or it has been removed from the
transitions applied on actor
, using clutter_actor_remove_transition()
.
Clutter.Actor::transitions-completed
The signal is emitted once all transitions
involving actor
are complete.
Clutter.Actor::unrealize
The signal is emitted each time an actor is being unrealized.
deprecated: 1.16
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct ClutterActorClass {
void (* show) (
ClutterActor* self
);
void (* hide) (
ClutterActor* self
);
void (* hide_all) (
ClutterActor* self
);
void (* realize) (
ClutterActor* self
);
void (* unrealize) (
ClutterActor* self
);
void (* map) (
ClutterActor* self
);
void (* unmap) (
ClutterActor* self
);
void (* paint) (
ClutterActor* self,
ClutterPaintContext* paint_context
);
void (* parent_set) (
ClutterActor* actor,
ClutterActor* old_parent
);
void (* destroy) (
ClutterActor* self
);
void (* pick) (
ClutterActor* actor,
ClutterPickContext* pick_context
);
void (* get_preferred_width) (
ClutterActor* self,
gfloat for_height,
gfloat* min_width_p,
gfloat* natural_width_p
);
void (* get_preferred_height) (
ClutterActor* self,
gfloat for_width,
gfloat* min_height_p,
gfloat* natural_height_p
);
void (* allocate) (
ClutterActor* self,
const ClutterActorBox* box
);
void (* apply_transform) (
ClutterActor* actor,
graphene_matrix_t* matrix
);
gboolean (* event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* button_press_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* button_release_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* scroll_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* key_press_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* key_release_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* motion_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* enter_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* leave_event) (
ClutterActor* actor,
ClutterEvent* event
);
gboolean (* captured_event) (
ClutterActor* actor,
ClutterEvent* event
);
void (* key_focus_in) (
ClutterActor* actor
);
void (* key_focus_out) (
ClutterActor* actor
);
void (* queue_relayout) (
ClutterActor* self
);
AtkObject* (* get_accessible) (
ClutterActor* self
);
GType (* get_accessible_type) (
void
);
gboolean (* get_paint_volume) (
ClutterActor* actor,
ClutterPaintVolume* volume
);
gboolean (* has_overlaps) (
ClutterActor* self
);
void (* paint_node) (
ClutterActor* self,
ClutterPaintNode* root,
ClutterPaintContext* paint_context
);
gboolean (* touch_event) (
ClutterActor* self,
ClutterEvent* event
);
void (* resource_scale_changed) (
ClutterActor* self
);
float (* calculate_resource_scale) (
ClutterActor* self,
int phase
);
void (* child_added) (
ClutterActor* self,
ClutterActor* child
);
void (* child_removed) (
ClutterActor* self,
ClutterActor* child
);
GType layout_manager_type;
}
Base class for actors.
Class members
show: void (* show) ( ClutterActor* self )
Signal class handler for
ClutterActor::show
; it must chain up to the parent’s implementation.hide: void (* hide) ( ClutterActor* self )
Signal class handler for
ClutterActor::hide
; it must chain up to the parent’s implementation.hide_all: void (* hide_all) ( ClutterActor* self )
Virtual function for containers and composite actors, to determine which children should be shown when calling
clutter_actor_hide_all()
on the actor. Defaults to calling clutter_actor_hide(). This virtual function is deprecated and it should not be overridden.realize: void (* realize) ( ClutterActor* self )
Virtual function, used to allocate resources for the actor; it should chain up to the parent’s implementation. This virtual function is deprecated and should not be overridden in newly written code.
unrealize: void (* unrealize) ( ClutterActor* self )
Virtual function, used to deallocate resources allocated in ::realize; it should chain up to the parent’s implementation. This function is deprecated and should not be overridden in newly written code.
map: void (* map) ( ClutterActor* self )
Virtual function for containers and composite actors, to map their children; it must chain up to the parent’s implementation. Overriding this function is optional.
unmap: void (* unmap) ( ClutterActor* self )
Virtual function for containers and composite actors, to unmap their children; it must chain up to the parent’s implementation. Overriding this function is optional.
paint: void (* paint) ( ClutterActor* self, ClutterPaintContext* paint_context )
Virtual function, used to paint the actor.
parent_set: void (* parent_set) ( ClutterActor* actor, ClutterActor* old_parent )
Signal class handler for the
ClutterActor::parent-set
.destroy: void (* destroy) ( ClutterActor* self )
Signal class handler for
ClutterActor::destroy
. It must chain up to the parent’s implementation.pick: void (* pick) ( ClutterActor* actor, ClutterPickContext* pick_context )
Virtual function, used to draw an outline of the actor with the given color.
get_preferred_width: void (* get_preferred_width) ( ClutterActor* self, gfloat for_height, gfloat* min_width_p, gfloat* natural_width_p )
Virtual function, used when querying the minimum and natural widths of an actor for a given height; it is used by clutter_actor_get_preferred_width().
get_preferred_height: void (* get_preferred_height) ( ClutterActor* self, gfloat for_width, gfloat* min_height_p, gfloat* natural_height_p )
Virtual function, used when querying the minimum and natural heights of an actor for a given width; it is used by clutter_actor_get_preferred_height().
allocate: void (* allocate) ( ClutterActor* self, const ClutterActorBox* box )
Virtual function, used when setting the coordinates of an actor; it is used by clutter_actor_allocate(); when overriding this function without chaining up,
clutter_actor_set_allocation()
must be called and children must be allocated by the implementation, when chaining up though, those things will be done by the parent’s implementation.apply_transform: void (* apply_transform) ( ClutterActor* actor, graphene_matrix_t* matrix )
Virtual function, used when applying the transformations to an actor before painting it or when transforming coordinates or the allocation; if the transformation calculated by this function may have changed, the cached transformation must be invalidated by calling clutter_actor_invalidate_transform(); it must chain up to the parent’s implementation.
event: gboolean (* event) ( ClutterActor* actor, ClutterEvent* event )
Class handler for
ClutterActor::event
.button_press_event: gboolean (* button_press_event) ( ClutterActor* actor, ClutterEvent* event )
Class handler for
ClutterActor::button-press-event
.button_release_event: gboolean (* button_release_event) ( ClutterActor* actor, ClutterEvent* event )
Class handler for
ClutterActor::button-release-event
.scroll_event: gboolean (* scroll_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::scroll-event
.key_press_event: gboolean (* key_press_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::key-press-event
.key_release_event: gboolean (* key_release_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::key-release-event
.motion_event: gboolean (* motion_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::motion-event
.enter_event: gboolean (* enter_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::enter-event
.leave_event: gboolean (* leave_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::leave-event
.captured_event: gboolean (* captured_event) ( ClutterActor* actor, ClutterEvent* event )
Signal class closure for
ClutterActor::captured-event
.key_focus_in: void (* key_focus_in) ( ClutterActor* actor )
Signal class closure for
ClutterActor::key-focus-in
.key_focus_out: void (* key_focus_out) ( ClutterActor* actor )
Signal class closure for
ClutterActor::key-focus-out
.queue_relayout: void (* queue_relayout) ( ClutterActor* self )
Class handler for
ClutterActor::queue-relayout
.get_accessible: AtkObject* (* get_accessible) ( ClutterActor* self )
Virtual function, returns the accessible object that describes the actor to an assistive technology.
get_accessible_type: GType (* get_accessible_type) ( void )
Returns the type of the accessible object that describes the actor to an assistive technology.
get_paint_volume: gboolean (* get_paint_volume) ( ClutterActor* actor, ClutterPaintVolume* volume )
Virtual function, for sub-classes to define their
ClutterPaintVolume
.has_overlaps: gboolean (* has_overlaps) ( ClutterActor* self )
Virtual function for sub-classes to advertise whether they need an offscreen redirect to get the correct opacity. See
clutter_actor_set_offscreen_redirect()
for details.paint_node: void (* paint_node) ( ClutterActor* self, ClutterPaintNode* root, ClutterPaintContext* paint_context )
Virtual function for creating paint nodes and attaching them to the render tree.
touch_event: gboolean (* touch_event) ( ClutterActor* self, ClutterEvent* event )
Signal class closure for
ClutterActor::touch-event
.resource_scale_changed: void (* resource_scale_changed) ( ClutterActor* self )
No description available.
calculate_resource_scale: float (* calculate_resource_scale) ( ClutterActor* self, int phase )
No description available.
child_added: void (* child_added) ( ClutterActor* self, ClutterActor* child )
No description available.
child_removed: void (* child_removed) ( ClutterActor* self, ClutterActor* child )
No description available.
layout_manager_type: GType
No description available.
Virtual methods
Clutter.ActorClass.apply_transform
Virtual function, used when applying the transformations to an actor before painting it or when transforming coordinates or the allocation; if the transformation calculated by this function may have changed, the cached transformation must be invalidated by calling clutter_actor_invalidate_transform(); it must chain up to the parent’s implementation.
Clutter.ActorClass.destroy
Destroys an actor. When an actor is destroyed, it will break any references it holds to other objects. If the actor is inside a container, the actor will be removed.
Clutter.ActorClass.get_accessible
Returns the accessible object that describes the actor to an assistive technology.
Clutter.ActorClass.get_paint_volume
Virtual function, for sub-classes to define their
ClutterPaintVolume
.
Clutter.ActorClass.get_preferred_height
Computes the requested minimum and natural heights for an actor, or if they are already computed, returns the cached values.
Clutter.ActorClass.get_preferred_width
Computes the requested minimum and natural widths for an actor, optionally depending on the specified height, or if they are already computed, returns the cached values.
Clutter.ActorClass.has_overlaps
Asks the actor’s implementation whether it may contain overlapping primitives.
Clutter.ActorClass.hide
Flags an actor to be hidden. A hidden actor will not be rendered on the stage.
Clutter.ActorClass.hide_all
Virtual function for containers and composite actors, to
determine which children should be shown when calling
clutter_actor_hide_all()
on the actor. Defaults to calling
clutter_actor_hide(). This virtual function is deprecated and it
should not be overridden.
Clutter.ActorClass.map
Sets the CLUTTER_ACTOR_MAPPED
flag on the actor and possibly maps
and realizes its children if they are visible. Does nothing if the
actor is not visible.
Clutter.ActorClass.paint_node
Virtual function for creating paint nodes and attaching them to the render tree.
Clutter.ActorClass.queue_relayout
Indicates that the actor’s size request or other layout-affecting
properties may have changed. This function is used inside ClutterActor
subclass implementations, not by applications directly.
Clutter.ActorClass.realize
Realization informs the actor that it is attached to a stage. It can use this to allocate resources if it wanted to delay allocation until it would be rendered. However it is perfectly acceptable for an actor to create resources before being realized because Clutter only ever has a single rendering context so that actor is free to be moved from one stage to another.
deprecated: 1.16
Clutter.ActorClass.show
Flags an actor to be displayed. An actor that isn’t shown will not be rendered on the stage.
Clutter.ActorClass.unmap
Unsets the CLUTTER_ACTOR_MAPPED
flag on the actor and possibly
unmaps its children if they were mapped.
Clutter.ActorClass.unrealize
Unrealization informs the actor that it may be being destroyed or moved to another stage. The actor may want to destroy any underlying graphics resources at this point. However it is perfectly acceptable for it to retain the resources until the actor is destroyed because Clutter only ever uses a single rendering context and all of the graphics resources are valid on any stage.
deprecated: 1.16
Class methods
clutter_actor_class_get_layout_manager_type
Retrieves the type of the ClutterLayoutManager
used by actors of class actor_class
.
clutter_actor_class_set_layout_manager_type
Sets the type to be used for creating layout managers for
actors of actor_class
.