Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Methods
- baseInit
- cairoClear
- cairoSetSourceColor
- checkVersion
- checkWindowingBackend
- clearGlyphCache
- disableAccessibility
- doEvent
- eventsPending
- featureAvailable
- featureGetAll
- frameSourceAdd
- getAccessibilityEnabled
- getActorByGid
- getCurrentEvent
- getCurrentEventTime
- getDebugEnabled
- getDefaultBackend
- getDefaultFrameRate
- getDefaultTextDirection
- getFontFlags
- getFontMap
- getInputDeviceForId
- getKeyboardGrab
- getMotionEventsEnabled
- getPointerGrab
- getScriptId
- getShowFps
- getTimestamp
- grabKeyboard
- grabPointer
- grabPointerForDevice
- init
- initWithArgs
- keysymToUnicode
- main
- mainLevel
- mainQuit
- redraw
- setDefaultFrameRate
- setFontFlags
- setMotionEventsEnabled
- setWindowingBackend
- testAddDataFull
- testCheckActorAtPoint
- testCheckColorAtPoint
- testGetStage
- testInit
- testRun
- threadsAddFrameSource
- threadsAddIdle
- threadsAddRepaintFunc
- threadsAddRepaintFuncFull
- threadsAddTimeout
- threadsEnter
- threadsInit
- threadsLeave
- threadsRemoveRepaintFunc
- ungrabKeyboard
- ungrabPointer
- ungrabPointerForDevice
- unicodeToKeysym
- utilNextP2
- valueDupPaintNode
- valueGetColor
- valueGetPaintNode
- valueGetShaderFloat
- valueGetShaderInt
- valueGetShaderMatrix
- valueGetUnits
- valueSetColor
- valueSetPaintNode
- valueSetShaderFloat
- valueSetShaderInt
- valueSetShaderMatrix
- valueSetUnits
- valueTakePaintNode
Synopsis
- baseInit :: (HasCallStack, MonadIO m) => m ()
- cairoClear :: (HasCallStack, MonadIO m) => Context -> m ()
- cairoSetSourceColor :: (HasCallStack, MonadIO m) => Context -> Color -> m ()
- checkVersion :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m Bool
- checkWindowingBackend :: (HasCallStack, MonadIO m) => Text -> m Bool
- clearGlyphCache :: (HasCallStack, MonadIO m) => m ()
- disableAccessibility :: (HasCallStack, MonadIO m) => m ()
- doEvent :: (HasCallStack, MonadIO m) => Event -> m ()
- eventsPending :: (HasCallStack, MonadIO m) => m Bool
- featureAvailable :: (HasCallStack, MonadIO m) => [FeatureFlags] -> m Bool
- featureGetAll :: (HasCallStack, MonadIO m) => m [FeatureFlags]
- frameSourceAdd :: (HasCallStack, MonadIO m) => Int32 -> Word32 -> SourceFunc -> m Word32
- getAccessibilityEnabled :: (HasCallStack, MonadIO m) => m Bool
- getActorByGid :: (HasCallStack, MonadIO m) => Word32 -> m Actor
- getCurrentEvent :: (HasCallStack, MonadIO m) => m Event
- getCurrentEventTime :: (HasCallStack, MonadIO m) => m Word32
- getDebugEnabled :: (HasCallStack, MonadIO m) => m Bool
- getDefaultBackend :: (HasCallStack, MonadIO m) => m Backend
- getDefaultFrameRate :: (HasCallStack, MonadIO m) => m Word32
- getDefaultTextDirection :: (HasCallStack, MonadIO m) => m TextDirection
- getFontFlags :: (HasCallStack, MonadIO m) => m [FontFlags]
- getFontMap :: (HasCallStack, MonadIO m) => m FontMap
- getInputDeviceForId :: (HasCallStack, MonadIO m) => Int32 -> m InputDevice
- getKeyboardGrab :: (HasCallStack, MonadIO m) => m Actor
- getMotionEventsEnabled :: (HasCallStack, MonadIO m) => m Bool
- getPointerGrab :: (HasCallStack, MonadIO m) => m Actor
- getScriptId :: (HasCallStack, MonadIO m, IsObject a) => a -> m Text
- getShowFps :: (HasCallStack, MonadIO m) => m Bool
- getTimestamp :: (HasCallStack, MonadIO m) => m CULong
- grabKeyboard :: (HasCallStack, MonadIO m, IsActor a) => a -> m ()
- grabPointer :: (HasCallStack, MonadIO m, IsActor a) => a -> m ()
- grabPointerForDevice :: (HasCallStack, MonadIO m, IsActor a) => a -> Int32 -> m ()
- init :: (HasCallStack, MonadIO m) => Maybe [Text] -> m (InitError, Maybe [Text])
- initWithArgs :: (HasCallStack, MonadIO m) => Maybe [Text] -> Maybe Text -> Maybe [OptionEntry] -> Maybe Text -> m (InitError, Maybe [Text])
- keysymToUnicode :: (HasCallStack, MonadIO m) => Word32 -> m Word32
- main :: (HasCallStack, MonadIO m) => m ()
- mainLevel :: (HasCallStack, MonadIO m) => m Int32
- mainQuit :: (HasCallStack, MonadIO m) => m ()
- redraw :: (HasCallStack, MonadIO m, IsStage a) => a -> m ()
- setDefaultFrameRate :: (HasCallStack, MonadIO m) => Word32 -> m ()
- setFontFlags :: (HasCallStack, MonadIO m) => [FontFlags] -> m ()
- setMotionEventsEnabled :: (HasCallStack, MonadIO m) => Bool -> m ()
- setWindowingBackend :: (HasCallStack, MonadIO m) => Text -> m ()
- testAddDataFull :: (HasCallStack, MonadIO m) => Text -> TestDataFunc -> m ()
- testCheckActorAtPoint :: (HasCallStack, MonadIO m, IsActor a, IsActor b) => a -> Point -> b -> m (Bool, Maybe Actor)
- testCheckColorAtPoint :: (HasCallStack, MonadIO m, IsActor a) => a -> Point -> Color -> m (Bool, Color)
- testGetStage :: (HasCallStack, MonadIO m) => m Actor
- testInit :: (HasCallStack, MonadIO m) => Int32 -> Text -> m ()
- testRun :: (HasCallStack, MonadIO m) => m Int32
- threadsAddFrameSource :: (HasCallStack, MonadIO m) => Int32 -> Word32 -> SourceFunc -> m Word32
- threadsAddIdle :: (HasCallStack, MonadIO m) => Int32 -> SourceFunc -> m Word32
- threadsAddRepaintFunc :: (HasCallStack, MonadIO m) => SourceFunc -> m Word32
- threadsAddRepaintFuncFull :: (HasCallStack, MonadIO m) => [RepaintFlags] -> SourceFunc -> m Word32
- threadsAddTimeout :: (HasCallStack, MonadIO m) => Int32 -> Word32 -> SourceFunc -> m Word32
- threadsEnter :: (HasCallStack, MonadIO m) => m ()
- threadsInit :: (HasCallStack, MonadIO m) => m ()
- threadsLeave :: (HasCallStack, MonadIO m) => m ()
- threadsRemoveRepaintFunc :: (HasCallStack, MonadIO m) => Word32 -> m ()
- ungrabKeyboard :: (HasCallStack, MonadIO m) => m ()
- ungrabPointer :: (HasCallStack, MonadIO m) => m ()
- ungrabPointerForDevice :: (HasCallStack, MonadIO m) => Int32 -> m ()
- unicodeToKeysym :: (HasCallStack, MonadIO m) => Word32 -> m Word32
- utilNextP2 :: (HasCallStack, MonadIO m) => Int32 -> m Int32
- valueDupPaintNode :: (HasCallStack, MonadIO m) => GValue -> m PaintNode
- valueGetColor :: (HasCallStack, MonadIO m) => GValue -> m Color
- valueGetPaintNode :: (HasCallStack, MonadIO m) => GValue -> m PaintNode
- valueGetShaderFloat :: (HasCallStack, MonadIO m) => GValue -> m [Float]
- valueGetShaderInt :: (HasCallStack, MonadIO m) => GValue -> m [Int32]
- valueGetShaderMatrix :: (HasCallStack, MonadIO m) => GValue -> m [Float]
- valueGetUnits :: (HasCallStack, MonadIO m) => GValue -> m Units
- valueSetColor :: (HasCallStack, MonadIO m) => GValue -> Color -> m ()
- valueSetPaintNode :: (HasCallStack, MonadIO m, IsPaintNode a) => GValue -> Maybe a -> m ()
- valueSetShaderFloat :: (HasCallStack, MonadIO m) => GValue -> [Float] -> m ()
- valueSetShaderInt :: (HasCallStack, MonadIO m) => GValue -> [Int32] -> m ()
- valueSetShaderMatrix :: (HasCallStack, MonadIO m) => GValue -> [Float] -> m ()
- valueSetUnits :: (HasCallStack, MonadIO m) => GValue -> Units -> m ()
- valueTakePaintNode :: (HasCallStack, MonadIO m, IsPaintNode a) => GValue -> Maybe a -> m ()
Methods
baseInit
baseInit :: (HasCallStack, MonadIO m) => m () Source #
No description available in the introspection data.
cairoClear
:: (HasCallStack, MonadIO m) | |
=> Context |
|
-> m () |
Utility function to clear a Cairo context.
Since: 1.12
cairoSetSourceColor
:: (HasCallStack, MonadIO m) | |
=> Context |
|
-> Color |
|
-> m () |
Utility function for setting the source color of cr
using
a Color
. This function is the equivalent of:
cairo_set_source_rgba (cr, color->red / 255.0, color->green / 255.0, color->blue / 255.0, color->alpha / 255.0);
Since: 1.0
checkVersion
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m Bool | Returns: |
Run-time version check, to check the version the Clutter library that an application is currently linked against
This is the run-time equivalent of the compile-time CLUTTER_CHECK_VERSION
pre-processor macro
Since: 1.2
checkWindowingBackend
checkWindowingBackend Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Bool | Returns: |
Checks the run-time name of the Clutter windowing system backend, using
the symbolic macros like CLUTTER_WINDOWING_WIN32
or
WINDOWING_X11
.
This function should be used in conjuction with the compile-time macros inside applications and libraries that are using the platform-specific windowing system API, to ensure that they are running on the correct windowing system; for instance:
#ifdef CLUTTER_WINDOWING_X11 if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) { // it is safe to use the clutter_x11_* API } else #endif #ifdef CLUTTER_WINDOWING_WIN32 if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32)) { // it is safe to use the clutter_win32_* API } else #endif g_error ("Unknown Clutter backend.");
Since: 1.10
clearGlyphCache
clearGlyphCache :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.10)Use getFontMap
and fontMapClearGlyphCache
instead.
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
disableAccessibility
disableAccessibility :: (HasCallStack, MonadIO m) => m () Source #
Disable loading the accessibility support. It has the same effect
as setting the environment variable
CLUTTER_DISABLE_ACCESSIBILITY. For the same reason, this method
should be called before init
.
Since: 1.14
doEvent
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m () |
eventsPending
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: TRUE if there are pending events, FALSE otherwise. |
Checks if events are pending in the event queue.
Since: 0.4
featureAvailable
:: (HasCallStack, MonadIO m) | |
=> [FeatureFlags] |
|
-> m Bool | Returns: |
Checks whether feature
is available. feature
can be a logical
OR of FeatureFlags
.
Since: 0.2
featureGetAll
:: (HasCallStack, MonadIO m) | |
=> m [FeatureFlags] | Returns: a logical OR of all the supported features. |
Returns all the supported features.
Since: 0.2
frameSourceAdd
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Word32 |
|
-> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the event source. |
Deprecated: (Since version 1.6)There is no direct replacement for this API.
Sets a function to be called at regular intervals with the given
priority. The function is called repeatedly until it returns
False
, at which point the timeout is automatically destroyed and
the function will not be called again. The notify
function is
called when the timeout is destroyed. The first call to the
function will be at the end of the first interval
.
This function is similar to timeoutAdd
except that it
will try to compensate for delays. For example, if func
takes half
the interval time to execute then the function will be called again
half the interval time after it finished. In contrast
timeoutAdd
would not fire until a full interval after the
function completes so the delay between calls would be 1.0 / fps
*
1.5. This function does not however try to invoke the function
multiple times to catch up missing frames if func
takes more than
interval
ms to execute.
Since: 0.8
getAccessibilityEnabled
getAccessibilityEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: |
Returns whether Clutter has accessibility support enabled. As least, a value of TRUE means that there are a proper AtkUtil implementation available
Since: 1.4
getActorByGid
getCurrentEvent
:: (HasCallStack, MonadIO m) | |
=> m Event | Returns: The current ClutterEvent, or |
If an event is currently being processed, return that event. This function is intended to be used to access event state that might not be exposed by higher-level widgets. For example, to get the key modifier state from a Button 'clicked' event.
Since: 1.2
getCurrentEventTime
:: (HasCallStack, MonadIO m) | |
=> m Word32 | Returns: the event timestamp, or |
Retrieves the timestamp of the last event, if there is an event or if the event has a timestamp.
Since: 1.0
getDebugEnabled
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: |
Deprecated: (Since version 1.10)This function does not do anything.
Check if Clutter has debugging enabled.
getDefaultBackend
:: (HasCallStack, MonadIO m) | |
=> m Backend | Returns: the default backend. You should not ref or unref the returned object. Applications should rarely need to use this. |
getDefaultFrameRate
:: (HasCallStack, MonadIO m) | |
=> m Word32 | Returns: the default frame rate |
Retrieves the default frame rate. See setDefaultFrameRate
.
Since: 0.6
getDefaultTextDirection
getDefaultTextDirection Source #
:: (HasCallStack, MonadIO m) | |
=> m TextDirection | Returns: the default text direction |
Retrieves the default direction for the text. The text direction is
determined by the locale and/or by the CLUTTER_TEXT_DIRECTION
environment variable.
The default text direction can be overridden on a per-actor basis by using
actorSetTextDirection
.
Since: 1.2
getFontFlags
:: (HasCallStack, MonadIO m) | |
=> m [FontFlags] | Returns: The font flags |
Deprecated: (Since version 1.10)Use backendGetFontOptions
and the FontOptions
API.
Gets the current font flags for rendering text. See
setFontFlags
.
Since: 1.0
getFontMap
:: (HasCallStack, MonadIO m) | |
=> m FontMap | Returns: the |
Retrieves the FontMap
instance used by Clutter.
You can use the global font map object with the COGL
Pango API.
Since: 1.0
getInputDeviceForId
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m InputDevice | Returns: a |
Deprecated: (Since version 1.10)Use deviceManagerGetDevice
instead.
Retrieves the InputDevice
from its id_
. This is a convenience
wrapper for deviceManagerGetDevice
and it is functionally
equivalent to:
ClutterDeviceManager *manager; ClutterInputDevice *device; manager = clutter_device_manager_get_default (); device = clutter_device_manager_get_device (manager, id);
Since: 0.8
getKeyboardGrab
:: (HasCallStack, MonadIO m) | |
=> m Actor | Returns: the actor currently holding the keyboard grab, or NULL if there is no grab. |
Queries the current keyboard grab of clutter.
Since: 0.6
getMotionEventsEnabled
getMotionEventsEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: |
Deprecated: (Since version 1.8)Use stageGetMotionEventsEnabled
instead.
Gets whether the per-actor motion events are enabled.
Since: 0.6
getPointerGrab
:: (HasCallStack, MonadIO m) | |
=> m Actor | Returns: the actor currently holding the pointer grab, or NULL if there is no grab. |
Queries the current pointer grab of clutter.
Since: 0.6
getScriptId
:: (HasCallStack, MonadIO m, IsObject a) | |
=> a |
|
-> m Text | Returns: the script id, or |
Retrieves the Clutter script id, if any.
Since: 0.6
getShowFps
:: (HasCallStack, MonadIO m) | |
=> m Bool | Returns: |
Deprecated: (Since version 1.10)This function does not do anything. Use the environment variable or the configuration file to determine whether Clutter should print out the FPS counter on the console.
Returns whether Clutter should print out the frames per second on the console. You can enable this setting either using the <literal>CLUTTER_SHOW_FPS</literal> environment variable or passing the <literal>--clutter-show-fps</literal> command line argument. *
Since: 0.4
getTimestamp
:: (HasCallStack, MonadIO m) | |
=> m CULong | Returns: Number of microseconds since |
Deprecated: (Since version 1.10)Use Timer
or getMonotonicTime
for a proper timing source
Returns the approximate number of microseconds passed since Clutter was intialised.
This function shdould not be used by application code.
The output of this function depends on whether Clutter was configured to enable its debugging code paths, so it's less useful than intended.
Since Clutter 1.10, this function is an alias to getMonotonicTime
if Clutter was configured to enable the debugging code paths.
grabKeyboard
:: (HasCallStack, MonadIO m, IsActor a) | |
=> a |
|
-> m () |
Grabs keyboard events, after the grab is done keyboard events (Actor::keyPressEvent and Actor::keyReleaseEvent) 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.
Like pointer grabs, keyboard grabs should only be used as a last resource.
See also stageSetKeyFocus
and actorGrabKeyFocus
to perform a "soft" key grab and assign key focus to a specific actor.
Since: 0.6
grabPointer
:: (HasCallStack, MonadIO m, IsActor a) | |
=> a |
|
-> m () |
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 without passing through both capture and bubble phases of the event delivery chain. The source set in the event will be the actor that would have received the event if the pointer grab was not in effect.
Grabs completely override the entire event delivery chain done by Clutter. Pointer grabs should only be used as a last resource; using the Actor::capturedEvent signal should always be the preferred way to intercept event delivery to reactive actors.
This function should rarely be used.
If a grab is required, you are strongly encouraged to use a specific
input device by calling inputDeviceGrab
.
Since: 0.6
grabPointerForDevice
:: (HasCallStack, MonadIO m, IsActor a) | |
=> a |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.10)Use inputDeviceGrab
instead.
Grabs all the pointer events coming from the device id
for actor
.
If id
is -1 then this function is equivalent to grabPointer
.
Since: 0.8
init
:: (HasCallStack, MonadIO m) | |
=> Maybe [Text] |
|
-> m (InitError, Maybe [Text]) | Returns: a |
Initialises everything needed to operate with Clutter and parses some
standard command line options; argc
and argv
are adjusted accordingly
so your own code will never see those standard arguments.
It is safe to call this function multiple times.
This function will not abort in case of errors during
initialization; init
will print out the error message on
stderr, and will return an error code. It is up to the application
code to handle this case. If you need to display the error message
yourself, you can use initWithArgs
, which takes a GError
pointer.
If this function fails, and returns an error code, any subsequent
Clutter API will have undefined behaviour - including segmentation
faults and assertion failures. Make sure to handle the returned
InitError
enumeration value.
initWithArgs
:: (HasCallStack, MonadIO m) | |
=> Maybe [Text] |
|
-> Maybe Text |
|
-> Maybe [OptionEntry] |
|
-> Maybe Text |
|
-> m (InitError, Maybe [Text]) | Returns: |
This function does the same work as init
. Additionally,
it allows you to add your own command line options, and it
automatically generates nicely formatted <option>--help</option>
output. Note that your program will be terminated after writing
out the help output. Also note that, in case of error, the
error message will be placed inside error
instead of being
printed on the display.
Just like init
, if this function returns an error code then
any subsequent call to any other Clutter API will result in undefined
behaviour - including segmentation faults.
Since: 0.2
keysymToUnicode
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Word32 | Returns: a Unicode character, or 0 if there is no corresponding character. |
Converts keyval
from a Clutter key symbol to the corresponding
ISO10646 (Unicode) character.
main
main :: (HasCallStack, MonadIO m) => m () Source #
Starts the Clutter mainloop.
mainLevel
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: The level of the mainloop. |
Retrieves the depth of the Clutter mainloop.
mainQuit
mainQuit :: (HasCallStack, MonadIO m) => m () Source #
Terminates the Clutter mainloop.
redraw
redraw :: (HasCallStack, MonadIO m, IsStage a) => a -> m () Source #
Deprecated: (Since version 1.10)Use stageEnsureRedraw
instead.
Forces a redraw of the entire stage. Applications should never use this
function, but queue a redraw using actorQueueRedraw
.
This function should only be used by libraries integrating Clutter from within another toolkit.
setDefaultFrameRate
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m () |
Deprecated: (Since version 1.10)This function does not do anything any more.
Sets the default frame rate. This frame rate will be used to limit the number of frames drawn if Clutter is not able to synchronize with the vertical refresh rate of the display. When synchronization is possible, this value is ignored.
Since: 0.6
setFontFlags
:: (HasCallStack, MonadIO m) | |
=> [FontFlags] |
|
-> m () |
Deprecated: (Since version 1.10)Use backendSetFontOptions
and the cairo_font_option_t
API.
Sets the font quality options for subsequent text rendering operations.
Using mipmapped textures will improve the quality for scaled down text but will use more texture memory.
Enabling hinting improves text quality for static text but may introduce some artifacts if the text is animated.
Since: 1.0
setMotionEventsEnabled
setMotionEventsEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m () |
Deprecated: (Since version 1.8)Use stageSetMotionEventsEnabled
instead.
Sets whether per-actor motion events should be enabled or not on
all Stage
s managed by Clutter.
If enable
is False
the following events will not work:
- ClutterActormotionEvent, except on the
Stage
- ClutterActorenterEvent
- ClutterActorleaveEvent
Since: 0.6
setWindowingBackend
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m () |
Restricts Clutter to only use the specified backend or list of backends.
You can use one of the CLUTTER_WINDOWING_*
symbols, e.g.
C code
clutter_set_windowing_backend (CLUTTER_WINDOWING_X11);
Will force Clutter to use the X11 windowing and input backend, and terminate if the X11 backend could not be initialized successfully.
Since Clutter 1.26, you can also use a comma-separated list of windowing system backends to provide a fallback in case backends are not available or enabled, e.g.:
C code
clutter_set_windowing_backend ("gdk,wayland,x11");
Will make Clutter test for the GDK, Wayland, and X11 backends in that order.
You can use the *
special value to ask Clutter to use the internally
defined list of backends. For instance:
C code
clutter_set_windowing_backend ("x11,wayland,*");
Will make Clutter test the X11 and Wayland backends, and then fall back to the internal list of available backends.
This function must be called before the first API call to Clutter, including
clutter_get_option_context()
Since: 1.16
testAddDataFull
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> TestDataFunc |
|
-> m () |
Adds a test unit to the Clutter test environment.
See also: g_test_add_data_func_full()
Since: 1.18
testCheckActorAtPoint
testCheckActorAtPoint Source #
:: (HasCallStack, MonadIO m, IsActor a, IsActor b) | |
=> a |
|
-> Point |
|
-> b |
|
-> m (Bool, Maybe Actor) | Returns: |
Checks the given coordinates of the stage
and compares the
actor found there with the given actor
.
Since: 1.18
testCheckColorAtPoint
testCheckColorAtPoint Source #
:: (HasCallStack, MonadIO m, IsActor a) | |
=> a |
|
-> Point |
|
-> Color |
|
-> m (Bool, Color) | Returns: |
Checks the color at the given coordinates on stage
, and matches
it with the red, green, and blue channels of color
. The alpha
component of color
and result
is ignored.
Since: 1.18
testGetStage
:: (HasCallStack, MonadIO m) | |
=> m Actor | Returns: the stage used for testing |
Retrieves the Stage
used for testing.
Since: 1.18
testInit
testInit :: (HasCallStack, MonadIO m) => Int32 -> Text -> m () Source #
No description available in the introspection data.
testRun
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: the exit code for the test suite |
Runs the test suite using the units added by calling
clutter_test_add()
.
The typical test suite is composed of a list of functions
called by testRun
, for instance:
static void unit_foo (void) { ... } static void unit_bar (void) { ... } static void unit_baz (void) { ... } int main (int argc, char *argv[]) { clutter_test_init (&argc, &argv); clutter_test_add ("/unit/foo", unit_foo); clutter_test_add ("/unit/bar", unit_bar); clutter_test_add ("/unit/baz", unit_baz); return clutter_test_run (); }
Since: 1.18
threadsAddFrameSource
threadsAddFrameSource Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Word32 |
|
-> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the event source. |
Deprecated: (Since version 1.6)There is no direct replacement for this API
Sets a function to be called at regular intervals holding the Clutter
threads lock, with the given priority. The function is called repeatedly
until it returns False
, at which point the timeout is automatically
removed and the function will not be called again. The notify
function
is called when the timeout is removed.
This function is similar to threadsAddTimeout
except that it will try to compensate for delays. For example, if
func
takes half the interval time to execute then the function
will be called again half the interval time after it finished. In
contrast threadsAddTimeout
would not fire until a
full interval after the function completes so the delay between
calls would be interval
* 1.5. This function does not however try
to invoke the function multiple times to catch up missing frames if
func
takes more than interval
ms to execute.
See also threadsAddIdle
.
Since: 0.8
threadsAddIdle
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the event source. |
Adds a function to be called whenever there are no higher priority
events pending. If the function returns False
it is automatically
removed from the list of event sources and will not be called again.
This function can be considered a thread-safe variant of idleAdd
:
it will call function
while holding the Clutter lock. It is logically
equivalent to the following implementation:
static gboolean idle_safe_callback (gpointer data) { SafeClosure *closure = data; gboolean res = FALSE; // mark the critical section // clutter_threads_enter(); // the callback does not need to acquire the Clutter / lock itself, as it is held by the this proxy handler // res = closure->callback (closure->data); clutter_threads_leave(); return res; } static gulong add_safe_idle (GSourceFunc callback, gpointer data) { SafeClosure *closure = g_new0 (SafeClosure, 1); closure->callback = callback; closure->data = data; return g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, idle_safe_callback, closure, g_free) }
This function should be used by threaded applications to make sure
that func
is emitted under the Clutter threads lock and invoked
from the same thread that started the Clutter main loop. For instance,
it can be used to update the UI using the results from a worker
thread:
static gboolean update_ui (gpointer data) { SomeClosure *closure = data; // it is safe to call Clutter API from this function because / it is invoked from the same thread that started the main / loop and under the Clutter thread lock // clutter_label_set_text (CLUTTER_LABEL (closure->label), closure->text); g_object_unref (closure->label); g_free (closure); return FALSE; } // within another thread // closure = g_new0 (SomeClosure, 1); // always take a reference on GObject instances // closure->label = g_object_ref (my_application->label); closure->text = g_strdup (processed_text_to_update_the_label); clutter_threads_add_idle_full (G_PRIORITY_HIGH_IDLE, update_ui, closure, NULL);
Since: 0.4
threadsAddRepaintFunc
threadsAddRepaintFunc Source #
:: (HasCallStack, MonadIO m) | |
=> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the repaint function. You
can use the returned integer to remove the repaint function by
calling |
Adds a function to be called whenever Clutter is processing a new frame.
If the function returns False
it is automatically removed from the
list of repaint functions and will not be called again.
This function is guaranteed to be called from within the same thread
that called main
, and while the Clutter lock is being held;
the function will be called within the main loop, so it is imperative
that it does not block, otherwise the frame time budget may be lost.
A repaint function is useful to ensure that an update of the scenegraph
is performed before the scenegraph is repainted; for instance, uploading
a frame from a video into a Texture
. By default, a repaint
function added using this function will be invoked prior to the frame
being processed.
Adding a repaint function does not automatically ensure that a new frame will be queued.
When the repaint function is removed (either because it returned False
or because threadsRemoveRepaintFunc
has been called) the
notify
function will be called, if any is set.
See also: threadsAddRepaintFuncFull
Since: 1.0
threadsAddRepaintFuncFull
threadsAddRepaintFuncFull Source #
:: (HasCallStack, MonadIO m) | |
=> [RepaintFlags] |
|
-> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the repaint function. You
can use the returned integer to remove the repaint function by
calling |
Adds a function to be called whenever Clutter is processing a new frame.
If the function returns False
it is automatically removed from the
list of repaint functions and will not be called again.
This function is guaranteed to be called from within the same thread
that called main
, and while the Clutter lock is being held;
the function will be called within the main loop, so it is imperative
that it does not block, otherwise the frame time budget may be lost.
A repaint function is useful to ensure that an update of the scenegraph
is performed before the scenegraph is repainted; for instance, uploading
a frame from a video into a Texture
. The flags
passed to this
function will determine the section of the frame processing that will
result in func
being called.
Adding a repaint function does not automatically ensure that a new frame will be queued.
When the repaint function is removed (either because it returned False
or because threadsRemoveRepaintFunc
has been called) the
notify
function will be called, if any is set.
Since: 1.10
threadsAddTimeout
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> Word32 |
|
-> SourceFunc |
|
-> m Word32 | Returns: the ID (greater than 0) of the event source. |
Sets a function to be called at regular intervals holding the Clutter
threads lock, with the given priority. The function is called repeatedly
until it returns False
, at which point the timeout is automatically
removed and the function will not be called again. The notify
function
is called when the timeout is removed.
The first call to the function will be at the end of the first interval
.
It is important to note that, due to how the Clutter main loop is implemented, the timing will not be accurate and it will not try to "keep up" with the interval.
See also threadsAddIdle
.
Since: 0.4
threadsEnter
threadsEnter :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.12)This function should not be used by application code; marking critical sections is not portable on various platforms. Instead of acquiring the Clutter lock, schedule UI updates from the main loop using clutter_threads_add_idle()
or clutter_threads_add_timeout()
.
Locks the Clutter thread lock.
Since: 0.4
threadsInit
threadsInit :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.10)This function does not do anything. Threading support is initialized when Clutter is initialized.
Initialises the Clutter threading mechanism, so that Clutter API can be
called by multiple threads, using threadsEnter
and
threadsLeave
to mark the critical sections.
You must call g_thread_init()
before this function.
This function must be called before init
.
It is safe to call this function multiple times.
Since: 0.4
threadsLeave
threadsLeave :: (HasCallStack, MonadIO m) => m () Source #
Deprecated: (Since version 1.12)This function should not be used by application code; marking critical sections is not portable on various platforms. Instead of acquiring the Clutter lock, schedule UI updates from the main loop using clutter_threads_add_idle()
or clutter_threads_add_timeout()
.
Unlocks the Clutter thread lock.
Since: 0.4
threadsRemoveRepaintFunc
threadsRemoveRepaintFunc Source #
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m () |
Removes the repaint function with handleId
as its id
Since: 1.0
ungrabKeyboard
ungrabKeyboard :: (HasCallStack, MonadIO m) => m () Source #
Removes an existing grab of the keyboard.
Since: 0.6
ungrabPointer
ungrabPointer :: (HasCallStack, MonadIO m) => m () Source #
Removes an existing grab of the pointer.
Since: 0.6
ungrabPointerForDevice
ungrabPointerForDevice Source #
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m () |
Deprecated: (Since version 1.10)Use inputDeviceUngrab
instead.
Removes an existing grab of the pointer events for device id_
.
Since: 0.8
unicodeToKeysym
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Word32 | Returns: the corresponding Clutter key symbol, if one exists. or, if there is no corresponding symbol, wc | 0x01000000 |
Convert from a ISO10646 character to a key symbol.
Since: 1.10
utilNextP2
:: (HasCallStack, MonadIO m) | |
=> Int32 |
|
-> m Int32 | Returns: The nearest power of two, greater or equal to |
Deprecated: (Since version 1.2)
Calculates the nearest power of two, greater than or equal to a
.
valueDupPaintNode
valueGetColor
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m Color | Returns: the color inside the passed |
Gets the Color
contained in value
.
Since: 0.8
valueGetPaintNode
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m PaintNode |
valueGetShaderFloat
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m [Float] | Returns: the pointer to a list of
floating point values. The returned value is owned by the
|
Retrieves the list of floating point values stored inside
the passed Value
. value
must have been initialized with
CLUTTER_TYPE_SHADER_FLOAT
.
Since: 0.8
valueGetShaderInt
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m [Int32] | Returns: the pointer to a list of
integer values. The returned value is owned by the |
Retrieves the list of integer values stored inside the passed
Value
. value
must have been initialized with
CLUTTER_TYPE_SHADER_INT
.
Since: 0.8
valueGetShaderMatrix
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m [Float] | Returns: the pointer to a matrix
of floating point values. The returned value is owned by the |
Retrieves a matrix of floating point values stored inside
the passed Value
. value
must have been initialized with
CLUTTER_TYPE_SHADER_MATRIX
.
Since: 0.8
valueGetUnits
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m Units | Returns: the units inside the passed |
Gets the Units
contained in value
.
Since: 0.8
valueSetColor
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> Color |
|
-> m () |
Sets value
to color
.
Since: 0.8
valueSetPaintNode
:: (HasCallStack, MonadIO m, IsPaintNode a) | |
=> GValue |
|
-> Maybe a | |
-> m () |
Sets the contents of a Value
initialized with CLUTTER_TYPE_PAINT_NODE
.
This function increased the reference count of node
; if you do not wish
to increase the reference count, use valueTakePaintNode
instead. The reference count will be released by valueUnset
.
Since: 1.10
valueSetShaderFloat
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> [Float] |
|
-> m () |
Sets floats
as the contents of value
. The passed Value
must have been initialized using CLUTTER_TYPE_SHADER_FLOAT
.
Since: 0.8
valueSetShaderInt
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> [Int32] |
|
-> m () |
Sets ints
as the contents of value
. The passed Value
must have been initialized using CLUTTER_TYPE_SHADER_INT
.
Since: 0.8
valueSetShaderMatrix
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> [Float] |
|
-> m () |
Sets matrix
as the contents of value
. The passed Value
must have been initialized using CLUTTER_TYPE_SHADER_MATRIX
.
Since: 0.8
valueSetUnits
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> Units |
|
-> m () |
Sets value
to units
Since: 0.8
valueTakePaintNode
:: (HasCallStack, MonadIO m, IsPaintNode a) | |
=> GValue |
|
-> Maybe a | |
-> m () |
Sets the contents of a Value
initialized with CLUTTER_TYPE_PAINT_NODE
.
Unlike valueSetPaintNode
, this function will not take a
reference on the passed node
: instead, it will take ownership of the
current reference count.
Since: 1.10