Next: , Previous: ClutterListModel, Up: Top


25 General

Various 'global' clutter functions.

25.1 Overview

Functions to retrieve various global Clutter resources and other utility functions for mainloops, events and threads

25.2 Usage

— Function: clutter-main

Starts the Clutter mainloop.

— Function: clutter-main-quit

Terminates the Clutter mainloop.

— Function: clutter-main-level   (ret int)

Retrieves the depth of the Clutter mainloop.

ret
The level of the mainloop.
— Function: clutter-get-debug-enabled   (ret bool)

Check if clutter has debugging turned on.

ret
TRUE if debugging is turned on, FALSE otherwise.
— Function: clutter-get-show-fps   (ret bool)

Returns whether Clutter should print out the frames per second on the console. You can enable this setting either using the ‘CLUTTER_SHOW_FPS’ environment variable or passing the ‘--clutter-show-fps’ command line argument. *

ret
#t’ if Clutter should show the FPS.

Since 0.4

— Function: clutter-get-timestamp   (ret unsigned-long)

Returns the approximate number of microseconds passed since clutter was intialised.

ret
Number of microseconds since clutter-init was called.
— Function: clutter-get-actor-by-gid (id unsigned-int32)   (ret <clutter-actor>)

Retrieves the <clutter-actor> with id.

id
a <clutter-actor> ID.
ret
the actor with the passed id or ‘#f’. The returned actor does not have its reference count increased.

Since 0.6

— Function: clutter-set-default-frame-rate (frames_per_sec unsigned-int)

Sets the default frame rate to be used when creating <clutter-timeline>s

frames-per-sec
the new default frame rate

Since 0.6

— Function: clutter-get-default-frame-rate   (ret unsigned-int)

Retrieves the default frame rate used when creating <clutter-timeline>s.

This value is also used to compute the default frequency of motion events.

ret
the default frame rate

Since 0.6

— Function: clutter-set-motion-events-enabled (enable bool)

Sets whether per-actor motion events should be enabled or not (the default is to enable them).

If enable is ‘#f’ the following events will not work:

ClutterActor::motion-event, unless on the <clutter-stage>

ClutterActor::enter-event

ClutterActor::leave-event

enable
#t’ to enable per-actor motion events

Since 0.6

— Function: clutter-get-motion-events-enabled   (ret bool)

Gets whether the per-actor motion events are enabled.

ret
#t’ if the motion events are enabled

Since 0.6

— Function: clutter-set-motion-events-frequency (frequency unsigned-int)

Sets the motion events frequency. Setting this to a non-zero value will override the default setting, so it should be rarely used.

Motion events are delivered from the default backend to the stage and are used to generate the enter/leave events pair. This might lead to a performance penalty due to the way the actors are identified. Using this function is possible to reduce the frequency of the motion events delivery to the stage.

frequency
the number of motion events per second, or 0 for the default value

Since 0.6

— Function: clutter-get-motion-events-frequency   (ret unsigned-int)

Retrieves the number of motion events per second that are delivered to the stage.

See clutter-set-motion-events-frequency.

ret
the number of motion events per second

Since 0.6

— Function: clutter-clear-glyph-cache

Clears the internal cache of glyphs used by the Pango renderer. This will free up some memory and GL texture resources. The cache will be automatically refilled as more text is drawn.

Since 0.8

— Function: clutter-set-use-mipmapped-text (value bool)

Sets whether subsequent text rendering operations will use mipmapped textures or not. Using mipmapped textures will improve the quality for scaled down text but will use more texture memory.

value
#t’ to enable mipmapping or ‘#f’ to disable.

Since 0.8

— Function: clutter-get-use-mipmapped-text   (ret bool)

Gets whether mipmapped textures are used in text operations. See clutter-set-use-mipmapped-text.

ret
#t’ if text operations should use mipmapped textures

Since 0.8

— Function: clutter-get-keyboard-grab   (ret <clutter-actor>)

Queries the current keyboard grab of clutter.

ret
the actor currently holding the keyboard grab, or NULL if there is no grab.

Since 0.6

— Function: clutter-get-pointer-grab   (ret <clutter-actor>)

Queries the current pointer grab of clutter.

ret
the actor currently holding the pointer grab, or NULL if there is no grab.

Since 0.6

— Function: clutter-grab-keyboard (actor <clutter-actor>)

Grabs keyboard events, after the grab is done keyboard events ("key-press-event" and "key-release-event") are delivered to this actor directly. The source set in the event will be the actor that would have received the event if the keyboard grab was not in effect.

actor
a <clutter-actor>

Since 0.6

— Function: clutter-grab-pointer (actor <clutter-actor>)

Grabs pointer events, after the grab is done all pointer related events (press, motion, release, enter, leave and scroll) are delivered to this actor directly. The source set in the event will be the actor that would have received the event if the pointer grab was not in effect.

If you wish to grab all the pointer events for a specific input device, you should use clutter-grab-pointer-for-device.

actor
a <clutter-actor>

Since 0.6

— Function: clutter-ungrab-keyboard

Removes an existing grab of the keyboard.

Since 0.6

— Function: clutter-ungrab-pointer

Removes an existing grab of the pointer.

Since 0.6

— Function: clutter-grab-pointer-for-device (actor <clutter-actor>) (id int)

Grabs all the pointer events coming from the device id for actor.

If id is -1 then this function is equivalent to clutter-grab-pointer.

actor
a <clutter-actor>
id
a device id, or -1

Since 0.8

— Function: clutter-ungrab-pointer-for-device (id int)

Removes an existing grab of the pointer events for device id.

id
a device id

Since 0.8

— Function: clutter-do-event (event <clutter-event>)

Processes an event. This function should never be called by applications.

event
a <clutter-event>.

Since 0.4