gi-clutter-1.0.3: clutter GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Clutter.Functions

Description

 
Synopsis

Methods

baseInit

baseInit :: (HasCallStack, MonadIO m) => m () Source #

No description available in the introspection data.

cairoClear

cairoClear Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> m () 

Utility function to clear a Cairo context.

Since: 1.12

cairoSetSourceColor

cairoSetSourceColor Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Context

cr: a Cairo context

-> Color

color: a 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

checkVersion Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

major: major version, like 1 in 1.2.3

-> Word32

minor: minor version, like 2 in 1.2.3

-> Word32

micro: micro version, like 3 in 1.2.3

-> m Bool

Returns: True if the version of the Clutter library is greater than (major, minor, micro), and False otherwise

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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

backendType: the name of the backend to check

-> m Bool

Returns: True if the current Clutter windowing system backend is the one checked, and False otherwise

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

doEvent Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Event

event: a Event.

-> m () 

Processes an event.

The event must be a valid Event and have a Stage associated to it.

This function is only useful when embedding Clutter inside another toolkit, and it should never be called by applications.

Since: 0.4

eventsPending

eventsPending Source #

Arguments

:: (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

featureAvailable Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [FeatureFlags]

feature: a FeatureFlags

-> m Bool

Returns: True if a feature is available

Checks whether feature is available. feature can be a logical OR of FeatureFlags.

Since: 0.2

featureGetAll

featureGetAll Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m [FeatureFlags]

Returns: a logical OR of all the supported features.

Returns all the supported features.

Since: 0.2

frameSourceAdd

frameSourceAdd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

priority: the priority of the frame source. Typically this will be in the range between PRIORITY_DEFAULT and PRIORITY_HIGH.

-> Word32

fps: the number of times per second to call the function

-> SourceFunc

func: function to call

-> 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Bool

Returns: True if Clutter has accessibility support enabled

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

getActorByGid Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

id_: a Actor unique id.

-> m Actor

Returns: the actor with the passed id or Nothing. The returned actor does not have its reference count increased.

Deprecated: (Since version 1.8)The id is deprecated, and this function always returns Nothing. Use the proper scene graph API in Actor to find a child of the stage.

Retrieves the Actor with id_.

Since: 0.6

getCurrentEvent

getCurrentEvent Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Event

Returns: The current ClutterEvent, or Nothing if none

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

getCurrentEventTime Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Word32

Returns: the event timestamp, or CURRENT_TIME

Retrieves the timestamp of the last event, if there is an event or if the event has a timestamp.

Since: 1.0

getDebugEnabled

getDebugEnabled Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Bool

Returns: False

Deprecated: (Since version 1.10)This function does not do anything.

Check if Clutter has debugging enabled.

getDefaultBackend

getDefaultBackend Source #

Arguments

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

Retrieves the default Backend used by Clutter. The Backend holds backend-specific configuration options.

Since: 0.4

getDefaultFrameRate

getDefaultFrameRate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Word32

Returns: the default frame rate

Retrieves the default frame rate. See setDefaultFrameRate.

Since: 0.6

getDefaultTextDirection

getDefaultTextDirection Source #

Arguments

:: (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

getFontFlags Source #

Arguments

:: (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

getFontMap Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m FontMap

Returns: the FontMap instance. The returned value is owned by Clutter and it should never be unreferenced.

Retrieves the FontMap instance used by Clutter. You can use the global font map object with the COGL Pango API.

Since: 1.0

getInputDeviceForId

getInputDeviceForId Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

id_: the unique id for a device

-> m InputDevice

Returns: a InputDevice, or Nothing

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

getKeyboardGrab Source #

Arguments

:: (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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Bool

Returns: True if the motion events are enabled

Deprecated: (Since version 1.8)Use stageGetMotionEventsEnabled instead.

Gets whether the per-actor motion events are enabled.

Since: 0.6

getPointerGrab

getPointerGrab Source #

Arguments

:: (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

getScriptId Source #

Arguments

:: (HasCallStack, MonadIO m, IsObject a) 
=> a

gobject: a Object

-> m Text

Returns: the script id, or Nothing if object was not defined inside a UI definition file. The returned string is owned by the object and should never be modified or freed.

Retrieves the Clutter script id, if any.

Since: 0.6

getShowFps

getShowFps Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Bool

Returns: True if Clutter should show the FPS.

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

getTimestamp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m CULong

Returns: Number of microseconds since init was called, or zero if Clutter was not configured with debugging code paths.

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

grabKeyboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsActor a) 
=> a

actor: a Actor

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

grabPointer Source #

Arguments

:: (HasCallStack, MonadIO m, IsActor a) 
=> a

actor: a Actor

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

grabPointerForDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsActor a) 
=> a

actor: a Actor

-> Int32

id_: a device id, or -1

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

init Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe [Text]

argv: A pointer to an array of arguments.

-> m (InitError, Maybe [Text])

Returns: a InitError value

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

initWithArgs Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe [Text]

argv: a pointer to the array of command line arguments

-> Maybe Text

parameterString: a string which is displayed in the first line of <option>--help</option> output, after <literal><replaceable>programname</replaceable> [OPTION...]</literal>

-> Maybe [OptionEntry]

entries: a Nothing terminated array of OptionEntrys describing the options of your program

-> Maybe Text

translationDomain: a translation domain to use for translating the <option>--help</option> output for the options in entries with gettext(), or Nothing

-> m (InitError, Maybe [Text])

Returns: InitErrorSuccess if Clutter has been successfully initialised, or other values or InitError in case of error. (Can throw GError)

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

keysymToUnicode Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

keyval: a key symbol

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

mainLevel Source #

Arguments

:: (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

setDefaultFrameRate Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

framesPerSec: the new default frame rate

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

setFontFlags Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [FontFlags]

flags: The new flags

-> 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

enable: True to enable per-actor motion events

-> m () 

Deprecated: (Since version 1.8)Use stageSetMotionEventsEnabled instead.

Sets whether per-actor motion events should be enabled or not on all Stages managed by Clutter.

If enable is False the following events will not work:

Since: 0.6

setWindowingBackend

setWindowingBackend Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

backendType: a comma separated list of windowing backends

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

testAddDataFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

testPath: unique path for identifying the test

-> TestDataFunc

testFunc: function containing the test

-> m () 

Adds a test unit to the Clutter test environment.

See also: g_test_add_data_func_full()

Since: 1.18

testCheckActorAtPoint

testCheckActorAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsActor a, IsActor b) 
=> a

stage: a Stage

-> Point

point: coordinates to check

-> b

actor: the expected actor at the given coordinates

-> m (Bool, Maybe Actor)

Returns: True if the actor at the given coordinates matches

Checks the given coordinates of the stage and compares the actor found there with the given actor.

Since: 1.18

testCheckColorAtPoint

testCheckColorAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsActor a) 
=> a

stage: a Stage

-> Point

point: coordinates to check

-> Color

color: expected color

-> m (Bool, Color)

Returns: True if the colors match

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

testGetStage Source #

Arguments

:: (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

testRun Source #

Arguments

:: (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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

priority: the priority of the frame source. Typically this will be in the range between PRIORITY_DEFAULT and PRIORITY_HIGH.

-> Word32

fps: the number of times per second to call the function

-> SourceFunc

func: function to call

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

threadsAddIdle Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

priority: the priority of the timeout source. Typically this will be in the range between PRIORITY_DEFAULT_IDLE and PRIORITY_HIGH_IDLE

-> SourceFunc

func: function to call

-> 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> SourceFunc

func: the function to be called within the paint cycle

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

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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> [RepaintFlags]

flags: flags for the repaint function

-> SourceFunc

func: the function to be called within the paint cycle

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

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

threadsAddTimeout Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

priority: the priority of the timeout source. Typically this will be in the range between PRIORITY_DEFAULT and PRIORITY_HIGH.

-> Word32

interval: the time between calls to the function, in milliseconds

-> SourceFunc

func: function to call

-> 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

handleId: an unsigned integer greater than zero

-> 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

id_: a device id

-> m () 

Deprecated: (Since version 1.10)Use inputDeviceUngrab instead.

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

Since: 0.8

unicodeToKeysym

unicodeToKeysym Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

wc: a ISO10646 encoded character

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

utilNextP2 Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

a: Value to get the next power

-> m Int32

Returns: The nearest power of two, greater or equal to a.

Deprecated: (Since version 1.2)

Calculates the nearest power of two, greater than or equal to a.

valueDupPaintNode

valueDupPaintNode Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized with CLUTTER_TYPE_PAINT_NODE

-> m PaintNode

Returns: a pointer to the PaintNode, with its reference count increased, or Nothing

Retrieves a pointer to the PaintNode contained inside the passed Value, and if not Nothing it will increase the reference count.

Since: 1.10

valueGetColor

valueGetColor Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized to CLUTTER_TYPE_COLOR

-> m Color

Returns: the color inside the passed Value

Gets the Color contained in value.

Since: 0.8

valueGetPaintNode

valueGetPaintNode Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized with CLUTTER_TYPE_PAINT_NODE

-> m PaintNode

Returns: a pointer to a PaintNode, or Nothing

Retrieves a pointer to the PaintNode contained inside the passed Value.

Since: 1.10

valueGetShaderFloat

valueGetShaderFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> m [Float]

Returns: the pointer to a list of floating point values. The returned value is owned by the Value and should never be modified or freed.

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

valueGetShaderInt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> m [Int32]

Returns: the pointer to a list of integer values. The returned value is owned by the Value and should never be modified or freed.

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

valueGetShaderMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> m [Float]

Returns: the pointer to a matrix of floating point values. The returned value is owned by the Value and should never be modified or freed.

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

valueGetUnits Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized to CLUTTER_TYPE_UNITS

-> m Units

Returns: the units inside the passed Value

Gets the Units contained in value.

Since: 0.8

valueSetColor

valueSetColor Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized to CLUTTER_TYPE_COLOR

-> Color

color: the color to set

-> m () 

Sets value to color.

Since: 0.8

valueSetPaintNode

valueSetPaintNode Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaintNode a) 
=> GValue

value: a Value initialized with CLUTTER_TYPE_PAINT_NODE

-> Maybe a

node: a PaintNode, or Nothing

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

valueSetShaderFloat Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> [Float]

floats: an array of floating point values

-> m () 

Sets floats as the contents of value. The passed Value must have been initialized using CLUTTER_TYPE_SHADER_FLOAT.

Since: 0.8

valueSetShaderInt

valueSetShaderInt Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> [Int32]

ints: an array of integer values

-> m () 

Sets ints as the contents of value. The passed Value must have been initialized using CLUTTER_TYPE_SHADER_INT.

Since: 0.8

valueSetShaderMatrix

valueSetShaderMatrix Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> [Float]

matrix: a matrix of floating point values

-> m () 

Sets matrix as the contents of value. The passed Value must have been initialized using CLUTTER_TYPE_SHADER_MATRIX.

Since: 0.8

valueSetUnits

valueSetUnits Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value initialized to CLUTTER_TYPE_UNITS

-> Units

units: the units to set

-> m () 

Sets value to units

Since: 0.8

valueTakePaintNode

valueTakePaintNode Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaintNode a) 
=> GValue

value: a Value, initialized with CLUTTER_TYPE_PAINT_NODE

-> Maybe a

node: a PaintNode, or Nothing

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