Backend abstraction
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
<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
<clutter-backend>
) ⇒ (ret double
)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
<clutter-backend>
) (options cairo-font-options-t
)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 toclutter-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
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:
#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.");
- backend-type
- the name of the backend to check
- ret
- ‘
#t
’ if the current Clutter windowing system backend is the one checked, and ‘#f
’ otherwiseSince 1.10