Next: , Previous: ClutterAlpha, Up: Top


10 ClutterBackend

Backend abstraction

10.1 Overview

Clutter can be compiled against different backends. Each backend has to implement a set of functions, in order to be used by Clutter.

<clutter-backend> is the base class abstracting the various implementation; it provides a basic API to query the backend for generic information and settings.

<clutter-backend> is available since Clutter 0.4

10.2 Usage

— Function: clutter-get-default-backend ⇒  (ret <clutter-backend>)

Retrieves the default <clutter-backend> used by Clutter. The <clutter-backend> holds backend-specific configuration options.

ret
the default backend. You should not ref or unref the returned object. Applications should rarely need to use this.

Since 0.4

— Function: clutter-backend-get-resolution (self <clutter-backend>) ⇒  (ret double)
— Method: get-resolution

Gets the resolution for font handling on the screen.

The resolution is a scale factor between points specified in a <pango-font-description> and cairo units. The default value is 96.0, meaning that a 10 point font will be 13 units high (10 * 96. / 72. = 13.3).

Clutter will set the resolution using the current backend when initializing; the resolution is also stored in the <"font-dpi"> property.

backend
a <clutter-backend>
ret
the current resolution, or -1 if no resolution has been set.

Since 0.4

— Function: clutter-backend-set-font-options (self <clutter-backend>) (options cairo-font-options-t)
— Method: set-font-options

Sets the new font options for backend. The <clutter-backend> will copy the <cairo-font-options-t>.

If options is ‘#f’, the first following call to clutter-backend-get-font-options will return the default font options for backend.

This function is intended for actors creating a Pango layout using the PangoCairo API.

backend
a <clutter-backend>
options
Cairo font options for the backend, or ‘#f

Since 0.8

— Function: clutter-check-windowing-backend (backend_type mchars) ⇒  (ret bool)

Checks the run-time name of the Clutter windowing system backend, using the symbolic macros like ‘CLUTTER_WINDOWING_WIN32’ or ‘CLUTTER_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:

          
          &#x0023;ifdef CLUTTER_WINDOWING_X11
            if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
              {
                /&#x002A; it is safe to use the clutter_x11_* API &#x002A;/
              }
            else
          &#x0023;endif
          &#x0023;ifdef CLUTTER_WINDOWING_WIN32
            if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32))
              {
                /&#x002A; it is safe to use the clutter_win32_* API &#x002A;/
              }
            else
          &#x0023;endif
              g_error ("Unknown Clutter backend.");
backend-type
the name of the backend to check
ret
#t’ if the current Clutter windowing system backend is the one checked, and ‘#f’ otherwise

Since 1.10