- Clutter (computing)
Infobox Software
name = Clutter
caption =
developer =OpenedHand Ltd
released =22 June 2006
latest_release_version = 0.8.0
latest_release_date = release date and age|2008|07|10
programming language = C
operating system =Cross-platform
language = English
genre =Graphics library
license =LGPL
website = [http://www.clutter-project.org/ Clutter Project]Clutter is an
open source graphics library for creating hardware-accelerated user interfaces. It relies uponOpenGL (1.4+) orOpenGL ES (1.1 or 2.0) for rendering, can be compiled on different platforms (X11, Darwin and Win32) and has multiple bindings to other languages (including Mono,Perl , Python, Ruby and Vala). It also supports media playback usingGStreamer and 2D graphics rendering using Cairo.Clutter was created by OpenedHand Ltd. Licensed under the LGPL, Clutter is
free software (andopen source ).Programming languages
Clutter uses the C programming language, although its design uses the
GObject object system . Bindings are available for these languages:*
C++ (cluttermm )
*Perl (clutter-perl )
*Ruby (rbclutter )
*Python (PyClutter )
*Vala (clutter-vala )
*C# (Clutter# )Platforms
Clutter is developed on the
X Window System , using the GLX extension. It is also targeted to embedded environments, either using X or the native frame buffer. As of release 0.6, native support forMac OS X has been added. A nativeMicrosoft Windows backend is supported since the 0.8 release.Design
Clutter is a scene graph based canvas working in retained mode. Every object on the scene is (usually) a 2D surface inside a 3D space.
Clutter abstracts the native windowing environment behind a backend, which is also responsible for creating the main container for the scene graph; this top level container is called the "stage". Items on the stage are called "actors".
Instead of operating on matrices, as does
OpenGL , the Clutter developer changes properties of each actor. Clutter will then notice the changes, and render the scene accordingly.Example
This example will add a label on the stage.
:This statement will retrieve the default stage, which will contain all the actors on the scene.
:These statement will create a new label, using the Sans font 32 pixels high, and with the "Hello, world" text, and will place it into the stage.
:These statements will position the label at the center of the stage, taking into account the stage and the label size.
:These statements will show the label and the stage.
Animation
Clutter allows implicit animations of every item on the canvas using special objects called "behaviours": each behaviour can be applied to multiple actors, and multiple behaviours can be composed on the same actor. Behaviours handle animations implicitly: the developer specifies the initial and final states, the time (or number of frames) needed to complete the animation, the function of time to be used (linear, sine wave, exponential, etc.), and the behaviour will take care of the
tweening . Clutter provides a generic base class for developers to implement custom behaviours, and various simple classes handling simple properties, like opacity, position on the Z axis (depth), position along a path, rotation, etc.Example
This example will scale the label from its size to a factor of 2 in 2 seconds, using a linear function of time:
:These statements will create a "timeline", a clock function which will be used to time the animation; and an "alpha", an object binding the timeline to a function.
:These statements will create a new behaviour and will apply it to the label.
:This statement will start the animation.
Interface builder
Clutter can build user interfaces using a specialized
JSON dialect. The entirescene graph is defined usingJSON types and built at run time through the ClutterScript class.Example
This definition will create the main window and place a label with the text "Hello, world!" inside it.
Integration libraries
Clutter can be integrated with other libraries and toolkits, for instance:
*
GTK+ applications can embed the Clutter stage using a special widget
* Clutter applications can useGStreamer to play videos directly into a Clutter texture actor
* Clutter applications can use Cairo to draw onto a textureExperimental support is present for using
WebKit to render a web page onto a Clutter texture. [ [http://blogs.gnome.org/iain/2008/02/04/never-thought-youd-write-a-browser-cos-html-is-so-passe/ Never thought you’d write a browser, cos HTML is so passé - My Dreams are Bulletproof ] ]See also
*
List of widget toolkits
*Core Animation
*Windows Presentation Foundation References
External links
* [http://www.clutter-project.org Clutter homepage]
* [http://www.clutter-project.org/blog/ Clutter project blog]"'
Wikimedia Foundation. 2010.