Top | ![]() |
![]() |
![]() |
![]() |
ClutterActor * | (*MxActorManagerCreateFunc) () |
MxActorManager * | mx_actor_manager_new () |
MxActorManager * | mx_actor_manager_get_for_stage () |
ClutterStage * | mx_actor_manager_get_stage () |
gulong | mx_actor_manager_create_actor () |
gulong | mx_actor_manager_add_actor () |
gulong | mx_actor_manager_remove_actor () |
void | mx_actor_manager_remove_container () |
void | mx_actor_manager_cancel_operation () |
void | mx_actor_manager_cancel_operations () |
void | mx_actor_manager_set_time_slice () |
guint | mx_actor_manager_get_time_slice () |
guint | mx_actor_manager_get_n_operations () |
guint | n-operations | Read |
ClutterStage * | stage | Read / Write / Construct Only |
guint | time-slice | Read / Write |
void | actor-added | Run Last |
void | actor-created | Run Last |
void | actor-finished | Run Last |
void | actor-removed | Run Last |
void | operation-cancelled | Run Last |
void | operation-completed | Run Last |
void | operation-failed | Run Last |
MxActorManager is an object that helps manage the creation, addition and removal of actors. It is bound to a particular stage, and spreads operations over time so as not to interrupt animations or interactivity.
Operations added to the MxActorManager will strictly be performed in the order in which they were added.
ClutterActor * (*MxActorManagerCreateFunc) (MxActorManager *manager
,gpointer userdata
);
MxActorManager *
mx_actor_manager_new (ClutterStage *stage
);
Creates a new MxActorManager, associated with the given stage.
A reference will not be taken on the stage, and when the stage is destroyed, the actor manager will lose a reference. The actor manager can be kept alive by taking a reference, but will no longer divide up events.
Since 1.2
MxActorManager *
mx_actor_manager_get_for_stage (ClutterStage *stage
);
Get the MxActorManager associated with a stage, or creates one if this is the first call to the function with the given ClutterStage.
This is a convenience function that allows for easy association of one MxActorManager to a ClutterStage.
Since 1.2
ClutterStage *
mx_actor_manager_get_stage (MxActorManager *manager
);
Gets the ClutterStage the actor manager is associated with.
Since 1.2
gulong mx_actor_manager_create_actor (MxActorManager *manager
,MxActorManagerCreateFunc create_func
,gpointer userdata
,GDestroyNotify destroy_func
);
Creates a ClutterActor. The actor may not be created immediately, or at all, if the operation is cancelled.
On successful completion, the “actor_created” signal will be fired.
manager |
||
create_func |
A ClutterActor creation function |
|
userdata |
data to be passed to the function, or |
|
destroy_func |
callback to invoke before the operation is removed |
Since 1.2
gulong mx_actor_manager_add_actor (MxActorManager *manager
,ClutterContainer *container
,ClutterActor *actor
);
Adds actor
to container
. The actor may not be parented immediately,
or at all, if the operation is cancelled.
On successful completion, the “actor_added” signal will be fired.
Since 1.2
gulong mx_actor_manager_remove_actor (MxActorManager *manager
,ClutterContainer *container
,ClutterActor *actor
);
Removes actor
from container
.
On successful completion, the “actor_removed” signal will be fired.
The actor may not be removed immediately, and thus you may want to set the actor's opacity to 0 before calling this function.
Since 1.2
void mx_actor_manager_remove_container (MxActorManager *manager
,ClutterContainer *container
);
Removes the container. This is a utility function that works by first removing all the children of the container, then the children itself. This effectively spreads the load of removing a large container. All prior operations associated with this container will be cancelled.
The container may not be removed immediately, and thus you may want to set the container's opacity to 0 before calling this function.
Since 1.2
void mx_actor_manager_cancel_operation (MxActorManager *manager
,gulong id
);
Cancels the given operation, if it exists. The “operation_cancelled” signal is fired whenever an operation is cancelled.
Since 1.2
void mx_actor_manager_cancel_operations (MxActorManager *manager
,ClutterActor *actor
);
Cancels all operations associated with the given actor.
Since 1.2
void mx_actor_manager_set_time_slice (MxActorManager *manager
,guint msecs
);
Sets the amount of time the actor manager will spend performing operations, before yielding to allow any necessary redrawing to occur.
Lower times will lead to smoother performance, but will increase the amount of time it takes for operations to complete.
Since 1.2
guint
mx_actor_manager_get_time_slice (MxActorManager *manager
);
Retrieves the current time slice being used for operations.
Since 1.2
guint
mx_actor_manager_get_n_operations (MxActorManager *manager
);
Retrieves the amount of operations left in the queue.
Since 1.2
struct MxActorManagerClass { GObjectClass parent_class; /* signals */ void (*actor_created) (MxActorManager *manager, gulong id, ClutterActor *actor); void (*actor_added) (MxActorManager *manager, gulong id, ClutterContainer *container, ClutterActor *actor); void (*actor_removed) (MxActorManager *manager, gulong id, ClutterContainer *container, ClutterActor *actor); void (*actor_finished) (MxActorManager *manager, ClutterActor *actor); void (*operation_completed) (MxActorManager *manager, gulong id); void (*operation_cancelled) (MxActorManager *manager, gulong id); void (*operation_failed) (MxActorManager *manager, gulong id, GError *error); /* padding for future expansion */ void (*_padding_0) (void); void (*_padding_1) (void); void (*_padding_2) (void); void (*_padding_3) (void); void (*_padding_4) (void); };
“n-operations”
property “n-operations” guint
The amount of operations in the queue.
Flags: Read
Default value: 0
“stage”
property “stage” ClutterStage *
The stage that contains the managed actors.
Flags: Read / Write / Construct Only
“actor-added”
signalvoid user_function (MxActorManager *manager, gulong id, ClutterActor *container, ClutterActor *actor, gpointer user_data)
Emitted when an actor add operation has completed.
manager |
the object that received the signal |
|
id |
The operation ID |
|
container |
The ClutterContainer the actor was added to |
|
actor |
The added ClutterActor |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“actor-created”
signalvoid user_function (MxActorManager *manager, gulong id, ClutterActor *actor, gpointer user_data)
Emitted when an actor creation operation has completed.
manager |
the object that received the signal |
|
id |
The operation ID |
|
actor |
The created ClutterActor |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“actor-finished”
signalvoid user_function (MxActorManager *manager, ClutterActor *actor, gpointer user_data)
Emitted when all queued operations involving actor
have completed.
manager |
the object that received the signal |
|
actor |
The ClutterActor to which the signal pertains |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“actor-removed”
signalvoid user_function (MxActorManager *manager, gulong id, ClutterActor *container, ClutterActor *actor, gpointer user_data)
Emitted when an actor remove operation has completed.
manager |
the object that received the signal |
|
id |
The operation ID |
|
container |
The ClutterContainer the actor was removed from |
|
actor |
The removed ClutterActor |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“operation-cancelled”
signalvoid user_function (MxActorManager *manager, gulong id, gpointer user_data)
Emitted when an operation has been cancelled.
manager |
the object that received the signal |
|
id |
The operation id |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“operation-completed”
signalvoid user_function (MxActorManager *manager, gulong id, gpointer user_data)
Emitted when an operation has completed successfully.
manager |
the object that received the signal |
|
id |
The operation id |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2
“operation-failed”
signalvoid user_function (MxActorManager *manager, gulong id, GError *error, gpointer user_data)
Emitted when an operation has failed.
manager |
the object that received the signal |
|
id |
The operation id |
|
error |
A GError describing the reason of the failure |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since 1.2