|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/gdk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>General</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="reference.html" title="API Reference">
<link rel="next" href="multihead.html" title="Multi-head Support Overview">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="reference.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="multihead.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2848467" class="shortcut">Top</a>
 | 
<a href="#id2888523" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-General"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2848467"></a><span class="refentrytitle">General</span>
</h2>
<p>General — Library initialization and miscellaneous functions</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
void <a href="gdk-General.html#gdk-init">gdk_init</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-General.html#gdk-init-check">gdk_init_check</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);
void <a href="gdk-General.html#gdk-parse-args">gdk_parse_args</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);
const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="gdk-General.html#gdk-get-display-arg-name">gdk_get_display_arg_name</a> (void);
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="gdk-General.html#gdk-set-locale">gdk_set_locale</a> (void);
void <a href="gdk-General.html#gdk-set-sm-client-id">gdk_set_sm_client_id</a> (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *sm_client_id);
void <a href="gdk-General.html#gdk-exit">gdk_exit</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> error_code);
void <a href="gdk-General.html#gdk-notify-startup-complete">gdk_notify_startup_complete</a> (void);
const char* <a href="gdk-General.html#gdk-get-program-class">gdk_get_program_class</a> (void);
void <a href="gdk-General.html#gdk-set-program-class">gdk_set_program_class</a> (const char *program_class);
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* <a href="gdk-General.html#gdk-get-display">gdk_get_display</a> (void);
void <a href="gdk-General.html#gdk-flush">gdk_flush</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-General.html#gdk-screen-width">gdk_screen_width</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-General.html#gdk-screen-height">gdk_screen_height</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-General.html#gdk-screen-width-mm">gdk_screen_width_mm</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-General.html#gdk-screen-height-mm">gdk_screen_height_mm</a> (void);
<a href="gdk-General.html#GdkGrabStatus">GdkGrabStatus</a> <a href="gdk-General.html#gdk-pointer-grab">gdk_pointer_grab</a> (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> owner_events,
<a href="gdk-Events.html#GdkEventMask">GdkEventMask</a> event_mask,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *confine_to,
<a href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
enum <a href="gdk-General.html#GdkGrabStatus">GdkGrabStatus</a>;
void <a href="gdk-General.html#gdk-pointer-ungrab">gdk_pointer_ungrab</a> (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-General.html#gdk-pointer-is-grabbed">gdk_pointer_is_grabbed</a> (void);
void <a href="gdk-General.html#gdk-set-double-click-time">gdk_set_double_click_time</a> (<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> msec);
<a href="gdk-General.html#GdkGrabStatus">GdkGrabStatus</a> <a href="gdk-General.html#gdk-keyboard-grab">gdk_keyboard_grab</a> (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> owner_events,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
void <a href="gdk-General.html#gdk-keyboard-ungrab">gdk_keyboard_ungrab</a> (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);
void <a href="gdk-General.html#gdk-beep">gdk_beep</a> (void);
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> <a href="gdk-General.html#gdk-get-use-xshm">gdk_get_use_xshm</a> (void);
void <a href="gdk-General.html#gdk-set-use-xshm">gdk_set_use_xshm</a> (<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> use_xshm);
void <a href="gdk-General.html#gdk-error-trap-push">gdk_error_trap_push</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-General.html#gdk-error-trap-pop">gdk_error_trap_pop</a> (void);
#define <a href="gdk-General.html#GDK-WINDOWING-X11:CAPS">GDK_WINDOWING_X11</a>
#define <a href="gdk-General.html#GDK-WINDOWING-WIN32:CAPS">GDK_WINDOWING_WIN32</a>
#define <a href="gdk-General.html#GDK-WINDOWING-FB:CAPS">GDK_WINDOWING_FB</a>
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2888523"></a><h2>Description</h2>
<p>
This section describes the GDK initialization functions and miscellaneous
utility functions.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2888539"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2888549"></a><h3>
<a name="gdk-init"></a>gdk_init ()</h3>
<a class="indexterm" name="id2888561"></a><pre class="programlisting">void gdk_init (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);</pre>
<p>
Initializes the GDK library and connects to the X server.
If initialization fails, a warning message is output and the application
terminates with a call to <code class="literal">exit(1)</code>.
</p>
<p>
Any arguments used by GDK are removed from the array and <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are
updated accordingly.
</p>
<p>
GTK+ initializes GDK in <a
href="../gtk/gtk-General.html#gtk-init"
><code class="function">gtk_init()</code></a> and so this function is not usually needed
by GTK+ applications.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>argc</code></em> :</span></td>
<td>the number of command line arguments.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>argv</code></em> :</span></td>
<td>the array of command line arguments.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2888670"></a><h3>
<a name="gdk-init-check"></a>gdk_init_check ()</h3>
<a class="indexterm" name="id2888681"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_init_check (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);</pre>
<p>
Initializes the GDK library and connects to the X server, returning <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> on
success.
</p>
<p>
Any arguments used by GDK are removed from the array and <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are
updated accordingly.
</p>
<p>
GTK+ initializes GDK in <a
href="../gtk/gtk-General.html#gtk-init"
><code class="function">gtk_init()</code></a> and so this function is not usually needed
by GTK+ applications.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>argc</code></em> :</span></td>
<td>the number of command line arguments.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>argv</code></em> :</span></td>
<td>the array of command line arguments.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if initialization succeeded.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2888815"></a><h3>
<a name="gdk-parse-args"></a>gdk_parse_args ()</h3>
<a class="indexterm" name="id2888830"></a><pre class="programlisting">void gdk_parse_args (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *argc,
<a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> ***argv);</pre>
<p>
Parse command line arguments, and store for future
use by calls to <a href="GdkDisplay.html#gdk-display-open"><code class="function">gdk_display_open()</code></a>.
</p>
<p>
Any arguments used by GDK are removed from the array and <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are
updated accordingly.
</p>
<p>
You shouldn't call this function explicitely if you are using
<a
href="../gtk/gtk-General.html#gtk-init"
><code class="function">gtk_init()</code></a>, <a
href="../gtk/gtk-General.html#gtk-init-check"
><code class="function">gtk_init_check()</code></a>, <a href="gdk-General.html#gdk-init"><code class="function">gdk_init()</code></a>, or <a href="gdk-General.html#gdk-init-check"><code class="function">gdk_init_check()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>argc</code></em> :</span></td>
<td> the number of command line arguments.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>argv</code></em> :</span></td>
<td> the array of command line arguments.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2888983"></a><h3>
<a name="gdk-get-display-arg-name"></a>gdk_get_display_arg_name ()</h3>
<a class="indexterm" name="id2888998"></a><pre class="programlisting">const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gdk_get_display_arg_name (void);</pre>
<p>
Gets the display name specified in the command line arguments passed
to <a href="gdk-General.html#gdk-init"><code class="function">gdk_init()</code></a> or <a href="gdk-General.html#gdk-parse-args"><code class="function">gdk_parse_args()</code></a>, if any.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the display name, if specified explicitely, otherwise <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>
this string is owned by GTK+ and must not be modified or freed.
</td>
</tr></tbody>
</table></div>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889078"></a><h3>
<a name="gdk-set-locale"></a>gdk_set_locale ()</h3>
<a class="indexterm" name="id2889091"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gdk_set_locale (void);</pre>
<p>
Initializes the support for internationalization by calling the <code class="function"><code class="function">setlocale()</code></code>
system call. This function is called by <a
href="../gtk/gtk-General.html#gtk-set-locale"
><code class="function">gtk_set_locale()</code></a> and so GTK+
applications should use that instead.
</p>
<p>
The locale to use is determined by the <code class="envar">LANG</code> environment variable,
so to run an application in a certain locale you can do something like this:
</p>
<div class="informalexample"><pre class="programlisting">
export LANG="fr"
... run application ...
</pre></div>
<p>
</p>
<p>
If the locale is not supported by X then it is reset to the standard "C"
locale.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the resulting locale.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889179"></a><h3>
<a name="gdk-set-sm-client-id"></a>gdk_set_sm_client_id ()</h3>
<a class="indexterm" name="id2889192"></a><pre class="programlisting">void gdk_set_sm_client_id (const <a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a> *sm_client_id);</pre>
<p>
Sets the <code class="literal">SM_CLIENT_ID</code> property on the application's leader window so that
the window manager can save the application's state using the X11R6 ICCCM
session management protocol.
</p>
<p>
See the X Session Management Library documentation for more information on
session management and the Inter-Client Communication Conventions Manual
(ICCCM) for information on the <code class="literal">WM_CLIENT_LEADER</code> property.
(Both documents are part of the X Window System distribution.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>sm_client_id</code></em> :</span></td>
<td> the client id assigned by the session manager when the
connection was opened, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> to remove the property.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889276"></a><h3>
<a name="gdk-exit"></a>gdk_exit ()</h3>
<a class="indexterm" name="id2889290"></a><pre class="programlisting">void gdk_exit (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> error_code);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_exit</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Exits the application using the <code class="function"><code class="function">exit()</code></code> system call.
</p>
<p>
This routine is provided mainly for backwards compatibility, since it used to
perform tasks necessary to exit the application cleanly. Those tasks are now
performed in a function which is automatically called on exit (via the use
of <a
href="../glib/glib-Miscellaneous-Utility-Functions.html#g-atexit"
><code class="function">g_atexit()</code></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>error_code</code></em> :</span></td>
<td>the error code to pass to the <code class="function"><code class="function">exit()</code></code> call.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889399"></a><h3>
<a name="gdk-notify-startup-complete"></a>gdk_notify_startup_complete ()</h3>
<a class="indexterm" name="id2889414"></a><pre class="programlisting">void gdk_notify_startup_complete (void);</pre>
<p>
Indicates to the GUI environment that the application has finished
loading. If the applications opens windows, this function is
normally called after opening the application's initial set of
windows.
</p>
<p>
GTK+ will call this function automatically after opening the first
<a
href="../gtk/GtkWindow.html"
><span class="type">GtkWindow</span></a> unless <a
href="../gtk/GtkWindow.html#gtk-window-set-auto-startup-notification"
><code class="function">gtk_window_set_auto_startup_notification()</code></a> is called
to disable that feature.</p>
<p>
</p>
<p>Since 2.2
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889471"></a><h3>
<a name="gdk-get-program-class"></a>gdk_get_program_class ()</h3>
<a class="indexterm" name="id2889484"></a><pre class="programlisting">const char* gdk_get_program_class (void);</pre>
<p>
Gets the program class. Unless the program class has explicitly
been set with <a href="gdk-General.html#gdk-set-program-class"><code class="function">gdk_set_program_class()</code></a> or with the <code class="option">--class</code>
commandline option, the default value is the program name (determined
with <a
href="../glib/glib-Miscellaneous-Utility-Functions.html#g-get-prgname"
><code class="function">g_get_prgname()</code></a>) with the first character converted to uppercase.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the program class.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889551"></a><h3>
<a name="gdk-set-program-class"></a>gdk_set_program_class ()</h3>
<a class="indexterm" name="id2889564"></a><pre class="programlisting">void gdk_set_program_class (const char *program_class);</pre>
<p>
Sets the program class. The X11 backend uses the program class to set
the class name part of the <code class="literal">WM_CLASS</code> property on
toplevel windows; see the ICCCM.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>program_class</code></em> :</span></td>
<td>a string.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889619"></a><h3>
<a name="gdk-get-display"></a>gdk_get_display ()</h3>
<a class="indexterm" name="id2889632"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gchar"
>gchar</a>* gdk_get_display (void);</pre>
<p>
Gets the name of the display, which usually comes from the <code class="envar">DISPLAY</code>
environment variable or the <code class="option">--display</code> command line option.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the name of the display.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889677"></a><h3>
<a name="gdk-flush"></a>gdk_flush ()</h3>
<a class="indexterm" name="id2889689"></a><pre class="programlisting">void gdk_flush (void);</pre>
<p>
Flushes the X output buffer and waits until all requests have been processed
by the server. This is rarely needed by applications. It's main use is for
trapping X errors with <a href="gdk-General.html#gdk-error-trap-push"><code class="function">gdk_error_trap_push()</code></a> and <a href="gdk-General.html#gdk-error-trap-pop"><code class="function">gdk_error_trap_pop()</code></a>.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889735"></a><h3>
<a name="gdk-screen-width"></a>gdk_screen_width ()</h3>
<a class="indexterm" name="id2889747"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_screen_width (void);</pre>
<p>
Returns the width of the default screen in pixels.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the width of the default screen in pixels.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889788"></a><h3>
<a name="gdk-screen-height"></a>gdk_screen_height ()</h3>
<a class="indexterm" name="id2889801"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_screen_height (void);</pre>
<p>
Returns the height of the default screen in pixels.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the height of the default screen in pixels.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889841"></a><h3>
<a name="gdk-screen-width-mm"></a>gdk_screen_width_mm ()</h3>
<a class="indexterm" name="id2889854"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_screen_width_mm (void);</pre>
<p>
Returns the width of the default screen in millimeters.
Note that on many X servers this value will not be correct.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the width of the default screen in millimeters,
though it is not always correct.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889896"></a><h3>
<a name="gdk-screen-height-mm"></a>gdk_screen_height_mm ()</h3>
<a class="indexterm" name="id2889910"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_screen_height_mm (void);</pre>
<p>
Returns the height of the default screen in millimeters.
Note that on many X servers this value will not be correct.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the height of the default screen in millimeters,
though it is not always correct.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2889952"></a><h3>
<a name="gdk-pointer-grab"></a>gdk_pointer_grab ()</h3>
<a class="indexterm" name="id2889965"></a><pre class="programlisting"><a href="gdk-General.html#GdkGrabStatus">GdkGrabStatus</a> gdk_pointer_grab (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> owner_events,
<a href="gdk-Events.html#GdkEventMask">GdkEventMask</a> event_mask,
<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *confine_to,
<a href="gdk-Cursors.html#GdkCursor">GdkCursor</a> *cursor,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Grabs the pointer (usually a mouse) so that all events are passed to this
application until the pointer is ungrabbed with <a href="gdk-General.html#gdk-pointer-ungrab"><code class="function">gdk_pointer_ungrab()</code></a>, or
the grab window becomes unviewable.
This overrides any previous pointer grab by this client.
</p>
<p>
Pointer grabs are used for operations which need complete control over mouse
events, even if the mouse leaves the application.
For example in GTK+ it is used for Drag and Drop, for dragging the handle in
the <a
href="../gtk/GtkHPaned.html"
><span class="type">GtkHPaned</span></a> and <a
href="../gtk/GtkVPaned.html"
><span class="type">GtkVPaned</span></a> widgets, and for resizing columns in <a
href="../gtk/GtkCList.html"
><span class="type">GtkCList</span></a>
widgets.
</p>
<p>
Note that if the event mask of an X window has selected both button press and
button release events, then a button press event will cause an automatic
pointer grab until the button is released.
X does this automatically since most applications expect to receive button
press and release events in pairs.
It is equivalent to a pointer grab on the window with <em class="parameter"><code>owner_events</code></em> set to
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a>.
</p>
<p>
If you set up anything at the time you take the grab that needs to be cleaned
up when the grab ends, you should handle the <a href="gdk-Event-Structures.html#GdkEventGrabBroken"><span class="type">GdkEventGrabBroken</span></a> events that
are emitted when the grab ends unvoluntarily.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td>the <a href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> which will own the grab (the grab window).
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>owner_events</code></em> :</span></td>
<td>if <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> then all pointer events are reported with respect to
<em class="parameter"><code>window</code></em> and are only reported if selected by <em class="parameter"><code>event_mask</code></em>. If <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> then pointer
events for this application are reported as normal, but pointer events outside
this application are reported with respect to <em class="parameter"><code>window</code></em> and only if selected by
<em class="parameter"><code>event_mask</code></em>. In either mode, unreported events are discarded.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>event_mask</code></em> :</span></td>
<td>specifies the event mask, which is used in accordance with
<em class="parameter"><code>owner_events</code></em>. Note that only pointer events (i.e. button and motion events)
may be selected.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>confine_to</code></em> :</span></td>
<td>If non-<a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a>, the pointer will be confined to this
window during the grab. If the pointer is outside <em class="parameter"><code>confine_to</code></em>, it will
automatically be moved to the closest edge of <em class="parameter"><code>confine_to</code></em> and enter
and leave events will be generated as necessary.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>cursor</code></em> :</span></td>
<td>the cursor to display while the grab is active. If this is <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> then
the normal cursors are used for <em class="parameter"><code>window</code></em> and its descendants, and the cursor
for <em class="parameter"><code>window</code></em> is used for all other windows.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td>the timestamp of the event which led to this pointer grab. This usually
comes from a <a href="gdk-Event-Structures.html#GdkEventButton"><span class="type">GdkEventButton</span></a> struct, though <a href="gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> can be used if
the time isn't known.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a href="gdk-General.html#GDK-GRAB-SUCCESS:CAPS"><code class="literal">GDK_GRAB_SUCCESS</code></a> if the grab was successful.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2890368"></a><h3>
<a name="GdkGrabStatus"></a>enum GdkGrabStatus</h3>
<a class="indexterm" name="id2890379"></a><pre class="programlisting">typedef enum
{
GDK_GRAB_SUCCESS = 0,
GDK_GRAB_ALREADY_GRABBED = 1,
GDK_GRAB_INVALID_TIME = 2,
GDK_GRAB_NOT_VIEWABLE = 3,
GDK_GRAB_FROZEN = 4
} GdkGrabStatus;
</pre>
<p>
Returned by <a href="gdk-General.html#gdk-pointer-grab"><code class="function">gdk_pointer_grab()</code></a> and <a href="gdk-General.html#gdk-keyboard-grab"><code class="function">gdk_keyboard_grab()</code></a> to indicate
success or the reason for the failure of the grab attempt.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-GRAB-SUCCESS:CAPS"></a><code class="literal">GDK_GRAB_SUCCESS</code></span></td>
<td>the resource was successfully grabbed.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-GRAB-ALREADY-GRABBED:CAPS"></a><code class="literal">GDK_GRAB_ALREADY_GRABBED</code></span></td>
<td>the resource is actively grabbed by another client.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-GRAB-INVALID-TIME:CAPS"></a><code class="literal">GDK_GRAB_INVALID_TIME</code></span></td>
<td>the resource was grabbed more recently than the
specified time.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-GRAB-NOT-VIEWABLE:CAPS"></a><code class="literal">GDK_GRAB_NOT_VIEWABLE</code></span></td>
<td>the grab window or the <em class="parameter"><code>confine_to</code></em> window are not
viewable.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-GRAB-FROZEN:CAPS"></a><code class="literal">GDK_GRAB_FROZEN</code></span></td>
<td>the resource is frozen by an active grab of another client.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2890544"></a><h3>
<a name="gdk-pointer-ungrab"></a>gdk_pointer_ungrab ()</h3>
<a class="indexterm" name="id2890557"></a><pre class="programlisting">void gdk_pointer_ungrab (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Ungrabs the pointer, if it is grabbed by this application.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> a timestamp from a <a href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a>, or <a href="gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> if no
timestamp is available.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2890628"></a><h3>
<a name="gdk-pointer-is-grabbed"></a>gdk_pointer_is_grabbed ()</h3>
<a class="indexterm" name="id2890640"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_pointer_is_grabbed (void);</pre>
<p>
Returns <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the pointer is currently grabbed by this application.
</p>
<p>
Note that this does not take the inmplicit pointer grab on button
presses into account.</p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if the pointer is currently grabbed by this application.*
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2890709"></a><h3>
<a name="gdk-set-double-click-time"></a>gdk_set_double_click_time ()</h3>
<a class="indexterm" name="id2890723"></a><pre class="programlisting">void gdk_set_double_click_time (<a
href="../glib/glib-Basic-Types.html#guint"
>guint</a> msec);</pre>
<p>
Set the double click time for the default display. See
<a href="GdkDisplay.html#gdk-display-set-double-click-time"><code class="function">gdk_display_set_double_click_time()</code></a>.
See also <a href="GdkDisplay.html#gdk-display-set-double-click-distance"><code class="function">gdk_display_set_double_click_distance()</code></a>.
Applications should <span class="emphasis"><em>not</em></span> set this, it is a
global user-configured setting.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>msec</code></em> :</span></td>
<td> double click time in milliseconds (thousandths of a second)
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2890804"></a><h3>
<a name="gdk-keyboard-grab"></a>gdk_keyboard_grab ()</h3>
<a class="indexterm" name="id2890817"></a><pre class="programlisting"><a href="gdk-General.html#GdkGrabStatus">GdkGrabStatus</a> gdk_keyboard_grab (<a href="gdk-Windows.html#GdkWindow">GdkWindow</a> *window,
<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> owner_events,
<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Grabs the keyboard so that all events are passed to this
application until the keyboard is ungrabbed with <a href="gdk-General.html#gdk-keyboard-ungrab"><code class="function">gdk_keyboard_ungrab()</code></a>.
This overrides any previous keyboard grab by this client.
</p>
<p>
If you set up anything at the time you take the grab that needs to be cleaned
up when the grab ends, you should handle the <a href="gdk-Event-Structures.html#GdkEventGrabBroken"><span class="type">GdkEventGrabBroken</span></a> events that
are emitted when the grab ends unvoluntarily.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>window</code></em> :</span></td>
<td>the <a href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> which will own the grab (the grab window).
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>owner_events</code></em> :</span></td>
<td>if <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a> then all keyboard events are reported with respect to
<em class="parameter"><code>window</code></em>. If <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> then keyboard events for this application are reported as
normal, but keyboard events outside this application are reported with respect
to <em class="parameter"><code>window</code></em>. Both key press and key release events are always reported,
independant of the event mask set by the application.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td>a timestamp from a <a href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a>, or <a href="gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> if no timestamp is
available.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a href="gdk-General.html#GDK-GRAB-SUCCESS:CAPS"><code class="literal">GDK_GRAB_SUCCESS</code></a> if the grab was successful.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891020"></a><h3>
<a name="gdk-keyboard-ungrab"></a>gdk_keyboard_ungrab ()</h3>
<a class="indexterm" name="id2891033"></a><pre class="programlisting">void gdk_keyboard_ungrab (<a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> time_);</pre>
<p>
Ungrabs the keyboard, if it is grabbed by this application.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>time_</code></em> :</span></td>
<td> a timestamp from a <a href="gdk-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a>, or <a href="gdk-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a> if no
timestamp is available.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891103"></a><h3>
<a name="gdk-beep"></a>gdk_beep ()</h3>
<a class="indexterm" name="id2891115"></a><pre class="programlisting">void gdk_beep (void);</pre>
<p>
Emits a short beep.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891140"></a><h3>
<a name="gdk-get-use-xshm"></a>gdk_get_use_xshm ()</h3>
<a class="indexterm" name="id2891154"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> gdk_get_use_xshm (void);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_get_use_xshm</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Returns <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if GDK will attempt to use the MIT-SHM shared memory extension.
</p>
<p>
The shared memory extension is used for <a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>, and consequently for
<a href="gdk-GdkRGB.html" title="GdkRGB">GdkRGB</a>.
It enables much faster drawing by communicating with the X server through
SYSV shared memory calls. However, it can only be used if the X client and
server are on the same machine and the server supports it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if use of the MIT shared memory extension will be attempted.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891248"></a><h3>
<a name="gdk-set-use-xshm"></a>gdk_set_use_xshm ()</h3>
<a class="indexterm" name="id2891263"></a><pre class="programlisting">void gdk_set_use_xshm (<a
href="../glib/glib-Basic-Types.html#gboolean"
>gboolean</a> use_xshm);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_set_use_xshm</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Sets whether the use of the MIT shared memory extension should be attempted.
This function is mainly for internal use. It is only safe for an application
to set this to <a
href="../glib/glib-Standard-Macros.html#FALSE:CAPS"
><code class="literal">FALSE</code></a>, since if it is set to <a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> and the server does not
support the extension it may cause warning messages to be output.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>use_xshm</code></em> :</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><code class="literal">TRUE</code></a> if use of the MIT shared memory extension should be attempted.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891356"></a><h3>
<a name="gdk-error-trap-push"></a>gdk_error_trap_push ()</h3>
<a class="indexterm" name="id2891370"></a><pre class="programlisting">void gdk_error_trap_push (void);</pre>
<p>
This function allows X errors to be trapped instead of the normal behavior
of exiting the application. It should only be used if it is not possible to
avoid the X error in any other way.
</p>
<div class="example">
<a name="id2891394"></a><p class="title"><b>Example 1. Trapping an X error</b></p>
<pre class="programlisting">
gdk_error_trap_push ();
/* ... Call the X function which may cause an error here ... */
/* Flush the X queue to catch errors now. */
gdk_flush ();
if (gdk_error_trap_pop ())
{
/* ... Handle the error here ... */
}
</pre>
</div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891418"></a><h3>
<a name="gdk-error-trap-pop"></a>gdk_error_trap_pop ()</h3>
<a class="indexterm" name="id2891431"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_error_trap_pop (void);</pre>
<p>
Removes the X error trap installed with <a href="gdk-General.html#gdk-error-trap-push"><code class="function">gdk_error_trap_push()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the X error code, or 0 if no error occurred.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891479"></a><h3>
<a name="GDK-WINDOWING-X11:CAPS"></a>GDK_WINDOWING_X11</h3>
<a class="indexterm" name="id2891492"></a><pre class="programlisting">#define GDK_WINDOWING_X11
</pre>
<p>
This macro is defined if GDK is configured to use the X backend.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891508"></a><h3>
<a name="GDK-WINDOWING-WIN32:CAPS"></a>GDK_WINDOWING_WIN32</h3>
<a class="indexterm" name="id2891521"></a><pre class="programlisting">#define GDK_WINDOWING_WIN32
</pre>
<p>
This macro is defined if GDK is configured to use the Win32 backend.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2891537"></a><h3>
<a name="GDK-WINDOWING-FB:CAPS"></a>GDK_WINDOWING_FB</h3>
<a class="indexterm" name="id2891550"></a><pre class="programlisting">#define GDK_WINDOWING_FB
</pre>
<p>
This macro is defined if GDK is configured to use the Linux framebuffer backend.
</p>
</div>
</div>
</div>
</body>
</html>