Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GDK
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Software library}} {{Others|GDK (disambiguation)}} {{Infobox software | name = GTK | title = GDK | logo = | screenshot = GTK+ software architecture.svg | caption = Simplified software architecture of [[GTK]] | collapsible = | author = GIMP authors | developer = [[The GNOME Project]] | released = | programming language = [[C (programming language)|C]] | operating system = [[Linux]], [[macOS]], [[Microsoft Windows]] | platform = [[X Window System core protocol|X11]], [[Wayland (display server protocol)|Wayland]], [[Quartz (graphics layer)|Quartz]] and [[Graphics Device Interface|GDI]] | size = | language = | genre = [[Library (computing)|Software library]] | license = [[GNU Lesser General Public License]] (LGPL) | website = {{URL|https://developer.gnome.org/gdk3/stable/}} }} '''GDK''' ([[GIMP]] Drawing Kit) is a [[Library (computing)|library]] that acts as a [[Wrapper pattern|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 (computer graphics)|rendering]] such as drawing primitives, [[raster graphics]] (bitmaps), [[Cursor (computers)|cursor]]s, [[font]]s, as well as [[Event (computing)|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== [[File:GDK software architecture.svg|thumb|GDK contains back-ends to [[X11]], [[Wayland (display server protocol)|Wayland]], Broadway ([[Hypertext Transfer Protocol|HTTP]]), [[Quartz Compositor|Quartz]] and [[Graphics Device Interface|GDI]] and relies on [[Cairo (graphics)|Cairo]] for the rendering. Its new [[Canvas (GUI)|scene graph (canvas)]] is work-in-progress, its arrival should herald GTK 4.0.]] GTK is implemented on top of an abstraction layer called GDK, freeing GTK from low-level concerns like input gathering, [[drag and drop]], 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]]'s graphics layer. Hence, the GDK ports to the [[Windows API]] and [[Quartz (graphics layer)|Quartz]] are what enable GTK applications to run on [[Microsoft Windows|Windows]] and [[macOS]], respectively. Starting with GTK+ 2.8, GDK supports [[Cairo (graphics)|Cairo]], which is recommended for use with GTK+ 3 instead of GDK's drawing functions.<ref>[https://docs.gtk.org/gtk3/migrating-2to3.html#use-cairo-for-drawing Migrating from GTK+ 2.x to GTK+ 3 - Use cairo for drawing]</ref> 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 (display server protocol)|Wayland]] or Microsoft Windows. The Xlib functionality provided is mostly that targeted toward applications; for example, many features used solely by [[window manager]]s are not exposed in GDK. GDK supports [[OpenGL]] (or [[OpenGL ES]]) for better control of the [[graphics pipeline]]. ===GdkFrameClock=== GdkFrameClock was added in GTK 3.8<ref>{{cite web |url=https://developer.gnome.org/gdk3/stable/GdkFrameClock.html |title=GdkFrameClock}}</ref> While GTK applications remain mainloop driven (cf. [[Event_loop#Glib_event_loop|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.<ref>{{cite web |url=https://blogs.gnome.org/alexl/2013/11/04/the-modern-gtk-drawing-model/ |title=The modern Gtk drawing model |date=2013-11-04 |last=Larsson |first=Alexander}}</ref> The update rate can be synchronized with the monitor refresh rate. ===GTK Scene Graph Kit=== {{Main|GTK Scene Graph Kit}} In its history GDK contained and linked with a couple of different [[Canvas (GUI)|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 [[Application programming interface|API]] components and adding an integrated [[Canvas (GUI)|scene graph (canvas)]] system, similar to the Clutter graphics library, effectively integrating GTK with [[OpenGL]] and [[Vulkan (API)|Vulkan]].<ref>[https://aruiz.typepad.com/siliconisland/2008/03/gtk-hackfest-20.html Alberto Ruiz's Blog]</ref><ref>[https://mail.gnome.org/archives/gtk-devel-list/2008-March/msg00017.html Havoc Pennington's scene graph proposal]</ref> * [[GTK Scene Graph Kit]] (GSK)<ref>{{cite web |url=https://www.bassi.io/articles/2014/07/29/guadec-2014-gsk/ |title=The GTK+ Scene Graph Kit |date=2014-07-29}}</ref><ref>{{cite web |url=https://blogs.gnome.org/ebassi/2014/05/02/graphene/ |title=Graphene |date=2014-05-02}}</ref> 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]]s, namely to the [[X11]] and [[Wayland (display server protocol)|Wayland]] protocols, to [[Quartz Compositor|Quartz]] and [[Graphics Device Interface|GDI]], and even to the [[Hypertext Transfer Protocol]] (HTTP) engine Broadway.{{cn|date=April 2023}} With the release of GNOME 3.16 in March 2015, GDK obtained an experimental back-end for the [[Mir_(software)|Mir]] display server protocol.<ref>{{cite web |url=https://git.gnome.org/browse/gtk+/commit/?id=0f26b26f1d93f002ccd5fe6b6fd636172bfbb24b |title=add an experimental backend for mir}}</ref> The Mir display server protocol is a product by [[Canonical (company)|Canonical]] for their [[Ubuntu (operating system)|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 back-end exists for [[Direct Rendering Manager#Kernel Mode Setting|KMS]].{{cn|date=April 2023}} The environment variable ''GDK_BACKEND'' can be used to start an application and force this instance of it to use a certain windowing system:<br /> <code>GDK_BACKEND=wayland gnome-calculator</code><br /> <code>GDK_BACKEND=wayland CLUTTER_BACKEND=wayland cheese</code> =={{Anchor|GDKPIXBUF}}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 was [https://mail.gnome.org/archives/ftp-release-list/2010-September/msg00119.html 2.22] on 2010-Sep-21, its development started with [https://mail.gnome.org/archives/ftp-release-list/2010-June/msg00171.html 2.21.3] on 2010-06-23. ==History== GDK was originally developed on the [[display server#X|X Window System]] for the GIMP [[raster graphics editor]].<ref>[https://www.gimp.org/about/ancient_history.html GIMP - A Brief (and Ancient) History of GIMP]</ref> ==See also== {{Portal|Free and open-source software}} * Clutter ==References== {{Reflist}} ==External links== * [https://git.gnome.org/browse/gtk+/tree/gdk?h=gtk-3-18 GDK code from release GTK+ 3.19.0] * [https://blogs.gnome.org/alexl/2013/11/04/the-modern-gtk-drawing-model/ The modern Gtk drawing model] β Alexander Larsson, 2013/11/04 * [https://www.gtk.org/overview.php Overview of GTK and its Libraries] {{Webarchive|url=https://web.archive.org/web/20190312022548/https://www.gtk.org/overview.php |date=2019-03-12 }} - The GTK Project * https://git.gnome.org/browse/gtk-web/plain/images/architecture.svg {{GTK}} {{DEFAULTSORT:Gdk}} [[Category:Graphics libraries]] [[Category:GTK]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Cite web
(
edit
)
Template:Cn
(
edit
)
Template:GTK
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main
(
edit
)
Template:Main other
(
edit
)
Template:Others
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)
Template:Webarchive
(
edit
)