HOME

TheInfoList



OR:

Clutter is a discontinued
GObject The GLib Object System, or GObject, is a free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C programs to provide object-oriented C-based APIs ...
-based
graphics library A graphics library is a program library designed to aid in rendering computer graphics to a monitor. This typically involves providing optimized versions of functions that handle common rendering tasks. This can be done purely in software and runn ...
for creating hardware-accelerated user interfaces. Clutter is an OpenGL-based 'interactive canvas' library and does not contain any graphical control elements. It relies upon OpenGL (1.4+) or
OpenGL ES OpenGL for Embedded Systems (OpenGL ES or GLES) is a subset of the OpenGL computer graphics rendering application programming interface (API) for rendering 2D and 3D computer graphics such as those used by video games, typically hardware-accele ...
(1.1 or 2.0) for rendering,. It also supports media playback using
GStreamer GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes the ...
and 2D graphics rendering using
Cairo Cairo ( ; ar, القاهرة, al-Qāhirah, ) is the Capital city, capital of Egypt and its largest city, home to 10 million people. It is also part of the List of urban agglomerations in Africa, largest urban agglomeration in Africa, List of ...
. Clutter was authored by OpenedHand Ltd, now part of
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world's largest semiconductor chip manufacturer by revenue, and is one of the developers of the x86 seri ...
. Clutter is free and open-source software, subject to the requirements of the
GNU Lesser General Public License The GNU Lesser General Public License (LGPL) is a free-software license published by the Free Software Foundation (FSF). The license allows developers and companies to use and integrate a software component released under the LGPL into their own ...
(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 GNOME Videos, formerly known as Totem, is a media player (audio and video) for the GNOME computer desktop environment. GNOME Videos uses the Clutter and GTK+ toolkits. It is officially included in GNOME starting from version 2.10 (released in ...
(a.k.a. Totem),
GNOME Shell GNOME Shell is the graphical shell of the GNOME desktop environment starting with version 3, which was released on April 6, 2011. It provides basic functions like launching applications, switching between windows and is also a widget engine. ...
,
Pitivi Pitivi (originally spelled PiTiVi) is a free and open-source non-linear video editor for Linux, developed by various contributors from free software community and the GNOME project, with support also available from Collabora. Pitivi is designed t ...
, Cinnamon Desktop and
GNOME Ease A gnome is a mythological creature and diminutive spirit in Renaissance magic and alchemy, first introduced by Paracelsus in the 16th century and later adopted by more recent authors including those of modern fantasy literature. Its character ...
. Mx is a widget toolkit based on Clutter originally designed for the
graphical shell In computing, a shell is a computer program that exposes an operating system's services to a human user or other programs. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending ...
of
Moblin Moblin, short for 'mobile Linux', is a discontinued open source operating system and application stack for Mobile Internet Devices (MIDs), netbooks, nettops and embedded devices. Built around the Intel Atom processor, all builds were designed to ...
/ 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 GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and propriet ...
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 Wayland is a communication protocol that specifies the communication between a display server and its clients, as well as a C library implementation of that protocol. A display server using the Wayland protocol is called a '' Wayland composito ...
utilizing Clutter. * Snappy is a lightweight media player based on Clutter and
GStreamer GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes the ...
. * Pinpoint is a simple light-weight presentation program. *
GNOME Maps GNOME Core Applications is a software suite of approximately 30 application software that are packaged as part of the standard free and open-source GNOME desktop environment. GNOME Core Applications have the look and feel of the GNOME desktop, an ...
uses ClutterActor *
Proof of concept Proof of concept (POC or PoC), also known as proof of principle, is a realization of a certain method or idea in order to demonstrate its feasibility, or a demonstration in principle with the aim of verifying that some concept or theory has prac ...
casual
video games Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, controller, keyboard, or motion sensing device to generate visual feedback. This feedbac ...
PillPopper (a '' Pac-Man'' clone) and HappyWombats (an ''
Angry Birds ''Angry Birds'' is a Finnish action-based media franchise created by Rovio Entertainment. The game series focuses on the eponymous flock of angry birds who try to save their eggs from green-colored pigs. Inspired by the game ''Crush the Castl ...
'' clone) use Clutter.
GTK Scene Graph Kit GTK Scene Graph Kit (GSK) is the rendering and scene graph API for GTK introduced with version 3.90. GSK lies between the graphical control elements (widgets) and the rendering. Like GDK, GSK is part of GTK and licensed under the GNU Lesser Ge ...
(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 Scene (from Greek σκηνή ''skēnḗ'') may refer to: Arts, entertainment, and media Music * Scene (subculture), a youth subculture from the early 2000s characterized by a distinct music and style. Groups and performers * The Scene who rec ...
-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. 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 Pango (stylized as Παν語) is a text (i.e. glyph) layout engine library which works with the HarfBuzz shaping engine for displaying multi-language text. Full-function rendering of text and cross-platform support is achieved when Pango is us ...
for text rendering (with a special GL/GLES renderer) and GdkPixbuf 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 The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems. X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
using
GLX GLX (initialism for "OpenGL Extension to the X Window System") is an extension to the X Window System core protocol providing an interface between OpenGL and the X Window System as well as extensions to OpenGL itself. It enables programs wishing ...
as well as Wayland using EGL. Clutter can also use the
framebuffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
. As of release 0.6, native support for
Mac OS X macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
has been added. A native Microsoft Windows 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 MinGW ("Minimalist GNU for Windows"), formerly mingw32, is a free and open source software development environment to create Microsoft Windows applications. MinGW includes a port of the GNU Compiler Collection (GCC), GNU Binutils for Windows ...
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 with a design based on the
GObject The GLib Object System, or GObject, is a free software library providing a portable object system and transparent cross-language interoperability. GObject is designed for use both directly in C programs to provide object-oriented C-based APIs ...
object system Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of p ...
. Bindings are available for these languages: *
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
( Cluttermm) *
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
(Perl-Clutter) *
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
(PyClutter) *
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
() *
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, of ...
(Seed and GJS) * C# (Clutter-sharp (aka Clutter#)) ? *
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
() ? *
Vala Vala or VALA may refer to: Religion and mythology * Vala (Vedic), a demon or a stone cavern in the Hindu scriptures * Völva, also spelled Vala, a priestess in Norse mythology and Norse paganism Fiction * Vala (Middle-earth), an angelic being in ...
(Clutter)


Integration libraries

Clutter can be integrated with other libraries and toolkits, for instance: *
GTK GTK (formerly GIMP ToolKit and GTK+) is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both free and propriet ...
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 GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes the ...
to play videos directly into a Clutter texture actor. * Clutter applications can use
Cairo Cairo ( ; ar, القاهرة, al-Qāhirah, ) is the Capital city, capital of Egypt and its largest city, home to 10 million people. It is also part of the List of urban agglomerations in Africa, largest urban agglomeration in Africa, List of ...
to draw onto a texture. * Video Acceleration API


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 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 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, a French navigator, explorer and cartographer.


See also

*
Core Animation Core Animation is an animation graphics compositing framework used by macOS (Mac OS X Leopard and later), iOS, watchOS, and tvOS to produce animated user interfaces. Overview Core Animation provides a way for developers to produce animated user ...
– data visualization API used by Mac OS X 10.5 and later *
Qt Quick Qt Quick is a free software application framework developed and maintained by the Qt Project within the Qt framework. It provides a way of building custom, highly dynamic graphical user interfaces with fluid transitions and effects, which are b ...
– a similar application framework based on Qt and
QML QML (Qt Modeling Language) is a user interface markup language. It is a declarative language (similar to CSS and JSON) for designing user interface–centric applications. Inline JavaScript code handles imperative aspects. It is associated wi ...


References


External links


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