<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" id="tech-gdk" xml:lang="ca">
<info>
  <link type="guide" xref="tech" group="gdk"/>
  <desc>Low-level abstraction for the windowing system</desc>
  <revision pkgversion="3.0" date="2011-04-05" status="candidate"/>
</info>

<title>GDK</title>

  <p>GDK is the low-level library used by <link xref="tech-gtk">GTK+</link> to
  interact with the windowing system for graphics and input devices. Although
  you will rarely use GDK directly in application code, it contains all the
  necessary functionality to create low-level windows in the the screen and to
  interact with the user with various input devices. GDK acts as an abstraction
  over various windowing systems, so that GTK+ can be portable to all of them:
  the X Window System (X11), Microsoft Windows, Mac OS X Quartz.</p>

<p>GDK enables you to access events from keyboards, mice, and other
input devices.  Implementations of widgets in GTK+ use this functionality, and
translate the events into higher-level signals that can in turn be used from
application code.  For example, a <code>GtkButton</code> widget will track
<code>GDK_BUTTON_PRESS</code> and <code>GTK_BUTTON_RELEASE</code> events,
which come from the mouse, and translate them as appropriate into a
<code>GtkButton::clicked</code> signal when the user presses and releases
the button in the right location.</p>

<p>GDK also provides low-level routines to access drag and drop
and clipboard data from the system.  When implementing custom controls,
you may need to access these features to implement proper user interaction
behavior.</p>

<p>La GDK altres funcions necessàries per la creació d'un conjunt d'eines gràfiques com la GTK+. Com que la GDK serveix com a capa d'abstracció de la plataforma, i d'aquesta manera la GTK+ pot córrer en múltiples entorns, proporciona una API per a totes les funcions del sistema que necessita la GTK+. Això inclou informació sobre les pantalles, la seva resolució i profunditat de color, els mapes de colors i els cursors.</p>

  <p>You should use GDK whenever you need low-level access to the underlying
  windowing system, including low-level access to events, windows, and the
  clipboard. Using GDK for these tasks ensures that your code is portable and
  integrates with the rest of your GTK+ code. The simple drawing routines in
  GDK should generally not be used; these are a left-over from when GDK simply
  wrapped the windowing system's drawing primitives. Instead, you should use
  the extensive functionality provided by <link xref="tech-cairo">Cairo</link>
  to draw high-quality 2D graphics.</p>

<list style="compact">
  <item><p><link href="http://library.gnome.org/devel/gdk/stable/">GDK Reference Manual</link></p></item>
</list>
</page>
