agproto.h revision ea1d6981
1/*
2Copyright 1996, 1998, 2001  The Open Group
3
4Permission to use, copy, modify, distribute, and sell this software and its
5documentation for any purpose is hereby granted without fee, provided that
6the above copyright notice appear in all copies and that both that
7copyright notice and this permission notice appear in supporting
8documentation.
9
10The above copyright notice and this permission notice shall be included
11in all copies or substantial portions of the Software.
12
13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
17OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall
22not be used in advertising or otherwise to promote the sale, use or
23other dealings in this Software without prior written authorization
24from The Open Group.
25*/
26
27#ifndef _AGPROTO_H_ /* { */
28#define _AGPROTO_H_
29
30#include <X11/extensions/ag.h>
31
32#define X_XagQueryVersion		0
33#define X_XagCreate			1
34#define X_XagDestroy			2
35#define X_XagGetAttr			3
36#define X_XagQuery			4
37#define X_XagCreateAssoc		5
38#define X_XagDestroyAssoc		6
39
40#define XAppGroup CARD32
41
42/*
43* Redefine some basic types used by structures defined herein.  This allows
44* both the library and server to view communicated data as 32-bit entities,
45* thus preventing problems on 64-bit architectures where libXext sees this
46* data as 64 bits and the server sees it as 32 bits.
47*/
48
49#define Colormap CARD32
50#define VisualID CARD32
51#define Window CARD32
52
53typedef struct _XagQueryVersion {
54    CARD8	reqType;	/* always XagReqCode */
55    CARD8	xagReqType;	/* always X_XagQueryVersion */
56    CARD16	length;
57    CARD16	client_major_version;
58    CARD16	client_minor_version;
59} xXagQueryVersionReq;
60#define sz_xXagQueryVersionReq		8
61
62typedef struct {
63    BYTE	type;		/* X_Reply */
64    BOOL	pad1;
65    CARD16	sequence_number;
66    CARD32	length;
67    CARD16	server_major_version;
68    CARD16	server_minor_version;
69    CARD32	pad2;
70    CARD32	pad3;
71    CARD32	pad4;
72    CARD32	pad5;
73    CARD32	pad6;
74} xXagQueryVersionReply;
75#define sz_xXagQueryVersionReply	32
76
77/* Set AppGroup Attributes masks */
78#define XagSingleScreenMask		1 << 0
79#define XagDefaultRootMask		1 << XagNdefaultRoot
80#define XagRootVisualMask		1 << XagNrootVisual
81#define XagDefaultColormapMask		1 << XagNdefaultColormap
82#define XagBlackPixelMask		1 << XagNblackPixel
83#define XagWhitePixelMask		1 << XagNwhitePixel
84#define XagAppGroupLeaderMask		1 << XagNappGroupLeader
85
86typedef struct _XagCreate {
87    CARD8	reqType;	/* always XagReqCode */
88    CARD8	xagReqType;	/* always X_XagCreate */
89    CARD16	length;
90    XAppGroup	app_group;
91    CARD32	attrib_mask;	/* LISTofVALUE follows */
92} xXagCreateReq;
93#define sz_xXagCreateReq		12
94
95typedef struct _XagDestroy {
96    CARD8	reqType;	/* always XagReqCode */
97    CARD8	xagReqType;	/* always X_XagDestroy */
98    CARD16	length;
99    XAppGroup	app_group;
100} xXagDestroyReq;
101#define sz_xXagDestroyReq		8
102
103typedef struct _XagGetAttr {
104    CARD8	reqType;	/* always XagReqCode */
105    CARD8	xagReqType;	/* always X_XagGetAttr */
106    CARD16	length;
107    XAppGroup	app_group;
108} xXagGetAttrReq;
109#define sz_xXagGetAttrReq		8
110
111typedef struct {
112    BYTE	type;		/* X_Reply */
113    BOOL	pad1;
114    CARD16	sequence_number;
115    CARD32	length;
116    Window	default_root;
117    VisualID	root_visual;
118    Colormap	default_colormap;
119    CARD32	black_pixel;
120    CARD32	white_pixel;
121    BOOL	single_screen;
122    BOOL	app_group_leader;
123    CARD16	pad2;
124} xXagGetAttrReply;
125#define sz_xXagGetAttrReply		32
126
127typedef struct _XagQuery {
128    CARD8	reqType;	/* always XagReqCode */
129    CARD8	xagReqType;	/* always X_XagQuery */
130    CARD16	length;
131    CARD32	resource;
132} xXagQueryReq;
133#define sz_xXagQueryReq			8
134
135typedef struct {
136    BYTE	type;		/* X_Reply */
137    BOOL	pad1;
138    CARD16	sequence_number;
139    CARD32	length;
140    XAppGroup	app_group;
141    CARD32	pad2;
142    CARD32	pad3;
143    CARD32	pad4;
144    CARD32	pad5;
145    CARD32	pad6;
146} xXagQueryReply;
147#define sz_xXagQueryReply		32
148
149typedef struct _XagCreateAssoc {
150    CARD8	reqType;	/* always XagReqCode */
151    CARD8	xagReqType;	/* always X_XagCreateAssoc */
152    CARD16	length;
153    Window	window;
154    CARD16	window_type;
155    CARD16	system_window_len; /* LISTofCARD8 follows */
156} xXagCreateAssocReq;
157#define sz_xXagCreateAssocReq		12
158
159typedef struct _XagDestroyAssoc {
160    CARD8	reqType;	/* always XagReqCode */
161    CARD8	xagReqType;	/* always X_XagDestroyAssoc */
162    CARD16	length;
163    Window	window;
164} xXagDestroyAssocReq;
165#define sz_xXagDestroyAssocReq		8
166
167#undef XAppGroup
168/*
169 * Cancel the previous redefinition of the basic types, thus restoring their
170 * X.h definitions.
171 */
172
173#undef Window
174#undef Colormap
175#undef VisualID
176
177#endif /* } _AGPROTO_H_ */
178
179