Clayton (software)
   HOME

TheInfoList



OR:

Clutter is a discontinued GObject-based graphics library for creating hardware-accelerated user interfaces. Clutter is an
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
-based 'interactive canvas' library and does not contain any
graphical control element A graphical widget (also graphical control element or control) in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct ...
s. It relies upon
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
(1.4+) or OpenGL ES (1.1 or 2.0) for rendering,. It also supports media playback using GStreamer and 2D graphics rendering using Cairo. Clutter was authored by OpenedHand Ltd, now part of Intel. Clutter is
free and open-source software Free and open-source software (FOSS) is a term used to refer to groups of software consisting of both free software and open-source software where anyone is freely licensed to use, copy, study, and change the software in any way, and the source ...
, subject to the requirements of the GNU Lesser General Public License (LGPL), version 2.1. In February 2022, the development team announced that the project would be discontinued. No more versions will be released and developers using Clutter are encouraged to port their applications to GTK 4 and libadwaita2.


Adoption

Popular programs that adopt Clutter are GNOME Videos (a.k.a. Totem), GNOME Shell, Pitivi, Cinnamon Desktop and GNOME Ease. Mx is a widget toolkit based on Clutter originally designed for the graphical shell of Moblin/ MeeGo netbook, but evolved into an independent project. The widget toolkits Netbook Toolkit (nbtk) and Mx are based on Clutter. Often Clutter is seen analogous to GTK but this is inaccurate. Only Clutter ''together'' with Mx or Nbtk can match the extent of the GTK. This is also the reason why Clutter is used together with GTK. Clutter supports multi-touch gestures. * Clayland is a Wayland compositor utilizing Clutter. * Snappy is a lightweight media player based on Clutter and GStreamer. * Pinpoint is a simple light-weight presentation program. * GNOME Maps uses ClutterActor * Proof of concept
casual Casual or Casuals may refer to: * Casual wear, a loosely defined dress code **Business casual a loosely defined dress code **Smart casual a loosely defined dress code * Casual Company, term used by the United States military to describe a type of ...
video games PillPopper (a ''
Pac-Man originally called ''Puck Man'' in Japan, is a 1980 maze action video game developed and released by Namco for arcades. In North America, the game was released by Midway Manufacturing as part of its licensing agreement with Namco America. Th ...
''
clone Clone or Clones or Cloning or Cloned or The Clone may refer to: Places * Clones, County Fermanagh * Clones, County Monaghan, a town in Ireland Biology * Clone (B-cell), a lymphocyte clone, the massive presence of which may indicate a pathologi ...
) and HappyWombats (an '' Angry Birds'' clone) use Clutter. GTK Scene Graph Kit (GSK) was initially released as part of GTK+ 3.90 in March 2017 and is meant for GTK-based applications that wish to replace Clutter for their UI.


Software architecture

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 OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
, the Clutter developer changes properties of each actor. Clutter will then notice the changes, and render the scene accordingly. Clutter is currently being developed by OpenedHand to provide visually rich graphical user interfaces on desktop and embedded hardware. The main target are media center-like applications, small devices UIs and base drawing API for GL- and GL/ES-based UI toolkits. Clutter uses Pango for text rendering (with a special GL/GLES renderer) and
GdkPixbuf GDK (GIMP Drawing Kit) is a library that acts as a wrapper around the low-level functions provided by the underlying windowing and graphics systems. GDK lies between the display server and the GTK library, handling basic rendering such as dr ...
for loading images into GL textures. Interaction with other GNOME platform libraries is done through multiple integration libraries, e.g.: clutter-gst (GStreamer), clutter-gtk (for embedding the stage into a GTK application), clutter-cairo (for using cairo to draw into a texture). It's API and ABI are kept stable within micro releases, but can break API during minor releases—until it reaches 1.0, then it will be API and ABI stable until the following major release.


ClutterActor

ClutterActor is the basic element of Clutter's scene graph, it encapsulates the position, size, and transformations of a node in the graph. * A ClutterActor can receive and handle input device events, for instance pointer events and key events. * Animation is a core concept of modern user interfaces; Clutter provides a complete and powerful animation framework that automatically tweens the actor's state without requiring direct, frame by frame manipulation from your application code.


Supported platforms

Clutter is developed for the X Window System using GLX as well as Wayland using EGL. Clutter can also use the framebuffer. As of release 0.6, native support for Mac OS X has been added. A native
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
backend is supported since the 0.8 release and Windows pre-compiled DLLs are available, however, it is possible to build the latest DLL for Windows with MinGW and Bash shell for Windows. Since version 1.19.4 from June 2014, Clutter's evdev input backend depends on libinput 0.4.0.


Programming language bindings

Clutter is implemented using the
C programming language ''The C Programming Language'' (sometimes termed ''K&R'', after its authors' initials) is a computer programming book written by Brian Kernighan and Dennis Ritchie, the latter of whom originally designed and implemented the language, as well as ...
with a design based on the GObject object system. Bindings are available for these languages: * C++ ( Cluttermm) * Perl (Perl-Clutter) * Python (PyClutter) * Haskell () * JavaScript (Seed and GJS) * C# (Clutter-sharp (aka Clutter#)) ? * Ruby () ? * Vala (Clutter)


Integration libraries

Clutter can be integrated with other libraries and toolkits, for instance: * GTK applications can embed Clutter stages using a special widget. * Clutter applications can embed GTK widgets using the 'client-side windows' feature since GTK+ 2.18. * Clutter applications can use GStreamer to play videos directly into a Clutter texture actor. * Clutter applications can use Cairo to draw onto a texture. *
Video Acceleration API Video Acceleration API (VA-API) is an open source application programming interface that allows applications such as VLC media player or GStreamer to use hardware video acceleration capabilities, usually provided by the graphics processing uni ...


Example

This example will add a label on the stage (written in C). // Retrieve the default stage, which will contain all the actors on the scene. ClutterActor *stage = clutter_stage_get_default (); // Create a new label, using the Sans font 32 pixels high, and with the "Hello, world" text, // and will place it into the stage. ClutterActor *label = clutter_text_new_with_text ("Sans 32px", "Hello, world"); clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); // Position the label at the center of the stage, taking into account the stage and the label size. float x = (clutter_actor_get_width (stage) - clutter_actor_get_width (label)) / 2; float y = (clutter_actor_get_height (stage) - clutter_actor_get_height (label)) / 2; clutter_actor_set_position (label, x, y); // Show the stage. All actors in Clutter are visible unless explicitly hidden, except for the stage; // thus showing the stage will // automatically display all of its visible children. clutter_actor_show (stage);


Interface builder

Clutter can build user interfaces using a specialized
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
dialect. The entire scene graph is defined using JSON 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. The definition can be saved into a file or as a string, and loaded using: ClutterScript *script = clutter_script_new (); GError *error = NULL; clutter_script_load_from_data (script, description, -1, &error); if (error) else


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. Since Clutter 1.0, it is also possible to create simple, one-off animations using the ClutterAnimation class and the clutter_actor_animate() convenience function. The clutter_actor_animate() function animates an actor properties between their current state and the specified final state.


Example

This example will scale the label from its size to a factor of 2 in 2 seconds, using a linear function of time and behaviours: ClutterTimeline *timeline = clutter_timeline_new (2000); ClutterAlpha *alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); ClutterBehaviour *behaviour = clutter_behaviour_scale_new (alpha, 1.0, 1.0, /* initial scaling factors */ 2.0, 2.0 /* final scaling factors */ ); clutter_behaviour_apply (behaviour, label); :These statements will create a timeline with a duration of 2 seconds; an alpha, binding the timeline to a linear easing mode; a behaviour, which will scale any actor to which it is applied between factor 1.0 and factor 2.0 (both horizontally and vertically). Finally, it applies the behaviour to an actor. The equivalent code using the implicit animations API is: clutter_actor_animate (label, /* the actor to animate */ CLUTTER_LINEAR, /* the easing mode */ 2000, /* the duration of the animation */ "scale-x", 2.0, /* final horizontal scaling factor */ "scale-y", 2.0, /* final vertical scaling factor */ NULL); :This statement will create an implicit ClutterAnimation object, which will animate the provided GObject properties between their current value and the specified final value.


COGL

Cogl is a small open source software library for using 3D graphics hardware to draw pretty pictures. The API departs from the flat state machine style of OpenGL and is designed to make it easy to write orthogonal components that can render without stepping on each other's toes. Cogl currently supports OpenGL ES 1.1/2.0 and OpenGL > 1.3 (or 1.2 if you have the GL_ARB_multitexture extension), and having
Gallium3D Mesa, also called Mesa3D and The Mesa 3D Graphics Library, is an open source implementation of OpenGL, Vulkan, and other graphics API specifications. Mesa translates these specifications to vendor-specific graphics hardware drivers. Its most ...
or D3D back-ends are options for the future.


libchamplain

libchamplain is a C library providing a ClutterActor to display maps. It also provides a GTK widget to display maps in GTK applications. libchamplain is named after
Samuel de Champlain Samuel de Champlain (; Fichier OrigineFor a detailed analysis of his baptismal record, see RitchThe baptism act does not contain information about the age of Samuel, neither his birth date nor his place of birth. – 25 December 1635) was a Fre ...
, a French navigator, explorer and cartographer.


See also

* Core Animation – data visualization API used by Mac OS X 10.5 and later * Qt Quick – a similar application framework based on Qt and QML


References


External links


Clutter homepage
{{DEFAULTSORT:Clutter (Toolkit) GNOME libraries Software that uses Cairo (graphics) GTK Articles with example C code