It is proposed that this article be deleted because of the following concern:
If you can address this concern by improving, copyediting, sourcing, renaming, or merging the page, please edit this page and do so. You may remove this message if you improve the article or otherwise object to deletion for any reason. Although not required, you are encouraged to explain why you object to the deletion, either in your edit summary or on the talk page. If this template is removed, do not replace it . Contents
The article may be deleted if this message remains in place for seven days, i.e., after 22:26, 19 September 2024 (UTC). Find sources: "Clutter" software – news · newspapers · books · scholar · JSTOR |
Original author(s) | Emmanuele Bassi, OpenedHand Ltd |
---|---|
Developer(s) | The GNOME Project |
Initial release | June 22, 2006 |
Stable release | 1.26.4 / March 9, 2020 [1] |
Preview release | 1.25.6 / February 18, 2016 [2] |
Repository | |
Written in | C |
Operating system | Linux, BSDs, OS X, Microsoft Windows |
Type | Graphics library |
License | GNU Lesser General Public License [3] |
Website | GNOME/Projects/clutter |
Clutter is a discontinued GObject-based graphics library 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 (1.1 or 2.0) for rendering,[ citation needed ]. It also supports media playback using GStreamer and 2D graphics rendering using Cairo. [4]
Clutter was authored by OpenedHand Ltd, now part of Intel. Clutter is free and open-source software, subject to the requirements of the GNU Lesser General Public License (LGPL), version 2.1. [3]
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 libadwaita. [5]
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. [6] 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 required to be used along with GTK.
Clutter supports multi-touch gestures.[ citation needed ]
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.
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.
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 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 is the basic element of Clutter's scene graph, it encapsulates the position, size, and transformations of a node in the graph. [8]
Clutter is developed for the X Window System using GLX as well as Wayland [9] [10] [11] using EGL. Clutter can also use the framebuffer. As of release 0.6, native support for Mac OS X has been added. [12] A native Microsoft Windows backend is supported since the 0.8 release [13] and Windows pre-compiled DLLs are available, [14] [15] [16] 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. [17]
Clutter is implemented using the C programming language with a design based on the GObject object system. Bindings are available for these languages:
Clutter can be integrated with other libraries and toolkits, for instance:
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.floatx=(clutter_actor_get_width(stage)-clutter_actor_get_width(label))/2;floaty=(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);
Clutter can build user interfaces using a specialized JSON dialect. [19] The entire scene graph is defined using JSON types and built at run time through the ClutterScript class.
This definition will create the main window and place a label with the text Hello, world! inside it.
{"id":"main-stage","type":"ClutterStage","color":"white","width":800,"height":600,"title":"Script demo","children":[{"id":"hello-label","type":"ClutterText","x":400,"y":300,"text":"Hello, world!","color":"black","font-name":"Sans 48px"}],"signals":[{"name":"destroy","handler":"clutter_main_quit"}]}
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){g_warning("Unable to load UI description: %s",error->message);g_error_free(error);}else{GObject*stage;clutter_script_connect_signals(script,NULL);/* connect the signal handlers */stage=clutter_script_get_object(script,"main-stage");/* get the "main-stage" object */clutter_actor_show(CLUTTER_ACTOR(stage));}
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.
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);
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);
Cogl is a small open source software library for using 3D graphics hardware to draw pretty pictures. [21] 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 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.
A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements used to construct the graphical user interface (GUI) of programs.
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 them, and exports them in another. The formats and processes can be changed in a plug and play fashion.
PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its original author is GNOME developer James Henstridge. There are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on One Laptop Per Child systems.
Cairo is an open-source graphics library that provides a vector graphics-based, device-independent API for software developers. It provides primitives for two-dimensional drawing across a number of different backends. Cairo uses hardware acceleration when available.
GNOME-DB is a database application by the GNOME community. The project aims to provide a free unified data access architecture to the GNOME project for all Unix platforms. GNOME-DB is useful for any application that accesses persistent data, since it contains a data management API.
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 and through bindings to other languages to provide transparent cross-language interoperability, e.g. PyGObject.
GLib is a bundle of three low-level system libraries written in C and developed mainly by GNOME. GLib's code was separated from GTK, so it can be used by software other than GNOME and has been developed in parallel ever since.
GDK 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 drawing primitives, raster graphics (bitmaps), cursors, fonts, as well as window events and drag-and-drop functionality.
Accessibility Toolkit (ATK) is an open source software library, part of the GNOME project, which provides application programming interfaces (APIs) for implementing accessibility support in software.
A graphics library or graphics API 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 running on the CPU, common in embedded systems, or being hardware accelerated by a GPU, more common in PCs. By employing these functions, a program can assemble an image to be output to a monitor. This relieves the programmer of the task of creating and optimizing these functions, and allows them to focus on building the graphics program. Graphics libraries are mainly used in video games and simulations.
Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system.
java-gnome is a set of language bindings for the Java programming language for use in the GNOME desktop environment. It is part of the official GNOME language bindings suite and provides a set of libraries allowing developers to write computer programs for GNOME using the Java programming language and the GTK cross-platform widget toolkit.
GTK is a free software 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 proprietary software to use it. It is one of the most popular toolkits for the Wayland and X11 windowing systems.
Seed is a JavaScript interpreter and a library of the GNOME project to create standalone applications in JavaScript. It uses the JavaScript engine JavaScriptCore of the WebKit project. It is possible to easily create modules in C.
mpv is free and open-source media player software based on MPlayer, mplayer2 and FFmpeg. It runs on several operating systems, including Unix-like operating systems and Microsoft Windows, along with having an Android port called mpv-android. It is cross-platform, running on ARM, PowerPC, x86/IA-32, x86-64, and MIPS architecture.
In computer science and visualization, a canvas is a container that holds various drawing elements. It takes its name from the canvas used in visual arts. It is sometimes called a scene graph because it arranges the logical representation of a user interface or graphical scene. Some implementations also define the spatial representation and allow the user to interact with the elements via a graphical user interface.
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.