GDK
   HOME

TheInfoList



OR:

GDK ( GIMP Drawing Kit) is a
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
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 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 ...
library, handling basic rendering such as drawing primitives, raster graphics (bitmaps),
cursor Cursor may refer to: * Cursor (user interface), an indicator used to show the current position for user interaction on a computer monitor or other display device * Cursor (databases), a control structure that enables traversal over the records in ...
s, fonts, as well as window events and
drag-and-drop In computer graphical user interfaces, drag and drop is a pointing device gesture in which the user selects a virtual object by "grabbing" it and dragging it to a different location or onto another virtual object. In general, it can be used to ...
functionality. Like
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), GDK is part of GTK and licensed under 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).


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 selects a virtual object by "grabbing" it and dragging it to a different location or onto another virtual object. In general, it can be used to ...
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, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
's graphics layer. Hence, the GDK ports to the
Windows API The Windows API, informally WinAPI, is Microsoft's core set of application programming interfaces (APIs) available in the Microsoft Windows operating systems. The name Windows API collectively refers to several different platform implementations th ...
and
Quartz Quartz is a hard, crystalline mineral composed of silica ( silicon dioxide). The atoms are linked in a continuous framework of SiO4 silicon-oxygen tetrahedra, with each oxygen being shared between two tetrahedra, giving an overall chemical ...
are what enable GTK applications to run on
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 ser ...
and
macOS 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 lapt ...
, respectively. Starting with GTK+ 2.8, GDK supports
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 ...
which should be used 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 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 ...
from the details of the
windowing system In computing, a windowing system (or window system) is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP (windows, icons, menus, pointer) paradigm fo ...
. GDK is a thin wrapper around
Xlib Xlib (also known as libX11) is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the ...
. The X Window System comes with a low-level library called
Xlib Xlib (also known as libX11) is an X Window System protocol client library written in the C programming language. It contains functions for interacting with an X server. These functions allow programmers to write programs without knowing the ...
. 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 concealed Xlib functionality will rarely be of interest to application programmers; for example, many features used solely by
window manager A window manager is system software that controls the placement and appearance of windows within a windowing system in a graphical user interface. Most window managers are designed to help provide a desktop environment. They work in conjunctio ...
s are not exposed in GDK. GDK lets you do low level stuff, like e.g. " blit this pixmap to the screen". GDK provides a layer that is much more portable than say the X protocol, without sacrificing any of the low-level accessibility that systems such as X provide. The true power of this abstraction is that if you choose to use it rather than say, X, your software will automatically render on the Linux Framebuffer and Windows. Having OpenGL (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 ...
) support in GDK, facilitates a slightly better control of the graphics pipeline; OpenGL is well suited for compositing textured data but totally unsuited for drawing.


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 and just waits for something to happen and then calls the appropriate subroutine when it does, GdkFrameClock adds an additional mechanism, that gives a "pulse" to the application. It tells the application when to update and repaint a window. The beat 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 way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
components and adding an integrated scene graph (canvas) system, similar to the
Clutter Clutter and its derivations may refer to any of the following: Excessive physical disorder * Clutter, a confusing, or disorderly, state or collection, and possible symptom of compulsive hoarding * Clutter (marketing), numerous advertisements, a ...
graphics library, effectively integrating GTK with OpenGL and
Vulkan Vulkan is a low- overhead, cross-platform API, open standard for 3D graphics and computing. Vulkan targets high-performance real-time 3D graphics applications, such as video games and interactive media. Vulkan is intended to offer higher perfor ...
. *
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) 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 system In computing, a windowing system (or window system) is software that manages separately different parts of display screens. It is a type of graphical user interface (GUI) which implements the WIMP (windows, icons, menus, pointer) paradigm fo ...
s, namely to the
X11 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 ...
and Wayland protocols, to
Quartz Quartz is a hard, crystalline mineral composed of silica ( silicon dioxide). The atoms are linked in a continuous framework of SiO4 silicon-oxygen tetrahedra, with each oxygen being shared between two tetrahedra, giving an overall chemical ...
and
GDI GDI may refer to: Science and technology * Gasoline direct injection, a type of fuel injection * Graphics Device Interface, a component of Microsoft Windows * Guanosine nucleotide dissociation inhibitor, a protein Organisations * Gabriel Dumont I ...
, and even to the
Hypertext Transfer Protocol The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, ...
(HTTP) engine Broadway. With the release of GNOME 3.16 in March 2015, GDK obtained an experimental back-end for the
Mir ''Mir'' (russian: Мир, ; ) was a space station that operated in low Earth orbit from 1986 to 2001, operated by the Soviet Union and later by Russia. ''Mir'' was the first modular space station and was assembled in orbit from 1986 to&n ...
display server protocol. The Mir display server protocol is a product by
Canonical The adjective canonical is applied in many contexts to mean "according to the canon" the standard, rule or primary source that is accepted as authoritative for the body of knowledge or literature in that context. In mathematics, "canonical examp ...
for their
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
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. To start an application and force this instance of it to use a certain windowing system, you specify the variable ''GDK_BACKEND'':
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 GNOME 1 is the first major release of the GNOME desktop environment. Its primary goal was to provide a consistent user-friendly environment in conjunction with the X Window System. It was also a modern and free and open source software alternativ ...
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. The latest release of gdk-pixbuf i

from 2017-Oct-02. The development of 3.36 started wit

on 2016-04-26.


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 provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wi ...
for the GIMP raster graphics editor.GIMP - A Brief (and Ancient) History of GIMP
/ref>


See also

*
Clutter Clutter and its derivations may refer to any of the following: Excessive physical disorder * Clutter, a confusing, or disorderly, state or collection, and possible symptom of compulsive hoarding * Clutter (marketing), numerous advertisements, a ...


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