1e8a5466aSmrg<?xml version="1.0" encoding="UTF-8" ?>
2a5602400Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3af9a7ee5Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
4af9a7ee5Smrg[
5af9a7ee5Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs;
6af9a7ee5Smrg]>
7e8a5466aSmrg
8e8a5466aSmrg<!-- lifted from troff+ms+XMan by doclifter -->
9e8a5466aSmrg<book id="shapelib">
10e8a5466aSmrg
11e8a5466aSmrg<bookinfo>
12e8a5466aSmrg   <title>X Nonrectangular Window Shape Extension Library</title>
13e8a5466aSmrg   <subtitle>X Consortium Standard</subtitle>
14af9a7ee5Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
15af9a7ee5Smrg   <releaseinfo>Version 1.0</releaseinfo>
16e8a5466aSmrg   <authorgroup>
17e8a5466aSmrg      <author>
18e8a5466aSmrg         <firstname>Keith</firstname><surname>Packard</surname>
19af9a7ee5Smrg         <affiliation><orgname>MIT X Consortium</orgname></affiliation>
20e8a5466aSmrg      </author>
21e8a5466aSmrg   </authorgroup>
22e8a5466aSmrg   <copyright><year>1989</year><holder>X Consortium</holder></copyright>
23e8a5466aSmrg
24e8a5466aSmrg<legalnotice>
25e8a5466aSmrg
26e8a5466aSmrg<para>
27e8a5466aSmrgPermission is hereby granted, free of charge, to any person obtaining a copy
28e8a5466aSmrgof this software and associated documentation files
29e8a5466aSmrg(the &ldquo;Software&rdquo;), to deal in the Software without restriction,
30e8a5466aSmrgincluding without limitation the rights to use, copy, modify, merge,
31e8a5466aSmrgpublish, distribute, sublicense, and/or sell copies of the Software, and
32e8a5466aSmrgto permit persons to whom the Software is furnished to do so, subject to
33e8a5466aSmrgthe following conditions:
34e8a5466aSmrg</para>
35e8a5466aSmrg
36e8a5466aSmrg<para>
37e8a5466aSmrgThe above copyright notice and this permission notice shall be included in
38e8a5466aSmrgall copies or substantial portions of the Software.
39e8a5466aSmrg</para>
40e8a5466aSmrg
41e8a5466aSmrg<para>
42e8a5466aSmrgTHE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY
43e8a5466aSmrgKIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
44e8a5466aSmrgOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45e8a5466aSmrgIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
46e8a5466aSmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
47e8a5466aSmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
48e8a5466aSmrgOTHER DEALINGS IN THE SOFTWARE.
49e8a5466aSmrg</para>
50e8a5466aSmrg
51e8a5466aSmrg<para>
52e8a5466aSmrgExcept as contained in this notice, the name of the X Consortium shall not be
53e8a5466aSmrgused in advertising or otherwise to promote the sale, use or other dealings
54e8a5466aSmrgin this Software without prior written authorization from the X Consortium.
55e8a5466aSmrg</para>
56af9a7ee5Smrg<para>X Window System is a trademark of The OpenGroup.</para>
57e8a5466aSmrg</legalnotice>
58e8a5466aSmrg</bookinfo>
59e8a5466aSmrg
60e8a5466aSmrg<chapter id='overview'>
61e8a5466aSmrg<title>Overview</title>
62e8a5466aSmrg
63e8a5466aSmrg<para>This extension provides arbitrary window and border shapes within
64e8a5466aSmrgthe X11 protocol.
65e8a5466aSmrg</para>
66e8a5466aSmrg
67e8a5466aSmrg<para>
68e8a5466aSmrgThe restriction of rectangular windows within the X protocol is a significant
69e8a5466aSmrglimitation in the implementation of many styles of user interface.  For
70e8a5466aSmrgexample, many transient windows would like to display a
71e8a5466aSmrg&ldquo;drop shadow&rdquo; to give the illusion of 3 dimensions.  As
72e8a5466aSmrganother example, some user interface style guides call for buttons with
73e8a5466aSmrgrounded corners; the full simulation of a nonrectangular shape,
74e8a5466aSmrgparticularly with respect to event distribution and cursor shape, is not
75e8a5466aSmrgpossible within the core X protocol.  As a final example, round clocks
76e8a5466aSmrgand nonrectangular icons are desirable visual addition to the desktop.
77e8a5466aSmrg</para>
78e8a5466aSmrg
79e8a5466aSmrg<para>
80e8a5466aSmrgThis extension provides mechanisms for changing the visible shape of a
81e8a5466aSmrgwindow to an arbitrary, possibly disjoint, nonrectangular form.  The intent
82e8a5466aSmrgof the extension is to supplement the existing semantics, not replace them.
83e8a5466aSmrgIn particular, it is desirable for clients that are unaware of the
84e8a5466aSmrgextension to still be able to cope reasonably with shaped windows.  For
85e8a5466aSmrgexample, window managers should still be able to negotiate screen
86e8a5466aSmrgreal estate in rectangular pieces.  Toward this end, any shape specified for
87e8a5466aSmrga window is clipped by the bounding rectangle for the window as specified by
88e8a5466aSmrgthe window's geometry in the core protocol.  An expected convention would be
89e8a5466aSmrgthat client programs expand their shape to fill the area offered by the
90e8a5466aSmrgwindow manager.
91e8a5466aSmrg</para>
92e8a5466aSmrg</chapter>
93e8a5466aSmrg
94e8a5466aSmrg<chapter id='description'>
95e8a5466aSmrg<title>Description</title>
96e8a5466aSmrg
97e8a5466aSmrg<para>
98e8a5466aSmrgEach window (even with no shapes specified) is defined by two regions:  the
99af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='bounding_region'>bounding region</olink>
100af9a7ee5Smrgand the
101af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='clip_region'>clip region</olink>.
102af9a7ee5SmrgThe bounding region is the
103e8a5466aSmrgarea of the parent window that the window will occupy (including border).
104e8a5466aSmrgThe clip region is the subset of the bounding region that is available for
105e8a5466aSmrgsubwindows and graphics.  The area between the bounding region and the
106e8a5466aSmrgclip region is defined to be the border of the window.
107e8a5466aSmrg</para>
108e8a5466aSmrg
109e8a5466aSmrg<para>
110e8a5466aSmrgA nonshaped window will have a bounding region that is a rectangle spanning
111e8a5466aSmrgthe window, including its border; the clip region will be a rectangle
112e8a5466aSmrgfilling the inside dimensions (not including the border).  In this document,
113e8a5466aSmrgthese areas are referred to as the
114af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='default_bounding_region'>
115af9a7ee5Smrgdefault bounding region</olink> and the
116af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='default_clip_region'>
117af9a7ee5Smrgdefault clip region</olink>.  For a window with
118e8a5466aSmrginside size of <emphasis remap='I'>width</emphasis> by
119e8a5466aSmrg<emphasis remap='I'>height</emphasis> and border width
120e8a5466aSmrg<emphasis remap='I'>bwidth</emphasis>, the default bounding and clip
121e8a5466aSmrgregions are the rectangles (relative to the window origin):
122e8a5466aSmrg</para>
123e8a5466aSmrg
124e8a5466aSmrg<literallayout remap='Ds'>
125e8a5466aSmrgbounding.x = -<emphasis remap='I'>bwidth</emphasis>
126e8a5466aSmrgbounding.y = -<emphasis remap='I'>bwidth</emphasis>
127e8a5466aSmrgbounding.width = <emphasis remap='I'>width</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
128e8a5466aSmrgbounding.height = <emphasis remap='I'>height</emphasis> + 2 * <emphasis remap='I'>bwidth</emphasis>
129e8a5466aSmrg
130e8a5466aSmrgclip.x = 0
131e8a5466aSmrgclip.y = 0
132e8a5466aSmrgclip.width = <emphasis remap='I'>width</emphasis>
133e8a5466aSmrgclip.height = <emphasis remap='I'>height</emphasis>
134e8a5466aSmrg</literallayout>
135e8a5466aSmrg
136e8a5466aSmrg<para>
137e8a5466aSmrgThis extension allows a client to modify either or both of the bounding or
138e8a5466aSmrgclip regions by specifying new regions that combine with the default
139e8a5466aSmrgregions.  These new regions are called the
140af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='client_bounding_region'>
141af9a7ee5Smrgclient bounding region</olink> and the
142af9a7ee5Smrg<olink targetdoc='shapelib' targetptr='client_clip_region'>
143af9a7ee5Smrgclient clip region</olink>.  They are specified
144e8a5466aSmrgrelative to the origin of the window and are always defined by offsets
145e8a5466aSmrgrelative to the window origin (that is, region adjustments are not
146e8a5466aSmrgrequired when the window is moved).  Three mechanisms for specifying
147e8a5466aSmrgregions are provided:  a list of rectangles, a bitmap, and an existing
148e8a5466aSmrgbounding or clip region from a window.  This is modeled on the specification
149e8a5466aSmrgof regions in graphics contexts in the core protocol and allows a variety
150e8a5466aSmrgof different uses of the extension.
151e8a5466aSmrg</para>
152e8a5466aSmrg
153e8a5466aSmrg<para>
154e8a5466aSmrgWhen using an existing window shape as an operand in specifying a new shape,
155e8a5466aSmrgthe client region is used, unless none has been set, in which case the
156e8a5466aSmrgdefault region is used instead.
157e8a5466aSmrg</para>
158e8a5466aSmrg
159e8a5466aSmrg<para>
160af9a7ee5SmrgThe <olink targetdoc='shapelib' targetptr='effective_bounding_region'>
161af9a7ee5Smrgeffective bounding region</olink> of a window is
162e8a5466aSmrgdefined to be the intersection of the client bounding region with the default
163e8a5466aSmrgbounding region.  Any portion of the client bounding region that is not
164e8a5466aSmrgincluded in the default bounding region will not be included in the
165e8a5466aSmrgeffective bounding region on the screen.  This means that window managers
166e8a5466aSmrg(or other geometry managers) used to dealing with rectangular client windows
167e8a5466aSmrgwill be able to constrain the client to a rectangular area of the screen.
168e8a5466aSmrg</para>
169e8a5466aSmrg
170e8a5466aSmrg<para>
171e8a5466aSmrgConstruction of the effective bounding region is dynamic; the client bounding
172e8a5466aSmrgregion is not mutated to obtain the effective bounding region.  If a client
173e8a5466aSmrgbounding region is specified that extends beyond the current default bounding
174e8a5466aSmrgregion, and the window is later enlarged, the effective bounding region will
175e8a5466aSmrgbe enlarged to include more of the client bounding region.
176e8a5466aSmrg</para>
177e8a5466aSmrg
178e8a5466aSmrg<para>
179af9a7ee5SmrgThe <olink targetdoc='shapelib' targetptr='effective_clip_region'>
180af9a7ee5Smrgeffective clip region</olink> of a window is
181e8a5466aSmrgdefined to be the intersection of the client clip region with both the
182e8a5466aSmrgdefault clip region and the client bounding region.  Any portion of the
183e8a5466aSmrgclient clip region that is not included in both the default clip region
184e8a5466aSmrgand the client bounding region will not be included in the effective clip
185e8a5466aSmrgregion on the screen.
186e8a5466aSmrg</para>
187e8a5466aSmrg
188e8a5466aSmrg<para>
189e8a5466aSmrgConstruction of the effective clip region is dynamic; the client clip region is
190e8a5466aSmrgnot mutated to obtain the effective clip region.  If a client clip region is
191e8a5466aSmrgspecified that extends beyond the current default clip region and the
192e8a5466aSmrgwindow or its bounding region is later enlarged, the effective clip region will
193e8a5466aSmrgbe enlarged to include more of the client clip region if it is included in
194e8a5466aSmrgthe effective bounding region.
195e8a5466aSmrg</para>
196e8a5466aSmrg
197e8a5466aSmrg<para>
198e8a5466aSmrgThe border of a window is defined to be the difference between the effective
199e8a5466aSmrgbounding region and the effective clip region.  If this region is empty, no
200e8a5466aSmrgborder is displayed.  If this region is nonempty, the border is filled
201e8a5466aSmrgusing the border-tile or border-pixel of the window as specified in the core
202e8a5466aSmrgprotocol.  Note that a window with a nonzero border width will never be able
203e8a5466aSmrgto draw beyond the default clip region of the window.  Also note that a zero
204e8a5466aSmrgborder width does not prevent a window from having a border, since the clip
205e8a5466aSmrgshape can still be made smaller than the bounding shape.
206e8a5466aSmrg</para>
207e8a5466aSmrg
208e8a5466aSmrg<para>
209e8a5466aSmrgAll output to the window and visible regions of any subwindows will be
210e8a5466aSmrgclipped to the effective clip region.  The server must not retain window
211e8a5466aSmrgcontents beyond the effective bounding region with backing store.  The window's
212e8a5466aSmrgorigin (for graphics operations, background tiling, and subwindow placement)
213e8a5466aSmrgis not affected by the existence of a bounding region or clip region.
214e8a5466aSmrg</para>
215e8a5466aSmrg
216e8a5466aSmrg<para>
217e8a5466aSmrgAreas that are inside the default bounding region but outside the effective
218e8a5466aSmrgbounding region are not part of the window; these areas of the screen will
219e8a5466aSmrgbe occupied by other windows.  Input events that occur within the default
220e8a5466aSmrgbounding region but outside the effective bounding region will be delivered as
221e8a5466aSmrgif the window was not occluding the event position.  Events that occur in
222e8a5466aSmrga nonrectangular border of a window will be delivered to that window, just
223e8a5466aSmrgas for events that occur in a normal rectangular border.
224e8a5466aSmrg</para>
225e8a5466aSmrg
226e8a5466aSmrg<para>An
227af9a7ee5Smrg<olink targetdoc='libX11' targetptr='glossary:InputOnly_window'>
228af9a7ee5SmrgInputOnly</olink>
229e8a5466aSmrgwindow can have its bounding region set, but it is a
230af9a7ee5Smrg<olink targetdoc='libX11' targetptr='BadMatch'>Match</olink>
231e8a5466aSmrgerror to attempt to set a clip region on an
232af9a7ee5Smrg<olink targetdoc='libX11' targetptr='glossary:InputOnly_window'>InputOnly</olink>
233e8a5466aSmrgwindow or to specify its clip region as a source to a request
234e8a5466aSmrgin this extension.
235e8a5466aSmrg</para>
236e8a5466aSmrg
237e8a5466aSmrg<para>
238e8a5466aSmrgThe server must accept changes to the clip region of a root window, but
239e8a5466aSmrgthe server is permitted to ignore requested changes to the bounding region
240e8a5466aSmrgof a root window.  If the server accepts bounding region changes, the contents
241e8a5466aSmrgof the screen outside the bounding region are implementation dependent.
242e8a5466aSmrg</para>
243e8a5466aSmrg</chapter>
244e8a5466aSmrg
245e8a5466aSmrg<chapter id='c_language_binding'>
246e8a5466aSmrg<title>C Language Binding</title>
247e8a5466aSmrg
248e8a5466aSmrg<para>
249e8a5466aSmrgThe C functions provide direct access to the protocol and add no additional
250e8a5466aSmrgsemantics.
251e8a5466aSmrg</para>
252e8a5466aSmrg
253e8a5466aSmrg<para>The include file for this extension is
254e8a5466aSmrg&lt;<symbol role='Pn'>X11/extensions/shape.h</symbol>&gt;.
255e8a5466aSmrgThe defined shape kinds are
256e8a5466aSmrg<function>ShapeBounding</function>
257e8a5466aSmrgand
258e8a5466aSmrg<function>ShapeClip</function>
259e8a5466aSmrgThe defined region operations are
260e8a5466aSmrg<function>ShapeSet</function>
261e8a5466aSmrg<function>ShapeUnion</function>
262e8a5466aSmrg<function>ShapeIntersect</function>
263e8a5466aSmrg<function>ShapeSubtract</function>
264e8a5466aSmrgand
265e8a5466aSmrg<function>ShapeInvert</function>.</para>
266e8a5466aSmrg
267af9a7ee5Smrg<funcsynopsis id='xshapequeryextension'>
268e8a5466aSmrg<funcprototype>
269e8a5466aSmrg<funcdef>Bool<function> XShapeQueryExtension</function></funcdef>
270e8a5466aSmrg<paramdef>Display <parameter>*display</parameter></paramdef>
271e8a5466aSmrg<paramdef>int <parameter>*event_base</parameter></paramdef>
272e8a5466aSmrg<paramdef>int <parameter>*error_base</parameter></paramdef>
273e8a5466aSmrg</funcprototype>
274e8a5466aSmrg</funcsynopsis>
275e8a5466aSmrg
276e8a5466aSmrg<para>
277e8a5466aSmrg<function>XShapeQueryExtension</function>
278e8a5466aSmrgreturns
279e8a5466aSmrg<function>True</function>
280e8a5466aSmrgif the specified display supports the SHAPE extension else
281e8a5466aSmrg<function>False</function>
282e8a5466aSmrgIf the extension is supported, *event_base is set to the event number for
283e8a5466aSmrg<function>ShapeNotify</function>
284e8a5466aSmrgevents and *error_base would be set to the error number for the first error for
285e8a5466aSmrgthis extension.  Because no errors are defined for this version of
286e8a5466aSmrgthe extension, the value returned here is not defined (nor useful).
287e8a5466aSmrg</para>
288e8a5466aSmrg
289af9a7ee5Smrg<funcsynopsis id='xshapequeryversion'>
290e8a5466aSmrg<funcprototype>
291e8a5466aSmrg<funcdef>Status<function> XShapeQueryVersion</function></funcdef>
292e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
293e8a5466aSmrg<paramdef>int<parameter> *major_version</parameter></paramdef>
294e8a5466aSmrg<paramdef>int<parameter> *minor_version</parameter></paramdef>
295e8a5466aSmrg</funcprototype>
296e8a5466aSmrg</funcsynopsis>
297e8a5466aSmrg
298e8a5466aSmrg<para>
299e8a5466aSmrgIf the extension is supported,
300e8a5466aSmrg<function>XShapeQueryVersion</function>
301e8a5466aSmrgsets the major and minor version numbers of the
302e8a5466aSmrgextension supported by the display and returns a nonzero value.
303e8a5466aSmrgOtherwise, the arguments are not set and zero is returned.
304e8a5466aSmrg</para>
305e8a5466aSmrg
306af9a7ee5Smrg<funcsynopsis id='xshapecombineregion'>
307e8a5466aSmrg<funcprototype>
308e8a5466aSmrg<funcdef><function>XShapeCombineRegion</function></funcdef>
309e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
310e8a5466aSmrg<paramdef>Window<parameter> dest</parameter></paramdef>
311e8a5466aSmrg<paramdef>int<parameter> dest_kind</parameter></paramdef>
312e8a5466aSmrg<paramdef>int<parameter> x_off</parameter></paramdef>
313e8a5466aSmrg<paramdef>int<parameter> y_off</parameter></paramdef>
314e8a5466aSmrg<paramdef>int<parameter> region</parameter></paramdef>
315e8a5466aSmrg<paramdef>int<parameter> op</parameter></paramdef>
316e8a5466aSmrg<paramdef>REGION<parameter> *region</parameter></paramdef>
317e8a5466aSmrg</funcprototype>
318e8a5466aSmrg</funcsynopsis>
319e8a5466aSmrg
320e8a5466aSmrg<para>
321e8a5466aSmrg<function>XShapeCombineRegion</function>
322e8a5466aSmrgconverts the specified region into a list of rectangles and calls
323e8a5466aSmrg<function>XShapeCombineRectangles</function>
324e8a5466aSmrg</para>
325e8a5466aSmrg
326af9a7ee5Smrg<funcsynopsis id='xshapecombinerectangles'>
327e8a5466aSmrg<funcprototype>
328e8a5466aSmrg<funcdef><function>XShapeCombineRectangles</function></funcdef>
329e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
330e8a5466aSmrg<paramdef>Window<parameter> dest</parameter></paramdef>
331e8a5466aSmrg<paramdef>int<parameter> dest_kind</parameter></paramdef>
332e8a5466aSmrg<paramdef>int<parameter> x_off</parameter></paramdef>
333e8a5466aSmrg<paramdef>int<parameter> y_off</parameter></paramdef>
334e8a5466aSmrg<paramdef>XRectangle<parameter> *rectangles</parameter></paramdef>
335e8a5466aSmrg<paramdef>int<parameter> n_rects</parameter></paramdef>
336e8a5466aSmrg<paramdef>int<parameter> op</parameter></paramdef>
337e8a5466aSmrg<paramdef>int<parameter> ordering</parameter></paramdef>
338e8a5466aSmrg</funcprototype>
339e8a5466aSmrg</funcsynopsis>
340e8a5466aSmrg
341e8a5466aSmrg<para>
342e8a5466aSmrgIf the extension is supported,
343e8a5466aSmrg<function>XShapeCombineRectangles</function>
344e8a5466aSmrgperforms a
345e8a5466aSmrg<function>ShapeRectangles</function>
346e8a5466aSmrgoperation; otherwise, the request is ignored.
347e8a5466aSmrg</para>
348e8a5466aSmrg
349af9a7ee5Smrg<funcsynopsis id='xshapecombinemask'>
350e8a5466aSmrg<funcprototype>
351e8a5466aSmrg<funcdef><function>XShapeCombineMask</function></funcdef>
352e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
353e8a5466aSmrg<paramdef>int<parameter> dest</parameter></paramdef>
354e8a5466aSmrg<paramdef>int<parameter> dest_kind</parameter></paramdef>
355e8a5466aSmrg<paramdef>int<parameter> x_off</parameter></paramdef>
356e8a5466aSmrg<paramdef>int<parameter> y_off</parameter></paramdef>
357e8a5466aSmrg<paramdef>Pixmap<parameter> src</parameter></paramdef>
358e8a5466aSmrg<paramdef>int<parameter> op</parameter></paramdef>
359e8a5466aSmrg</funcprototype>
360e8a5466aSmrg</funcsynopsis>
361e8a5466aSmrg
362e8a5466aSmrg<para>
363e8a5466aSmrgIf the extension is supported,
364e8a5466aSmrg<function>XShapeCombineMask</function>
365e8a5466aSmrgperforms a
366e8a5466aSmrg<function>ShapeMask</function>
367e8a5466aSmrgoperation; otherwise, the request is ignored.
368e8a5466aSmrg</para>
369e8a5466aSmrg
370af9a7ee5Smrg<funcsynopsis id='xshapecombineshape'>
371e8a5466aSmrg<funcprototype>
372e8a5466aSmrg<funcdef><function>XShapeCombineShape</function></funcdef>
373e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
374e8a5466aSmrg<paramdef>Window<parameter> dest</parameter></paramdef>
375e8a5466aSmrg<paramdef>int<parameter> dest_kind</parameter></paramdef>
376e8a5466aSmrg<paramdef>int<parameter> x_off</parameter></paramdef>
377e8a5466aSmrg<paramdef>int<parameter> y_off</parameter></paramdef>
378e8a5466aSmrg<paramdef>Window<parameter> src</parameter></paramdef>
379e8a5466aSmrg<paramdef>int<parameter> src_kind</parameter></paramdef>
380e8a5466aSmrg<paramdef>int<parameter> op</parameter></paramdef>
381e8a5466aSmrg</funcprototype>
382e8a5466aSmrg</funcsynopsis>
383e8a5466aSmrg
384e8a5466aSmrg<para>
385e8a5466aSmrgIf the extension is supported,
386e8a5466aSmrg<function>XShapeCombineShape</function>
387e8a5466aSmrgperforms a
388e8a5466aSmrg<function>ShapeCombine</function>
389e8a5466aSmrgoperation; otherwise, the request is ignored.
390e8a5466aSmrg</para>
391e8a5466aSmrg
392af9a7ee5Smrg<funcsynopsis id='xshapeoffsetshape'>
393e8a5466aSmrg<funcprototype>
394e8a5466aSmrg<funcdef><function>XShapeOffsetShape</function></funcdef>
395e8a5466aSmrg<paramdef><parameter>display</parameter></paramdef>
396e8a5466aSmrg<paramdef><parameter>dest</parameter></paramdef>
397e8a5466aSmrg<paramdef><parameter>dest_kind</parameter></paramdef>
398e8a5466aSmrg<paramdef><parameter>x_off</parameter></paramdef>
399e8a5466aSmrg<paramdef><parameter>y_off</parameter></paramdef>
400e8a5466aSmrg</funcprototype>
401e8a5466aSmrg</funcsynopsis>
402e8a5466aSmrg
403e8a5466aSmrg<para>
404e8a5466aSmrgIf the extension is supported,
405e8a5466aSmrg<function>XShapeOffsetShape</function>
406e8a5466aSmrgperforms a
407e8a5466aSmrg<function>ShapeOffset</function>
408e8a5466aSmrgoperation; otherwise, the request is ignored.
409e8a5466aSmrg</para>
410e8a5466aSmrg
411af9a7ee5Smrg<funcsynopsis id='xshapequeryextents'>
412e8a5466aSmrg<funcprototype>
413e8a5466aSmrg<funcdef>Status <function>XShapeQueryExtents</function></funcdef>
414e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
415e8a5466aSmrg<paramdef>Window<parameter> window</parameter></paramdef>
416e8a5466aSmrg<paramdef>Bool<parameter> *bounding_shaped</parameter></paramdef>
417e8a5466aSmrg<paramdef>int<parameter> *x_bounding</parameter></paramdef>
418e8a5466aSmrg<paramdef>int<parameter> *y_bounding</parameter></paramdef>
419e8a5466aSmrg<paramdef>unsigned int<parameter> *w_bounding</parameter></paramdef>
420e8a5466aSmrg<paramdef>unsigned int<parameter> *h_bounding</parameter></paramdef>
421e8a5466aSmrg<paramdef>Bool<parameter> *clip_shaped</parameter></paramdef>
422e8a5466aSmrg<paramdef>int<parameter> *x_clip</parameter></paramdef>
423e8a5466aSmrg<paramdef>int<parameter> *y_clip</parameter></paramdef>
424e8a5466aSmrg<paramdef>unsigned int<parameter> *w_clip</parameter></paramdef>
425e8a5466aSmrg<paramdef>unsigned int<parameter> *h_clip</parameter></paramdef>
426e8a5466aSmrg</funcprototype>
427e8a5466aSmrg</funcsynopsis>
428e8a5466aSmrg
429e8a5466aSmrg<para>
430e8a5466aSmrgIf the extension is supported,
431e8a5466aSmrg<function>XShapeQueryExtents</function>
432e8a5466aSmrgsets x_bounding, y_bounding, w_bounding, h_bounding to the extents of the
433e8a5466aSmrgbounding shape and sets x_clip, y_clip, w_clip, h_clip to the extents of
434e8a5466aSmrgthe clip shape.  For unspecified client regions, the extents of the
435e8a5466aSmrgcorresponding default region are used.
436e8a5466aSmrg</para>
437e8a5466aSmrg
438e8a5466aSmrg<para>
439e8a5466aSmrgIf the extension is supported, a nonzero value is returned; otherwise,
440e8a5466aSmrgzero is returned.
441e8a5466aSmrg</para>
442e8a5466aSmrg
443af9a7ee5Smrg<funcsynopsis id='xshapeselectinput'>
444e8a5466aSmrg<funcprototype>
445e8a5466aSmrg<funcdef><function>XShapeSelectInput</function></funcdef>
446e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
447e8a5466aSmrg<paramdef>Window<parameter> window</parameter></paramdef>
448e8a5466aSmrg<paramdef>unsigned long<parameter> mask</parameter></paramdef>
449e8a5466aSmrg</funcprototype>
450e8a5466aSmrg</funcsynopsis>
451e8a5466aSmrg
452e8a5466aSmrg<para>
453e8a5466aSmrgTo make this extension more compatible with other interfaces, although
454e8a5466aSmrgonly one event type can be selected via the extension,
455e8a5466aSmrg<function>XShapeSelectInput</function>
456e8a5466aSmrgprovides a general mechanism similar to the standard Xlib binding for
457e8a5466aSmrgwindow events.  A mask value has been defined,
458e8a5466aSmrg<function>ShapeNotifyMask</function>
459e8a5466aSmrgthat is the only valid bit in mask that may be specified.
460e8a5466aSmrgThe structure for this event is defined as follows:
461e8a5466aSmrg</para>
462e8a5466aSmrg
463e8a5466aSmrg<literallayout remap='Ds'>
464e8a5466aSmrgtypedef struct {
465e8a5466aSmrg    int type;     /* of event */
466e8a5466aSmrg    unsigned long serial;     /* # of last request processed by server */
4670760f5d2Smrg    Bool send_event;     /* true if this came from a SendEvent request */
468e8a5466aSmrg    Display *display;     /* Display the event was read from */
469e8a5466aSmrg    Window window;     /* window of event */
470e8a5466aSmrg    int kind;     /* ShapeBounding or ShapeClip */
471e8a5466aSmrg    int x, y;     /* extents of new region */
472e8a5466aSmrg    unsigned width, height;
473e8a5466aSmrg    Time time;     /* server timestamp when region changed */
474e8a5466aSmrg    Bool shaped;     /* true if the region exists */
475e8a5466aSmrg} XShapeEvent;
476e8a5466aSmrg</literallayout>
477e8a5466aSmrg
478af9a7ee5Smrg<funcsynopsis id='xshapeinputselected'>
479e8a5466aSmrg<funcprototype>
480e8a5466aSmrg<funcdef>unsigned long <function>XShapeInputSelected</function></funcdef>
481e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
482e8a5466aSmrg<paramdef>Window<parameter> window</parameter></paramdef>
483e8a5466aSmrg</funcprototype>
484e8a5466aSmrg</funcsynopsis>
485e8a5466aSmrg
486e8a5466aSmrg<para>
487e8a5466aSmrg<function>XShapeInputSelected</function>
488e8a5466aSmrgreturns the current input mask for extension events on the specified
489e8a5466aSmrgwindow; the value returned if
490e8a5466aSmrg<function>ShapeNotify</function>
491e8a5466aSmrgis selected for is
492e8a5466aSmrg<function>ShapeNotifyMask</function>
493e8a5466aSmrgotherwise, it returns zero.
494e8a5466aSmrgIf the extension is not supported, it returns zero.
495e8a5466aSmrg</para>
496e8a5466aSmrg
497af9a7ee5Smrg<funcsynopsis id='xshapegetrectangles'>
498e8a5466aSmrg<funcprototype>
499e8a5466aSmrg<funcdef>XRectangle<function> *XShapeGetRectangles</function></funcdef>
500e8a5466aSmrg<paramdef>Display<parameter> *display</parameter></paramdef>
501e8a5466aSmrg<paramdef>Window<parameter> window</parameter></paramdef>
502e8a5466aSmrg<paramdef>int<parameter> kind</parameter></paramdef>
503e8a5466aSmrg<paramdef>int<parameter> *count</parameter></paramdef>
504e8a5466aSmrg<paramdef>int<parameter> *ordering</parameter></paramdef>
505e8a5466aSmrg</funcprototype>
506e8a5466aSmrg</funcsynopsis>
507e8a5466aSmrg
508e8a5466aSmrg<para>
509e8a5466aSmrgIf the extension is not supported,
510e8a5466aSmrg<function>XShapeGetRectangles</function>
511e8a5466aSmrgreturns NULL.  Otherwise, it returns a list of rectangles that describe the
512e8a5466aSmrgregion specified by kind.
513e8a5466aSmrg</para>
514e8a5466aSmrg</chapter>
515e8a5466aSmrg
516e8a5466aSmrg<glossary id='glossary'>
517e8a5466aSmrg
518e8a5466aSmrg<glossentry id='bounding_region'>
519e8a5466aSmrg  <glossterm>bounding region</glossterm>
520e8a5466aSmrg  <glossdef><para>The area of the parent window that this window will occupy.
521e8a5466aSmrgThis area is divided into two parts:  the border and the interior.</para>
522e8a5466aSmrg  </glossdef>
523e8a5466aSmrg</glossentry>
524e8a5466aSmrg
525e8a5466aSmrg<glossentry id='clip_region'>
526e8a5466aSmrg  <glossterm>clip region</glossterm>
527e8a5466aSmrg  <glossdef><para>The interior of the window, as a subset of the bounding
528e8a5466aSmrgregion.  This region describes the area that will be painted with the
529e8a5466aSmrgwindow background when the window is cleared, will contain all graphics
530e8a5466aSmrgoutput to the window, and will clip any subwindows.</para></glossdef>
531e8a5466aSmrg</glossentry>
532e8a5466aSmrg
533e8a5466aSmrg<glossentry id='default_bounding_region'>
534e8a5466aSmrg  <glossterm>default bounding region</glossterm>
535e8a5466aSmrg  <glossdef><para>The rectangular area, as described by the core protocol
536e8a5466aSmrgwindow size, that covers the interior of the window and its border.</para>
537e8a5466aSmrg  </glossdef>
538e8a5466aSmrg</glossentry>
539e8a5466aSmrg
540e8a5466aSmrg<glossentry id='default_clip_region'>
541e8a5466aSmrg  <glossterm>default clip region</glossterm>
542e8a5466aSmrg  <glossdef><para>The rectangular area, as described by the core protocol
543e8a5466aSmrgwindow size, that covers the interior of the window and excludes the border.
544e8a5466aSmrg  </para></glossdef>
545e8a5466aSmrg</glossentry>
546e8a5466aSmrg
547e8a5466aSmrg<glossentry id='client_bounding_region'>
548e8a5466aSmrg  <glossterm>client bounding region</glossterm>
549e8a5466aSmrg  <glossdef><para>The region associated with a window that is directly
550e8a5466aSmrgmodified via this extension when specified by
551e8a5466aSmrg<function>ShapeBounding</function>
552e8a5466aSmrgThis region is used in conjunction with the default bounding region
553e8a5466aSmrgto produce the effective bounding region.</para></glossdef>
554e8a5466aSmrg</glossentry>
555e8a5466aSmrg
556e8a5466aSmrg<glossentry id='client_clip_region'>
557e8a5466aSmrg  <glossterm>client clip region</glossterm>
558e8a5466aSmrg  <glossdef><para>The region associated with a window that is directly
559e8a5466aSmrgmodified via this extension when specified by
560e8a5466aSmrg<function>ShapeClip</function>
561e8a5466aSmrgThis region is used in conjunction with the default clip region
562e8a5466aSmrgand the client bounding region to produce the effective clip region.</para>
563e8a5466aSmrg  </glossdef>
564e8a5466aSmrg</glossentry>
565e8a5466aSmrg
566e8a5466aSmrg<glossentry id='effective_bounding_region'>
567e8a5466aSmrg  <glossterm>effective bounding region</glossterm>
568e8a5466aSmrg  <glossdef><para>The actual shape of the window on the screen, including
569e8a5466aSmrgborder and interior (but excluding the effects of overlapping windows).
570e8a5466aSmrgWhen a window has a client bounding region, the effective bounding region
571e8a5466aSmrgis the intersection of the default bounding region and the client bounding
572e8a5466aSmrgregion.  Otherwise, the effective bounding region is the same as the
573e8a5466aSmrgdefault bounding region.</para>
574e8a5466aSmrg  </glossdef>
575e8a5466aSmrg</glossentry>
576e8a5466aSmrg
577e8a5466aSmrg<glossentry id='effective_clip_region'>
578e8a5466aSmrg  <glossterm>effective clip region</glossterm>
579e8a5466aSmrg  <glossdef><para>The actual shape of the interior of the window on the
580e8a5466aSmrgscreen (excluding the effects of overlapping windows).  When a window
581e8a5466aSmrghas a client clip region or a client bounding region, the effective
582e8a5466aSmrgclip region is the intersection of the default clip region, the client
583e8a5466aSmrgclip region (if any) and the client bounding region (if any).  Otherwise,
584e8a5466aSmrgthe effective clip region is the same as the default clip region.</para>
585e8a5466aSmrg  </glossdef>
586e8a5466aSmrg</glossentry>
587e8a5466aSmrg</glossary>
588e8a5466aSmrg</book>
589