Initial packaging to sync OBS with git/gerrit
[profile/ivi/gtk3.git] / docs / reference / gtk / x11.sgml
1 <?xml version="1.0"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3                "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
4 ]>
5 <refentry id="gtk-x11">
6 <refmeta>
7 <refentrytitle>Using GTK+ on the X Window System</refentrytitle>
8 <manvolnum>3</manvolnum>
9 <refmiscinfo>GTK Library</refmiscinfo>
10 </refmeta>
11
12 <refnamediv>
13 <refname>Using GTK+ on the X Window System</refname>
14 <refpurpose>
15 X11-specific aspects of using GTK+
16 </refpurpose>
17 </refnamediv>
18
19 <refsect1>
20 <title>GTK+ for the X Window System</title>
21
22 <para>
23 On UNIX, the X backend is the default build for GTK+.
24 So you don't need to do anything special when compiling it,
25 and everything should "just work."
26 </para>
27
28 <para>
29 To mix low-level Xlib routines into a GTK program,
30 see <link linkend="gdk-X-Window-System-Interaction">GDK X Window
31 System interaction</link> in the GDK manual.
32 </para>
33
34 <para>
35 GTK+ includes an cross-process embedding facility in the form of
36 the #GtkSocket and #GtkPlug widgets. These are X11-specific, and
37 you have to include the <filename>gtk/gtkx.h</filename> header
38 to use them.
39 </para>
40
41 <refsect2 id="x11-cmdline">
42 <title>X11-specific commandline options</title>
43
44 <para>
45 The X backend understands some additional command line arguments.
46 </para>
47
48 <formalpara>
49 <title><systemitem>--display <replaceable>display</replaceable></systemitem></title>
50
51 <para>
52 The name of the X display to open instead of the one specified
53 in the <envar>DISPLAY</envar> environment variable.
54 </para>
55 </formalpara>
56
57 </refsect2>
58
59 </refsect1>
60
61 <refsect1 id="gtk-X11-arch">
62 <title>Understanding the X11 architecture</title>
63
64 <para>
65 People coming from a Windows or MacOS background often find certain
66 aspects of the X Window System surprising. This section introduces
67 some basic X concepts at a high level. For more details, the book most
68 people use is called the <citetitle pubwork="book">Xlib Programming
69 Manual</citetitle> by Adrian Nye; this book is volume one in the
70 O'Reilly X Window System series.
71 </para>
72 <para>
73 Standards are another important resource if you're poking in low-level
74 X11 details, in particular the ICCCM and the Extended Window Manager
75 Hints specifications. <ulink
76 url="http://www.freedesktop.org/standards/">freedesktop.org</ulink>
77 has links to many relevant specifications.
78 </para>
79 <para>
80 The GDK manual covers <link
81 linkend="gdk-X-Window-System-Interaction">using Xlib in a GTK
82 program</link>.
83 </para>
84
85 <refsect2>
86 <title>Server, client, window manager</title>
87
88 <para>
89 Other window systems typically put all their functionality in the
90 application itself. With X, each application involves three different
91 programs: the <firstterm>X server</firstterm>, the application (called
92 a <firstterm>client</firstterm> because it's a client of the X
93 server), and a special client called the <firstterm>window
94 manager</firstterm>.
95 </para>
96
97 <para>
98 The X server is in charge of managing resources, processing drawing
99 requests, and dispatching events such as keyboard and mouse events to
100 interested applications. So client applications can ask the X server
101 to create a window, draw a circle, or move windows around.
102 </para>
103
104 <para>
105 The window manager is in charge of rendering the frame or borders
106 around windows; it also has final say on the size of each window,
107 and window states such as minimized, maximized, and so forth.
108 On Windows and MacOS the application handles most of this.
109 On X11, if you wish to modify the window's state, or 
110 change its frame, you must ask the window manager to do so on your
111 behalf, using an established  <ulink
112 url="http://www.freedesktop.org/standards/">convention</ulink>.
113 </para>
114
115 <para>
116 GTK+ has functions for asking the window manager to do various things;
117 see for example <link
118 linkend="gtk-window-iconify">gtk_window_iconify()</link> or <link
119 linkend="gtk-window-maximize">gtk_window_maximize()</link> or <link
120 linkend="gtk-window-set-decorated">gtk_window_set_decorated()</link>.
121 Keep in mind that <link
122 linkend="gtk-window-move">gtk_window_move()</link> and window sizing
123 are ultimately controlled by the window manager as well and most
124 window managers <emphasis>will</emphasis> ignore certain requests from
125 time to time, in the interests of good user interface.
126 </para>
127
128 <!--
129 May also want to explain DESKTOP_STARTUP_ID here. 
130 http://www.freedesktop.org/Standards/startup-notification-spec
131 -->
132
133 </refsect2>
134
135 </refsect1>
136
137 </refentry>