7.9 KB、293行 生 Blame 履歴
1/**************************************************************************
2
3Copyright (c) 2002 Apple Computer, Inc.
4All Rights Reserved.
5
6Permission is hereby granted, free of charge, to any person obtaining a
7copy of this software and associated documentation files (the
8"Software"), to deal in the Software without restriction, including
9without limitation the rights to use, copy, modify, merge, publish,
10distribute, sub license, and/or sell copies of the Software, and to
11permit persons to whom the Software is furnished to do so, subject to
12the following conditions:
13
14The above copyright notice and this permission notice (including the
15next paragraph) shall be included in all copies or substantial portions
16of the Software.
17
18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
22ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26**************************************************************************/
27
28#ifndef _APPLEWMPROTO_H_
29#define _APPLEWMPROTO_H_
30
31#include <X11/extensions/applewmconst.h>
32#include <X11/X.h>
33#include <X11/Xmd.h>
34
35#define APPLEWMNAME "Apple-WM"
36
37#define APPLE_WM_MAJOR_VERSION 1 /* current version numbers */
38#define APPLE_WM_MINOR_VERSION 3
39#define APPLE_WM_PATCH_VERSION 0
40
41#define X_AppleWMQueryVersion 0
42#define X_AppleWMFrameGetRect 1
43#define X_AppleWMFrameHitTest 2
44#define X_AppleWMFrameDraw 3
45#define X_AppleWMDisableUpdate 4
46#define X_AppleWMReenableUpdate 5
47#define X_AppleWMSelectInput 6
48#define X_AppleWMSetWindowMenuCheck 7
49#define X_AppleWMSetFrontProcess 8
50#define X_AppleWMSetWindowLevel 9
51#define X_AppleWMSetCanQuit 10
52#define X_AppleWMSetWindowMenu 11
53#define X_AppleWMSendPSN 12
54#define X_AppleWMAttachTransient 13
55
56/* For the purpose of the structure definitions in this file,
57we must redefine the following types in terms of Xmd.h's types, which may
58include bit fields. All of these are #undef'd at the end of this file,
59restoring the definitions in X.h. */
60
61#define Window CARD32
62#define Drawable CARD32
63#define Font CARD32
64#define Pixmap CARD32
65#define Cursor CARD32
66#define Colormap CARD32
67#define GContext CARD32
68#define Atom CARD32
69#define VisualID CARD32
70#define Time CARD32
71#define KeyCode CARD8
72#define KeySym CARD32
73
74typedef struct _AppleWMQueryVersion {
75 CARD8 reqType; /* always WMReqCode */
76 CARD8 wmReqType; /* always X_AppleWMQueryVersion */
77 CARD16 length;
78} xAppleWMQueryVersionReq;
79#define sz_xAppleWMQueryVersionReq 4
80
81typedef struct {
82 BYTE type; /* X_Reply */
83 BOOL pad1;
84 CARD16 sequenceNumber;
85 CARD32 length;
86 CARD16 majorVersion; /* major version of WM protocol */
87 CARD16 minorVersion; /* minor version of WM protocol */
88 CARD32 patchVersion; /* patch version of WM protocol */
89 CARD32 pad3;
90 CARD32 pad4;
91 CARD32 pad5;
92 CARD32 pad6;
93} xAppleWMQueryVersionReply;
94#define sz_xAppleWMQueryVersionReply 32
95
96typedef struct _AppleWMDisableUpdate {
97 CARD8 reqType; /* always WMReqCode */
98 CARD8 wmReqType; /* always X_AppleWMDisableUpdate */
99 CARD16 length;
100 CARD32 screen;
101} xAppleWMDisableUpdateReq;
102#define sz_xAppleWMDisableUpdateReq 8
103
104typedef struct _AppleWMReenableUpdate {
105 CARD8 reqType; /* always WMReqCode */
106 CARD8 wmReqType; /* always X_AppleWMReenableUpdate */
107 CARD16 length;
108 CARD32 screen;
109} xAppleWMReenableUpdateReq;
110#define sz_xAppleWMReenableUpdateReq 8
111
112typedef struct _AppleWMSelectInput {
113 CARD8 reqType; /* always WMReqCode */
114 CARD8 wmReqType; /* always X_AppleWMSelectInput */
115 CARD16 length;
116 CARD32 mask;
117} xAppleWMSelectInputReq;
118#define sz_xAppleWMSelectInputReq 8
119
120typedef struct _AppleWMNotify {
121 BYTE type; /* always eventBase + event type */
122 BYTE kind;
123 CARD16 sequenceNumber;
124 Time time; /* time of change */
125 CARD16 pad1;
126 CARD32 arg;
127 CARD32 pad3;
128 CARD32 pad4;
129 CARD32 pad5;
130 CARD32 pad6;
131} xAppleWMNotifyEvent;
132#define sz_xAppleWMNotifyEvent 32
133
134typedef struct _AppleWMSetWindowMenu {
135 CARD8 reqType; /* always WMReqCode */
136 CARD8 wmReqType; /* always X_AppleWMSetWindowMenu */
137 CARD16 length;
138 CARD16 nitems;
139 CARD16 pad1;
140} xAppleWMSetWindowMenuReq;
141#define sz_xAppleWMSetWindowMenuReq 8
142
143typedef struct _AppleWMSetWindowMenuCheck {
144 CARD8 reqType; /* always WMReqCode */
145 CARD8 wmReqType; /* always X_AppleWMSetWindowMenuCheck */
146 CARD16 length;
147 CARD32 index;
148} xAppleWMSetWindowMenuCheckReq;
149#define sz_xAppleWMSetWindowMenuCheckReq 8
150
151typedef struct _AppleWMSetFrontProcess {
152 CARD8 reqType; /* always WMReqCode */
153 CARD8 wmReqType; /* always X_AppleWMSetFrontProcess */
154 CARD16 length;
155} xAppleWMSetFrontProcessReq;
156#define sz_xAppleWMSetFrontProcessReq 4
157
158typedef struct _AppleWMSetWindowLevel {
159 CARD8 reqType; /* always WMReqCode */
160 CARD8 wmReqType; /* always X_AppleWMSetWindowLevel */
161 CARD16 length;
162 CARD32 window;
163 CARD32 level;
164} xAppleWMSetWindowLevelReq;
165#define sz_xAppleWMSetWindowLevelReq 12
166
167typedef struct _AppleWMSendPSN {
168 CARD8 reqType; /* always WMReqCode */
169 CARD8 wmReqType; /* always X_AppleWMSendPSN */
170 CARD16 length;
171 CARD32 psn_hi;
172 CARD32 psn_lo;
173} xAppleWMSendPSNReq;
174#define sz_xAppleWMSendPSNReq 12
175
176typedef struct _AppleWMAttachTransient {
177 CARD8 reqType; /* always WMReqCode */
178 CARD8 wmReqType; /* always X_AppleWMAttachTransient */
179 CARD16 length;
180 CARD32 child;
181 CARD32 parent;
182} xAppleWMAttachTransientReq;
183#define sz_xAppleWMAttachTransientReq 12
184
185typedef struct _AppleWMSetCanQuit {
186 CARD8 reqType; /* always WMReqCode */
187 CARD8 wmReqType; /* always X_AppleWMSetCanQuit */
188 CARD16 length;
189 CARD32 state;
190} xAppleWMSetCanQuitReq;
191#define sz_xAppleWMSetCanQuitReq 8
192
193typedef struct _AppleWMFrameGetRect {
194 CARD8 reqType; /* always WMReqCode */
195 CARD8 wmReqType; /* always X_AppleWMFrameGetRect */
196 CARD16 length;
197 CARD16 frame_class;
198 CARD16 frame_rect;
199 CARD16 ix;
200 CARD16 iy;
201 CARD16 iw;
202 CARD16 ih;
203 CARD16 ox;
204 CARD16 oy;
205 CARD16 ow;
206 CARD16 oh;
207} xAppleWMFrameGetRectReq;
208#define sz_xAppleWMFrameGetRectReq 24
209
210typedef struct {
211 BYTE type; /* X_Reply */
212 BOOL pad1;
213 CARD16 sequenceNumber;
214 CARD32 length;
215 CARD16 x;
216 CARD16 y;
217 CARD16 w;
218 CARD16 h;
219 CARD32 pad3;
220 CARD32 pad4;
221 CARD32 pad5;
222 CARD32 pad6;
223} xAppleWMFrameGetRectReply;
224#define sz_xAppleWMFrameGetRectReply 32
225
226typedef struct _AppleWMFrameHitTest {
227 CARD8 reqType; /* always WMReqCode */
228 CARD8 wmReqType; /* always X_AppleWMFrameHitTest */
229 CARD16 length;
230 CARD16 frame_class;
231 CARD16 pad1;
232 CARD16 px;
233 CARD16 py;
234 CARD16 ix;
235 CARD16 iy;
236 CARD16 iw;
237 CARD16 ih;
238 CARD16 ox;
239 CARD16 oy;
240 CARD16 ow;
241 CARD16 oh;
242} xAppleWMFrameHitTestReq;
243#define sz_xAppleWMFrameHitTestReq 28
244
245typedef struct {
246 BYTE type; /* X_Reply */
247 BOOL pad1;
248 CARD16 sequenceNumber;
249 CARD32 length;
250 CARD32 ret;
251 CARD32 pad2;
252 CARD32 pad3;
253 CARD32 pad4;
254 CARD32 pad5;
255 CARD32 pad6;
256} xAppleWMFrameHitTestReply;
257#define sz_xAppleWMFrameHitTestReply 32
258
259typedef struct _AppleWMFrameDraw {
260 CARD8 reqType; /* always WMReqCode */
261 CARD8 wmReqType; /* always X_AppleWMFrameDraw */
262 CARD16 length;
263 CARD32 screen;
264 CARD32 window;
265 CARD16 frame_class;
266 CARD16 frame_attr;
267 CARD16 ix;
268 CARD16 iy;
269 CARD16 iw;
270 CARD16 ih;
271 CARD16 ox;
272 CARD16 oy;
273 CARD16 ow;
274 CARD16 oh;
275 CARD32 title_length;
276} xAppleWMFrameDrawReq;
277#define sz_xAppleWMFrameDrawReq 36
278
279/* restore these definitions back to the typedefs in X.h */
280#undef Window
281#undef Drawable
282#undef Font
283#undef Pixmap
284#undef Cursor
285#undef Colormap
286#undef GContext
287#undef Atom
288#undef VisualID
289#undef Time
290#undef KeyCode
291#undef KeySym
292
293#endif /* _APPLEWMPROTO_H_ */