GDK
Original author(s) | GIMP authors |
---|---|
Developer(s) | The GNOME Project |
Stable release | 3.22.2 (9 November 2016[1]) [±] |
Preview release | 3.23.2 (23 November 2016[2]) [±] |
Development status | Active |
Written in | C |
Operating system | Linux, OS X, Microsoft Windows |
Platform | X11, Wayland, others |
Type | Software library |
License | GNU Lesser General Public License (LGPL) |
Website |
developer |
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 drawing primitives, raster graphics (bitmaps), cursors, fonts, as well as window events and drag-and-drop functionality.
Like GTK+, GDK is 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 and pixel format conversion.
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's graphics layer. Hence, the GDK ports to the Windows API and Quartz are what makes GTK+ applications run on Windows and OS X, respectively.
Starting with GTK+ 2.8, GDK supports Cairo which should be used with GTK+ 3 instead of GDK's drawing functions.[3]
GDK is an intermediate layer which isolates GTK+ 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 concealed Xlib functionality will rarely be of interest to application programmers; for example, many features used solely by window managers 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) 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.
Canvas (Scene graph)
In its history GDK contained and linked with a couple of different Canvases.
- https://wiki.gnome.org/Attic/ProjectRidley/CanvasOverview
- https://wiki.gnome.org/Projects/GooCanvas
- GTK+ Scene Graph Kit (GSK)[4]
- Graphene is the forthcoming GTK+ scene graph (canvas) API.[5]
- Pigment
Developers are also considering new directions for the library, including removing deprecated API components and adding an integrated scene graph (canvas) system, similar to the Clutter graphics library, effectively integrating GTK+ with OpenGL.[6][7]
Windowing systems
GDK contains back-ends to a couple of windowing systems, namely to the X11 and Wayland protocols, to Quartz 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.[8] The Mir display server protocol is a product by Canonical for their Ubuntu 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 backend exists for KMS.
GdkPixbuf
GdkPixbuf is a toolkit for image loading and pixel buffer manipulation. In GTK+ version 2.22 from 2010-09-23 GdkPixbuf was split off from GDK into a separate package in preparation for the transition to GTK+ 3.
History
GDK was originally developed on the X Window System for the GIMP raster graphics editor.[9]
See also
References
- ↑ Clasen, Matthias (21 September 2016). "GNOME 3.22". gnome-announce-list (Mailing list). Retrieved 21 September 2016.
- ↑ Clasen, Matthias (21 September 2016). "GNOME 3.22". gnome-announce-list (Mailing list). Retrieved 21 September 2016.
- ↑ Migrating from GTK+ 2.x to GTK+ 3 - Use cairo for drawing
- ↑ "The GTK+ Scene Graph Kit". 2014-07-29.
- ↑ "Graphene". 2014-05-02.
- ↑ Alberto Ruiz's Blog
- ↑ Havoc Pennington's scene graph proposal
- ↑ "add an experimental backend for mir".
- ↑ GIMP - A Brief (and Ancient) History of GIMP
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