![]() |
![]() |
![]() |
Clutter 0.2 Reference Manual | ![]() |
---|---|---|---|---|
#define CLUTTER_ACTOR_SET_FLAGS (e,f) #define CLUTTER_ACTOR_UNSET_FLAGS (e,f) #define CLUTTER_ACTOR_IS_MAPPED (e) #define CLUTTER_ACTOR_IS_REALIZED (e) #define CLUTTER_ACTOR_IS_VISIBLE (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_allocate_coords (ClutterActor *self, ClutterActorBox *box); 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 *x1, gint *y1, gint *x2, gint *y2); 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_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); gint clutter_actor_get_x (ClutterActor *self); gint clutter_actor_get_y (ClutterActor *self); void clutter_actor_move_by (ClutterActor *self, gint dx, gint dy); void clutter_actor_rotate_x (ClutterActor *self, gfloat angle, gint y, gint z); void clutter_actor_rotate_y (ClutterActor *self, gfloat angle, gint x, gint z); void clutter_actor_rotate_z (ClutterActor *self, gfloat angle, gint x, gint y); 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_id (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_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_scalex (ClutterActor *self, ClutterFixed scale_x, ClutterFixed scale_y); void clutter_actor_set_scale (ClutterActor *self, gdouble scale_x, gdouble scale_y); void clutter_actor_get_scalex (ClutterActor *self, ClutterFixed *scale_x, ClutterFixed *scale_y); void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_x, gdouble *scale_y); void clutter_actor_get_abs_size (ClutterActor *self, guint *width, guint *height);
GObject +----GInitiallyUnowned +----ClutterActor +----ClutterGroup +----ClutterRectangle +----ClutterTexture +----ClutterCloneTexture +----ClutterLabel
"clip" ClutterGeometry : Read / Write "has-clip" gboolean : Read "height" gint : Read / Write "name" gchararray : Read / Write "opacity" guchar : Read / Write / Construct "visible" gboolean : Read / Write "width" gint : Read / Write "x" gint : Read / Write "y" gint : Read / Write
"destroy" void user_function (ClutterActor *actor, gpointer user_data) : Cleanup / No recursion / No hooks "hide" void user_function (ClutterActor *actor, gpointer user_data) : Run first "parent-set" void user_function (ClutterActor *actor, ClutterActor *old_parent, gpointer user_data) : Run last "show" void user_function (ClutterActor *actor, gpointer user_data) : Run first
#define CLUTTER_ACTOR_SET_FLAGS(e,f) ((e)->flags |= (f))
Sets a flag from ClutterActorFlags to an actor
e : |
a ClutterActor |
f : |
the flag to set |
#define CLUTTER_ACTOR_UNSET_FLAGS(e,f) ((e)->flags &= ~(f))
Unsets a flag from ClutterActorFlags to an actor
e : |
a ClutterActor |
f : |
the flag to unset |
#define CLUTTER_ACTOR_IS_MAPPED(e) ((e)->flags & CLUTTER_ACTOR_MAPPED)
Evaluates to TRUE
if an actor is mapped.
e : |
a ClutterActor |
#define CLUTTER_ACTOR_IS_REALIZED(e) ((e)->flags & CLUTTER_ACTOR_REALIZED)
Evaluates to TRUE
if an actor has been realized.
e : |
a ClutterActor |
#define CLUTTER_ACTOR_IS_VISIBLE(e)
Evaluates to TRUE
if an actor is visible.
e : |
a ClutterActor |
typedef struct { gint x1, y1, x2, y2; } ClutterActorBox;
Coordinates (top-left to bottom-right) of a box surrounding an actor.
gint x1 ; |
X coordinate of the top left corner of the box |
gint y1 ; |
Y coordinate of the top left corner of the box |
gint x2 ; |
X coordinate of the bottom right corner of the box |
gint y2 ; |
Y coordinate of the bottom right corner of the box |
typedef enum { CLUTTER_ACTOR_MAPPED = 1 << 1, CLUTTER_ACTOR_REALIZED = 1 << 2 } ClutterActorFlags;
Flags used by an actor.
typedef struct { /* FIXME: * It is likely gonna save a load of pain if we make * x,y unsigned... */ gint x; gint y; guint width; guint height; } ClutterGeometry;
Positional and dimensional coordinates of an actor.
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 |
#define CLUTTER_CALLBACK(f) ((ClutterCallback) (f))
Casts a generic callback function into a ClutterCallback
f : |
a function pointer |
void (*ClutterCallback) (ClutterActor *actor, gpointer data);
Generic callback function.
actor : |
a ClutterActor |
data : |
optional data to be passed to the function |
typedef struct { GObject parent_instance; guint32 flags; } ClutterActor;
Basic element of the Clutter canvas. Every object present on the stage must be an actor. You can scale, move and rotate an actor; you can group actors inside ClutterGroups or let them follow a ClutterBehaviour.
GObject parent_instance ; |
parent class |
guint32 flags ; |
flags set for the actor |
typedef struct { GObjectClass parent_class; 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 (* allocate_coords) (ClutterActor *actor, ClutterActorBox *box); void (* set_depth) (ClutterActor *actor, gint depth); gint (* get_depth) (ClutterActor *actor); void (* parent_set) (ClutterActor *actor, ClutterActor *old_parent); void (* destroy) (ClutterActor *actor); /* to go ? */ void (* queue_redraw) (ClutterActor *actor); /* padding for future expansion */ void (*_clutter_actor_1) (void); void (*_clutter_actor_2) (void); void (*_clutter_actor_3) (void); void (*_clutter_actor_4) (void); void (*_clutter_actor_5) (void); void (*_clutter_actor_6) (void); } ClutterActorClass;
Base class for ClutterActor
GObjectClass parent_class ; |
parent class |
show () |
|
show_all () |
|
hide () |
|
hide_all () |
|
realize () |
|
unrealize () |
|
paint () |
|
request_coords () |
|
allocate_coords () |
|
set_depth () |
|
get_depth () |
|
parent_set () |
|
destroy () |
|
queue_redraw () |
|
_clutter_actor_1 () |
|
_clutter_actor_2 () |
|
_clutter_actor_3 () |
|
_clutter_actor_4 () |
|
_clutter_actor_5 () |
|
_clutter_actor_6 () |
void clutter_actor_show (ClutterActor *self);
Flags a clutter actor to be displayed. An actor not shown will not appear on the display.
self : |
A ClutterActor |
void clutter_actor_show_all (ClutterActor *self);
Recursively show an actor, and any child actor if self
has
child actors.
self : |
a ClutterActor |
Since 0.2
void clutter_actor_hide (ClutterActor *self);
Flags a clutter actor to be hidden. An actor not shown will not appear on the display.
self : |
A ClutterActor |
void clutter_actor_hide_all (ClutterActor *self);
Recursively hides an actor, and any child actor if self
has child actors.
self : |
a ClutterActor |
Since 0.2
void clutter_actor_realize (ClutterActor *self);
Creates any underlying graphics resources needed by the actor to be displayed.
self : |
A ClutterActor |
void clutter_actor_unrealize (ClutterActor *self);
Frees up any underlying graphics resources needed by the actor to be displayed.
self : |
A ClutterActor |
void clutter_actor_paint (ClutterActor *self);
Renders the actor to display.
This function should not be called directly by applications instead clutter_actor_queue_redraw should be used to queue paints.
self : |
A ClutterActor |
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 |
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 group, the actor will be removed from the group.
When you destroy a group its children will be destroyed as well.
self : |
a ClutterActor |
void clutter_actor_request_coords (ClutterActor *self, ClutterActorBox *box);
Requests new co-ordinates for the ClutterActor ralative to any parent.
This function should not be called directly by applications instead the various position/geometry methods should be used.
self : |
A ClutterActor |
box : |
A ClutterActorBox with requested new co-ordinates. |
void clutter_actor_allocate_coords (ClutterActor *self, ClutterActorBox *box);
Requests the allocated co-ordinates for the ClutterActor relative to any parent.
This function should not be called directly by applications instead the various position/geometry methods should be used.
self : |
A ClutterActor |
box : |
A location to store the actors ClutterActorBox co-ordinates |
void clutter_actor_set_geometry (ClutterActor *self, const ClutterGeometry *geometry);
Sets the actors geometry in pixels relative to any parent actor.
self : |
A ClutterActor |
geometry : |
A ClutterGeometry |
void clutter_actor_get_geometry (ClutterActor *self, ClutterGeometry *geometry);
Gets the actors geometry in pixels relative to any parent actor.
self : |
A ClutterActor |
geometry : |
A location to store actors ClutterGeometry |
void clutter_actor_get_coords (ClutterActor *self, gint *x1, gint *y1, gint *x2, gint *y2);
Gets the actors bounding rectangle co-ordinates in pixels relative to any parent actor.
self : |
A ClutterActor |
x1 : |
A location to store actors left position if non NULL. |
y1 : |
A location to store actors top position if non NULL. |
x2 : |
A location to store actors right position if non NULL. |
y2 : |
A location to store actors bottom position if non NULL. |
void clutter_actor_set_size (ClutterActor *self, gint width, gint height);
Sets the actors position in pixels relative to any parent actor.
self : |
A ClutterActor |
width : |
New width of actor in pixels |
height : |
New height of actor in pixels |
void clutter_actor_get_size (ClutterActor *self, guint *width, guint *height);
Gets the size of an actor ignoring any scaling factors
self : |
A ClutterActor |
width : |
Location to store width if non NULL. |
height : |
Location to store height if non NULL. |
Since 0.2
void clutter_actor_set_position (ClutterActor *self, gint x, gint y);
Sets the actors 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. |
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 : |
Location to store x position if non NULL. |
y : |
Location to store y position if non NULL. |
void clutter_actor_set_width (ClutterActor *self, guint width);
Requests a new width for actor
self : |
A ClutterActor |
width : |
Requested new width for actor |
Since 2.0
guint clutter_actor_get_width (ClutterActor *self);
Retrieves the actors width.
self : |
A ClutterActor |
Returns : | The actor width in pixels |
void clutter_actor_set_height (ClutterActor *self, guint height);
Requests a new height for actor
self : |
A ClutterActor |
height : |
Requested new height for actor |
Since 2.0
guint clutter_actor_get_height (ClutterActor *self);
Retrieves the actors height.
self : |
A ClutterActor |
Returns : | The actor height in pixels |
gint clutter_actor_get_x (ClutterActor *self);
Retrieves the actors x position relative to any parent.
self : |
A ClutterActor |
Returns : | The actor x position in pixels |
gint clutter_actor_get_y (ClutterActor *self);
Retrieves the actors y position relative to any parent.
self : |
A ClutterActor |
Returns : | The actor y position in pixels |
void clutter_actor_move_by (ClutterActor *self, gint dx, gint dy);
Moves an actor by specified distance relative to current position.
self : |
A ClutterActor |
dx : |
Distance to move Actor on X axis. |
dy : |
Distance to move Actor on Y axis. |
Since 0.2
void clutter_actor_rotate_x (ClutterActor *self, gfloat angle, gint y, gint z);
Rotates actor around the X axis.
self : |
A ClutterActor |
angle : |
Angle of rotation |
y : |
Y co-ord to rotate actor around ( relative to actor position ) |
z : |
Z co-ord to rotate actor around ( relative to actor position ) |
void clutter_actor_rotate_y (ClutterActor *self, gfloat angle, gint x, gint z);
Rotates actor around the X axis.
self : |
A ClutterActor |
angle : |
Angle of rotation |
x : |
X co-ord to rotate actor around ( relative to actor position ) |
z : |
Z co-ord to rotate actor around ( relative to actor position ) |
void clutter_actor_rotate_z (ClutterActor *self, gfloat angle, gint x, gint y);
Rotates actor around the Z axis.
self : |
A ClutterActor |
angle : |
Angle of rotation |
x : |
X co-ord to rotate actor around ( relative to actor position ) |
y : |
Y co-ord to rotate actor around ( relative to actor position ) |
void clutter_actor_set_opacity (ClutterActor *self, guint8 opacity);
Sets the actors opacity, with zero being completely transparent.
self : |
A ClutterActor |
opacity : |
New opacity value for actor. |
guint8 clutter_actor_get_opacity (ClutterActor *self);
Retrieves the actors opacity.
self : |
A ClutterActor |
Returns : | The actor opacity value. |
void clutter_actor_set_name (ClutterActor *self, const gchar *name);
Sets a textual tag to the actor.
self : |
A ClutterActor |
name : |
Textual tag to apply to actor |
const gchar* clutter_actor_get_name (ClutterActor *self);
Retrieves the name of self
.
self : |
A ClutterActor |
Returns : | pointer to textual tag for the actor. The returned string is owned by the actor and should not be modified or freed. |
guint32 clutter_actor_get_id (ClutterActor *self);
Retrieves the unique id for self
.
self : |
A ClutterActor |
Returns : | Globally unique value for object instance. |
void clutter_actor_set_clip (ClutterActor *self, gint xoff, gint yoff, gint width, gint height);
Sets clip area for self
.
self : |
A ClutterActor |
xoff : |
X offset of the clip rectangle |
yoff : |
Y offset of the clip rectangle |
width : |
Width of the clip rectangle |
height : |
Height of the clip rectangle |
void clutter_actor_remove_clip (ClutterActor *self);
Removes clip area from self
.
self : |
A ClutterActor |
gboolean clutter_actor_has_clip (ClutterActor *self);
Gets whether the actor has a clip set or not.
self : |
a ClutterActor |
Returns : | TRUE if the actor has a clip set.
|
Since 0.1.1
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.
self : |
A ClutterActor |
parent : |
A new ClutterActor parent |
ClutterActor* clutter_actor_get_parent (ClutterActor *self);
Retrieves the parent of self
.
self : |
A ClutterActor |
Returns : | The ClutterActor parent or NULL |
void clutter_actor_reparent (ClutterActor *self, ClutterActor *new_parent);
This function resets the parent actor of self
. It is
logically equivalent to calling clutter_actory_unparent()
and clutter_actor_set_parent()
.
self : |
a ClutterActor |
new_parent : |
the new ClutterActor parent |
Since 0.2
void clutter_actor_unparent (ClutterActor *self);
This function should not be used in applications. It should be called by implementations of group actors, to dissociate a child from the container.
self : |
a ClutterActor |
Since 0.1.1
void clutter_actor_raise (ClutterActor *self, ClutterActor *below);
Puts self
above below
.
Both actors must have the same parent.
self : |
A ClutterActor |
below : |
A ClutterActor to raise above. |
void clutter_actor_lower (ClutterActor *self, ClutterActor *above);
Puts self
below above
.
Both actors must have the same parent.
self : |
A ClutterActor |
above : |
A ClutterActor to lower below |
void clutter_actor_raise_top (ClutterActor *self);
Raises self
to the top.
self : |
A ClutterActor |
void clutter_actor_lower_bottom (ClutterActor *self);
Lowers self
to the bottom.
self : |
A ClutterActor |
void clutter_actor_set_depth (ClutterActor *self, gint depth);
Sets the Z co-ordinate of self
to depth
.
self : |
a ClutterActor |
depth : |
Z co-ord |
gint clutter_actor_get_depth (ClutterActor *self);
Retrieves the depth of self
.
self : |
a ClutterActor |
Returns : | the depth of a ClutterActor |
void clutter_actor_set_scalex (ClutterActor *self, ClutterFixed scale_x, ClutterFixed scale_y);
Scale an actor.
self : |
A ClutterActor |
scale_x : |
ClutterFixed factor to scale actor by horizontally. |
scale_y : |
ClutterFixed factor to scale actor by vertically. |
void clutter_actor_set_scale (ClutterActor *self, gdouble scale_x, gdouble scale_y);
FIXME
self : |
A ClutterActor |
scale_x : |
double |
scale_y : |
double |
Since 0.2
void clutter_actor_get_scalex (ClutterActor *self, ClutterFixed *scale_x, ClutterFixed *scale_y);
FIXME
self : |
A ClutterActor |
scale_x : |
FIXME |
scale_y : |
FIXME |
Since 0.2
void clutter_actor_get_scale (ClutterActor *self, gdouble *scale_x, gdouble *scale_y);
FIXME
self : |
A ClutterActor |
scale_x : |
FIXME |
scale_y : |
FIXME |
Since 0.2
void clutter_actor_get_abs_size (ClutterActor *self, guint *width, guint *height);
Gets the absolute size of an actor taking into account an scaling factors
self : |
A ClutterActor |
width : |
Location to store width if non NULL. |
height : |
Location to store height if non NULL. |
has-clip
" property"has-clip" gboolean : Read
Whether the actor has the clip property set or not.
Default value: FALSE
height
" property"height" gint : Read / Write
Height of the actor (in pixels).
Allowed values: >= 0
Default value: 0
name
" property"name" gchararray : Read / Write
The name of the actor.
Default value: NULL
Since 0.2
opacity
" property"opacity" guchar : Read / Write / Construct
Opacity of the actor.
Default value: 255
visible
" property"visible" gboolean : Read / Write
Whether the actor is visible or not.
Default value: FALSE
width
" property"width" gint : Read / Write
Width of the actor (in pixels).
Allowed values: >= 0
Default value: 0
x
" property"x" gint : Read / Write
X coordinate of the actor.
Allowed values: >= -2147483647
Default value: 0
void user_function (ClutterActor *actor, gpointer user_data) : Cleanup / No recursion / No hooks
The ::destroy signal is emitted when an actor is destroyed,
either by direct invocation of clutter_actor_destroy()
or
when the ClutterGroup that contains the actor is destroyed.
actor : |
the object which received the signal |
user_data : |
user data set when the signal handler was connected. |
Since 0.2
void user_function (ClutterActor *actor, gpointer user_data) : Run first
The ::hide signal is emitted when an actor is no longer visible.
actor : |
the object which received the signal |
user_data : |
user data set when the signal handler was connected. |
Since 0.2
void user_function (ClutterActor *actor, ClutterActor *old_parent, gpointer user_data) : Run last
This signal is emitted when the parent of the actor changes.
actor : |
the object which received the signal |
old_parent : |
the previous parent of the actor, or NULL
|
user_data : |
user data set when the signal handler was connected. |
Since 0.2
void user_function (ClutterActor *actor, gpointer user_data) : Run first
The ::show signal is emitted when an actor becomes visible.
actor : |
the object which received the signal |
user_data : |
user data set when the signal handler was connected. |
Since 0.2