tizen 2.4 release
[framework/uifw/xorg/proto/x11proto-present.git] / presentproto.h
1 /*
2  * Copyright © 2013 Keith Packard
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and its
5  * documentation for any purpose is hereby granted without fee, provided that
6  * the above copyright notice appear in all copies and that both that copyright
7  * notice and this permission notice appear in supporting documentation, and
8  * that the name of the copyright holders not be used in advertising or
9  * publicity pertaining to distribution of the software without specific,
10  * written prior permission.  The copyright holders make no representations
11  * about the suitability of this software for any purpose.  It is provided "as
12  * is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16  * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20  * OF THIS SOFTWARE.
21  */
22
23 #ifndef _PRESENT_PROTO_H_
24 #define _PRESENT_PROTO_H_
25
26 #include <X11/extensions/presenttokens.h>
27
28 #define Region CARD32
29 #define XSyncFence CARD32
30 #define EventID CARD32
31
32 typedef struct {
33     Window  window B32;
34     CARD32  serial B32;
35 } xPresentNotify;
36 #define sz_xPresentNotify               8
37
38 typedef struct {
39     CARD8   reqType;
40     CARD8   presentReqType;
41     CARD16  length B16;
42     CARD32  majorVersion B32;
43     CARD32  minorVersion B32;
44 } xPresentQueryVersionReq;
45 #define sz_xPresentQueryVersionReq   12
46
47 typedef struct {
48     BYTE    type;   /* X_Reply */
49     BYTE    pad1;
50     CARD16  sequenceNumber B16;
51     CARD32  length B32;
52     CARD32  majorVersion B32;
53     CARD32  minorVersion B32;
54     CARD32  pad2 B32;
55     CARD32  pad3 B32;
56     CARD32  pad4 B32;
57     CARD32  pad5 B32;
58 } xPresentQueryVersionReply;
59 #define sz_xPresentQueryVersionReply    32
60
61 typedef struct {
62     CARD8   reqType;
63     CARD8   presentReqType;
64     CARD16  length B16;
65     Window  window B32;
66
67     Pixmap  pixmap B32;
68     CARD32  serial B32;
69
70     Region  valid B32;
71     Region  update B32;
72
73     INT16   x_off B16;
74     INT16   y_off B16;
75     CARD32  target_crtc B32;
76
77     XSyncFence wait_fence B32;
78     XSyncFence idle_fence B32;
79
80     CARD32  options B32;
81     CARD32  pad1 B32;
82
83     CARD64  target_msc;
84     CARD64  divisor;
85     CARD64  remainder;
86     /* followed by a LISTofPRESENTNOTIFY */
87 } xPresentPixmapReq;
88 #define sz_xPresentPixmapReq    72
89
90 typedef struct {
91     CARD8   reqType;
92     CARD8   presentReqType;
93     CARD16  length B16;
94     Window  window B32;
95
96     CARD32  serial B32;
97     CARD32  pad0 B32;
98
99     CARD64  target_msc;
100     CARD64  divisor;
101     CARD64  remainder;
102 } xPresentNotifyMSCReq;
103 #define sz_xPresentNotifyMSCReq 40
104
105 typedef struct {
106     CARD8   reqType;
107     CARD8   presentReqType;
108     CARD16  length B16;
109     CARD32  eid B32;
110     CARD32  window B32;
111     CARD32  eventMask B32;
112 } xPresentSelectInputReq;
113 #define sz_xPresentSelectInputReq   16
114
115 typedef struct {
116     CARD8   reqType;
117     CARD8   presentReqType;
118     CARD16  length B16;
119     CARD32  target B32;
120 } xPresentQueryCapabilitiesReq;
121 #define sz_xPresentQueryCapabilitiesReq   8
122
123 typedef struct {
124     BYTE    type;   /* X_Reply */
125     BYTE    pad1;
126     CARD16  sequenceNumber B16;
127     CARD32  length B32;
128     CARD32  capabilities B32;
129     CARD32  pad3 B32;
130     CARD32  pad4 B32;
131     CARD32  pad5 B32;
132     CARD32  pad6 B32;
133     CARD32  pad7 B32;
134 } xPresentQueryCapabilitiesReply;
135 #define sz_xPresentQueryCapabilitiesReply       32
136
137 /*
138  * Events
139  *
140  * All Present events are X Generic Events
141  */
142
143 typedef struct {
144     CARD8 type;
145     CARD8 extension;
146     CARD16 sequenceNumber B16;
147     CARD32 length;
148     CARD16 evtype B16;
149     CARD16 pad2;
150     CARD32 eid B32;
151     CARD32 window B32;
152     INT16  x B16;
153     INT16  y B16;
154     CARD16 width B16;
155     CARD16 height B16;
156     INT16  off_x B16;
157     INT16  off_y B16;
158
159     CARD16 pixmap_width B16;
160     CARD16 pixmap_height B16;
161     CARD32 pixmap_flags B32;
162 } xPresentConfigureNotify;
163 #define sz_xPresentConfigureNotify 40
164
165 typedef struct {
166     CARD8 type;
167     CARD8 extension;
168     CARD16 sequenceNumber B16;
169     CARD32 length;
170     CARD16 evtype B16;
171     CARD8  kind;
172     CARD8  mode;
173     CARD32 eid B32;
174     Window window B32;
175     CARD32 serial B32;
176     CARD64 ust;
177
178     CARD64 msc;
179 } xPresentCompleteNotify;
180 #define sz_xPresentCompleteNotify 40
181
182 typedef struct {
183     CARD8 type;
184     CARD8 extension;
185     CARD16 sequenceNumber B16;
186     CARD32 length;
187     CARD16 evtype B16;
188     CARD16 pad2 B16;
189     CARD32 eid B32;
190     Window window B32;
191     CARD32 serial B32;
192     Pixmap pixmap B32;
193     CARD32 idle_fence B32;
194 } xPresentIdleNotify;
195 #define sz_xPresentIdleNotify   32
196
197 typedef struct {
198     CARD8 type;
199     CARD8 extension;
200     CARD16 sequenceNumber B16;
201     CARD32 length;
202     CARD16 evtype B16;
203     CARD8 update_window;
204     CARD8 pad1;
205     CARD32 eid B32;
206     Window event_window B32;
207     Window window B32;
208     Pixmap pixmap B32;
209     CARD32 serial B32;
210
211     /* 32-byte boundary */
212
213     Region valid_region B32;
214     Region update_region B32;
215
216     xRectangle valid_rect;
217
218     xRectangle update_rect;
219
220     INT16 x_off B16;
221     INT16 y_off B16;
222     CARD32 target_crtc B32;
223
224     XSyncFence wait_fence B32;
225     XSyncFence idle_fence B32;
226
227     CARD32 options B32;
228     CARD32 pad2 B32;
229
230     CARD64 target_msc;
231     CARD64 divisor;
232     CARD64 remainder;
233
234 } xPresentRedirectNotify;
235
236 #define sz_xPresentRedirectNotify 104
237
238 typedef struct {
239     CARD8 type;
240     CARD8 extension;
241     CARD16 sequenceNumber B16;
242     CARD32 length;
243     CARD16 evtype B16;
244     CARD16 pad2 B16;
245     CARD32 eid B32;
246     Window window B32;
247     CARD16 scanout B16;
248     CARD32 flag B32;
249     CARD16 pad3 B16;
250     CARD32 pad4 B32;
251 } xPresentScanoutNotify;
252 #define sz_xPresentScanoutNotify 32
253
254 #undef Region
255 #undef XSyncFence
256 #undef EventID
257
258 #endif