ClutterActor

ClutterActor — Base abstract class for all visual stage actors.

Synopsis

#define             CLUTTER_ACTOR_SET_FLAGS             (a,f)
#define             CLUTTER_ACTOR_UNSET_FLAGS           (a,f)
#define             CLUTTER_ACTOR_IS_MAPPED             (e)
#define             CLUTTER_ACTOR_IS_REALIZED           (e)
#define             CLUTTER_ACTOR_IS_VISIBLE            (e)
#define             CLUTTER_ACTOR_IS_REACTIVE           (e)

                    ClutterActorBox;
enum                ClutterActorFlags;
                    ClutterGeometry;
#define             CLUTTER_CALLBACK                    (f)
void                (*ClutterCallback)                  (ClutterActor *actor,
                                                         gpointer data);
                    ClutterActor;
                    ClutterActorClass;
void                clutter_actor_show                  (ClutterActor *self);
void                clutter_actor_show_all              (ClutterActor *self);
void                clutter_actor_hide                  (ClutterActor *self);
void                clutter_actor_hide_all              (ClutterActor *self);
void                clutter_actor_realize               (ClutterActor *self);
void                clutter_actor_unrealize             (ClutterActor *self);
void                clutter_actor_paint                 (ClutterActor *self);
void                clutter_actor_queue_redraw          (ClutterActor *self);
void                clutter_actor_destroy               (ClutterActor *self);
void                clutter_actor_request_coords        (ClutterActor *self,
                                                         ClutterActorBox *box);
void                clutter_actor_query_coords          (ClutterActor *self,
                                                         ClutterActorBox *box);
gboolean            clutter_actor_event                 (ClutterActor *actor,
                                                         ClutterEvent *event,
                                                         gboolean capture);
void                clutter_actor_pick                  (ClutterActor *self,
                                                         const ClutterColor *color);
gboolean            clutter_actor_should_pick_paint     (ClutterActor *self);

void                clutter_actor_set_geometry          (ClutterActor *self,
                                                         const ClutterGeometry *geometry);
void                clutter_actor_get_geometry          (ClutterActor *self,
                                                         ClutterGeometry *geometry);
void                clutter_actor_get_coords            (ClutterActor *self,
                                                         gint *x_1,
                                                         gint *y_1,
                                                         gint *x_2,
                                                         gint *y_2);
void                clutter_actor_set_size              (ClutterActor *self,
                                                         gint width,
                                                         gint height);
void                clutter_actor_get_size              (ClutterActor *self,
                                                         guint *width,
                                                         guint *height);
void                clutter_actor_set_position          (ClutterActor *self,
                                                         gint x,
                                                         gint y);
void                clutter_actor_get_position          (ClutterActor *self,
                                                         gint *x,
                                                         gint *y);
void                clutter_actor_get_abs_position      (ClutterActor *self,
                                                         gint *x,
                                                         gint *y);
void                clutter_actor_set_width             (ClutterActor *self,
                                                         guint width);
guint               clutter_actor_get_width             (ClutterActor *self);
void                clutter_actor_set_height            (ClutterActor *self,
                                                         guint height);
guint               clutter_actor_get_height            (ClutterActor *self);
void                clutter_actor_set_x                 (ClutterActor *self,
                                                         gint x);
gint                clutter_actor_get_x                 (ClutterActor *self);
void                clutter_actor_set_y                 (ClutterActor *self,
                                                         gint y);
gint                clutter_actor_get_y                 (ClutterActor *self);
void                clutter_actor_move_by               (ClutterActor *self,
                                                         gint dx,
                                                         gint dy);
void                clutter_actor_set_rotation          (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         gdouble angle,
                                                         gint x,
                                                         gint y,
                                                         gint z);
gdouble             clutter_actor_get_rotation          (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         gint *x,
                                                         gint *y,
                                                         gint *z);
gboolean            clutter_actor_is_rotated            (ClutterActor *self);
void                clutter_actor_set_opacity           (ClutterActor *self,
                                                         guint8 opacity);
guint8              clutter_actor_get_opacity           (ClutterActor *self);
void                clutter_actor_set_name              (ClutterActor *self,
                                                         const gchar *name);
const gchar*        clutter_actor_get_name              (ClutterActor *self);
guint32             clutter_actor_get_gid               (ClutterActor *self);

void                clutter_actor_set_clip              (ClutterActor *self,
                                                         gint xoff,
                                                         gint yoff,
                                                         gint width,
                                                         gint height);
void                clutter_actor_remove_clip           (ClutterActor *self);
gboolean            clutter_actor_has_clip              (ClutterActor *self);
void                clutter_actor_get_clip              (ClutterActor *self,
                                                         gint *xoff,
                                                         gint *yoff,
                                                         gint *width,
                                                         gint *height);

void                clutter_actor_set_parent            (ClutterActor *self,
                                                         ClutterActor *parent);
ClutterActor*       clutter_actor_get_parent            (ClutterActor *self);
void                clutter_actor_reparent              (ClutterActor *self,
                                                         ClutterActor *new_parent);
void                clutter_actor_unparent              (ClutterActor *self);
void                clutter_actor_raise                 (ClutterActor *self,
                                                         ClutterActor *below);
void                clutter_actor_lower                 (ClutterActor *self,
                                                         ClutterActor *above);
void                clutter_actor_raise_top             (ClutterActor *self);
void                clutter_actor_lower_bottom          (ClutterActor *self);

void                clutter_actor_set_depth             (ClutterActor *self,
                                                         gint depth);
gint                clutter_actor_get_depth             (ClutterActor *self);
void                clutter_actor_set_scale             (ClutterActor *self,
                                                         gdouble scale_x,
                                                         gdouble scale_y);
void                clutter_actor_get_scale             (ClutterActor *self,
                                                         gdouble *scale_x,
                                                         gdouble *scale_y);
gboolean            clutter_actor_is_scaled             (ClutterActor *self);
void                clutter_actor_get_abs_size          (ClutterActor *self,
                                                         guint *width,
                                                         guint *height);
void                clutter_actor_apply_transform_to_point
                                                        (ClutterActor *self,
                                                         ClutterVertex *point,
                                                         ClutterVertex *vertex);
gboolean            clutter_actor_transform_stage_point (ClutterActor *self,
                                                         ClutterUnit x,
                                                         ClutterUnit y,
                                                         ClutterUnit *x_out,
                                                         ClutterUnit *y_out);
void                clutter_actor_apply_relative_transform_to_point
                                                        (ClutterActor *self,
                                                         ClutterActor *ancestor,
                                                         ClutterVertex *point,
                                                         ClutterVertex *vertex);

                    ClutterVertex;
void                clutter_actor_get_vertices          (ClutterActor *self,
                                                         ClutterVertex verts[4]);
void                clutter_actor_get_relative_vertices (ClutterActor *self,
                                                         ClutterActor *ancestor,
                                                         ClutterVertex verts[4]);
void                clutter_actor_box_get_from_vertices (ClutterVertex vtx[4],
                                                         ClutterActorBox *box);

void                clutter_actor_set_anchor_point      (ClutterActor *self,
                                                         gint anchor_x,
                                                         gint anchor_y);
void                clutter_actor_get_anchor_point      (ClutterActor *self,
                                                         gint *anchor_x,
                                                         gint *anchor_y);
void                clutter_actor_set_anchor_point_from_gravity
                                                        (ClutterActor *self,
                                                         ClutterGravity gravity);
void                clutter_actor_move_anchor_point     (ClutterActor *self,
                                                         gint anchor_x,
                                                         gint anchor_y);
void                clutter_actor_move_anchor_point_from_gravity
                                                        (ClutterActor *self,
                                                         ClutterGravity gravity);

void                clutter_actor_set_reactive          (ClutterActor *actor,
                                                         gboolean reactive);
gboolean            clutter_actor_get_reactive          (ClutterActor *actor);
gboolean            clutter_actor_set_shader            (ClutterActor *self,
                                                         ClutterShader *shader);
ClutterShader*      clutter_actor_get_shader            (ClutterActor *self);
void                clutter_actor_set_shader_param      (ClutterActor *self,
                                                         const gchar *param,
                                                         gfloat value);

void                clutter_actor_set_depthu            (ClutterActor *self,
                                                         ClutterUnit depth);
ClutterUnit         clutter_actor_get_depthu            (ClutterActor *self);
void                clutter_actor_set_heightu           (ClutterActor *self,
                                                         ClutterUnit height);
ClutterUnit         clutter_actor_get_heightu           (ClutterActor *self);
void                clutter_actor_set_widthu            (ClutterActor *self,
                                                         ClutterUnit width);
ClutterUnit         clutter_actor_get_widthu            (ClutterActor *self);
void                clutter_actor_set_xu                (ClutterActor *self,
                                                         ClutterUnit x);
ClutterUnit         clutter_actor_get_xu                (ClutterActor *self);
void                clutter_actor_set_yu                (ClutterActor *self,
                                                         ClutterUnit y);
ClutterUnit         clutter_actor_get_yu                (ClutterActor *self);
void                clutter_actor_set_positionu         (ClutterActor *self,
                                                         ClutterUnit x,
                                                         ClutterUnit y);
void                clutter_actor_get_positionu         (ClutterActor *self,
                                                         ClutterUnit *x,
                                                         ClutterUnit *y);
void                clutter_actor_set_sizeu             (ClutterActor *self,
                                                         ClutterUnit width,
                                                         ClutterUnit height);
void                clutter_actor_get_sizeu             (ClutterActor *self,
                                                         ClutterUnit *width,
                                                         ClutterUnit *height);
void                clutter_actor_set_anchor_pointu     (ClutterActor *self,
                                                         ClutterUnit anchor_x,
                                                         ClutterUnit anchor_y);
void                clutter_actor_get_anchor_pointu     (ClutterActor *self,
                                                         ClutterUnit *anchor_x,
                                                         ClutterUnit *anchor_y);
void                clutter_actor_move_anchor_pointu    (ClutterActor *self,
                                                         ClutterUnit anchor_x,
                                                         ClutterUnit anchor_y);
void                clutter_actor_set_clipu             (ClutterActor *self,
                                                         ClutterUnit xoff,
                                                         ClutterUnit yoff,
                                                         ClutterUnit width,
                                                         ClutterUnit height);
void                clutter_actor_get_clipu             (ClutterActor *self,
                                                         ClutterUnit *xoff,
                                                         ClutterUnit *yoff,
                                                         ClutterUnit *width,
                                                         ClutterUnit *height);
void                clutter_actor_move_byu              (ClutterActor *self,
                                                         ClutterUnit dx,
                                                         ClutterUnit dy);

void                clutter_actor_set_scalex            (ClutterActor *self,
                                                         ClutterFixed scale_x,
                                                         ClutterFixed scale_y);
void                clutter_actor_get_scalex            (ClutterActor *self,
                                                         ClutterFixed *scale_x,
                                                         ClutterFixed *scale_y);
void                clutter_actor_set_rotationx         (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         ClutterFixed angle,
                                                         gint x,
                                                         gint y,
                                                         gint z);
ClutterFixed        clutter_actor_get_rotationx         (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         gint *x,
                                                         gint *y,
                                                         gint *z);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----ClutterGroup
               +----ClutterRectangle
               +----ClutterTexture
               +----ClutterCloneTexture
               +----ClutterLabel
               +----ClutterEntry

Known Derived Interfaces

ClutterActor is required by ClutterContainer.

Implemented Interfaces

ClutterActor implements

Properties

  "clip"                     ClutterGeometry*      : Read / Write
  "depth"                    gint                  : Read / Write
  "has-clip"                 gboolean              : Read
  "height"                   gint                  : Read / Write
  "name"                     gchar*                : Read / Write
  "opacity"                  guchar                : Read / Write
  "reactive"                 gboolean              : Read / Write
  "rotation-angle-x"         gdouble               : Read / Write
  "rotation-angle-y"         gdouble               : Read / Write
  "rotation-angle-z"         gdouble               : Read / Write
  "rotation-center-x"        ClutterVertex*        : Read / Write
  "rotation-center-y"        ClutterVertex*        : Read / Write
  "rotation-center-z"        ClutterVertex*        : Read / Write
  "scale-x"                  gdouble               : Read / Write
  "scale-y"                  gdouble               : Read / Write
  "visible"                  gboolean              : Read / Write
  "width"                    gint                  : Read / Write
  "x"                        gint                  : Read / Write
  "y"                        gint                  : Read / Write

Signals

  "button-press-event"                             : Run Last
  "button-release-event"                           : Run Last
  "captured-event"                                 : Run Last
  "destroy"                                        : Cleanup / No Recursion / No Hooks
  "enter-event"                                    : Run Last
  "event"                                          : Run Last
  "focus-in"                                       : Run Last
  "focus-out"                                      : Run Last
  "hide"                                           : Run First
  "key-press-event"                                : Run Last
  "key-release-event"                              : Run Last
  "leave-event"                                    : Run Last
  "motion-event"                                   : Run Last
  "parent-set"                                     : Run Last
  "scroll-event"                                   : Run Last
  "show"                                           : Run First

Description

ClutterActor is a base abstract class for all visual elements on the stage. Every object that must appear on the main ClutterStage must also be a ClutterActor, either by using one of the classes provided by Clutter, or by implementing a new ClutterActor subclass.

Every actor is a 2D surface in a 3D environment. The surface is contained inside its bounding box, described by the ClutterActorBox structure:

Figure 1. Bounding box of an Actor

Bounding box of an Actor


The OpenGL modelview matrix for the actor is constructed from the actor settings by the following order of operations:

  1. Translation by actor x, y coords,

  2. Scaling by scale_x, scale_y,

  3. Negative translation by anchor point x, y,

  4. Rotation around z axis,

  5. Rotation around y axis,

  6. Rotation around x axis,

  7. Translation by actor depth (z),

  8. Clip stencil is applied (not an operation on the matrix as such, but done as part of the transform set up).

Note

The position of any children is referenced from the top-left corner of the parent, not the parent's anchor point.

Events are handled in the following ways:

  1. Actors emit pointer events if set reactive, see clutter_actor_set_reactive()

  2. The stage is always reactive

  3. Events are handled by connecting signal handlers to the numerous event signal types.

  4. Event handlers must return TRUE if they handled the event and wish to block the event emission chain, or FALSE if the emission chain must continue

  5. Keyboard events are emitted if actor has focus, see clutter_stage_set_key_focus()

  6. Motion events (motion, enter, leave) are not emitted if clutter_set_motion_events_enabled() is called with FALSE. See clutter_set_motion_events_enabled() documentation for more information.

  7. Once emitted, an event emission chain has two phases: capture and bubble. An emitted event starts in the capture phase (see ClutterActor::captured-event) beginning at the stage and traversing every child actor until the event source actor is reached. The emission then enters the bubble phase, traversing back up the chain via parents until it reaches the stage. Any event handler can abort this chain by returning TRUE (meaning "event handled").

  8. Pointer events will 'pass through' non reactive overlapping actors.

Figure 2. Event flow in Clutter

Event flow in Clutter


Every '?' box in the diagram above is an entry point for application code.

For implementing a new actor class, please read the corresponding section of the API reference.

Details

CLUTTER_ACTOR_SET_FLAGS()

#define CLUTTER_ACTOR_SET_FLAGS(a,f)    (((ClutterActor*)(a))->flags |= (f))

Sets the given flags on a ClutterActor

a :

a ClutterActor

f :

the ClutterActorFlags to set

CLUTTER_ACTOR_UNSET_FLAGS()

#define CLUTTER_ACTOR_UNSET_FLAGS(a,f)  (((ClutterActor*)(a))->flags &= ~(f))

Unsets the given flags on a ClutterActor

a :

a ClutterActor

f :

the ClutterActorFlags to unset

CLUTTER_ACTOR_IS_MAPPED()

#define CLUTTER_ACTOR_IS_MAPPED(e)      (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_MAPPED)

Evaluates to TRUE if the CLUTTER_ACTOR_MAPPED flag is set.

e :

a ClutterActor

Since 0.2


CLUTTER_ACTOR_IS_REALIZED()

#define CLUTTER_ACTOR_IS_REALIZED(e)    (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REALIZED)

Evaluates to TRUE if the CLUTTER_ACTOR_REALIZED flag is set.

e :

a ClutterActor

Since 0.2


CLUTTER_ACTOR_IS_VISIBLE()

#define CLUTTER_ACTOR_IS_VISIBLE(e)     (CLUTTER_ACTOR_IS_MAPPED (e) && CLUTTER_ACTOR_IS_REALIZED (e))

Evaluates to TRUE if the actor is both realized and mapped.

e :

a ClutterActor

Since 0.2


CLUTTER_ACTOR_IS_REACTIVE()

#define CLUTTER_ACTOR_IS_REACTIVE(e)    (((ClutterActor*)(e))->flags & CLUTTER_ACTOR_REACTIVE)

Evaluates to TRUE if the CLUTTER_ACTOR_REACTIVE flag is set.

e :

a ClutterActor

Since 0.6


ClutterActorBox

typedef struct {
  ClutterUnit x1;
  ClutterUnit y1;
  ClutterUnit x2;
  ClutterUnit y2;
} ClutterActorBox;

Bounding box of an actor. The coordinates of the top left and right bottom corners of an actor. The coordinates of the two points are expressed in ClutterUnits, that is are device-independent. If you want to obtain the box dimensions in pixels, use clutter_actor_get_geometry().

ClutterUnit x1;

X coordinate of the top left corner

ClutterUnit y1;

Y coordinate of the top left corner

ClutterUnit x2;

X coordinate of the bottom right corner

ClutterUnit y2;

Y coordinate of the bottom right corner

enum ClutterActorFlags

typedef enum
{
  CLUTTER_ACTOR_MAPPED   = 1 << 1,
  CLUTTER_ACTOR_REALIZED = 1 << 2,
  CLUTTER_ACTOR_REACTIVE = 1 << 3
} ClutterActorFlags;

Flags used to signal the state of an actor.

CLUTTER_ACTOR_MAPPED

the actor has been painted

CLUTTER_ACTOR_REALIZED

the resources associated to the actor have been allocated

CLUTTER_ACTOR_REACTIVE

the actor 'reacts' to mouse events emmitting event signals

ClutterGeometry

typedef struct {
  gint   x;
  gint   y;
  guint  width;
  guint  height;
} ClutterGeometry;

The rectangle containing an actor's bounding box, measured in pixels.

gint x;

X coordinate of the top left corner of an actor

gint y;

Y coordinate of the top left corner of an actor

guint width;

width of an actor

guint height;

height of an actor

CLUTTER_CALLBACK()

#define CLUTTER_CALLBACK(f)        ((ClutterCallback) (f))

Convenience macro to cast a function to ClutterCallback

f :

a function

ClutterCallback ()

void                (*ClutterCallback)                  (ClutterActor *actor,
                                                         gpointer data);

Generic callback

actor :

a ClutterActor

data :

user data

ClutterActor

typedef struct {
  guint32 flags;
} ClutterActor;

Base class for actors.

guint32 flags;

ClutterActorFlags

ClutterActorClass

typedef struct {
  void (* show)            (ClutterActor        *actor);
  void (* show_all)        (ClutterActor        *actor);
  void (* hide)            (ClutterActor        *actor);
  void (* hide_all)        (ClutterActor        *actor);
  void (* realize)         (ClutterActor        *actor);
  void (* unrealize)       (ClutterActor        *actor);
  void (* paint)           (ClutterActor        *actor);
  void (* request_coords)  (ClutterActor        *actor,
                            ClutterActorBox     *box);
  void (* query_coords)    (ClutterActor        *actor,
                            ClutterActorBox     *box);
  void (* parent_set)      (ClutterActor        *actor,
                            ClutterActor        *old_parent);

  void (* destroy)         (ClutterActor        *actor);
  void (* pick)            (ClutterActor        *actor,
                            const ClutterColor  *color);

  /* event signals */
  gboolean (* event)                (ClutterActor         *actor,
                                     ClutterEvent         *event);
  gboolean (* button_press_event)   (ClutterActor         *actor,
                                     ClutterButtonEvent   *event);
  gboolean (* button_release_event) (ClutterActor         *actor,
                                     ClutterButtonEvent   *event);
  gboolean (* scroll_event)         (ClutterActor         *actor,
                                     ClutterScrollEvent   *event);
  gboolean (* key_press_event)      (ClutterActor         *actor,
                                     ClutterKeyEvent      *event);
  gboolean (* key_release_event)    (ClutterActor         *actor,
                                     ClutterKeyEvent      *event);
  gboolean (* motion_event)         (ClutterActor         *actor,
                                     ClutterMotionEvent   *event);
  gboolean (* enter_event)          (ClutterActor         *actor,
                                     ClutterCrossingEvent *event);
  gboolean (* leave_event)          (ClutterActor         *actor,
                                     ClutterCrossingEvent *event);
  gboolean (* captured_event)       (ClutterActor         *actor,
                                     ClutterEvent         *event);
  void     (* focus_in)             (ClutterActor         *actor);
  void     (* focus_out)            (ClutterActor         *actor);
} ClutterActorClass;

Base class for actors.

show ()

signal class handler for ClutterActor::show; it must chain up to the parent's implementation

show_all ()

virtual function for containers and composite actors, to determine which children should be shown when calling clutter_actor_show_all() on the actor. Defaults to calling clutter_actor_show().

hide ()

signal class handler for ClutterActor::hide; it must chain up to the parent's implementation

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().

realize ()

virtual function, used to allocate resources for the actor; it should chain up to the parent's implementation

unrealize ()

virtual function, used to deallocate resources allocated in ::realized; it should chain up to the parent's implementation

paint ()

virtual function, used to paint the actor

request_coords ()

virtual function, used when setting the coordinates of an actor

query_coords ()

virtual function, used when querying the actor for its coordinates; it must chain up to the parent's implementation

parent_set ()

signal class closure for the ClutterActor::parent-set

destroy ()

signal class closure for ClutterActor::destroy

pick ()

virtual function, used to draw an outline of the actor with the given colour

event ()

signal class closure for ClutterActor::event

button_press_event ()

signal class closure for ClutterActor::button-press-event

button_release_event ()

signal class closure for ClutterActor::button-release-event

scroll_event ()

signal class closure for ClutterActor::scroll-event

key_press_event ()

signal class closure for ClutterActor::key-press-event

key_release_event ()

signal class closure for ClutterActor::key-release-event

motion_event ()

signal class closure for ClutterActor::motion-event

enter_event ()

signal class closure for ClutterActor::enter-event

leave_event ()

signal class closure for ClutterActor::leave-event

captured_event ()

signal class closure for ClutterActor::captured-event

focus_in ()

signal class closure for ClutterActor::focus-in

focus_out ()

signal class closure for ClutterActor::focus-out

clutter_actor_show ()

void                clutter_actor_show                  (ClutterActor *self);

Flags an actor to be displayed. An actor that isn't shown will not be rendered on the stage.

self :

A ClutterActor

clutter_actor_show_all ()

void                clutter_actor_show_all              (ClutterActor *self);

Call show() on all children of an actor (if any).

self :

a ClutterActor

Since 0.2


clutter_actor_hide ()

void                clutter_actor_hide                  (ClutterActor *self);

Flags an actor to be hidden. A hidden actor will not be rendered on the stage.

self :

A ClutterActor

clutter_actor_hide_all ()

void                clutter_actor_hide_all              (ClutterActor *self);

Call hide() on all child actors (if any).

self :

a ClutterActor

Since 0.2


clutter_actor_realize ()

void                clutter_actor_realize               (ClutterActor *self);

Creates any underlying graphics resources needed by the actor to be displayed.

self :

A ClutterActor

clutter_actor_unrealize ()

void                clutter_actor_unrealize             (ClutterActor *self);

Frees up any underlying graphics resources needed by the actor to be displayed.

self :

A ClutterActor

clutter_actor_paint ()

void                clutter_actor_paint                 (ClutterActor *self);

Renders the actor to display.

This function should not be called directly by applications. Call clutter_actor_queue_redraw() to queue paints, instead.

self :

A ClutterActor

clutter_actor_queue_redraw ()

void                clutter_actor_queue_redraw          (ClutterActor *self);

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).

Applications rarely need to call this, as redraws are handled automatically by modification functions.

self :

A ClutterActor

clutter_actor_destroy ()

void                clutter_actor_destroy               (ClutterActor *self);

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.

When you destroy a container, its children will be destroyed as well.

Note: you cannot destroy the ClutterStage returned by clutter_stage_get_default().

self :

a ClutterActor

clutter_actor_request_coords ()

void                clutter_actor_request_coords        (ClutterActor *self,
                                                         ClutterActorBox *box);

Requests new untransformed coordinates for the bounding box of a ClutterActor. The coordinates must be relative to the current parent of the actor.

This function should not be called directly by applications; instead, the various position/geometry methods should be used.

Note: Actors overriding the ClutterActor::request_coords() virtual function should always chain up to the parent class request_coords() method. Actors should override this function only if they need to recompute some internal state or need to reposition their children.

self :

A ClutterActor

box :

A ClutterActorBox with the new coordinates, in ClutterUnits

clutter_actor_query_coords ()

void                clutter_actor_query_coords          (ClutterActor *self,
                                                         ClutterActorBox *box);

Requests the untransformed co-ordinates (in ClutterUnits) for the ClutterActor, relative to any parent.

This function should not be called directly by applications. The various position/geometry methods should be used instead.

self :

A ClutterActor

box :

A location to store the actor's ClutterActorBox

clutter_actor_event ()

gboolean            clutter_actor_event                 (ClutterActor *actor,
                                                         ClutterEvent *event,
                                                         gboolean capture);

This function is used to emit an event on the main stage. You should rarely need to use this function, except for synthetising events.

actor :

a ClutterActor

event :

a ClutterEvent

capture :

TRUE if event in in capture phase, FALSE otherwise.

Returns :

the return value from the signal emission: TRUE if the actor handled the event, or FALSE if the event was not handled

Since 0.6


clutter_actor_pick ()

void                clutter_actor_pick                  (ClutterActor *self,
                                                         const ClutterColor *color);

Renders a silhouette of the actor using the supplied color. Used internally for mapping pointer events to actors.

This function should never be called directly by applications.

Subclasses overiding the ClutterActor::pick() method should call clutter_actor_should_pick_paint() to decide whether to render their silhouette. Containers should always recursively call pick for each child.

Since 0.4

self :

A ClutterActor

color :

A ClutterColor

clutter_actor_should_pick_paint ()

gboolean            clutter_actor_should_pick_paint     (ClutterActor *self);

Utility call for subclasses overiding the pick method.

This function should never be called directly by applications.

self :

A ClutterActor

Returns :

TRUE if the actor should paint its silhouette, FALSE otherwise

clutter_actor_set_geometry ()

void                clutter_actor_set_geometry          (ClutterActor *self,
                                                         const ClutterGeometry *geometry);

Sets the actor's untransformed geometry in pixels relative to any parent actor.

self :

A ClutterActor

geometry :

A ClutterGeometry

clutter_actor_get_geometry ()

void                clutter_actor_get_geometry          (ClutterActor *self,
                                                         ClutterGeometry *geometry);

Gets the actor's untransformed geometry in pixels relative to any parent actor.

self :

A ClutterActor

geometry :

A location to store actors ClutterGeometry

clutter_actor_get_coords ()

void                clutter_actor_get_coords            (ClutterActor *self,
                                                         gint *x_1,
                                                         gint *y_1,
                                                         gint *x_2,
                                                         gint *y_2);

Gets the actor's untransformed bounding rectangle coordinates in pixels relative to any parent actor.

self :

A ClutterActor

x_1 :

A location to store actors left position, or NULL.

y_1 :

A location to store actors top position, or NULL.

x_2 :

A location to store actors right position, or NULL.

y_2 :

A location to store actors bottom position, or NULL.

clutter_actor_set_size ()

void                clutter_actor_set_size              (ClutterActor *self,
                                                         gint width,
                                                         gint height);

Sets the actor's size in pixels.

If width and/or height are -1 the actor will assume the same size of its bounding box.

Note

This function is a "request" to the ClutterActor. Depending on the actual implementation, calling clutter_actor_set_size() might not produce visible results. Calling this function on a ClutterGroup, for instance, will not resize the group - as its size is dependant on bounding box of actual contents

self :

A ClutterActor

width :

New width of actor in pixels, or -1

height :

New height of actor in pixels, or -1

clutter_actor_get_size ()

void                clutter_actor_get_size              (ClutterActor *self,
                                                         guint *width,
                                                         guint *height);

Gets the size of an actor in pixels, ignoring any scaling factors.

self :

A ClutterActor

width :

return location for the width, or NULL.

height :

return location for the height, or NULL.

Since 0.2


clutter_actor_set_position ()

void                clutter_actor_set_position          (ClutterActor *self,
                                                         gint x,
                                                         gint y);

Sets the actor's position in pixels relative to any parent actor.

self :

A ClutterActor

x :

New left position of actor in pixels.

y :

New top position of actor in pixels.

clutter_actor_get_position ()

void                clutter_actor_get_position          (ClutterActor *self,
                                                         gint *x,
                                                         gint *y);

Retrieves the position of an actor.

self :

a ClutterActor

x :

return location for the X coordinate, or NULL

y :

return location for the Y coordinate, or NULL

Since 0.6


clutter_actor_get_abs_position ()

void                clutter_actor_get_abs_position      (ClutterActor *self,
                                                         gint *x,
                                                         gint *y);

Gets the absolute position of an actor, in pixels, relative to the stage.

self :

A ClutterActor

x :

return location for the X coordinate, or NULL

y :

return location for the Y coordinate, or NULL

clutter_actor_set_width ()

void                clutter_actor_set_width             (ClutterActor *self,
                                                         guint width);

Requests a new width for the actor

self :

A ClutterActor

width :

Requested new width for the actor, in pixels

Since 0.2


clutter_actor_get_width ()

guint               clutter_actor_get_width             (ClutterActor *self);

Retrieves the actor's width ignoring any scaling factors.

self :

A ClutterActor

Returns :

the width in pixels

clutter_actor_set_height ()

void                clutter_actor_set_height            (ClutterActor *self,
                                                         guint height);

Requests a new height for the actor

self :

A ClutterActor

height :

Requested new height for the actor, in pixels

Since 0.2


clutter_actor_get_height ()

guint               clutter_actor_get_height            (ClutterActor *self);

Retrieves the actor's height ignoring any scaling factors.

self :

A ClutterActor

Returns :

the height in pixels

clutter_actor_set_x ()

void                clutter_actor_set_x                 (ClutterActor *self,
                                                         gint x);

Sets the actor's X coordinate, relative to its parent.

self :

a ClutterActor

x :

the actor's position on the X axis

Since 0.6


clutter_actor_get_x ()

gint                clutter_actor_get_x                 (ClutterActor *self);

Retrieves the actor's X coordinate, relative to any parent.

self :

A ClutterActor

Returns :

the X coordinate, in pixels, ignoring any transformation (i.e. scaling, rotation).

clutter_actor_set_y ()

void                clutter_actor_set_y                 (ClutterActor *self,
                                                         gint y);

Sets the actor's Y coordinate, relative to its parent.

self :

a ClutterActor

y :

the actor's position on the Y axis

Since 0.6


clutter_actor_get_y ()

gint                clutter_actor_get_y                 (ClutterActor *self);

Retrieves the actor's Y coordinate, relative to any parent.

self :

A ClutterActor

Returns :

the Y coordinate, in pixels, ignoring any transformation (i.e. scaling, rotation).

clutter_actor_move_by ()

void                clutter_actor_move_by               (ClutterActor *self,
                                                         gint dx,
                                                         gint dy);

Moves an actor by the specified distance relative to its current position in pixels.

self :

A ClutterActor

dx :

Distance to move Actor on X axis.

dy :

Distance to move Actor on Y axis.

Since 0.2


clutter_actor_set_rotation ()

void                clutter_actor_set_rotation          (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         gdouble angle,
                                                         gint x,
                                                         gint y,
                                                         gint z);

Sets the rotation angle of self around the given axis.

The rotation center coordinates used depend on the value of axis:

The rotation coordinates are relative to the anchor point of the actor, set using clutter_actor_set_anchor_point(). If no anchor point is set, the upper left corner is assumed as the origin.

self :

a ClutterActor

axis :

the axis of rotation

angle :

the angle of rotation

x :

X coordinate of the rotation center

y :

Y coordinate of the rotation center

z :

Z coordinate of the rotation center

Since 0.6


clutter_actor_get_rotation ()

gdouble             clutter_actor_get_rotation          (ClutterActor *self,
                                                         ClutterRotateAxis axis,
                                                         gint *x,
                                                         gint *y,
                                                         gint *z);

Retrieves the angle and center of rotation on the given axis, set using clutter_actor_set_angle().

The coordinates of the center returned by this function depend on the axis passed.

self :

a ClutterActor

axis :

the axis of rotation

x :

return value for the X coordinate of the center of rotation

y :

return value for the Y coordinate of the center of rotation

z :

return value for the Z coordinate of the center of rotation

Returns :

the angle of rotation.

Since 0.6


clutter_actor_is_rotated ()

gboolean            clutter_actor_is_rotated            (ClutterActor *self);

Checks whether any rotation is applied to the actor.

self :

a ClutterActor

Returns :

TRUE if the actor is rotated.

Since 0.6


clutter_actor_set_opacity ()

void                clutter_actor_set_opacity           (ClutterActor *self,
                                                         guint8 opacity);

Sets the actor's opacity, with zero being completely transparent and 255 (0xff) being fully opaque.

self :

A ClutterActor

opacity :

New opacity value for the actor.

clutter_actor_get_opacity ()

guint8              clutter_actor_get_opacity           (ClutterActor *self);

Retrieves the actor's opacity.

self :

A ClutterActor

Returns :

The actor opacity value.

clutter_actor_set_name ()

void                clutter_actor_set_name              (ClutterActor *self,
                                                         const gchar *name);

Sets the given name to self. The name can be used to identify a ClutterActor.

self :

A ClutterActor

name :

Textual tag to apply to actor

clutter_actor_get_name ()

const gchar*        clutter_actor_get_name              (ClutterActor *self);

Retrieves the name of self.

self :

A ClutterActor

Returns :

the name of the actor, or NULL. The returned string is owned by the actor and should not be modified or freed.

clutter_actor_get_gid ()

guint32             clutter_actor_get_gid               (ClutterActor *self);

Retrieves the unique id for self.

self :

A ClutterActor

Returns :

Globally unique value for this object instance.

Since 0.6


clutter_actor_set_clip ()

void                clutter_actor_set_clip              (ClutterActor *self,
                                                         gint xoff,
                                                         gint yoff,
                                                         gint width,
                                                         gint height);

Sets clip area in pixels for self. The clip area is always computed from the upper left corner of the actor, even if the anchor point is set otherwise.

self :

A ClutterActor

xoff :

X offset of the clip rectangle, in pixels

yoff :

Y offset of the clip rectangle, in pixels

width :

Width of the clip rectangle, in pixels

height :

Height of the clip rectangle, in pixels

clutter_actor_remove_clip ()

void                clutter_actor_remove_clip           (ClutterActor *self);

Removes clip area from self.

self :

A ClutterActor

clutter_actor_has_clip ()

gboolean            clutter_actor_has_clip              (ClutterActor *self);

Determines whether the actor has a clip area set or not.

self :

a ClutterActor

Returns :

TRUE if the actor has a clip area set.

Since 0.1.1


clutter_actor_get_clip ()

void                clutter_actor_get_clip              (ClutterActor *self,
                                                         gint *xoff,
                                                         gint *yoff,
                                                         gint *width,
                                                         gint *height);

Gets the clip area for self, in pixels.

self :

a ClutterActor

xoff :

return location for the X offset of the clip rectangle, or NULL

yoff :

return location for the Y offset of the clip rectangle, or NULL

width :

return location for the width of the clip rectangle, or NULL

height :

return location for the height of the clip rectangle, or NULL

Since 0.6


clutter_actor_set_parent ()

void                clutter_actor_set_parent            (ClutterActor *self,
                                                         ClutterActor *parent);

Sets the parent of self to parent. The opposite function is clutter_actor_unparent().

This function should not be used by applications, but by custom 'composite' actor subclasses.

self :

A ClutterActor

parent :

A new ClutterActor parent