1 /*
2  * $XFree86: xc/include/extensions/renderproto.h,v 1.12 2002/09/26 02:56:48 keithp Exp $
3  *
4  * Copyright © 2000 SuSE, Inc.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of SuSE not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  SuSE makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  *
16  * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
18  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  *
23  * Author:  Keith Packard, SuSE, Inc.
24  */
25 
26 #ifndef _XRENDERP_H_
27 #define _XRENDERP_H_
28 
29 #include <X11/Xmd.h>
30 #include <X11/extensions/render.h>
31 
32 #define Window CARD32
33 #define Drawable CARD32
34 #define Font CARD32
35 #define Pixmap CARD32
36 #define Cursor CARD32
37 #define Colormap CARD32
38 #define GContext CARD32
39 #define Atom CARD32
40 #define VisualID CARD32
41 #define Time CARD32
42 #define KeyCode CARD8
43 #define KeySym CARD32
44 
45 #define Picture	    CARD32
46 #define PictFormat  CARD32
47 #define Fixed	    INT32
48 #define Glyphset    CARD32
49 
50 /*
51  * data structures
52  */
53 
54 typedef struct {
55     CARD16  red B16;
56     CARD16  redMask B16;
57     CARD16  green B16;
58     CARD16  greenMask B16;
59     CARD16  blue B16;
60     CARD16  blueMask B16;
61     CARD16  alpha B16;
62     CARD16  alphaMask B16;
63 } xDirectFormat;
64 
65 #define sz_xDirectFormat    16
66 
67 typedef struct {
68     PictFormat	id B32;
69     CARD8	type;
70     CARD8	depth;
71     CARD16	pad1 B16;
72     xDirectFormat   direct;
73     Colormap	colormap;
74 } xPictFormInfo;
75 
76 #define sz_xPictFormInfo    28
77 
78 typedef struct {
79     VisualID	visual;
80     PictFormat	format;
81 } xPictVisual;
82 
83 #define sz_xPictVisual	    8
84 
85 typedef struct {
86     CARD8	depth;
87     CARD8	pad1;
88     CARD16	nPictVisuals B16;
89     CARD32	pad2 B32;
90 } xPictDepth;
91 
92 #define sz_xPictDepth	8
93 
94 typedef struct {
95     CARD32	nDepth B32;
96     PictFormat	fallback B32;
97 } xPictScreen;
98 
99 #define sz_xPictScreen	8
100 
101 typedef struct {
102     CARD32	pixel B32;
103     CARD16	red B16;
104     CARD16	green B16;
105     CARD16	blue B16;
106     CARD16	alpha B16;
107 } xIndexValue;
108 
109 #define sz_xIndexValue	12
110 
111 typedef struct {
112     CARD16	red B16;
113     CARD16	green B16;
114     CARD16	blue B16;
115     CARD16	alpha B16;
116 } xRenderColor;
117 
118 #define sz_xRenderColor	8
119 
120 typedef struct {
121     Fixed	x B32;
122     Fixed	y B32;
123 } xPointFixed;
124 
125 #define sz_xPointFixed	8
126 
127 typedef struct {
128     xPointFixed	p1;
129     xPointFixed p2;
130 } xLineFixed;
131 
132 #define sz_xLineFixed	16
133 
134 typedef struct {
135     xPointFixed	p1, p2, p3;
136 } xTriangle;
137 
138 #define sz_xTriangle	24
139 
140 typedef struct {
141     Fixed	top B32;
142     Fixed	bottom B32;
143     xLineFixed	left;
144     xLineFixed	right;
145 } xTrapezoid;
146 
147 #define sz_xTrapezoid	40
148 
149 typedef struct {
150     CARD16  width B16;
151     CARD16  height B16;
152     INT16   x B16;
153     INT16   y B16;
154     INT16   xOff B16;
155     INT16   yOff B16;
156 } xGlyphInfo;
157 
158 #define sz_xGlyphInfo	12
159 
160 typedef struct {
161     CARD8   len;
162     CARD8   pad1;
163     CARD16  pad2;
164     INT16   deltax;
165     INT16   deltay;
166 } xGlyphElt;
167 
168 #define sz_xGlyphElt	8
169 
170 typedef struct {
171     Fixed   l, r, y;
172 } xSpanFix;
173 
174 #define sz_xSpanFix	12
175 
176 typedef struct {
177     xSpanFix	top, bot;
178 } xTrap;
179 
180 #define sz_xTrap	24
181 
182 /*
183  * requests and replies
184  */
185 typedef struct {
186     CARD8   reqType;
187     CARD8   renderReqType;
188     CARD16  length B16;
189     CARD32  majorVersion B32;
190     CARD32  minorVersion B32;
191 } xRenderQueryVersionReq;
192 
193 #define sz_xRenderQueryVersionReq   12
194 
195 typedef struct {
196     BYTE    type;   /* X_Reply */
197     BYTE    pad1;
198     CARD16  sequenceNumber B16;
199     CARD32  length B32;
200     CARD32  majorVersion B32;
201     CARD32  minorVersion B32;
202     CARD32  pad2 B32;
203     CARD32  pad3 B32;
204     CARD32  pad4 B32;
205     CARD32  pad5 B32;
206 } xRenderQueryVersionReply;
207 
208 #define sz_xRenderQueryVersionReply	32
209 
210 typedef struct {
211     CARD8   reqType;
212     CARD8   renderReqType;
213     CARD16  length B16;
214 } xRenderQueryPictFormatsReq;
215 
216 #define sz_xRenderQueryPictFormatsReq	4
217 
218 typedef struct {
219     BYTE    type;   /* X_Reply */
220     BYTE    pad1;
221     CARD16  sequenceNumber B16;
222     CARD32  length B32;
223     CARD32  numFormats B32;
224     CARD32  numScreens B32;
225     CARD32  numDepths B32;
226     CARD32  numVisuals B32;
227     CARD32  numSubpixel B32;	    /* Version 0.6 */
228     CARD32  pad5 B32;
229 } xRenderQueryPictFormatsReply;
230 
231 #define sz_xRenderQueryPictFormatsReply	32
232 
233 typedef struct {
234     CARD8   reqType;
235     CARD8   renderReqType;
236     CARD16  length B16;
237     PictFormat	format B32;
238 } xRenderQueryPictIndexValuesReq;
239 
240 #define sz_xRenderQueryPictIndexValuesReq   8
241 
242 typedef struct {
243     BYTE    type;   /* X_Reply */
244     BYTE    pad1;
245     CARD16  sequenceNumber B16;
246     CARD32  length B32;
247     CARD32  numIndexValues;
248     CARD32  pad2 B32;
249     CARD32  pad3 B32;
250     CARD32  pad4 B32;
251     CARD32  pad5 B32;
252     CARD32  pad6 B32;
253 } xRenderQueryPictIndexValuesReply;
254 
255 #define sz_xRenderQueryPictIndexValuesReply 32
256 
257 typedef struct {
258     CARD8	reqType;
259     CARD8	renderReqType;
260     CARD16	length B16;
261     Picture	pid B32;
262     Drawable	drawable B32;
263     PictFormat	format B32;
264     CARD32	mask B32;
265 } xRenderCreatePictureReq;
266 
267 #define sz_xRenderCreatePictureReq	    20
268 
269 typedef struct {
270     CARD8	reqType;
271     CARD8	renderReqType;
272     CARD16	length B16;
273     Picture	picture B32;
274     CARD32	mask B32;
275 } xRenderChangePictureReq;
276 
277 #define sz_xRenderChangePictureReq	    12
278 
279 typedef struct {
280     CARD8       reqType;
281     CARD8       renderReqType;
282     CARD16      length B16;
283     Picture     picture B32;
284     INT16	xOrigin B16;
285     INT16	yOrigin B16;
286 } xRenderSetPictureClipRectanglesReq;
287 
288 #define sz_xRenderSetPictureClipRectanglesReq	    12
289 
290 typedef struct {
291     CARD8       reqType;
292     CARD8       renderReqType;
293     CARD16      length B16;
294     Picture     picture B32;
295 } xRenderFreePictureReq;
296 
297 #define sz_xRenderFreePictureReq	    8
298 
299 typedef struct {
300     CARD8       reqType;
301     CARD8       renderReqType;
302     CARD16      length B16;
303     CARD8	op;
304     CARD8	pad1;
305     CARD16	pad2 B16;
306     Picture	src B32;
307     Picture	mask B32;
308     Picture	dst B32;
309     INT16	xSrc B16;
310     INT16	ySrc B16;
311     INT16	xMask B16;
312     INT16	yMask B16;
313     INT16	xDst B16;
314     INT16	yDst B16;
315     CARD16	width B16;
316     CARD16	height B16;
317 } xRenderCompositeReq;
318 
319 #define sz_xRenderCompositeReq		    36
320 
321 typedef struct {
322     CARD8       reqType;
323     CARD8       renderReqType;
324     CARD16      length B16;
325     Picture	src B32;
326     Picture	dst B32;
327     CARD32	colorScale B32;
328     CARD32	alphaScale B32;
329     INT16	xSrc B16;
330     INT16	ySrc B16;
331     INT16	xDst B16;
332     INT16	yDst B16;
333     CARD16	width B16;
334     CARD16	height B16;
335 } xRenderScaleReq;
336 
337 #define sz_xRenderScaleReq			    32
338 
339 typedef struct {
340     CARD8       reqType;
341     CARD8       renderReqType;
342     CARD16      length B16;
343     CARD8	op;
344     CARD8	pad1;
345     CARD16	pad2 B16;
346     Picture	src B32;
347     Picture	dst B32;
348     PictFormat	maskFormat B32;
349     INT16	xSrc B16;
350     INT16	ySrc B16;
351 } xRenderTrapezoidsReq;
352 
353 #define sz_xRenderTrapezoidsReq			    24
354 
355 typedef struct {
356     CARD8       reqType;
357     CARD8       renderReqType;
358     CARD16      length B16;
359     CARD8	op;
360     CARD8	pad1;
361     CARD16	pad2 B16;
362     Picture	src B32;
363     Picture	dst B32;
364     PictFormat	maskFormat B32;
365     INT16	xSrc B16;
366     INT16	ySrc B16;
367 } xRenderTrianglesReq;
368 
369 #define sz_xRenderTrianglesReq			    24
370 
371 typedef struct {
372     CARD8       reqType;
373     CARD8       renderReqType;
374     CARD16      length B16;
375     CARD8	op;
376     CARD8	pad1;
377     CARD16	pad2 B16;
378     Picture	src B32;
379     Picture	dst B32;
380     PictFormat	maskFormat B32;
381     INT16	xSrc B16;
382     INT16	ySrc B16;
383 } xRenderTriStripReq;
384 
385 #define sz_xRenderTriStripReq			    24
386 
387 typedef struct {
388     CARD8       reqType;
389     CARD8       renderReqType;
390     CARD16      length B16;
391     CARD8	op;
392     CARD8	pad1;
393     CARD16	pad2 B16;
394     Picture	src B32;
395     Picture	dst B32;
396     PictFormat	maskFormat B32;
397     INT16	xSrc B16;
398     INT16	ySrc B16;
399 } xRenderTriFanReq;
400 
401 #define sz_xRenderTriFanReq			    24
402 
403 typedef struct {
404     CARD8       reqType;
405     CARD8       renderReqType;
406     CARD16      length B16;
407     Glyphset	gsid B32;
408     PictFormat	format B32;
409 } xRenderCreateGlyphSetReq;
410 
411 #define sz_xRenderCreateGlyphSetReq		    12
412 
413 typedef struct {
414     CARD8       reqType;
415     CARD8       renderReqType;
416     CARD16      length B16;
417     Glyphset    gsid B32;
418     Glyphset    existing B32;
419 } xRenderReferenceGlyphSetReq;
420 
421 #define sz_xRenderReferenceGlyphSetReq		    24
422 
423 typedef struct {
424     CARD8       reqType;
425     CARD8       renderReqType;
426     CARD16      length B16;
427     Glyphset    glyphset B32;
428 } xRenderFreeGlyphSetReq;
429 
430 #define sz_xRenderFreeGlyphSetReq		    8
431 
432 typedef struct {
433     CARD8       reqType;
434     CARD8       renderReqType;
435     CARD16      length B16;
436     Glyphset    glyphset B32;
437     CARD32	nglyphs;
438 } xRenderAddGlyphsReq;
439 
440 #define sz_xRenderAddGlyphsReq			    12
441 
442 typedef struct {
443     CARD8       reqType;
444     CARD8       renderReqType;
445     CARD16      length B16;
446     Glyphset    glyphset B32;
447 } xRenderFreeGlyphsReq;
448 
449 #define sz_xRenderFreeGlyphsReq			    8
450 
451 typedef struct {
452     CARD8       reqType;
453     CARD8       renderReqType;
454     CARD16      length B16;
455     CARD8	op;
456     CARD8	pad1;
457     CARD16	pad2 B16;
458     Picture	src B32;
459     Picture	dst B32;
460     PictFormat	maskFormat B32;
461     Glyphset    glyphset B32;
462     INT16	xSrc B16;
463     INT16	ySrc B16;
464 } xRenderCompositeGlyphsReq, xRenderCompositeGlyphs8Req,
465 xRenderCompositeGlyphs16Req, xRenderCompositeGlyphs32Req;
466 
467 #define sz_xRenderCompositeGlyphs8Req		    28
468 #define sz_xRenderCompositeGlyphs16Req		    28
469 #define sz_xRenderCompositeGlyphs32Req		    28
470 
471 /* 0.1 and higher */
472 
473 typedef struct {
474     CARD8	reqType;
475     CARD8       renderReqType;
476     CARD16      length B16;
477     CARD8	op;
478     CARD8	pad1;
479     CARD16	pad2 B16;
480     Picture	dst B32;
481     xRenderColor    color;
482 } xRenderFillRectanglesReq;
483 
484 #define sz_xRenderFillRectanglesReq		    20
485 
486 /* 0.5 and higher */
487 
488 typedef struct {
489     CARD8	reqType;
490     CARD8	renderReqType;
491     CARD16	length B16;
492     Cursor	cid B32;
493     Picture	src B32;
494     CARD16	x B16;
495     CARD16	y B16;
496 } xRenderCreateCursorReq;
497 
498 #define sz_xRenderCreateCursorReq		    16
499 
500 /* 0.6 and higher */
501 
502 /*
503  * This can't use an array because 32-bit values may be in bitfields
504  */
505 typedef struct {
506     Fixed	matrix11 B32;
507     Fixed	matrix12 B32;
508     Fixed	matrix13 B32;
509     Fixed	matrix21 B32;
510     Fixed	matrix22 B32;
511     Fixed	matrix23 B32;
512     Fixed	matrix31 B32;
513     Fixed	matrix32 B32;
514     Fixed	matrix33 B32;
515 } xRenderTransform;
516 
517 #define sz_xRenderTransform 36
518 
519 typedef struct {
520     CARD8		reqType;
521     CARD8		renderReqType;
522     CARD16		length B16;
523     Picture		picture B32;
524     xRenderTransform	transform;
525 } xRenderSetPictureTransformReq;
526 
527 #define sz_xRenderSetPictureTransformReq	    44
528 
529 typedef struct {
530     CARD8		reqType;
531     CARD8		renderReqType;
532     CARD16		length B16;
533     Drawable		drawable B32;
534 } xRenderQueryFiltersReq;
535 
536 #define sz_xRenderQueryFiltersReq		    8
537 
538 typedef struct {
539     BYTE    type;   /* X_Reply */
540     BYTE    pad1;
541     CARD16  sequenceNumber B16;
542     CARD32  length B32;
543     CARD32  numAliases B32;	/* LISTofCARD16 */
544     CARD32  numFilters B32;	/* LISTofSTRING8 */
545     CARD32  pad2 B32;
546     CARD32  pad3 B32;
547     CARD32  pad4 B32;
548     CARD32  pad5 B32;
549 } xRenderQueryFiltersReply;
550 
551 #define sz_xRenderQueryFiltersReply		    32
552 
553 typedef struct {
554     CARD8		reqType;
555     CARD8		renderReqType;
556     CARD16		length B16;
557     Picture		picture B32;
558     CARD16		nbytes B16; /* number of bytes in name */
559     CARD16		pad B16;
560 } xRenderSetPictureFilterReq;
561 
562 #define sz_xRenderSetPictureFilterReq		    12
563 
564 /* 0.8 and higher */
565 
566 typedef struct {
567     Cursor		cursor B32;
568     CARD32		delay B32;
569 } xAnimCursorElt;
570 
571 #define sz_xAnimCursorElt			    8
572 
573 typedef struct {
574     CARD8		reqType;
575     CARD8		renderReqType;
576     CARD16		length B16;
577     Cursor		cid B32;
578 } xRenderCreateAnimCursorReq;
579 
580 #define sz_xRenderCreateAnimCursorReq		    8
581 
582 /* 0.9 and higher */
583 
584 typedef struct {
585     CARD8		reqType;
586     CARD8		renderReqType;
587     CARD16		length B16;
588     Picture		picture;
589     INT16		xOff B16;
590     INT16		yOff B16;
591 } xRenderAddTrapsReq;
592 
593 #define sz_xRenderAddTrapsReq			    12
594 
595 /* 0.10 and higher */
596 
597 typedef struct {
598     CARD8	reqType;
599     CARD8	renderReqType;
600     CARD16	length B16;
601     Picture	pid B32;
602     xRenderColor color;
603 } xRenderCreateSolidFillReq;
604 
605 #define sz_xRenderCreateSolidFillReq                 16
606 
607 typedef struct {
608     CARD8	reqType;
609     CARD8	renderReqType;
610     CARD16	length B16;
611     Picture	pid B32;
612     xPointFixed p1;
613     xPointFixed p2;
614     CARD32      nStops;
615 } xRenderCreateLinearGradientReq;
616 
617 #define sz_xRenderCreateLinearGradientReq                 28
618 
619 typedef struct {
620     CARD8	reqType;
621     CARD8	renderReqType;
622     CARD16	length B16;
623     Picture	pid B32;
624     xPointFixed inner;
625     xPointFixed outer;
626     Fixed       inner_radius;
627     Fixed       outer_radius;
628     CARD32      nStops;
629 } xRenderCreateRadialGradientReq;
630 
631 #define sz_xRenderCreateRadialGradientReq                 36
632 
633 typedef struct {
634     CARD8	reqType;
635     CARD8	renderReqType;
636     CARD16	length B16;
637     Picture	pid B32;
638     xPointFixed center;
639     Fixed       angle; /* in degrees */
640     CARD32      nStops;
641 } xRenderCreateConicalGradientReq;
642 
643 #define sz_xRenderCreateConicalGradientReq                 24
644 
645 #undef Window
646 #undef Drawable
647 #undef Font
648 #undef Pixmap
649 #undef Cursor
650 #undef Colormap
651 #undef GContext
652 #undef Atom
653 #undef VisualID
654 #undef Time
655 #undef KeyCode
656 #undef KeySym
657 
658 #undef Picture
659 #undef PictFormat
660 #undef Fixed
661 #undef Glyphset
662 
663 #endif /* _XRENDERP_H_ */
664