GDK Software Architecture
   HOME

TheInfoList



OR:

GDK (
GIMP Gimp or GIMP may refer to: Clothing * Bondage suit, also called a gimp suit, a type of suit used in BDSM * Bondage mask, also called a gimp mask, often worn in conjunction with a gimp suit Embroidery and crafts * Gimp (thread), an ornamental tr ...
Drawing Kit) is a
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
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 GTK (formerly GIMP ToolKit and 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 software, free and ...
library, handling basic rendering such as drawing primitives,
raster graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
(bitmaps), cursors,
font In metal typesetting, a font is a particular size, weight and style of a ''typeface'', defined as the set of fonts that share an overall design. For instance, the typeface Bauer Bodoni (shown in the figure) includes fonts " Roman" (or "regul ...
s, as well as window events and drag-and-drop functionality. Like GTK Scene Graph Kit (GSK), GDK is part of GTK and licensed under the GNU Lesser General Public License (LGPL).


Software architecture

GTK is implemented on top of an abstraction layer called GDK, freeing GTK from low-level concerns like input gathering,
drag and drop In computer graphical user interfaces, drag and drop is a pointing device gesture in which the user (computing), user selects a virtual object by "grabbing" it and dragging it to a different location or onto another virtual object. In general, i ...
, and pixel format conversion. GDK is an intermediate layer which separates GTK from the details of the windowing system. GDK is an important part of GTK's portability. Since low-level cross-platform functionality is already provided by GLib, all that is needed to make GTK run on other platforms is to port GDK to the underlying
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
's graphics layer. Hence, the GDK ports to the Windows API and
Quartz Quartz is a hard, crystalline mineral composed of silica (silicon dioxide). The Atom, atoms are linked in a continuous framework of SiO4 silicon–oxygen Tetrahedral molecular geometry, tetrahedra, with each oxygen being shared between two tet ...
are what enable GTK applications to run on
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
and
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
, respectively. Starting with GTK+ 2.8, GDK supports
Cairo Cairo ( ; , ) is the Capital city, capital and largest city of Egypt and the Cairo Governorate, being home to more than 10 million people. It is also part of the List of urban agglomerations in Africa, largest urban agglomeration in Africa, L ...
, which is recommended for use with GTK+ 3 instead of GDK's drawing functions. GDK is an intermediate layer which isolates
GTK GTK (formerly GIMP ToolKit and 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 software, free and ...
from the details of the windowing system. GDK is a thin wrapper around Xlib. The X Window System comes with a low-level library called Xlib. Almost every function in GDK is a very thin wrapper around a corresponding Xlib function; but some of the complexity (and functionality) of Xlib is hidden, to simplify programming and to make GDK easier to port to other windowing systems, such as Wayland or Microsoft Windows. The Xlib functionality provided is mostly that targeted toward applications; for example, many features used solely by
window manager A window manager is system software that controls the placement and appearance of window (computing), windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They ...
s are not exposed in GDK. GDK supports
OpenGL OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
(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-accelerate ...
) for better control of the
graphics pipeline The computer graphics pipeline, also known as the rendering pipeline, or graphics pipeline, is a framework within computer graphics that outlines the necessary procedures for transforming a three-dimensional (3D) scene into a two-dimensional (2 ...
.


GdkFrameClock

GdkFrameClock was added in GTK 3.8 While GTK applications remain mainloop driven (cf. Glib event loop), meaning the application is idle inside this main loop most of the time waiting for an event and then calls the appropriate subroutine when one occurs, GdkFrameClock adds an additional mechanism, which tells the application when to update and repaint a window. The update rate can be synchronized with the monitor refresh rate.


GTK Scene Graph Kit

In its history GDK contained and linked with a couple of different Canvases. * https://wiki.gnome.org/Attic/ProjectRidley/CanvasOverview ** https://wiki.gnome.org/Attic/ProjectRidley/CanvasOverview/Canvases * https://wiki.gnome.org/Projects/GooCanvas Developers were also considering new directions for the library, including removing deprecated
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
components and adding an integrated scene graph (canvas) system, similar to the Clutter graphics library, effectively integrating GTK with
OpenGL OpenGL (Open Graphics Library) is a Language-independent specification, cross-language, cross-platform application programming interface (API) for rendering 2D computer graphics, 2D and 3D computer graphics, 3D vector graphics. The API is typic ...
and Vulkan. * GTK Scene Graph Kit (GSK) GTK+ Scene Graph Kit (GSK) was released as part of GTK+ 3.90 in March 2017. It is the scene graph and rendering API for GTK. GSK has not been further integrated with GDK (which is also part of GTK) but is kept in its own directory.


Windowing systems

GDK contains back-ends to a couple of windowing systems, namely to the X11 and Wayland protocols, to
Quartz Quartz is a hard, crystalline mineral composed of silica (silicon dioxide). The Atom, atoms are linked in a continuous framework of SiO4 silicon–oxygen Tetrahedral molecular geometry, tetrahedra, with each oxygen being shared between two tet ...
and GDI, and even to the Hypertext Transfer Protocol (HTTP) engine Broadway. With the release of GNOME 3.16 in March 2015, GDK obtained an experimental back-end for the Mir display server protocol. The Mir display server protocol is a product by Canonical for their
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
distribution of Linux, which they intend to compete with the Wayland display server protocol; so far, it is implemented only in Ubuntu. At present, no back-end exists for KMS. The environment variable ''GDK_BACKEND'' can be used to start an application and force this instance of it to use a certain windowing system:
GDK_BACKEND=wayland gnome-calculator
GDK_BACKEND=wayland CLUTTER_BACKEND=wayland cheese


gdk-pixbuf

gdk-pixbuf is a toolkit for image loading and pixel buffer manipulation. The library provides image loading and saving facilities, fast scaling and compositing of pixbufs, simple animation loading (i.e. animated GIFs), and rendering the libart image buffer to a GdkDrawable instance. gdk-pixbuf has a fairly large API. The fundamental structure in the gdk-pixbuf library is GdkPixbuf, a private, opaque data structure that mirrors many of the same concepts that ArtPixBuf supports. In fact, most of GdkPixbuf's private data fields have the same names and data types as the corresponding ones in ArtPixBuf. This similarity dates back to the earlier days when gdk-pixbuf was a wrapper around libart. Since that time, the libart dependency has been stripped out, and gdk-pixbuf was merged into the GTK+ 2.0 code base. As such, gdk-pixbuf's days as a standalone library are limited to the GNOME 1 release. With the release of GTK+ 2.22 on 2010-09-23, gdk-pixbuf has been turned back into a standalone library, after being shipped as part of GTK+ since gtk+ 2.0. This was done in preparation for the transition to GTK+ 3. * https://git.gnome.org/browse/gdk-pixbuf/ The first stand-alone release wa
2.22
on 2010-Sep-21, its development started wit

on 2010-06-23.


History

GDK was originally developed on 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 originated as part of Project Athena at Massachusetts Institute of Technology (MIT) in 1984. The X protocol has been at ...
for the GIMP raster graphics editor.GIMP - A Brief (and Ancient) History of GIMP
/ref>


See also

* Clutter


References


External links


GDK code from release GTK+ 3.19.0

The modern Gtk drawing model
– Alexander Larsson, 2013/11/04
Overview of GTK and its Libraries
- The GTK Project * https://git.gnome.org/browse/gtk-web/plain/images/architecture.svg {{DEFAULTSORT:Gdk Graphics libraries GTK