1ea1d6981Smrg<?xml version="1.0" encoding="UTF-8" ?>
2ea1d6981Smrg<!DOCTYPE article
3ea1d6981Smrg          PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
4ea1d6981Smrg          "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
5ea1d6981Smrg[
6ea1d6981Smrg<!ENTITY % defs SYSTEM "defs.ent"> %defs;
7ea1d6981Smrg]>
8ea1d6981Smrg
9ea1d6981Smrg<article id="appgrp">
10ea1d6981Smrg
11ea1d6981Smrg<articleinfo>
12ea1d6981Smrg   <title>Application Group Extension to the X Protocol</title>
13ea1d6981Smrg   <subtitle>X Consortium Standard</subtitle>
14ea1d6981Smrg   <authorgroup>
15ea1d6981Smrg     <author>
16ea1d6981Smrg       <firstname>Kaleb</firstname>
17ea1d6981Smrg       <othername>S.</othername>
18ea1d6981Smrg       <surname>KEITHLEY</surname>
19ea1d6981Smrg       <affiliation><orgname>X Consortium, Inc</orgname></affiliation>
20ea1d6981Smrg       <email>kaleb@x.org</email>
21ea1d6981Smrg     </author>
22ea1d6981Smrg   </authorgroup>
23ea1d6981Smrg   <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
24ea1d6981Smrg   <releaseinfo>Version 1.0</releaseinfo>
25ea1d6981Smrg   <copyright><year>1996</year><holder>X Consortium, Inc.</holder>
26ea1d6981Smrg   </copyright>
27ea1d6981Smrg
28ea1d6981Smrg<legalnotice>
29ea1d6981Smrg<para>
30ea1d6981SmrgAll Rights Reserved.
31ea1d6981Smrg</para>
32ea1d6981Smrg
33ea1d6981Smrg<para>
34ea1d6981SmrgTHE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND,
35ea1d6981SmrgEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36ea1d6981SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37ea1d6981SmrgIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM,
38ea1d6981SmrgDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
39ea1d6981SmrgOR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
40ea1d6981SmrgOR THE USE OF OR OTHER DEALINGS IN THE SOFTWARE.
41ea1d6981Smrg</para>
42ea1d6981Smrg<para>
43ea1d6981SmrgExcept as contained in this notice, the name of the X Consortium shall not be used in advertising
44ea1d6981Smrgor otherwise to promote the sale, use or other dealings in this Software without prior written
45ea1d6981Smrgauthorization from the X Consortium.
46ea1d6981Smrg</para>
47ea1d6981Smrg<para>X Window System is a trademark of The OpenGroup.</para>
48ea1d6981Smrg</legalnotice>
49ea1d6981Smrg
50ea1d6981Smrg<pubdate>27 September 1996</pubdate>
51ea1d6981Smrg
52ea1d6981Smrg<abstract>
53ea1d6981Smrg<para>
54ea1d6981SmrgThe Application Group Extension to the X protocol is intended to provide a framework to allow
55ea1d6981Smrgmore than one program to manage X applications on the desktop. The initial use of this extension
56ea1d6981Smrgwill be to insert or embed the windows of X programs into the windows of another program, such
57ea1d6981Smrgas a web browser. This extension is not intended to address larger embedding issues that, for
58ea1d6981Smrgexample, OpenDoc does, such as shared menu bars, etc.
59ea1d6981Smrg</para>
60ea1d6981Smrg</abstract>
61ea1d6981Smrg</articleinfo>
62ea1d6981Smrg
63ea1d6981Smrg<sect1 id='Purpose_and_Goals'>
64ea1d6981Smrg<title>Purpose and Goals</title>
65ea1d6981Smrg
66ea1d6981Smrg<para>
67ea1d6981SmrgThe Application Group Extension to the X protocol is intended to provide
68ea1d6981Smrga framework to allow more than one program to manage X applications on
69ea1d6981Smrgthe desktop. The initial use of this extension will be to insert or embed
70ea1d6981Smrgthe windows of X programs into the windows of another program, such as a
71ea1d6981Smrgweb browser. This extension is not intended to address larger embedding
72ea1d6981Smrgissues that, for example, OpenDoc does, such as shared menu bars, etc.
73ea1d6981SmrgUsing X programs on the World Wide Web allows for greater control of the
74ea1d6981Smrgpresentation and takes advantage of the existing body of X programs rather
75ea1d6981Smrgthan re-implement them in another language. In addition it allows the
76ea1d6981Smrgembedding of non-X programs into web browsers by using third party products
77ea1d6981Smrglike Wabi, MAE, and WinCenter.
78ea1d6981Smrg<footnote><para>
79ea1d6981SmrgWabi is a trademark of Sun Microsystems, Inc. MAE is a trademark of Apple
80ea1d6981SmrgComputer, Inc. WinCenter is a trademark of Network Computing Devices, Inc.
81ea1d6981Smrg</para></footnote>
82ea1d6981Smrg</para>
83ea1d6981Smrg
84ea1d6981Smrg</sect1>
85ea1d6981Smrg
86ea1d6981Smrg<sect1 id='Overview_of_the_protocol'>
87ea1d6981Smrg<title>Overview of the protocol.</title>
88ea1d6981Smrg
89ea1d6981Smrg<para>
90ea1d6981SmrgThis extension introduces the concept of an Application Group. An Application Group is a set of one or more applications that are primarily managed by a special application known as the Application Group Leader, which, for example, might be a web browser. The primary purpose of Application Groups is to provide a means of sharing the Substructure-Redirect attribute of the root window between the window manager and one or more Application Group Leaders.
91ea1d6981Smrg</para>
92ea1d6981Smrg
93ea1d6981Smrg<para>
94ea1d6981SmrgTo join an Application Group an application must present the proper authorization during the connection setup. Authorizations are generated by the X server at the request of an Application Group Leader, and are then stored for the application to use to establish its connection to the X server. To generate an authorization the Application Group Leader sends a request to the server naming the Application Group to which the authorization will be bound, and any applications that connect using that authorization  will automatically become part of the associated Application Group. The protocol to generate an authorization is defined in the Security Extension specification.
95ea1d6981Smrg</para>
96ea1d6981Smrg
97ea1d6981Smrg<para>
98ea1d6981SmrgAs a member of an Application Group, when an application creates and maps a window as a child of the root window, the MapRequest and ConfigureRequest events are delivered to the Application Group Leader instead of the window manager. The Application Group Leader may then reparent the window into its own window hierarchy; or reissue the map request, in which case the window comes under the control of the window manager.
99ea1d6981Smrg</para>
100ea1d6981Smrg
101ea1d6981Smrg</sect1>
102ea1d6981Smrg<sect1 id='Requests'>
103ea1d6981Smrg<title>Requests</title>
104ea1d6981Smrg
105ea1d6981Smrg
106ea1d6981Smrg<para><emphasis role='bold'>AppGroupQueryVersion</emphasis></para>
107ea1d6981Smrg
108ea1d6981Smrg<informaltable frame='none'>
109ea1d6981Smrg<?dbfo keep-together="always" ?>
110ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
111ea1d6981Smrg<colspec colsep='0' colwidth='1.0*'/>
112ea1d6981Smrg<tbody>
113ea1d6981Smrg  <row>
114ea1d6981Smrg    <entry>client_major_version: CARD16</entry>
115ea1d6981Smrg  </row>
116ea1d6981Smrg  <row>
117ea1d6981Smrg    <entry>client_minor_version: CARD16</entry>
118ea1d6981Smrg  </row>
119ea1d6981Smrg  <row>
120ea1d6981Smrg    <entry>=&gt;</entry>
121ea1d6981Smrg  </row>
122ea1d6981Smrg  <row>
123ea1d6981Smrg    <entry>server_major_version: CARD16</entry>
124ea1d6981Smrg  </row>
125ea1d6981Smrg  <row>
126ea1d6981Smrg    <entry>server_minor_version: CARD16</entry>
127ea1d6981Smrg  </row>
128ea1d6981Smrg</tbody>
129ea1d6981Smrg</tgroup>
130ea1d6981Smrg</informaltable>
131ea1d6981Smrg
132ea1d6981Smrg<para>
133ea1d6981SmrgIf supplied, the client_major_version and client_minor_version indicate what version of the protocol the application wants the server to implement. The server version numbers returned indicate the version of the protocol the X server actually supports. This may not match the versions requested by the application. An implementation may (but need not) support more than one version simultaneously. The server_major_version and server_minor_version numbers are a mechanism to support any future revisions of the Application Group extension protocol which may be necessary. In general, the major version would increment for incompatible changes, and the minor version would increment for small, upward-compatible changes. X servers that support the protocol defined in this document will return a server_major_version of 1 and a server_minor_version of 0.
134ea1d6981Smrg</para>
135ea1d6981Smrg
136ea1d6981Smrg
137ea1d6981Smrg<para><emphasis role='bold'>AppGroupCreate</emphasis></para>
138ea1d6981Smrg
139ea1d6981Smrg<informaltable frame='none'>
140ea1d6981Smrg<?dbfo keep-together="always" ?>
141ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
142ea1d6981Smrg<colspec colsep='0' colwidth='1.0*'/>
143ea1d6981Smrg<tbody>
144ea1d6981Smrg  <row>
145ea1d6981Smrg    <entry>app_group: APPGROUP</entry>
146ea1d6981Smrg  </row>
147ea1d6981Smrg  <row>
148ea1d6981Smrg    <entry>value_mask: BITMASK</entry>
149ea1d6981Smrg  </row>
150ea1d6981Smrg  <row>
151ea1d6981Smrg    <entry>value_list: LISTofVALUE</entry>
152ea1d6981Smrg  </row>
153ea1d6981Smrg</tbody>
154ea1d6981Smrg</tgroup>
155ea1d6981Smrg</informaltable>
156ea1d6981Smrg
157ea1d6981Smrg<para>
158ea1d6981SmrgThis request creates an Application Group using app_group as the Application Group ID.
159ea1d6981Smrg</para>
160ea1d6981Smrg
161ea1d6981Smrg
162ea1d6981Smrg<para>
163ea1d6981Smrg&nbsp;
164ea1d6981Smrg</para>
165ea1d6981Smrg
166ea1d6981Smrg
167ea1d6981Smrg<para>
168ea1d6981SmrgThe value_mask and value_list specify attributes of the Application Group that are to be explicitly initialized. The attributes, their types, and the default values are:
169ea1d6981Smrg</para>
170ea1d6981Smrg
171ea1d6981Smrg<informaltable frame="topbot">
172ea1d6981Smrg<?dbfo keep-together="always" ?>
173ea1d6981Smrg<tgroup cols='3' colsep='0' rowsep='0'>
174ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
175ea1d6981Smrg<colspec colname='c2' colwidth='1.0*'/>
176ea1d6981Smrg<colspec colname='c3' colwidth='1.0*'/>
177ea1d6981Smrg<tbody>
178ea1d6981Smrg  <row rowsep='1'>
179ea1d6981Smrg  <entry>Attribute</entry>
180ea1d6981Smrg  <entry>Type</entry>
181ea1d6981Smrg  <entry>Default</entry>
182ea1d6981Smrg  </row>
183ea1d6981Smrg  <row>
184ea1d6981Smrg    <entry>app_group_leader</entry>
185ea1d6981Smrg    <entry>Bool</entry>
186ea1d6981Smrg    <entry>True</entry>
187ea1d6981Smrg  </row>
188ea1d6981Smrg  <row>
189ea1d6981Smrg    <entry>single_screen</entry>
190ea1d6981Smrg    <entry>Bool</entry>
191ea1d6981Smrg    <entry>True</entry>
192ea1d6981Smrg  </row>
193ea1d6981Smrg  <row>
194ea1d6981Smrg    <entry>default_root</entry>
195ea1d6981Smrg    <entry>Window</entry>
196ea1d6981Smrg    <entry>None</entry>
197ea1d6981Smrg  </row>
198ea1d6981Smrg  <row>
199ea1d6981Smrg    <entry>root_visual</entry>
200ea1d6981Smrg    <entry>VisualID</entry>
201ea1d6981Smrg    <entry>None</entry>
202ea1d6981Smrg  </row>
203ea1d6981Smrg  <row>
204ea1d6981Smrg    <entry>default_colormap</entry>
205ea1d6981Smrg    <entry>Colormap</entry>
206ea1d6981Smrg    <entry>None</entry>
207ea1d6981Smrg  </row>
208ea1d6981Smrg  <row>
209ea1d6981Smrg    <entry>black_pixel</entry>
210ea1d6981Smrg    <entry>Pixel</entry>
211ea1d6981Smrg    <entry>0</entry>
212ea1d6981Smrg  </row>
213ea1d6981Smrg  <row>
214ea1d6981Smrg    <entry>white_pixel</entry>
215ea1d6981Smrg    <entry>Pixel</entry>
216ea1d6981Smrg    <entry>0</entry>
217ea1d6981Smrg  </row>
218ea1d6981Smrg</tbody>
219ea1d6981Smrg</tgroup>
220ea1d6981Smrg</informaltable>
221ea1d6981Smrg
222ea1d6981Smrg<para>
223ea1d6981SmrgIf the single_screen attribute is True then the number of video screens returned to a program in the Application Group in the connection setup message is one, irrespective of how many video screens the server actually has. If a server supports both video and print screens, then all print screens will always be returned. If single_screen is specified as True then the connection setup message will contain only the information about the video screen which has default_root as its root window, plus any print screens.
224ea1d6981Smrg</para>
225ea1d6981Smrg
226ea1d6981Smrg<note><para>
227ea1d6981SmrgThe intent is to allow an embedding manager to ensure that it will be able to reparent any top-level windows that Application Group members create. By hiding the fact that there are other screens it can be reasonably assured that applications will only create top-level windows on the same screen that it itself appears on. An embedding manager should take care not to supply an invalid display, e.g. :0.1, to a program that will be in an Application Group where the single_screen attribute is True.
228ea1d6981Smrg</para></note>
229ea1d6981Smrg
230ea1d6981Smrg<para>
231ea1d6981SmrgIf single_screen is set to True default_root specifies which screen will be returned as screen zero in the connection setup message for applications in the Application Group. If set to None, then the real screen zero is used, otherwise the screen which has default_root as its root window will be used.
232ea1d6981Smrg</para>
233ea1d6981Smrg
234ea1d6981Smrg
235ea1d6981Smrg<para>
236d63b911fSmrgIf single_screen is set to True the  root_visual and default_colormap attributes may be used to over-ride the default values that are returned in the connection setup information returned to new programs in the Application Group. If None is specified for root_visual or default_colormap then the normal default values for the screen (possibly specified by default_root) are used, otherwise the specified values are used. If root_visual and/or default_colormap are specified they must be valid, i.e. root_visual must be a visual type available on the screen, and the colormap, if specified, must be a valid colormap for the visual that is used.
237ea1d6981Smrg</para>
238ea1d6981Smrg
239ea1d6981Smrg<para>
240ea1d6981SmrgIF single_screen is set to True and default_colormap is not specified as None, the black_pixel and white_pixel attributes must be specified, and they will over-ride the default values that are returned in the connection setup returned to new programs in the Application Group. If default_colormap is specified as None and black_pixel and/or white_pixel are specified, they will be ignored.
241ea1d6981Smrg</para>
242ea1d6981Smrg
243ea1d6981Smrg<para>
244ea1d6981SmrgThe app_group_leader attribute is used to identify the Application Group Leader program for the app_group. By specifying True the server will identify the program making the request as the Application Group Leader for the application group. The Application Group Leader receives MapRequest and ConfigureRequest events from the server when an attempt is made to map or configure top-level windows of a program in an Application Group, instead of being sent to a window manager that has selected SubstructureRedirect events on the root window. The parent window field in these events will contain the Application Group ID.
245ea1d6981Smrg</para>
246ea1d6981Smrg
247ea1d6981Smrg<para><emphasis role='bold'>AppGroupDestroy</emphasis></para>
248ea1d6981Smrg
249ea1d6981Smrg<para>app_group: APPGROUP</para>
250ea1d6981Smrg
251ea1d6981Smrg
252ea1d6981Smrg<para>
253ea1d6981SmrgThis request destroys the app_group. If the app_group_leader attribute for the app_group is True, then any applications in the Application Group that are still connected will be killed as if a KillClient request had been received for that application.
254ea1d6981Smrg</para>
255ea1d6981Smrg
256ea1d6981Smrg<note><para>
257ea1d6981SmrgIf the application that created a non-embedded Application Group exits, and therefore any Authorizations to be cancelled, and any applications  that attempt to open new connections to the X server using one of those Authorizations will be unable to do so.
258ea1d6981Smrg</para></note>
259ea1d6981Smrg
260ea1d6981Smrg<para><emphasis role='bold'>AppGroupGetAttr</emphasis></para>
261ea1d6981Smrg
262ea1d6981Smrg
263ea1d6981Smrg<informaltable frame='none'>
264ea1d6981Smrg<?dbfo keep-together="always" ?>
265ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
266ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
267ea1d6981Smrg<tbody>
268ea1d6981Smrg  <row>
269ea1d6981Smrg    <entry>>app_group: APPGROUP</entry>
270ea1d6981Smrg  </row>
271ea1d6981Smrg  <row>
272ea1d6981Smrg    <entry>=&gt;</entry>
273ea1d6981Smrg  </row>
274ea1d6981Smrg  <row>
275ea1d6981Smrg    <entry>LISTofVALUE</entry>
276ea1d6981Smrg  </row>
277ea1d6981Smrg</tbody>
278ea1d6981Smrg</tgroup>
279ea1d6981Smrg</informaltable>
280ea1d6981Smrg
281ea1d6981Smrg<para>
282ea1d6981SmrgThis request returns the application group attributes for app_group.
283ea1d6981Smrg</para>
284ea1d6981Smrg
285ea1d6981Smrg<para><emphasis role='bold'>AppGroupQuery</emphasis></para>
286ea1d6981Smrg
287ea1d6981Smrg<informaltable frame='none'>
288ea1d6981Smrg<?dbfo keep-together="always" ?>
289ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
290ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
291ea1d6981Smrg<tbody>
292ea1d6981Smrg  <row>
293ea1d6981Smrg    <entry>resource: XID</entry>
294ea1d6981Smrg  </row>
295ea1d6981Smrg  <row>
296ea1d6981Smrg    <entry>=&gt;</entry>
297ea1d6981Smrg  </row>
298ea1d6981Smrg  <row>
299ea1d6981Smrg    <entry>app_group: APPGROUP</entry>
300ea1d6981Smrg  </row>
301ea1d6981Smrg</tbody>
302ea1d6981Smrg</tgroup>
303ea1d6981Smrg</informaltable>
304ea1d6981Smrg
305ea1d6981Smrg<para>
306ea1d6981SmrgThis request returns the Application Group ID of the application that created resource or None if that application is not associated with any Application Group. The resource value may be the resource base of the application.
307ea1d6981Smrg</para>
308ea1d6981Smrg
309ea1d6981Smrg<para><emphasis role='bold'>AppGroupCreateAssociation</emphasis></para>
310ea1d6981Smrg
311ea1d6981Smrg<informaltable frame='none'>
312ea1d6981Smrg<?dbfo keep-together="always" ?>
313ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
314ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
315ea1d6981Smrg<tbody>
316ea1d6981Smrg  <row>
317ea1d6981Smrg    <entry>window: WINDOW</entry>
318ea1d6981Smrg  </row>
319ea1d6981Smrg  <row>
320ea1d6981Smrg    <entry>window_type: CARD32</entry>
321ea1d6981Smrg  </row>
322ea1d6981Smrg  <row>
323ea1d6981Smrg    <entry>system_window: LISTofCARD8</entry>
324ea1d6981Smrg  </row>
325ea1d6981Smrg</tbody>
326ea1d6981Smrg</tgroup>
327ea1d6981Smrg</informaltable>
328ea1d6981Smrg
329ea1d6981Smrg<para>
330ea1d6981SmrgThis request associates window with system_window. The window_type indicates the native window system of the application making the request. For non-X window_types both the embedding manager and the server must be executing on the same host. When system_window is Microsoft Windows or OS/2 Presentation Manager, the system_window is an HWND; when the native window system is Macintosh, the system_window is a WindowPtr and a Rect. The window may be used for any X request that takes a Window.
331ea1d6981Smrg</para>
332ea1d6981Smrg
333ea1d6981Smrg<para><emphasis role='bold'>AppGroupDestroyAssociation</emphasis></para>
334ea1d6981Smrg
335ea1d6981Smrg<informaltable frame='none'>
336ea1d6981Smrg<?dbfo keep-together="always" ?>
337ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
338ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
339ea1d6981Smrg<tbody>
340ea1d6981Smrg  <row>
341ea1d6981Smrg    <entry>window: WINDOW</entry>
342ea1d6981Smrg  </row>
343ea1d6981Smrg</tbody>
344ea1d6981Smrg</tgroup>
345ea1d6981Smrg</informaltable>
346ea1d6981Smrg
347ea1d6981Smrg<para>
348ea1d6981SmrgThis request destroys the association created with AppGroupCreateAssociation. The window is destroyed. The system_window that was specified in the AppGroupCreateAssociation request is not affected.
349ea1d6981Smrg</para>
350ea1d6981Smrg
351ea1d6981Smrg</sect1>
352ea1d6981Smrg
353ea1d6981Smrg<sect1 id='Changes_to_Existing_Requests'>
354ea1d6981Smrg<title>Changes to Existing Requests</title>
355ea1d6981Smrg
356ea1d6981Smrg<sect2 id='MapWindow'>
357ea1d6981Smrg<title>MapWindow</title>
358ea1d6981Smrg
359ea1d6981Smrg<para>
360ea1d6981SmrgIf the override-redirect attribute of the window is False and if the window is a child of a root window and if the window belongs to an application that is in an application group and if some other application is the application group leader for that group, then a MapRequest event is generated and the window remains unmapped. Otherwise, the core protocol semantics apply.
361ea1d6981Smrg</para>
362ea1d6981Smrg
363ea1d6981Smrg</sect2>
364ea1d6981Smrg<sect2 id='ConfigureWindow'>
365ea1d6981Smrg<title>ConfigureWindow</title>
366ea1d6981Smrg
367ea1d6981Smrg<para>
368ea1d6981SmrgIf the override-redirect attribute of the window is False and if the window is a child of a root window and if the window belongs to an application that is in an application group and if some other application is the application group leader for that group, then a ConfigureRequest event is generated and the window remains unchanged. Otherwise, the core protocol semantics apply.
369ea1d6981Smrg</para>
370ea1d6981Smrg
371ea1d6981Smrg</sect2>
372ea1d6981Smrg<sect2 id='CreateWindow'>
373ea1d6981Smrg<title>CreateWindow</title>
374ea1d6981Smrg
375ea1d6981Smrg<para>
376ea1d6981SmrgWhen a program in an Application Group creates a window that is a child of a root window and specifies CopyFromParent for the Visual, if the single_screen attribute is True and the root_visual attribute is set to something other than None, then the window will be created using the Application Group’s root_visual, otherwise core protocol semantics apply.
377ea1d6981Smrg</para>
378ea1d6981Smrg
379ea1d6981Smrg<para>
380ea1d6981SmrgWhen a program in an Application Group creates a window that is a child of a root window and specifies CopyFromParent for the Colormap, if the single_screen attribute is True, the default_colormap attribute is set to something other than None, and the window’s Visual is the same as the Application Group’s root_visual attribute, then the window will be created using the Application Group’s default_colormap, otherwise core protocol semantics apply.
381ea1d6981Smrg</para>
382ea1d6981Smrg
383ea1d6981Smrg</sect2>
384ea1d6981Smrg
385ea1d6981Smrg<sect2 id='ChangeWindowAttributes'>
386ea1d6981Smrg<title>ChangeWindowAttributes</title>
387ea1d6981Smrg
388ea1d6981Smrg<para>
389ea1d6981SmrgWhen a program in an Application Group changes the attributes of a window that is a child of a root window and specifies CopyFromParent for the Colormap, if the single_screen attribute is True, the default_colormap attribute is set to something other than None, and the window’s Visual is the same as the Application Group’s root_visual attribute, then the window will be created using the Application Group’s default_colormap, otherwise core protocol semantics apply.
390ea1d6981Smrg</para>
391ea1d6981Smrg
392ea1d6981Smrg</sect2>
393ea1d6981Smrg
394ea1d6981Smrg</sect1>
395ea1d6981Smrg
396ea1d6981Smrg<sect1 id='Changes_to_Existing_Events'>
397ea1d6981Smrg<title>Changes to Existing Events</title>
398ea1d6981Smrg
399ea1d6981Smrg<para>
400ea1d6981SmrgWhen the top-level window of an application that is a member of an Application Group  is the target of a MapWindow or ConfigureWindow request, if there is an Application Group Leader then MapRequest and ConfigureRequest events are automatically delivered to it, otherwise the core protocol semantics apply, i.e. they are delivered to the client, if any, that has SubstructureRedirect set in its root-window event mask, e.g. the window manager.
401ea1d6981Smrg</para>
402ea1d6981Smrg
403ea1d6981Smrg<note><para>
404ea1d6981SmrgThe Application Group Leader must not select SubstructuRedirect events on a root window as doing so would result in a core protocol error; only one client is permitted to do so, and that is usually the window manager.
405ea1d6981Smrg</para></note>
406ea1d6981Smrg
407ea1d6981Smrg
408ea1d6981Smrg<sect2 id='MapRequest'>
409ea1d6981Smrg<title>MapRequest</title>
410ea1d6981Smrg
411ea1d6981Smrg<para>
412d63b911fSmrgWhen a MapWindow request is received for a window whose override-redirect attribute is set to False and whose parent is the root window and the window belongs to an application that is in an application group and there is an application group leader for the group, then this event is delivered to the Application Group Leader with the parent field in the event set to the AppGroup ID. Otherwise the core protocol semantics apply.
413ea1d6981Smrg</para>
414ea1d6981Smrg
415ea1d6981Smrg</sect2>
416ea1d6981Smrg<sect2 id='ConfigureRequest'>
417ea1d6981Smrg<title>ConfigureRequest</title>
418ea1d6981Smrg
419ea1d6981Smrg<para>
420d63b911fSmrgWhen a ConfigureWindow request is received for a window whose override-redirect attribute is set to False and whose parent is the root window and the window belongs to an application that is in an application group and there is an application group leader for the group, then this event is delivered to the Application Group Leader with the parent field in the event set to the AppGroup ID. Otherwise the core protocol semantics apply.
421ea1d6981Smrg</para>
422ea1d6981Smrg
423ea1d6981Smrg</sect2>
424ea1d6981Smrg</sect1>
425ea1d6981Smrg
426ea1d6981Smrg<sect1 id='Errors'>
427ea1d6981Smrg<title>Errors</title>
428ea1d6981Smrg
429ea1d6981Smrg<sect2 id='AppGroupQueryVersion'>
430ea1d6981Smrg<title>AppGroupQueryVersion</title>
431ea1d6981Smrg
432ea1d6981Smrg<para>
433ea1d6981SmrgThere are no errors for AppGroupQueryVersion.
434ea1d6981Smrg</para>
435ea1d6981Smrg
436ea1d6981Smrg</sect2>
437ea1d6981Smrg
438ea1d6981Smrg<sect2 id='AppGroupCreate'>
439ea1d6981Smrg<title>AppGroupCreate</title>
440ea1d6981Smrg
441ea1d6981Smrg<para>
442ea1d6981SmrgA Window error is returned if default_root is specified and is not a valid root window..
443ea1d6981Smrg</para>
444ea1d6981Smrg
445ea1d6981Smrg<para>
446ea1d6981SmrgA Color error is returned default_colormap is specified but default_colormap is not a valid colormap for the screen of default_root.
447ea1d6981Smrg</para>
448ea1d6981Smrg
449ea1d6981Smrg<para>
450ea1d6981SmrgA Match error is returned if root_visual and default_colormap are both specified, but
451ea1d6981Smrg</para>
452ea1d6981Smrg
453ea1d6981Smrg<para>
454ea1d6981Smrgdefault_colormap’s visual is not root_visual.
455ea1d6981Smrg</para>
456ea1d6981Smrg
457ea1d6981Smrg<para>
458ea1d6981SmrgA Match error is returned if root_visual does not exist for the screen of the default_root.
459ea1d6981Smrg</para>
460ea1d6981Smrg
461ea1d6981Smrg</sect2>
462ea1d6981Smrg
463ea1d6981Smrg<sect2 id='AppGroupDestroy'>
464ea1d6981Smrg<title>AppGroupDestroy</title>
465ea1d6981Smrg
466ea1d6981Smrg<para>
467ea1d6981SmrgAn AppGroup error is returned if app_group is not a valid Application Group.
468ea1d6981Smrg</para>
469ea1d6981Smrg
470ea1d6981Smrg<para>
471ea1d6981SmrgAn Access error is returned if an untrusted application attempts to destroy an Application Group created by a trusted application.
472ea1d6981Smrg</para>
473ea1d6981Smrg
474ea1d6981Smrg</sect2>
475ea1d6981Smrg
476ea1d6981Smrg<sect2 id='AppGroupGetAttr'>
477ea1d6981Smrg<title>AppGroupGetAttr</title>
478ea1d6981Smrg
479ea1d6981Smrg<para>
480ea1d6981SmrgAn AppGroup error is returned if app_group is not a valid Application Group.
481ea1d6981Smrg</para>
482ea1d6981Smrg
483ea1d6981Smrg<para>
484ea1d6981SmrgAn Access error is returned if an untrusted application attempts to get the attributes of an Application Group created by a trusted application.
485ea1d6981Smrg</para>
486ea1d6981Smrg
487ea1d6981Smrg</sect2>
488ea1d6981Smrg
489ea1d6981Smrg<sect2 id='AppGroupQuery'>
490ea1d6981Smrg<title>AppGroupQuery</title>
491ea1d6981Smrg
492ea1d6981Smrg<para>
493ea1d6981SmrgAn Access error is returned if an untrusted application attempts to query the Application Group of a trusted application.
494ea1d6981Smrg</para>
495ea1d6981Smrg
496ea1d6981Smrg</sect2>
497ea1d6981Smrg
498ea1d6981Smrg<sect2 id='AppGroupCreateAssociation'>
499ea1d6981Smrg<title>AppGroupCreateAssociation</title>
500ea1d6981Smrg
501ea1d6981Smrg<para>
502ea1d6981SmrgA Match error is returned if the X server does not support the window_type.
503ea1d6981Smrg</para>
504ea1d6981Smrg
505ea1d6981Smrg<para>
506ea1d6981SmrgAn Access error may be returned if the X server only supports the window_type on the local host and the program making the request is on a non-local host.
507ea1d6981Smrg</para>
508ea1d6981Smrg
509ea1d6981Smrg<para>
510ea1d6981SmrgA Window error may be returned for system-specific errors related to system_window, e.g. system_window does not represent a valid native window.
511ea1d6981Smrg</para>
512ea1d6981Smrg
513ea1d6981Smrg</sect2>
514ea1d6981Smrg
515ea1d6981Smrg<sect2 id='AppGroupDestroyAssociation'>
516ea1d6981Smrg<title>AppGroupDestroyAssociation</title>
517ea1d6981Smrg
518ea1d6981Smrg<para>
519ea1d6981SmrgA Window error is returned if window was not specified in a previous AppGroupCreateAssociation request.
520ea1d6981Smrg</para>
521ea1d6981Smrg
522ea1d6981Smrg</sect2>
523ea1d6981Smrg</sect1>
524ea1d6981Smrg
525ea1d6981Smrg<sect1 id='Encoding'>
526ea1d6981Smrg<title>Encoding</title>
527ea1d6981Smrg
528ea1d6981Smrg<para>
529ea1d6981SmrgPlease refer to the X11 Protocol encoding document as this document uses conventions established there.
530ea1d6981Smrg</para>
531ea1d6981Smrg
532ea1d6981Smrg
533ea1d6981Smrg<para>
534ea1d6981SmrgThe name of this extension is XC-APPGROUP
535ea1d6981Smrg</para>
536ea1d6981Smrg
537ea1d6981Smrg
538ea1d6981Smrg<literallayout class='monospaced'>
539ea1d6981Smrg<emphasis role='bold'>AppGroupQueryVersion</emphasis>
540ea1d6981Smrg      1      CARD8        opcode
541ea1d6981Smrg      1      0            XC-APPGROUP opcode
542ea1d6981Smrg      2      3            length
543ea1d6981Smrg      2      CARD16       client_major_version
544ea1d6981Smrg      2      CARD16       client_minor_version
545ea1d6981Smrg=&gt;
546ea1d6981Smrg      1      1            Reply
547ea1d6981Smrg      1                   unused
548ea1d6981Smrg      2      CARD16       sequence_number
549ea1d6981Smrg      4      0            length
550ea1d6981Smrg      2      CARD16       server_major_version
551ea1d6981Smrg      2      CARD16       server_minor_version
552ea1d6981Smrg      20                  unused
553ea1d6981Smrg</literallayout>
554ea1d6981Smrg
555ea1d6981Smrg
556ea1d6981Smrg<literallayout class='monospaced'>
557ea1d6981Smrg<emphasis role='bold'>AppGroupCreate</emphasis>
558ea1d6981Smrg      1      CARD8            opcode
559ea1d6981Smrg      1      1                XC-APPGROUP opcode
560ea1d6981Smrg      2      8+n              length
561ea1d6981Smrg      4      XID              app_group
562ea1d6981Smrg      4      BITMASK          attrib_mask
563ea1d6981Smrg             #x00000001   app_group_leader
564ea1d6981Smrg             #x00000002   single_screen
565ea1d6981Smrg             #0x0000004   default_root
566ea1d6981Smrg             #x00000008   root_visual
567ea1d6981Smrg             #x00000010   default_colormap
568ea1d6981Smrg             #x00000020   black_pixel
569ea1d6981Smrg             #x00000040   white_pixel
570ea1d6981Smrg      n      LISTofVALUE      value-list
571ea1d6981SmrgVALUEs
572ea1d6981Smrg      4      BOOL             app_group_leader
573ea1d6981Smrg      4      BOOL             single_screen
574ea1d6981Smrg      4      WINDOW           default_root
575ea1d6981Smrg      4      VISUALID         root_visual
576ea1d6981Smrg      4      COLORMAP         default_colormap
577ea1d6981Smrg      4      CARD32           black_pixel
578ea1d6981Smrg      4      CARD32           white_pixel
579ea1d6981Smrg</literallayout>
580ea1d6981Smrg
581ea1d6981Smrg
582ea1d6981Smrg<literallayout class='monospaced'>
583ea1d6981Smrg<emphasis role='bold'>AppGroupDestroy</emphasis>
584ea1d6981Smrg      1      CARD8            opcode
585ea1d6981Smrg      1      2                XC-APPGROUP opcode
586ea1d6981Smrg      2      2                length
587ea1d6981Smrg      4      XID              app_group
588ea1d6981Smrg</literallayout>
589ea1d6981Smrg
590ea1d6981Smrg<literallayout class='monospaced'>
591ea1d6981Smrg<emphasis role='bold'>AAppGroupGetAttr</emphasis>
592ea1d6981Smrg      1      CARD8            opcode
593ea1d6981Smrg      1      4                XC-APPGROUP opcode
594ea1d6981Smrg      2      2                length
595ea1d6981Smrg      4      XID              app_group
596ea1d6981Smrg=&gt;
597ea1d6981Smrg      1      1                Reply
598ea1d6981Smrg      1                       unused
599ea1d6981Smrg      2      CARD16           sequence_number
600ea1d6981Smrg      4      0                length
601ea1d6981Smrg      4      WINDOW           default_root
602ea1d6981Smrg      4      VISUALID         root_visual
603ea1d6981Smrg      4      COLORMAP         default_colormap
604ea1d6981Smrg      4      CARD32           black_pixel
605ea1d6981Smrg      4      CARD32           whte_pixel
606ea1d6981Smrg      1      BOOL             single_screen
607ea1d6981Smrg      1      BOOL             app_group_leader
608ea1d6981Smrg      2                       unused
609ea1d6981Smrg</literallayout>
610ea1d6981Smrg
611ea1d6981Smrg
612ea1d6981Smrg<literallayout class='monospaced'>
613ea1d6981Smrg<emphasis role='bold'>AppGroupQuery</emphasis>
614ea1d6981Smrg      1      CARD8            opcode
615ea1d6981Smrg      1      5                XC-APPGROUP opcode
616ea1d6981Smrg      2      2                length
617ea1d6981Smrg      4      XID              resource
618ea1d6981Smrg=&gt;
619ea1d6981Smrg      1      1                Reply
620ea1d6981Smrg      1                       unused
621ea1d6981Smrg      2      CARD16           sequence_number
622ea1d6981Smrg      4      0                length
623ea1d6981Smrg      4      XID              app_group
624ea1d6981Smrg      20                      unused
625ea1d6981Smrg</literallayout>
626ea1d6981Smrg
627ea1d6981Smrg<literallayout class='monospaced'>
628ea1d6981Smrg<emphasis role='bold'>AppGroupCreateAssoc</emphasis>
629ea1d6981Smrg      1      CARD8            opcode
630ea1d6981Smrg      1      6                XC-APPGROUP opcode
631ea1d6981Smrg      2      n                length
632ea1d6981Smrg      4      WINDOW           window
633ea1d6981Smrg      2      CARD16           window_type
634ea1d6981Smrg             #0      X11
635ea1d6981Smrg             #1      Macintosh
636ea1d6981Smrg             #2      Win32, OS/2 PM 2.x
637ea1d6981Smrg             #3      Win16, OS/2 PM 1.x
638ea1d6981Smrg      2      n                system_window_len
639ea1d6981Smrg      n      LISTofCARD8      system_window
640ea1d6981Smrg</literallayout>
641ea1d6981Smrg
642ea1d6981Smrg
643ea1d6981Smrg<literallayout class='monospaced'>
644ea1d6981Smrg<emphasis role='bold'>AppGroupDestroyAssoc</emphasis>
645ea1d6981Smrg      1      CARD8            opcode
646ea1d6981Smrg      1      7                XC-APPGROUP opcode
647ea1d6981Smrg      2      2                length
648ea1d6981Smrg      4      WINDOW           window
649ea1d6981Smrg</literallayout>
650ea1d6981Smrg
651ea1d6981Smrg</sect1>
652ea1d6981Smrg
653ea1d6981Smrg<sect1 id='Library_API'>
654ea1d6981Smrg<title>Library API</title>
655ea1d6981Smrg
656ea1d6981Smrg<informaltable frame='none'>
657ea1d6981Smrg<?dbfo keep-together="always" ?>
658ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
659ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
660ea1d6981Smrg<tbody>
661ea1d6981Smrg  <row>
662ea1d6981Smrg    <entry role='functiondecl'>
663ea1d6981SmrgStatus <emphasis>XagQueryVersion</emphasis> (<emphasis> xkb, keycode</emphasis>)                              /* macro */
664ea1d6981Smrg    </entry>
665ea1d6981Smrg  </row>
666ea1d6981Smrg  <row>
667ea1d6981Smrg    <entry role='functionargdecl'>
668ea1d6981SmrgDisplay            <emphasis>dpy</emphasis>;
669ea1d6981Smrg    </entry>
670ea1d6981Smrg  </row>
671ea1d6981Smrg  <row>
672ea1d6981Smrg    <entry role='functionargdecl'>
673ea1d6981Smrgint *            <emphasis>major_version_return</emphasis>;
674ea1d6981Smrg    </entry>
675ea1d6981Smrg  </row>
676ea1d6981Smrg  <row>
677ea1d6981Smrg    <entry role='functionargdecl'>
678ea1d6981Smrgint *            <emphasis>minor_version_return</emphasis>;
679ea1d6981Smrg    </entry>
680ea1d6981Smrg  </row>
681ea1d6981Smrg</tbody>
682ea1d6981Smrg</tgroup>
683ea1d6981Smrg</informaltable>
684ea1d6981Smrg
685ea1d6981Smrg<para>
686ea1d6981SmrgXagQueryVersion sets major_version_return and minor_version_return to the major and minor Application Group protocol version supported by the server. If the Xag library is compatible with the version returned by the server it returns non-zero. If dpy does not support the Application Group extension, or if the server and library protocol versions are incompatible, or if there was an error during communication with the server, it returns zero. No other Xag functions may be called before this function. If a program violates this rule, the effects of all subsequent Xag calls that it makes are undefined.
687ea1d6981Smrg</para>
688ea1d6981Smrg
689ea1d6981Smrg<note><para>
690ea1d6981SmrgAn embedding manager in, e.g. a Personal Computer Web Browser, will need to open a connection to the Personal Computer X server by calling XOpenDisplay() before using the Application Group extension.
691ea1d6981Smrg</para></note>
692ea1d6981Smrg
693ea1d6981Smrg<para>
694ea1d6981SmrgAn embedding manager such as a web browser that intends to embed programs in an Application Group should create the Application Group with XagCreateEmbeddedApplicationGroup.
695ea1d6981Smrg</para>
696ea1d6981Smrg
697ea1d6981Smrg
698ea1d6981Smrg<informaltable frame='none'>
699ea1d6981Smrg<?dbfo keep-together="always" ?>
700ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
701ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
702ea1d6981Smrg<tbody>
703ea1d6981Smrg  <row>
704ea1d6981Smrg    <entry role='functiondecl'>
705ea1d6981SmrgStatus XagCreateEmbeddedApplicationGroup(
706ea1d6981Smrg    </entry>
707ea1d6981Smrg  </row>
708ea1d6981Smrg  <row>
709ea1d6981Smrg    <entry role='functionargdecl'>
710ea1d6981Smrg      Display*      dpy,
711ea1d6981Smrg    </entry>
712ea1d6981Smrg  </row>
713ea1d6981Smrg  <row>
714ea1d6981Smrg    <entry role='functionargdecl'>
715ea1d6981Smrg      VisualID      root_visual,
716ea1d6981Smrg    </entry>
717ea1d6981Smrg  </row>
718ea1d6981Smrg  <row>
719ea1d6981Smrg    <entry role='functionargdecl'>
720ea1d6981Smrg      Colormap      default_colormap,
721ea1d6981Smrg    </entry>
722ea1d6981Smrg  </row>
723ea1d6981Smrg  <row>
724ea1d6981Smrg    <entry role='functionargdecl'>
725ea1d6981Smrg      unsigned long      black_pixel,
726ea1d6981Smrg    </entry>
727ea1d6981Smrg  </row>
728ea1d6981Smrg  <row>
729ea1d6981Smrg    <entry role='functionargdecl'>
730ea1d6981Smrg      unsigned long      white_pixel,
731ea1d6981Smrg    </entry>
732ea1d6981Smrg  </row>
733ea1d6981Smrg  <row>
734ea1d6981Smrg    <entry role='functionargdecl'>
735ea1d6981Smrg      XAppGroup*      app_group_return);
736ea1d6981Smrg    </entry>
737ea1d6981Smrg  </row>
738ea1d6981Smrg</tbody>
739ea1d6981Smrg</tgroup>
740ea1d6981Smrg</informaltable>
741ea1d6981Smrg
742ea1d6981Smrg
743ea1d6981Smrg<para>
744ea1d6981SmrgXagCreateEmbeddedApplicationGroup creates an Application Group for an embedding manager with the attributes specified. It also sets the default_root attribute to DefaultRoot(dpy, DefaultsScreen(dpy)) and the single_screen and app_group_leader attributes to True. It returns the Application Group ID in app_group_return.
745ea1d6981Smrg</para>
746ea1d6981Smrg
747ea1d6981Smrg<para>
748ea1d6981SmrgYou can create an Application Group without intending to do embedding. One reason for doing this is to give a group of clients their own font-path.
749ea1d6981Smrg</para>
750ea1d6981Smrg
751ea1d6981Smrg<note><para>
752ea1d6981SmrgA special font-path can be created by creating an Application Group, getting an Authorization using XSecurityGenerateAuthorization, and then running ‘xset fp+ &lt;new font path&gt;’ as a member of the Application Group. Font-path elements added in this way will be "private" to the Application Group.
753ea1d6981Smrg</para></note>
754ea1d6981Smrg
755ea1d6981Smrg<informaltable frame='none'>
756ea1d6981Smrg<?dbfo keep-together="always" ?>
757ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
758ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
759ea1d6981Smrg<tbody>
760ea1d6981Smrg  <row>
761ea1d6981Smrg    <entry role='functiondecl'>
762ea1d6981SmrgStatus XagCreateNonembeddedApplicationGroup(
763ea1d6981Smrg    </entry>
764ea1d6981Smrg  </row>
765ea1d6981Smrg  <row>
766ea1d6981Smrg    <entry role='functionargdecl'>
767ea1d6981Smrg      Display*      dpy,
768ea1d6981Smrg    </entry>
769ea1d6981Smrg  </row>
770ea1d6981Smrg  <row>
771ea1d6981Smrg    <entry role='functionargdecl'>
772ea1d6981Smrg      XAppGroup*      app_group_return);
773ea1d6981Smrg    </entry>
774ea1d6981Smrg  </row>
775ea1d6981Smrg</tbody>
776ea1d6981Smrg</tgroup>
777ea1d6981Smrg</informaltable>
778ea1d6981Smrg
779ea1d6981Smrg<para>
780ea1d6981SmrgAn Application Group created with XagCreateNonembeddedApplicationGroup will have the default_root, root_visual, and default_colormap attributes all set to None; the single_screen and app_group_leader attributes are set to False, and the black_pixel and white_pixel attributes are not used since the default_colormap attribute is None.
781ea1d6981Smrg</para>
782ea1d6981Smrg
783ea1d6981Smrg<para>
784ea1d6981SmrgTo destroy an Application Group use XagDestroyApplicationGroup.
785ea1d6981Smrg</para>
786ea1d6981Smrg
787ea1d6981Smrg<informaltable frame='none'>
788ea1d6981Smrg<?dbfo keep-together="always" ?>
789ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
790ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
791ea1d6981Smrg<tbody>
792ea1d6981Smrg  <row>
793ea1d6981Smrg    <entry role='functiondecl'>
794ea1d6981SmrgStatus XagDestroyApplicationGroup(
795ea1d6981Smrg    </entry>
796ea1d6981Smrg  </row>
797ea1d6981Smrg  <row>
798ea1d6981Smrg    <entry role='functionargdecl'>
799ea1d6981Smrg      Display*      dpy,
800ea1d6981Smrg    </entry>
801ea1d6981Smrg  </row>
802ea1d6981Smrg  <row>
803ea1d6981Smrg    <entry role='functionargdecl'>
804ea1d6981Smrg      XAppGroup      app_group);
805ea1d6981Smrg    </entry>
806ea1d6981Smrg  </row>
807ea1d6981Smrg</tbody>
808ea1d6981Smrg</tgroup>
809ea1d6981Smrg</informaltable>
810ea1d6981Smrg
811ea1d6981Smrg<para>
812ea1d6981SmrgThe Application Group specified by app_group is destroyed. If the Application Group was created using XagCreateEmbeddingApplicationGroup, i.e. and therefore the app_group_leader attribute is True, all programs that are members of the Application Group are killed as if a KillClient request had been issued.
813ea1d6981Smrg</para>
814ea1d6981Smrg
815ea1d6981Smrg
816ea1d6981Smrg<para>
817ea1d6981SmrgTo retrieve the attributes of an Application Group use XagGetApplicationGroupAttributes.
818ea1d6981Smrg</para>
819ea1d6981Smrg
820ea1d6981Smrg
821ea1d6981Smrg<informaltable frame='none'>
822ea1d6981Smrg<?dbfo keep-together="always" ?>
823ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
824ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
825ea1d6981Smrg<tbody>
826ea1d6981Smrg  <row>
827ea1d6981Smrg    <entry role='functiondecl'>
828ea1d6981SmrgStatus XagGetApplicationGroupAttributes(
829ea1d6981Smrg    </entry>
830ea1d6981Smrg  </row>
831ea1d6981Smrg  <row>
832ea1d6981Smrg    <entry role='functionargdecl'>
833ea1d6981Smrg      Display*      dpy,
834ea1d6981Smrg    </entry>
835ea1d6981Smrg  </row>
836ea1d6981Smrg  <row>
837ea1d6981Smrg    <entry role='functionargdecl'>
838ea1d6981Smrg      XAppGroup      app_group,
839ea1d6981Smrg    </entry>
840ea1d6981Smrg  </row>
841ea1d6981Smrg  <row>
842ea1d6981Smrg    <entry role='functionargdecl'>
843ea1d6981Smrg      ...);
844ea1d6981Smrg    </entry>
845ea1d6981Smrg  </row>
846ea1d6981Smrg</tbody>
847ea1d6981Smrg</tgroup>
848ea1d6981Smrg</informaltable>
849ea1d6981Smrg
850ea1d6981Smrg
851ea1d6981Smrg
852ea1d6981Smrg<para>
853ea1d6981SmrgXagGetApplicationGroupAttributes is a varargs function that retrieves the Application Group’s attributes specified in the vararg parameter list.
854ea1d6981Smrg</para>
855ea1d6981Smrg
856ea1d6981Smrg<para>
857ea1d6981SmrgThe attributes that may be specified are: XagNappGroupLeader, XagNsingleScreen, XagNdefaultRoot, XagNrootVisual, XagNdefaultColormap, XagNblackPixel, and XagNwhitePixel; which correspond to app_group_leader, single_screen, default_root, root_visual, default_colormap, black_pixel, and white_pixel respectively. See AppGroupCreate in Section 3 for a description of each attribute.
858ea1d6981Smrg</para>
859ea1d6981Smrg
860ea1d6981Smrg<para>
861ea1d6981SmrgThe types for each of the parameters are pointers to the following:
862ea1d6981Smrg</para>
863ea1d6981Smrg
864ea1d6981Smrg<literallayout>
865ea1d6981Smrg      single_screen          Bool
866ea1d6981Smrg      default_root           Window
867ea1d6981Smrg      root_visual            VisualID
868ea1d6981Smrg      default_colormap       Colormap
869ea1d6981Smrg      black_pixel            unsigned long
870ea1d6981Smrg      white_pixel            unsigned long
871ea1d6981Smrg      app_group_leader       Bool
872ea1d6981Smrg</literallayout>
873ea1d6981Smrg
874ea1d6981Smrg<para><programlisting>
875ea1d6981SmrgExample:
876ea1d6981Smrg      ...
877ea1d6981Smrg      Boolean app_group_leader, single_screen;
878ea1d6981Smrg      Window default_root;
879ea1d6981Smrg      VisualID root_visual;
880ea1d6981Smrg      Colormap default_colormap;
881ea1d6981Smrg      Pixel black_pixel, white_pixel;
882ea1d6981Smrg      ...
883ea1d6981Smrg      status = XagGetApplicationGroupAttributes(dpy, app_group,
884ea1d6981Smrg            XagNappGroupLeader, &amp;app_group_leader,
885ea1d6981Smrg            XagNsingleScreen, &amp;single_screen,
886ea1d6981Smrg            XagNdefault_root, &amp;default_root,
887ea1d6981Smrg            XagNrootVisual, &amp;root_visual,
888ea1d6981Smrg            XagNdefaultColormap, &amp;default_colormap,
889ea1d6981Smrg            XagNblackPixel, &amp;black_pixel,
890ea1d6981Smrg            XagNwhitePixel, &amp;white_pixel,
891ea1d6981Smrg            NULL);
892ea1d6981Smrg      ...
893ea1d6981Smrg</programlisting></para>
894ea1d6981Smrg
895ea1d6981Smrg
896ea1d6981Smrg<para>
897ea1d6981SmrgTo determine which Application Group a resource (such as a window) belongs to, use XagQueryApplicationGroup.
898ea1d6981Smrg</para>
899ea1d6981Smrg
900ea1d6981Smrg<informaltable frame='none'>
901ea1d6981Smrg<?dbfo keep-together="always" ?>
902ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
903ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
904ea1d6981Smrg<tbody>
905ea1d6981Smrg  <row>
906ea1d6981Smrg    <entry role='functiondecl'>
907ea1d6981SmrgStatus XagQueryApplicationGroup(
908ea1d6981Smrg    </entry>
909ea1d6981Smrg  </row>
910ea1d6981Smrg  <row>
911ea1d6981Smrg    <entry role='functionargdecl'>
912ea1d6981Smrg      Display*      dpy,
913ea1d6981Smrg    </entry>
914ea1d6981Smrg  </row>
915ea1d6981Smrg  <row>
916ea1d6981Smrg    <entry role='functionargdecl'>
917ea1d6981Smrg      XID      resource,
918ea1d6981Smrg    </entry>
919ea1d6981Smrg  </row>
920ea1d6981Smrg  <row>
921ea1d6981Smrg    <entry role='functionargdecl'>
922ea1d6981Smrg      XAppGroup*      app_group_return);
923ea1d6981Smrg    </entry>
924ea1d6981Smrg  </row>
925ea1d6981Smrg</tbody>
926ea1d6981Smrg</tgroup>
927ea1d6981Smrg</informaltable>
928ea1d6981Smrg
929ea1d6981Smrg
930ea1d6981Smrg<para>
931ea1d6981SmrgThe Application Group is returned in app_group_return, if the resource is not in any Application Group then app_group_return will be set to None.
932ea1d6981Smrg</para>
933ea1d6981Smrg
934ea1d6981Smrg<para>
935ea1d6981SmrgTo associate an X Window ID with a system-specific window ID, such as a HWND or a WindowPtr, use XagCreateAssociation.
936ea1d6981Smrg</para>
937ea1d6981Smrg
938ea1d6981Smrg<informaltable frame='none'>
939ea1d6981Smrg<?dbfo keep-together="always" ?>
940ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
941ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
942ea1d6981Smrg<tbody>
943ea1d6981Smrg  <row>
944ea1d6981Smrg    <entry role='functiondecl'>
945ea1d6981SmrgStatus XagCreateAssociation(
946ea1d6981Smrg    </entry>
947ea1d6981Smrg  </row>
948ea1d6981Smrg  <row>
949ea1d6981Smrg    <entry role='functionargdecl'>
950ea1d6981Smrg      Display*      dpy,
951ea1d6981Smrg    </entry>
952ea1d6981Smrg  </row>
953ea1d6981Smrg  <row>
954ea1d6981Smrg    <entry role='functionargdecl'>
955ea1d6981Smrg      Window*      window_return,
956ea1d6981Smrg    </entry>
957ea1d6981Smrg  </row>
958ea1d6981Smrg  <row>
959ea1d6981Smrg    <entry role='functionargdecl'>
960ea1d6981Smrg      void*      system_window);
961ea1d6981Smrg    </entry>
962ea1d6981Smrg  </row>
963ea1d6981Smrg</tbody>
964ea1d6981Smrg</tgroup>
965ea1d6981Smrg</informaltable>
966ea1d6981Smrg
967ea1d6981Smrg
968ea1d6981Smrg<para>
969ea1d6981SmrgThe window_ret may be used as the target for a ReparentWindow request.
970ea1d6981Smrg</para>
971ea1d6981Smrg
972ea1d6981Smrg<note><para>
973ea1d6981SmrgBecause XReparentWindow is not constrained in the same way that Win32’s  SetParent and the Macintosh are, there is no reason to call XagCreateAssociation in an X-based embedding manager. As such if XagCreateAssociation is called in a native X program, the window_return will be the same as the system_window, and the implementation may even elect to not generate any protocol.
974ea1d6981Smrg</para></note>
975ea1d6981Smrg
976ea1d6981Smrg<para>To create an association on the Macintosh:</para>
977ea1d6981Smrg
978ea1d6981Smrg<para><programlisting>
979ea1d6981Smrg      struct {
980ea1d6981Smrg          WindowPtr win;
981ea1d6981Smrg          Rect rect;
982ea1d6981Smrg      } system_window;
983ea1d6981Smrg      system_window.win = win_ptr;
984ea1d6981Smrg      system_window.rect.top = system_window.rect.left = 20;
985ea1d6981Smrg      system_window.rect.bottom = 180;
986ea1d6981Smrg      system_window.rect.right = 380;
987ea1d6981Smrg</programlisting></para>
988ea1d6981Smrg
989ea1d6981Smrg<para><programlisting>
990ea1d6981Smrg      status = XagCreateAssociation (dpy, &amp;window, (void*)&amp;system_window);
991ea1d6981Smrg</programlisting></para>
992ea1d6981Smrg
993ea1d6981Smrg<para>
994ea1d6981SmrgTo create an association using a Win16, Win32, or OS/2 PM:
995ea1d6981Smrg</para>
996ea1d6981Smrg
997ea1d6981Smrg<para><programlisting>
998ea1d6981Smrg      HWND system_window;
999ea1d6981Smrg      status = XagCreateAssociation (dpy, &amp;window, (void*)&amp;system_window);
1000ea1d6981Smrg</programlisting></para>
1001ea1d6981Smrg
1002ea1d6981Smrg<para>
1003ea1d6981SmrgTo destroy the association created with XagCreateAssociation use XagDestroyAssociation.
1004ea1d6981Smrg</para>
1005ea1d6981Smrg
1006ea1d6981Smrg
1007ea1d6981Smrg<informaltable frame='none'>
1008ea1d6981Smrg<?dbfo keep-together="always" ?>
1009ea1d6981Smrg<tgroup cols='1' colsep='0' rowsep='0'>
1010ea1d6981Smrg<colspec colname='c1' colwidth='1.0*'/>
1011ea1d6981Smrg<tbody>
1012ea1d6981Smrg  <row>
1013ea1d6981Smrg    <entry role='functiondecl'>
1014ea1d6981SmrgStatus XagDestroyAssociation(
1015ea1d6981Smrg    </entry>
1016ea1d6981Smrg  </row>
1017ea1d6981Smrg  <row>
1018ea1d6981Smrg    <entry role='functionargdecl'>
1019ea1d6981Smrg      Display*      dpy,
1020ea1d6981Smrg    </entry>
1021ea1d6981Smrg  </row>
1022ea1d6981Smrg  <row>
1023ea1d6981Smrg    <entry role='functionargdecl'>
1024ea1d6981Smrg      Window      window);
1025ea1d6981Smrg    </entry>
1026ea1d6981Smrg  </row>
1027ea1d6981Smrg</tbody>
1028ea1d6981Smrg</tgroup>
1029ea1d6981Smrg</informaltable>
1030ea1d6981Smrg
1031ea1d6981Smrg<para>
1032ea1d6981SmrgAfter calling XagDestroyAssociation the window may no longer be used to
1033ea1d6981Smrgreparent windows with XReparentWindow.
1034ea1d6981Smrg</para>
1035ea1d6981Smrg
1036ea1d6981Smrg<note><para>
1037ea1d6981SmrgLike XagCreateAssociation, if the native window system is X11 the implementation may elect  to not generate any protocol as a result of this function call in order to avoid unintentionally destroying the the system_window that was specified in the prior XagCreateAssociation call.
1038ea1d6981Smrg</para></note>
1039ea1d6981Smrg</sect1>
1040ea1d6981Smrg<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"  href="appendix.xml"/>
1041ea1d6981Smrg</article>
1042