Xcomposite.xml revision 4b0ead49
1<?xml version="1.0" encoding="UTF-8" ?>
2<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3            "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" >
4<reference>
5<!--
6 Based on proto/compositeproto/compositeproto.txt
7
8 Conversion to DocBook/XML API documentation is:
9
10 Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
11 
12 Permission is hereby granted, free of charge, to any person obtaining a
13 copy of this software and associated documentation files (the
14 "Software"), to deal in the Software without restriction, including
15 without limitation the rights to use, copy, modify, merge, publish,
16 distribute, and/or sell copies of the Software, and to permit persons
17 to whom the Software is furnished to do so, provided that the above
18 copyright notice(s) and this permission notice appear in all copies of
19 the Software and that both the above copyright notice(s) and this
20 permission notice appear in supporting documentation.
21 
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
25 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26 HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
27 INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
28 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
29 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
30 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31 
32 Except as contained in this notice, the name of a copyright holder
33 shall not be used in advertising or otherwise to promote the sale, use
34 or other dealings in this Software without prior written authorization
35 of the copyright holder.
36
37 -->
38<title>X Composite Extension Library</title>
39
40<refentry id='Xcomposite.man'>
41 <refentryinfo>
42  <productname>__vendorversion__</productname>
43  <pubdate>23 April 2007</pubdate>
44  <authorgroup>
45   <author><firstname>Keith</firstname><surname>Packard</surname>
46	   <contrib>Extension specification and implementation</contrib>
47	   <email>keithp@keithp.com</email>
48   </author>
49   <author><firstname>Deron</firstname><surname>Johnson</surname>
50	   <contrib>Overlay Window specification and implementation</contrib>
51	   <email>deron.johnson@sun.com</email>
52   </author>
53  </authorgroup>
54 </refentryinfo>
55
56 <refmeta>
57  <refentrytitle>Xcomposite</refentrytitle>
58  <manvolnum>__libmansuffix__</manvolnum>
59 </refmeta>
60 <refnamediv>
61  <refname>Xcomposite</refname>
62  <refpurpose>X Composite Extension library</refpurpose>
63 </refnamediv>
64 <refsynopsisdiv><funcsynopsis>
65  <funcsynopsisinfo>#include &lt;X11/extensions/Xcomposite.h&gt;</funcsynopsisinfo>
66  <funcprototype>
67   <funcdef>Bool <function>XCompositeQueryExtension</function></funcdef>
68   <paramdef><type>Display *</type><parameter>dpy</parameter></paramdef>
69   <paramdef>int *<parameter>event_basep</parameter></paramdef>
70   <paramdef>int *<parameter>error_basep</parameter></paramdef>
71  </funcprototype>
72  <funcprototype>
73   <funcdef>Status <function>XCompositeQueryVersion</function></funcdef>
74   <paramdef>Display *<parameter>dpy</parameter></paramdef>
75   <paramdef>int *<parameter>major_versionp</parameter></paramdef>
76   <paramdef>int *<parameter>minor_versionp</parameter></paramdef>
77  </funcprototype>
78  <funcprototype>
79   <funcdef>int <function>XCompositeVersion</function></funcdef>
80   <void />
81  </funcprototype>
82  <funcprototype>
83   <funcdef>void <function>XCompositeRedirectWindow</function></funcdef>
84   <paramdef>Display *<parameter>dpy</parameter></paramdef>
85   <paramdef>Window <parameter>window</parameter></paramdef>
86   <paramdef>int <parameter>update</parameter></paramdef>
87  </funcprototype>
88  <funcprototype>
89   <funcdef>void <function>XCompositeRedirectSubwindows</function></funcdef>
90   <paramdef>Display *<parameter>dpy</parameter></paramdef>
91   <paramdef>Window <parameter>window</parameter></paramdef>
92   <paramdef>int <parameter>update</parameter></paramdef>
93  </funcprototype>
94  <funcprototype>
95   <funcdef>void <function>XCompositeUnredirectWindow</function></funcdef>
96   <paramdef>Display *<parameter>dpy</parameter></paramdef>
97   <paramdef>Window <parameter>window</parameter></paramdef>
98   <paramdef>int <parameter>update</parameter></paramdef>
99  </funcprototype>
100  <funcprototype>
101   <funcdef>void <function>XCompositeUnredirectSubwindows</function></funcdef>
102   <paramdef>Display *<parameter>dpy</parameter></paramdef>
103   <paramdef>Window <parameter>window</parameter></paramdef>
104   <paramdef>int <parameter>update</parameter></paramdef>
105  </funcprototype>
106  <funcprototype>
107   <funcdef>XserverRegion <function>XCompositeCreateRegionFromBorderClip</function></funcdef>
108   <paramdef>Display *<parameter>dpy</parameter></paramdef>
109   <paramdef>Window <parameter>window</parameter></paramdef>
110  </funcprototype>
111  <funcprototype>
112   <funcdef>Pixmap <function>XCompositeNameWindowPixmap</function></funcdef>
113   <paramdef>Display *<parameter>dpy</parameter></paramdef>
114   <paramdef>Window <parameter>window</parameter></paramdef>
115  </funcprototype>
116  <funcprototype>
117   <funcdef>Window <function>XCompositeGetOverlayWindow</function></funcdef>
118   <paramdef>Display *<parameter>dpy</parameter></paramdef>
119   <paramdef>Window <parameter>window</parameter></paramdef>
120  </funcprototype>
121  <funcprototype>
122   <funcdef>void <function>XCompositeReleaseOverlayWindow</function></funcdef>
123   <paramdef>Display *<parameter>dpy</parameter></paramdef>
124   <paramdef>Window <parameter>window</parameter></paramdef>
125  </funcprototype>
126 </funcsynopsis></refsynopsisdiv>
127
128<refsect1><title>Description</title>
129<para>
130The composite extension provides several related mechanisms:
131 <variablelist>
132  <varlistentry>
133   <term>Per-hierarchy storage</term>
134   <listitem><para>
135	The rendering of an entire hierarchy of windows
136 	is redirected to off-screen storage. The pixels of that hierarchy
137	are available whenever it is viewable. Storage is automatically
138	reallocated when the top level window changes size. Contents beyond
139	the geometry of the top window are not preserved.
140   </para></listitem>
141  </varlistentry>
142  <varlistentry>
143   <term>Automatic shadow update</term>
144   <listitem><para>
145 	When a hierarchy is rendered off-screen,
146 	the X server provides an automatic mechanism for presenting those
147	contents within the parent window. The implementation is free to
148	make this update lag behind actual rendering operations by an
149	unspecified amount of time. This automatic update mechanism may
150	be disabled so that the parent window contents can be completely
151	determined by an external application.
152   </para></listitem>
153  </varlistentry>
154  <varlistentry>
155   <term>Composite Overlay Window</term>
156   <listitem><para>
157	Version 0.3 of the protocol adds the Composite Overlay Window, which
158	provides compositing managers with a surface on which to draw without
159	interference. This window is always above normal windows and is always
160	below the screen saver window. It is an InputOutput window whose width
161	and height are the screen dimensions. Its visual is the root visual
162	and its border width is zero.  Attempts to redirect it using the
163	composite extension are ignored.  This window does not appear in the
164	reply of the QueryTree request. It is also an override redirect window.
165	These last two features make it invisible to window managers and other
166	X11 clients. The only way to access the XID of this window is via the
167	CompositeGetOverlayWindow request. Initially, the Composite Overlay
168	Window is unmapped.
169   </para></listitem>
170  </varlistentry>
171  <varlistentry>
172   <term>Parent window clipping</term>
173   <listitem><para>
174	Version 0.4 of the protocol modifies the semantics of parent window
175	clipping in the presence of manual redirected children. With this
176	version, the area in the parent covered by manual redirected
177	children is left in the parent clip list instead of being removed as
178	in older versions.
179   </para></listitem>
180  </varlistentry>
181 </variablelist>
182</para>
183<para>
184Per-hierarchy storage may be created for individual windows or for all
185children of a window. Manual shadow update may be selected by only a single
186application for each window; manual update may also be selected on a
187per-window basis or for each child of a window. Detecting when to update
188may be done with the Damage extension.
189</para>
190<para>
191The off-screen storage includes the window contents, its borders and the
192contents of all descendants.
193</para>
194</refsect1>
195<refsect1><title>Arguments</title>
196<para>
197 <variablelist>
198  <varlistentry>
199   <term><parameter>display</parameter></term>
200   <listitem><para>
201    Pointer to the <type>Display</type> structure returned from 
202    <function>XOpenDisplay</function> for the connection to the X server.
203   </para></listitem>
204  </varlistentry>
205  <varlistentry>
206   <term><parameter>event_basep</parameter></term>
207   <listitem><para>
208    Pointer to integer where the base value for Composite Extension events
209    will be stored.
210   </para></listitem>
211  </varlistentry>
212  <varlistentry>
213   <term><parameter>error_basep</parameter></term>
214   <listitem><para>
215    Pointer to integer where the base value for Composite Extension errors
216    will be stored.
217   </para></listitem>
218  </varlistentry>
219  <varlistentry>
220   <term><parameter>major_versionp</parameter></term>
221   <listitem><para>
222    Pointer to integer where the major version of the Composite Extension
223    supported by the X server will be stored.
224   </para></listitem>
225  </varlistentry>
226  <varlistentry>
227   <term><parameter>minor_versionp</parameter></term>
228   <listitem><para>
229    Pointer to integer where the minor version of the Composite Extension
230    supported by the X server will be stored.
231   </para></listitem>
232  </varlistentry>
233  <varlistentry>
234   <term><parameter>window</parameter></term>
235   <listitem><para>
236    Specifies the window ID to operate on.
237   </para></listitem>
238  </varlistentry>
239  <varlistentry>
240   <term><parameter>update</parameter></term>
241   <listitem><para>
242    Specifies the mode for updating the window contents.   Must be either
243    <constant>CompositeRedirectAutomatic</constant> or
244    <constant>CompositeRedirectManual</constant>.
245   </para></listitem>
246  </varlistentry>
247 </variablelist>
248</para></refsect1>
249<refsect1><title>Functions</title>
250<para>
251 <variablelist>
252  <varlistentry>
253   <term><function>XCompositeQueryExtension</function></term>
254   <listitem><para>
255    <function>XCompositeQueryExtension</function> determines if the 
256    Composite Extension is available on the given display.   It returns 
257    <constant>True</constant> if the extension is supported, otherwise 
258    <constant>False</constant>.   If the extension is present, the base 
259    values for events and errors are returned, and can be used to 
260    decode incoming event and error values.
261   </para></listitem>
262  </varlistentry>
263  <varlistentry>
264   <term><function>XCompositeQueryVersion</function></term>
265   <listitem><para>
266    <function>XCompositeQueryVersion</function> determines if the X Server
267    supports a version of the X Composite Extension which is compatible 
268    with the client library. A non-zero Status is returned if a compatible
269    version of the extension is supported, otherwise a zero Status is returned.
270    If the extension is supported, the major and minor version numbers are 
271    returned to indicate the level of Composite Extension support.
272    No other XComposite functions (except XCompositeQueryExtension) may be 
273    called before this function.  If a client violates this  rule, the
274    effects of all subsequent XComposite calls that it makes are undefined.
275   </para></listitem>
276  </varlistentry>
277  <varlistentry>
278   <term><function>XCompositeVersion</function></term>
279   <listitem><para>
280    <function>XCompositeVersion</function> returns the version of the 
281    X Composite library.   The version number is encoded as:
282    <blockquote><para><code language="C">
283     (major * 10000) + (minor * 100) + revision
284    </code></para></blockquote>
285   </para>
286   <para>
287    For example, version 1.4.6 would be encoded as the integer 10406.
288   </para></listitem>
289  </varlistentry>
290  <varlistentry>
291   <term><function>XCompositeRedirectWindow</function></term>
292   <listitem><para>
293	<function>XCompositeRedirectWindow</function> requests the X server 
294	to direct the hierarchy starting at <parameter>window</parameter> to 
295	off-screen storage. 
296        The <parameter>update</parameter> argument specifies whether 
297        the contents are mirrored to the parent window automatically or not.
298        Only one client at a time may specify an update type of 
299	<constant>CompositeRedirectManual</constant>, another attempt will 
300	result in a <errorname>BadAccess</errorname> error.  When all clients 
301        enabling redirection terminate, the redirection will automatically be
302        disabled.
303   </para><para>
304	The root window may not be redirected. Doing so results in a 
305	<errorname>BadMatch</errorname>	error.  Specifying an invalid
306        window id will result in a <errorname>BadWindow</errorname> error.
307   </para></listitem>
308  </varlistentry>
309  <varlistentry>
310   <term><function>XCompositeRedirectSubwindows</function></term>
311   <listitem><para>
312	<function>XCompositeRedirectSubwindows</function> requests the X 
313	server to redirect hierarchies starting at all current and future 
314	children of <parameter>window</parameter> as in 
315	<function>XCompositeRedirectWindow</function>. 
316	If <parameter>update</parameter> is 
317	<constant>CompositeRedirectManual</constant>, then painting of the 
318	window background during window manipulation and ClearArea requests 
319	is inhibited.
320   </para></listitem>
321  </varlistentry>
322  <varlistentry>
323   <term><function>XCompositeUnredirectWindow</function></term>
324   <listitem><para>
325	<function>XCompositeUnredirectWindow</function> requests the X 
326	server to terminate redirection of <parameter>window</parameter>.
327	If the specified window was not selected for redirection by the
328	current client, a <errorname>BadValue</errorname> error results.
329   </para></listitem>
330  </varlistentry>
331  <varlistentry>
332   <term><function>XCompositeUnredirectSubwindows</function></term>
333   <listitem><para>
334	<function>XCompositeUnredirectWindow</function> requests the X 
335	server to terminate redirection of all children of
336	<parameter>window</parameter>.
337	If the specified window was not selected for sub-redirection by the
338	current client, a <errorname>BadValue</errorname> error results.
339   </para></listitem>
340  </varlistentry>
341  <varlistentry>
342   <term><function>XCompositeCreateRegionFromBorderClip</function></term>
343   <listitem><para>
344	<function>XCompositeCreateRegionFromBorderClip</function>
345	creates a region containing the "usual" border clip
346	value; that is the area of the window clipped against siblings and
347	the parent. This region can be used to restrict rendering to
348	suitable areas while updating only a single window. The region
349	is copied at the moment the request is executed; future changes
350	to the window hierarchy will not be reflected in this region.
351   </para></listitem>
352  </varlistentry>
353  <varlistentry>
354   <term><function>XCompositeNameWindowPixmap</function></term>
355   <listitem><para>
356	<function>XCompositeNameWindowPixmap</function> creates and returns
357	a pixmap id that serves as a reference to the off-screen storage for
358	<parameter>window</parameter>. This pixmap will remain allocated 
359	until freed, even if the window is unmapped, reconfigured or 
360	destroyed. However, the window will get a new pixmap allocated each 
361	time it is mapped or resized, so this function will need to be 
362	reinvoked for the client to continue to refer to the storage holding
363	the current window contents. Generates a 
364	<errorname>BadMatch</errorname>	error if <parameter>window</parameter>
365	is not redirected or is not visible.
366   </para><para>
367        The X server must support at least version 0.2 of the Composite
368	Extension for <function>XCompositeNameWindowPixmap</function>.
369   </para></listitem>
370  </varlistentry>
371  <varlistentry>
372   <term><function>XCompositeGetOverlayWindow</function></term>
373   <listitem><para>
374    <function>XCompositeGetOverlayWindow</function> returns the window ID
375    of the Composite Overlay Window for 
376    the screen specified by the argument <parameter>window</parameter>. 
377    This function notifies the X server that the client wishes to use 
378    the Composite Overlay Window of this screen. If this 
379    Composite Overlay Window has not yet been mapped, it is mapped by this 
380    request.
381   </para><para>
382    The Composite Overlay Window for a particular screen will be 
383    unmapped when all clients who have called this function have 
384    either called <function>XCompositeReleaseOverlayWindow</function>
385    for that screen, or terminated their connection to the X server.
386   </para><para>
387    The X server must support at least version 0.3 of the Composite
388    Extension for <function>XCompositeGetOverlayWindow</function>.
389   </para></listitem>
390  </varlistentry>
391  <varlistentry>
392   <term><function>XCompositeReleaseOverlayWindow</function></term>
393   <listitem><para>
394    This request specifies that the client is no longer using the 
395    Composite Overlay Window on the screen specified by the 
396    argument <parameter>window</parameter>. A screen&apos;s Composite 
397    Overlay Window is unmapped when there are no longer any clients using it.
398   </para><para>
399    The X server must support at least version 0.3 of the Composite
400    Extension for <function>XCompositeReleaseOverlayWindow</function>.
401   </para></listitem>
402  </varlistentry>
403 </variablelist>
404</para>
405</refsect1>
406</refentry>
407</reference>
408