1
/* Cairo - a vector graphics library with display and print output
2
 *
3
 * Copyright © 2007 Red Hat, Inc.
4
 *
5
 * This library is free software; you can redistribute it and/or
6
 * modify it either under the terms of the GNU Lesser General Public
7
 * License version 2.1 as published by the Free Software Foundation
8
 * (the "LGPL") or, at your option, under the terms of the Mozilla
9
 * Public License Version 1.1 (the "MPL"). If you do not alter this
10
 * notice, a recipient may use your version of this file under either
11
 * the MPL or the LGPL.
12
 *
13
 * You should have received a copy of the LGPL along with this library
14
 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16
 * You should have received a copy of the MPL along with this library
17
 * in the file COPYING-MPL-1.1
18
 *
19
 * The contents of this file are subject to the Mozilla Public License
20
 * Version 1.1 (the "License"); you may not use this file except in
21
 * compliance with the License. You may obtain a copy of the License at
22
 * http://www.mozilla.org/MPL/
23
 *
24
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25
 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26
 * the specific language governing rights and limitations.
27
 *
28
 * The Original Code is the cairo graphics library.
29
 *
30
 * The Initial Developer of the Original Code is Red Hat, Inc.
31
 */
32

            
33
#ifndef CAIRO_XLIB_XRENDER_PRIVATE_H
34
#define CAIRO_XLIB_XRENDER_PRIVATE_H
35

            
36
#include "cairo-features.h"
37
#include "cairo-compiler-private.h"
38

            
39
#include <X11/Xlib.h>
40

            
41
/* These prototypes are used when defining interfaces missing from the
42
 * render headers.  As it happens, it is the case that all libxrender
43
 * functions take a pointer as first argument. */
44

            
45
__attribute__((__unused__)) static void   _void_consume        (void *p, ...)   { }
46
__attribute__((__unused__)) static void * _voidp_consume       (void *p, ...)   { return (void *)0; }
47
__attribute__((__unused__)) static int    _int_consume         (void *p, ...)   { return 0; }
48
__attribute__((__unused__)) static void   _void_consume_free   (Display *p, XID n) { }
49

            
50

            
51
#if CAIRO_HAS_XLIB_XRENDER_SURFACE
52

            
53
#include "cairo-xlib-xrender.h"
54

            
55
#include <X11/extensions/Xrender.h>
56
#include <X11/extensions/renderproto.h>
57

            
58
/* We require Render >= 0.6.  The following defines were only added in
59
 * 0.10.  Make sure they are defined.
60
 */
61

            
62
/* Filters included in 0.10 */
63
#ifndef FilterConvolution
64
#define FilterConvolution		    "convolution"
65
#endif
66

            
67
/* Extended repeat attributes included in 0.10 */
68
#ifndef RepeatNone
69
#define RepeatNone                          0
70
#define RepeatNormal                        1
71
#define RepeatPad                           2
72
#define RepeatReflect                       3
73
#endif
74

            
75

            
76
#ifndef PictOptBlendMinimum
77
/*
78
 * Operators only available in version 0.11
79
 */
80
#define PictOpBlendMinimum			    0x30
81
#define PictOpMultiply				    0x30
82
#define PictOpScreen				    0x31
83
#define PictOpOverlay				    0x32
84
#define PictOpDarken				    0x33
85
#define PictOpLighten				    0x34
86
#define PictOpColorDodge			    0x35
87
#define PictOpColorBurn				    0x36
88
#define PictOpHardLight				    0x37
89
#define PictOpSoftLight				    0x38
90
#define PictOpDifference			    0x39
91
#define PictOpExclusion				    0x3a
92
#define PictOpHSLHue				    0x3b
93
#define PictOpHSLSaturation			    0x3c
94
#define PictOpHSLColor				    0x3d
95
#define PictOpHSLLuminosity			    0x3e
96
#define PictOpBlendMaximum			    0x3e
97
#endif
98

            
99
#if !HAVE_XRENDERCREATESOLIDFILL
100
#define XRenderCreateSolidFill				_int_consume
101
#endif
102

            
103
#if !HAVE_XRENDERCREATELINEARGRADIENT
104
#define XRenderCreateLinearGradient			_int_consume
105

            
106
typedef struct _XLinearGradient {
107
    XPointFixed p1;
108
    XPointFixed p2;
109
} XLinearGradient;
110
#endif
111

            
112
#if !HAVE_XRENDERCREATERADIALGRADIENT
113
#define XRenderCreateRadialGradient			_int_consume
114

            
115
typedef struct _XCircle {
116
    XFixed x;
117
    XFixed y;
118
    XFixed radius;
119
} XCircle;
120
typedef struct _XRadialGradient {
121
    XCircle inner;
122
    XCircle outer;
123
} XRadialGradient;
124
#endif
125

            
126
#if !HAVE_XRENDERCREATECONICALGRADIENT
127
#define XRenderCreateConicalGradient			_int_consume
128

            
129
typedef struct _XConicalGradient {
130
    XPointFixed center;
131
    XFixed angle; /* in degrees */
132
} XConicalGradient;
133
#endif
134

            
135

            
136
#else /* !CAIRO_HAS_XLIB_XRENDER_SURFACE */
137

            
138
/* Provide dummy symbols and macros to get it compile and take the fallback
139
 * route, just like as if Xrender is not available in the server at run-time. */
140

            
141

            
142
/* Functions */
143

            
144
#define XRenderQueryExtension				_int_consume
145
#define XRenderQueryVersion				_int_consume
146
#define XRenderQueryFormats				_int_consume
147
#define XRenderQuerySubpixelOrder			_int_consume
148
#define XRenderSetSubpixelOrder				_int_consume
149
#define XRenderFindVisualFormat				_voidp_consume
150
#define XRenderFindFormat				_voidp_consume
151
#define XRenderFindStandardFormat			_voidp_consume
152
#define XRenderQueryPictIndexValues			_voidp_consume
153
#define XRenderCreatePicture				_int_consume
154
#define XRenderChangePicture				_void_consume
155
#define XRenderSetPictureClipRectangles			_void_consume
156
#define XRenderSetPictureClipRegion			_void_consume
157
#define XRenderSetPictureTransform			_void_consume
158
#define XRenderFreePicture				_void_consume_free
159
#define XRenderComposite				_void_consume
160
#define XRenderCreateGlyphSet				_int_consume
161
#define XRenderReferenceGlyphSet			_int_consume
162
#define XRenderFreeGlyphSet				_void_consume_free
163
#define XRenderAddGlyphs				_void_consume
164
#define XRenderFreeGlyphs				_void_consume
165
#define XRenderCompositeString8				_void_consume
166
#define XRenderCompositeString16			_void_consume
167
#define XRenderCompositeString32			_void_consume
168
#define XRenderCompositeText8				(cairo_xrender_composite_text_func_t) _void_consume
169
#define XRenderCompositeText16				_void_consume
170
#define XRenderCompositeText32				_void_consume
171
#define XRenderFillRectangle				_void_consume
172
#define XRenderFillRectangles				_void_consume
173
#define XRenderCompositeTrapezoids			_void_consume
174
#define XRenderCompositeTriangles			_void_consume
175
#define XRenderCompositeTriStrip			_void_consume
176
#define XRenderCompositeTriFan				_void_consume
177
#define XRenderCompositeDoublePoly			_void_consume
178
#define XRenderParseColor				_int_consume
179
#define XRenderCreateCursor				_int_consume
180
#define XRenderQueryFilters				_voidp_consume
181
#define XRenderSetPictureFilter				_void_consume
182
#define XRenderCreateAnimCursor				_int_consume
183
#define XRenderAddTraps					_void_consume
184
#define XRenderCreateSolidFill				_int_consume
185
#define XRenderCreateLinearGradient			_int_consume
186
#define XRenderCreateRadialGradient			_int_consume
187
#define XRenderCreateConicalGradient			_int_consume
188

            
189
#define cairo_xlib_surface_create_with_xrender_format	_voidp_consume
190

            
191

            
192

            
193
/* The rest of this file is copied from various Xrender header files, with
194
 * the following copyright/license information:
195
 *
196
 * Copyright © 2000 SuSE, Inc.
197
 *
198
 * Permission to use, copy, modify, distribute, and sell this software and its
199
 * documentation for any purpose is hereby granted without fee, provided that
200
 * the above copyright notice appear in all copies and that both that
201
 * copyright notice and this permission notice appear in supporting
202
 * documentation, and that the name of SuSE not be used in advertising or
203
 * publicity pertaining to distribution of the software without specific,
204
 * written prior permission.  SuSE makes no representations about the
205
 * suitability of this software for any purpose.  It is provided "as is"
206
 * without express or implied warranty.
207
 *
208
 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
209
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
210
 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
211
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
212
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
213
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
214
 *
215
 * Author:  Keith Packard, SuSE, Inc.
216
 */
217

            
218

            
219
/* Copied from X11/extensions/render.h */
220

            
221
typedef unsigned long	Glyph;
222
typedef unsigned long	GlyphSet;
223
typedef unsigned long	Picture;
224
typedef unsigned long	PictFormat;
225

            
226
#define BadPictFormat			    0
227
#define BadPicture			    1
228
#define BadPictOp			    2
229
#define BadGlyphSet			    3
230
#define BadGlyph			    4
231
#define RenderNumberErrors		    (BadGlyph+1)
232

            
233
#define PictTypeIndexed			    0
234
#define PictTypeDirect			    1
235

            
236
#define PictOpMinimum			    0
237
#define PictOpClear			    0
238
#define PictOpSrc			    1
239
#define PictOpDst			    2
240
#define PictOpOver			    3
241
#define PictOpOverReverse		    4
242
#define PictOpIn			    5
243
#define PictOpInReverse			    6
244
#define PictOpOut			    7
245
#define PictOpOutReverse		    8
246
#define PictOpAtop			    9
247
#define PictOpAtopReverse		    10
248
#define PictOpXor			    11
249
#define PictOpAdd			    12
250
#define PictOpSaturate			    13
251
#define PictOpMaximum			    13
252

            
253
/*
254
 * Operators only available in version 0.2
255
 */
256
#define PictOpDisjointMinimum			    0x10
257
#define PictOpDisjointClear			    0x10
258
#define PictOpDisjointSrc			    0x11
259
#define PictOpDisjointDst			    0x12
260
#define PictOpDisjointOver			    0x13
261
#define PictOpDisjointOverReverse		    0x14
262
#define PictOpDisjointIn			    0x15
263
#define PictOpDisjointInReverse			    0x16
264
#define PictOpDisjointOut			    0x17
265
#define PictOpDisjointOutReverse		    0x18
266
#define PictOpDisjointAtop			    0x19
267
#define PictOpDisjointAtopReverse		    0x1a
268
#define PictOpDisjointXor			    0x1b
269
#define PictOpDisjointMaximum			    0x1b
270

            
271
#define PictOpConjointMinimum			    0x20
272
#define PictOpConjointClear			    0x20
273
#define PictOpConjointSrc			    0x21
274
#define PictOpConjointDst			    0x22
275
#define PictOpConjointOver			    0x23
276
#define PictOpConjointOverReverse		    0x24
277
#define PictOpConjointIn			    0x25
278
#define PictOpConjointInReverse			    0x26
279
#define PictOpConjointOut			    0x27
280
#define PictOpConjointOutReverse		    0x28
281
#define PictOpConjointAtop			    0x29
282
#define PictOpConjointAtopReverse		    0x2a
283
#define PictOpConjointXor			    0x2b
284
#define PictOpConjointMaximum			    0x2b
285

            
286
/*
287
 * Operators only available in version 0.11
288
 */
289
#define PictOpBlendMinimum			    0x30
290
#define PictOpMultiply				    0x30
291
#define PictOpScreen				    0x31
292
#define PictOpOverlay				    0x32
293
#define PictOpDarken				    0x33
294
#define PictOpLighten				    0x34
295
#define PictOpColorDodge			    0x35
296
#define PictOpColorBurn				    0x36
297
#define PictOpHardLight				    0x37
298
#define PictOpSoftLight				    0x38
299
#define PictOpDifference			    0x39
300
#define PictOpExclusion				    0x3a
301
#define PictOpHSLHue				    0x3b
302
#define PictOpHSLSaturation			    0x3c
303
#define PictOpHSLColor				    0x3d
304
#define PictOpHSLLuminosity			    0x3e
305
#define PictOpBlendMaximum			    0x3e
306

            
307
#define PolyEdgeSharp			    0
308
#define PolyEdgeSmooth			    1
309

            
310
#define PolyModePrecise			    0
311
#define PolyModeImprecise		    1
312

            
313
#define CPRepeat			    (1 << 0)
314
#define CPAlphaMap			    (1 << 1)
315
#define CPAlphaXOrigin			    (1 << 2)
316
#define CPAlphaYOrigin			    (1 << 3)
317
#define CPClipXOrigin			    (1 << 4)
318
#define CPClipYOrigin			    (1 << 5)
319
#define CPClipMask			    (1 << 6)
320
#define CPGraphicsExposure		    (1 << 7)
321
#define CPSubwindowMode			    (1 << 8)
322
#define CPPolyEdge			    (1 << 9)
323
#define CPPolyMode			    (1 << 10)
324
#define CPDither			    (1 << 11)
325
#define CPComponentAlpha		    (1 << 12)
326
#define CPLastBit			    12
327

            
328
/* Filters included in 0.6 */
329
#define FilterNearest			    "nearest"
330
#define FilterBilinear			    "bilinear"
331
/* Filters included in 0.10 */
332
#define FilterConvolution		    "convolution"
333

            
334
#define FilterFast			    "fast"
335
#define FilterGood			    "good"
336
#define FilterBest			    "best"
337

            
338
#define FilterAliasNone			    -1
339

            
340
/* Subpixel orders included in 0.6 */
341
#define SubPixelUnknown			    0
342
#define SubPixelHorizontalRGB		    1
343
#define SubPixelHorizontalBGR		    2
344
#define SubPixelVerticalRGB		    3
345
#define SubPixelVerticalBGR		    4
346
#define SubPixelNone			    5
347

            
348
/* Extended repeat attributes included in 0.10 */
349
#define RepeatNone                          0
350
#define RepeatNormal                        1
351
#define RepeatPad                           2
352
#define RepeatReflect                       3
353

            
354

            
355

            
356
/* Copied from X11/extensions/Xrender.h */
357

            
358
typedef struct {
359
    short   red;
360
    short   redMask;
361
    short   green;
362
    short   greenMask;
363
    short   blue;
364
    short   blueMask;
365
    short   alpha;
366
    short   alphaMask;
367
} XRenderDirectFormat;
368

            
369
typedef struct {
370
    PictFormat		id;
371
    int			type;
372
    int			depth;
373
    XRenderDirectFormat	direct;
374
    Colormap		colormap;
375
} XRenderPictFormat;
376

            
377
#define PictFormatID	    (1 << 0)
378
#define PictFormatType	    (1 << 1)
379
#define PictFormatDepth	    (1 << 2)
380
#define PictFormatRed	    (1 << 3)
381
#define PictFormatRedMask   (1 << 4)
382
#define PictFormatGreen	    (1 << 5)
383
#define PictFormatGreenMask (1 << 6)
384
#define PictFormatBlue	    (1 << 7)
385
#define PictFormatBlueMask  (1 << 8)
386
#define PictFormatAlpha	    (1 << 9)
387
#define PictFormatAlphaMask (1 << 10)
388
#define PictFormatColormap  (1 << 11)
389

            
390
typedef struct _XRenderPictureAttributes {
391
    int 		repeat;
392
    Picture		alpha_map;
393
    int			alpha_x_origin;
394
    int			alpha_y_origin;
395
    int			clip_x_origin;
396
    int			clip_y_origin;
397
    Pixmap		clip_mask;
398
    Bool		graphics_exposures;
399
    int			subwindow_mode;
400
    int			poly_edge;
401
    int			poly_mode;
402
    Atom		dither;
403
    Bool		component_alpha;
404
} XRenderPictureAttributes;
405

            
406
typedef struct {
407
    unsigned short   red;
408
    unsigned short   green;
409
    unsigned short   blue;
410
    unsigned short   alpha;
411
} XRenderColor;
412

            
413
typedef struct _XGlyphInfo {
414
    unsigned short  width;
415
    unsigned short  height;
416
    short	    x;
417
    short	    y;
418
    short	    xOff;
419
    short	    yOff;
420
} XGlyphInfo;
421

            
422
typedef struct _XGlyphElt8 {
423
    GlyphSet		    glyphset;
424
    _Xconst char	    *chars;
425
    int			    nchars;
426
    int			    xOff;
427
    int			    yOff;
428
} XGlyphElt8;
429

            
430
typedef struct _XGlyphElt16 {
431
    GlyphSet		    glyphset;
432
    _Xconst unsigned short  *chars;
433
    int			    nchars;
434
    int			    xOff;
435
    int			    yOff;
436
} XGlyphElt16;
437

            
438
typedef struct _XGlyphElt32 {
439
    GlyphSet		    glyphset;
440
    _Xconst unsigned int    *chars;
441
    int			    nchars;
442
    int			    xOff;
443
    int			    yOff;
444
} XGlyphElt32;
445

            
446
typedef double	XDouble;
447

            
448
typedef struct _XPointDouble {
449
    XDouble  x, y;
450
} XPointDouble;
451

            
452
#define XDoubleToFixed(f)    ((XFixed) ((f) * 65536))
453
#define XFixedToDouble(f)    (((XDouble) (f)) / 65536)
454

            
455
typedef int XFixed;
456

            
457
typedef struct _XPointFixed {
458
    XFixed  x, y;
459
} XPointFixed;
460

            
461
typedef struct _XLineFixed {
462
    XPointFixed	p1, p2;
463
} XLineFixed;
464

            
465
typedef struct _XTriangle {
466
    XPointFixed	p1, p2, p3;
467
} XTriangle;
468

            
469
typedef struct _XCircle {
470
    XFixed x;
471
    XFixed y;
472
    XFixed radius;
473
} XCircle;
474

            
475
typedef struct _XTrapezoid {
476
    XFixed  top, bottom;
477
    XLineFixed	left, right;
478
} XTrapezoid;
479

            
480
typedef struct _XTransform {
481
    XFixed  matrix[3][3];
482
} XTransform;
483

            
484
typedef struct _XFilters {
485
    int	    nfilter;
486
    char    **filter;
487
    int	    nalias;
488
    short   *alias;
489
} XFilters;
490

            
491
typedef struct _XIndexValue {
492
    unsigned long    pixel;
493
    unsigned short   red, green, blue, alpha;
494
} XIndexValue;
495

            
496
typedef struct _XAnimCursor {
497
    Cursor	    cursor;
498
    unsigned long   delay;
499
} XAnimCursor;
500

            
501
typedef struct _XSpanFix {
502
    XFixed	    left, right, y;
503
} XSpanFix;
504

            
505
typedef struct _XTrap {
506
    XSpanFix	    top, bottom;
507
} XTrap;
508

            
509
typedef struct _XLinearGradient {
510
    XPointFixed p1;
511
    XPointFixed p2;
512
} XLinearGradient;
513

            
514
typedef struct _XRadialGradient {
515
    XCircle inner;
516
    XCircle outer;
517
} XRadialGradient;
518

            
519
typedef struct _XConicalGradient {
520
    XPointFixed center;
521
    XFixed angle; /* in degrees */
522
} XConicalGradient;
523

            
524
#define PictStandardARGB32  0
525
#define PictStandardRGB24   1
526
#define PictStandardA8	    2
527
#define PictStandardA4	    3
528
#define PictStandardA1	    4
529
#define PictStandardNUM	    5
530

            
531

            
532

            
533
/* Copied from X11/extensions/renderproto.h */
534

            
535
#include <X11/Xmd.h>
536

            
537
#define Window CARD32
538
#define Drawable CARD32
539
#define Font CARD32
540
#define Pixmap CARD32
541
#define Cursor CARD32
542
#define Colormap CARD32
543
#define GContext CARD32
544
#define Atom CARD32
545
#define VisualID CARD32
546
#define Time CARD32
547
#define KeyCode CARD8
548
#define KeySym CARD32
549

            
550
#define Picture	    CARD32
551
#define PictFormat  CARD32
552
#define Fixed	    INT32
553
#define Glyphset    CARD32
554
#define Glyph	    CARD32
555

            
556
/*
557
 * data structures
558
 */
559

            
560
typedef struct {
561
    CARD16  red B16;
562
    CARD16  redMask B16;
563
    CARD16  green B16;
564
    CARD16  greenMask B16;
565
    CARD16  blue B16;
566
    CARD16  blueMask B16;
567
    CARD16  alpha B16;
568
    CARD16  alphaMask B16;
569
} xDirectFormat;
570

            
571
#define sz_xDirectFormat    16
572

            
573
typedef struct {
574
    PictFormat	id B32;
575
    CARD8	type;
576
    CARD8	depth;
577
    CARD16	pad1 B16;
578
    xDirectFormat   direct;
579
    Colormap	colormap;
580
} xPictFormInfo;
581

            
582
#define sz_xPictFormInfo    28
583

            
584
typedef struct {
585
    VisualID	visual;
586
    PictFormat	format;
587
} xPictVisual;
588

            
589
#define sz_xPictVisual	    8
590

            
591
typedef struct {
592
    CARD8	depth;
593
    CARD8	pad1;
594
    CARD16	nPictVisuals B16;
595
    CARD32	pad2 B32;
596
} xPictDepth;
597

            
598
#define sz_xPictDepth	8
599

            
600
typedef struct {
601
    CARD32	nDepth B32;
602
    PictFormat	fallback B32;
603
} xPictScreen;
604

            
605
#define sz_xPictScreen	8
606

            
607
typedef struct {
608
    CARD32	pixel B32;
609
    CARD16	red B16;
610
    CARD16	green B16;
611
    CARD16	blue B16;
612
    CARD16	alpha B16;
613
} xIndexValue;
614

            
615
#define sz_xIndexValue	12
616

            
617
typedef struct {
618
    CARD16	red B16;
619
    CARD16	green B16;
620
    CARD16	blue B16;
621
    CARD16	alpha B16;
622
} xRenderColor;
623

            
624
#define sz_xRenderColor	8
625

            
626
typedef struct {
627
    Fixed	x B32;
628
    Fixed	y B32;
629
} xPointFixed;
630

            
631
#define sz_xPointFixed	8
632

            
633
typedef struct {
634
    xPointFixed	p1;
635
    xPointFixed p2;
636
} xLineFixed;
637

            
638
#define sz_xLineFixed	16
639

            
640
typedef struct {
641
    xPointFixed	p1, p2, p3;
642
} xTriangle;
643

            
644
#define sz_xTriangle	24
645

            
646
typedef struct {
647
    Fixed	top B32;
648
    Fixed	bottom B32;
649
    xLineFixed	left;
650
    xLineFixed	right;
651
} xTrapezoid;
652

            
653
#define sz_xTrapezoid	40
654

            
655
typedef struct {
656
    CARD16  width B16;
657
    CARD16  height B16;
658
    INT16   x B16;
659
    INT16   y B16;
660
    INT16   xOff B16;
661
    INT16   yOff B16;
662
} xGlyphInfo;
663

            
664
#define sz_xGlyphInfo	12
665

            
666
typedef struct {
667
    CARD8   len;
668
    CARD8   pad1;
669
    CARD16  pad2;
670
    INT16   deltax;
671
    INT16   deltay;
672
} xGlyphElt;
673

            
674
#define sz_xGlyphElt	8
675

            
676
typedef struct {
677
    Fixed   l, r, y;
678
} xSpanFix;
679

            
680
#define sz_xSpanFix	12
681

            
682
typedef struct {
683
    xSpanFix	top, bot;
684
} xTrap;
685

            
686
#define sz_xTrap	24
687

            
688
/*
689
 * requests and replies
690
 */
691
typedef struct {
692
    CARD8   reqType;
693
    CARD8   renderReqType;
694
    CARD16  length B16;
695
    CARD32  majorVersion B32;
696
    CARD32  minorVersion B32;
697
} xRenderQueryVersionReq;
698

            
699
#define sz_xRenderQueryVersionReq   12
700

            
701
typedef struct {
702
    BYTE    type;   /* X_Reply */
703
    BYTE    pad1;
704
    CARD16  sequenceNumber B16;
705
    CARD32  length B32;
706
    CARD32  majorVersion B32;
707
    CARD32  minorVersion B32;
708
    CARD32  pad2 B32;
709
    CARD32  pad3 B32;
710
    CARD32  pad4 B32;
711
    CARD32  pad5 B32;
712
} xRenderQueryVersionReply;
713

            
714
#define sz_xRenderQueryVersionReply	32
715

            
716
typedef struct {
717
    CARD8   reqType;
718
    CARD8   renderReqType;
719
    CARD16  length B16;
720
} xRenderQueryPictFormatsReq;
721

            
722
#define sz_xRenderQueryPictFormatsReq	4
723

            
724
typedef struct {
725
    BYTE    type;   /* X_Reply */
726
    BYTE    pad1;
727
    CARD16  sequenceNumber B16;
728
    CARD32  length B32;
729
    CARD32  numFormats B32;
730
    CARD32  numScreens B32;
731
    CARD32  numDepths B32;
732
    CARD32  numVisuals B32;
733
    CARD32  numSubpixel B32;	    /* Version 0.6 */
734
    CARD32  pad5 B32;
735
} xRenderQueryPictFormatsReply;
736

            
737
#define sz_xRenderQueryPictFormatsReply	32
738

            
739
typedef struct {
740
    CARD8   reqType;
741
    CARD8   renderReqType;
742
    CARD16  length B16;
743
    PictFormat	format B32;
744
} xRenderQueryPictIndexValuesReq;
745

            
746
#define sz_xRenderQueryPictIndexValuesReq   8
747

            
748
typedef struct {
749
    BYTE    type;   /* X_Reply */
750
    BYTE    pad1;
751
    CARD16  sequenceNumber B16;
752
    CARD32  length B32;
753
    CARD32  numIndexValues;
754
    CARD32  pad2 B32;
755
    CARD32  pad3 B32;
756
    CARD32  pad4 B32;
757
    CARD32  pad5 B32;
758
    CARD32  pad6 B32;
759
} xRenderQueryPictIndexValuesReply;
760

            
761
#define sz_xRenderQueryPictIndexValuesReply 32
762

            
763
typedef struct {
764
    CARD8	reqType;
765
    CARD8	renderReqType;
766
    CARD16	length B16;
767
    Picture	pid B32;
768
    Drawable	drawable B32;
769
    PictFormat	format B32;
770
    CARD32	mask B32;
771
} xRenderCreatePictureReq;
772

            
773
#define sz_xRenderCreatePictureReq	    20
774

            
775
typedef struct {
776
    CARD8	reqType;
777
    CARD8	renderReqType;
778
    CARD16	length B16;
779
    Picture	picture B32;
780
    CARD32	mask B32;
781
} xRenderChangePictureReq;
782

            
783
#define sz_xRenderChangePictureReq	    12
784

            
785
typedef struct {
786
    CARD8       reqType;
787
    CARD8       renderReqType;
788
    CARD16      length B16;
789
    Picture     picture B32;
790
    INT16	xOrigin B16;
791
    INT16	yOrigin B16;
792
} xRenderSetPictureClipRectanglesReq;
793

            
794
#define sz_xRenderSetPictureClipRectanglesReq	    12
795

            
796
typedef struct {
797
    CARD8       reqType;
798
    CARD8       renderReqType;
799
    CARD16      length B16;
800
    Picture     picture B32;
801
} xRenderFreePictureReq;
802

            
803
#define sz_xRenderFreePictureReq	    8
804

            
805
typedef struct {
806
    CARD8       reqType;
807
    CARD8       renderReqType;
808
    CARD16      length B16;
809
    CARD8	op;
810
    CARD8	pad1;
811
    CARD16	pad2 B16;
812
    Picture	src B32;
813
    Picture	mask B32;
814
    Picture	dst B32;
815
    INT16	xSrc B16;
816
    INT16	ySrc B16;
817
    INT16	xMask B16;
818
    INT16	yMask B16;
819
    INT16	xDst B16;
820
    INT16	yDst B16;
821
    CARD16	width B16;
822
    CARD16	height B16;
823
} xRenderCompositeReq;
824

            
825
#define sz_xRenderCompositeReq		    36
826

            
827
typedef struct {
828
    CARD8       reqType;
829
    CARD8       renderReqType;
830
    CARD16      length B16;
831
    Picture	src B32;
832
    Picture	dst B32;
833
    CARD32	colorScale B32;
834
    CARD32	alphaScale B32;
835
    INT16	xSrc B16;
836
    INT16	ySrc B16;
837
    INT16	xDst B16;
838
    INT16	yDst B16;
839
    CARD16	width B16;
840
    CARD16	height B16;
841
} xRenderScaleReq;
842

            
843
#define sz_xRenderScaleReq			    32
844

            
845
typedef struct {
846
    CARD8       reqType;
847
    CARD8       renderReqType;
848
    CARD16      length B16;
849
    CARD8	op;
850
    CARD8	pad1;
851
    CARD16	pad2 B16;
852
    Picture	src B32;
853
    Picture	dst B32;
854
    PictFormat	maskFormat B32;
855
    INT16	xSrc B16;
856
    INT16	ySrc B16;
857
} xRenderTrapezoidsReq;
858

            
859
#define sz_xRenderTrapezoidsReq			    24
860

            
861
typedef struct {
862
    CARD8       reqType;
863
    CARD8       renderReqType;
864
    CARD16      length B16;
865
    CARD8	op;
866
    CARD8	pad1;
867
    CARD16	pad2 B16;
868
    Picture	src B32;
869
    Picture	dst B32;
870
    PictFormat	maskFormat B32;
871
    INT16	xSrc B16;
872
    INT16	ySrc B16;
873
} xRenderTrianglesReq;
874

            
875
#define sz_xRenderTrianglesReq			    24
876

            
877
typedef struct {
878
    CARD8       reqType;
879
    CARD8       renderReqType;
880
    CARD16      length B16;
881
    CARD8	op;
882
    CARD8	pad1;
883
    CARD16	pad2 B16;
884
    Picture	src B32;
885
    Picture	dst B32;
886
    PictFormat	maskFormat B32;
887
    INT16	xSrc B16;
888
    INT16	ySrc B16;
889
} xRenderTriStripReq;
890

            
891
#define sz_xRenderTriStripReq			    24
892

            
893
typedef struct {
894
    CARD8       reqType;
895
    CARD8       renderReqType;
896
    CARD16      length B16;
897
    CARD8	op;
898
    CARD8	pad1;
899
    CARD16	pad2 B16;
900
    Picture	src B32;
901
    Picture	dst B32;
902
    PictFormat	maskFormat B32;
903
    INT16	xSrc B16;
904
    INT16	ySrc B16;
905
} xRenderTriFanReq;
906

            
907
#define sz_xRenderTriFanReq			    24
908

            
909
typedef struct {
910
    CARD8       reqType;
911
    CARD8       renderReqType;
912
    CARD16      length B16;
913
    Glyphset	gsid B32;
914
    PictFormat	format B32;
915
} xRenderCreateGlyphSetReq;
916

            
917
#define sz_xRenderCreateGlyphSetReq		    12
918

            
919
typedef struct {
920
    CARD8       reqType;
921
    CARD8       renderReqType;
922
    CARD16      length B16;
923
    Glyphset    gsid B32;
924
    Glyphset    existing B32;
925
} xRenderReferenceGlyphSetReq;
926

            
927
#define sz_xRenderReferenceGlyphSetReq		    24
928

            
929
typedef struct {
930
    CARD8       reqType;
931
    CARD8       renderReqType;
932
    CARD16      length B16;
933
    Glyphset    glyphset B32;
934
} xRenderFreeGlyphSetReq;
935

            
936
#define sz_xRenderFreeGlyphSetReq		    8
937

            
938
typedef struct {
939
    CARD8       reqType;
940
    CARD8       renderReqType;
941
    CARD16      length B16;
942
    Glyphset    glyphset B32;
943
    CARD32	nglyphs;
944
} xRenderAddGlyphsReq;
945

            
946
#define sz_xRenderAddGlyphsReq			    12
947

            
948
typedef struct {
949
    CARD8       reqType;
950
    CARD8       renderReqType;
951
    CARD16      length B16;
952
    Glyphset    glyphset B32;
953
} xRenderFreeGlyphsReq;
954

            
955
#define sz_xRenderFreeGlyphsReq			    8
956

            
957
typedef struct {
958
    CARD8       reqType;
959
    CARD8       renderReqType;
960
    CARD16      length B16;
961
    CARD8	op;
962
    CARD8	pad1;
963
    CARD16	pad2 B16;
964
    Picture	src B32;
965
    Picture	dst B32;
966
    PictFormat	maskFormat B32;
967
    Glyphset    glyphset B32;
968
    INT16	xSrc B16;
969
    INT16	ySrc B16;
970
} xRenderCompositeGlyphsReq, xRenderCompositeGlyphs8Req,
971
xRenderCompositeGlyphs16Req, xRenderCompositeGlyphs32Req;
972

            
973
#define sz_xRenderCompositeGlyphs8Req		    28
974
#define sz_xRenderCompositeGlyphs16Req		    28
975
#define sz_xRenderCompositeGlyphs32Req		    28
976

            
977
/* 0.1 and higher */
978

            
979
typedef struct {
980
    CARD8	reqType;
981
    CARD8       renderReqType;
982
    CARD16      length B16;
983
    CARD8	op;
984
    CARD8	pad1;
985
    CARD16	pad2 B16;
986
    Picture	dst B32;
987
    xRenderColor    color;
988
} xRenderFillRectanglesReq;
989

            
990
#define sz_xRenderFillRectanglesReq		    20
991

            
992
/* 0.5 and higher */
993

            
994
typedef struct {
995
    CARD8	reqType;
996
    CARD8	renderReqType;
997
    CARD16	length B16;
998
    Cursor	cid B32;
999
    Picture	src B32;
    CARD16	x B16;
    CARD16	y B16;
} xRenderCreateCursorReq;
#define sz_xRenderCreateCursorReq		    16
/* 0.6 and higher */
/*
 * This can't use an array because 32-bit values may be in bitfields
 */
typedef struct {
    Fixed	matrix11 B32;
    Fixed	matrix12 B32;
    Fixed	matrix13 B32;
    Fixed	matrix21 B32;
    Fixed	matrix22 B32;
    Fixed	matrix23 B32;
    Fixed	matrix31 B32;
    Fixed	matrix32 B32;
    Fixed	matrix33 B32;
} xRenderTransform;
#define sz_xRenderTransform 36
typedef struct {
    CARD8		reqType;
    CARD8		renderReqType;
    CARD16		length B16;
    Picture		picture B32;
    xRenderTransform	transform;
} xRenderSetPictureTransformReq;
#define sz_xRenderSetPictureTransformReq	    44
typedef struct {
    CARD8		reqType;
    CARD8		renderReqType;
    CARD16		length B16;
    Drawable		drawable B32;
} xRenderQueryFiltersReq;
#define sz_xRenderQueryFiltersReq		    8
typedef struct {
    BYTE    type;   /* X_Reply */
    BYTE    pad1;
    CARD16  sequenceNumber B16;
    CARD32  length B32;
    CARD32  numAliases B32;	/* LISTofCARD16 */
    CARD32  numFilters B32;	/* LISTofSTRING8 */
    CARD32  pad2 B32;
    CARD32  pad3 B32;
    CARD32  pad4 B32;
    CARD32  pad5 B32;
} xRenderQueryFiltersReply;
#define sz_xRenderQueryFiltersReply		    32
typedef struct {
    CARD8		reqType;
    CARD8		renderReqType;
    CARD16		length B16;
    Picture		picture B32;
    CARD16		nbytes B16; /* number of bytes in name */
    CARD16		pad B16;
} xRenderSetPictureFilterReq;
#define sz_xRenderSetPictureFilterReq		    12
/* 0.8 and higher */
typedef struct {
    Cursor		cursor B32;
    CARD32		delay B32;
} xAnimCursorElt;
#define sz_xAnimCursorElt			    8
typedef struct {
    CARD8		reqType;
    CARD8		renderReqType;
    CARD16		length B16;
    Cursor		cid B32;
} xRenderCreateAnimCursorReq;
#define sz_xRenderCreateAnimCursorReq		    8
/* 0.9 and higher */
typedef struct {
    CARD8		reqType;
    CARD8		renderReqType;
    CARD16		length B16;
    Picture		picture;
    INT16		xOff B16;
    INT16		yOff B16;
} xRenderAddTrapsReq;
#define sz_xRenderAddTrapsReq			    12
/* 0.10 and higher */
typedef struct {
    CARD8	reqType;
    CARD8	renderReqType;
    CARD16	length B16;
    Picture	pid B32;
    xRenderColor color;
} xRenderCreateSolidFillReq;
#define sz_xRenderCreateSolidFillReq                 16
typedef struct {
    CARD8	reqType;
    CARD8	renderReqType;
    CARD16	length B16;
    Picture	pid B32;
    xPointFixed p1;
    xPointFixed p2;
    CARD32      nStops;
} xRenderCreateLinearGradientReq;
#define sz_xRenderCreateLinearGradientReq                 28
typedef struct {
    CARD8	reqType;
    CARD8	renderReqType;
    CARD16	length B16;
    Picture	pid B32;
    xPointFixed inner;
    xPointFixed outer;
    Fixed       inner_radius;
    Fixed       outer_radius;
    CARD32      nStops;
} xRenderCreateRadialGradientReq;
#define sz_xRenderCreateRadialGradientReq                 36
typedef struct {
    CARD8	reqType;
    CARD8	renderReqType;
    CARD16	length B16;
    Picture	pid B32;
    xPointFixed center;
    Fixed       angle; /* in degrees */
    CARD32      nStops;
} xRenderCreateConicalGradientReq;
#define sz_xRenderCreateConicalGradientReq                 24
#undef Window
#undef Drawable
#undef Font
#undef Pixmap
#undef Cursor
#undef Colormap
#undef GContext
#undef Atom
#undef VisualID
#undef Time
#undef KeyCode
#undef KeySym
#undef Picture
#undef PictFormat
#undef Fixed
#undef Glyphset
#undef Glyph
#endif /* CAIRO_HAS_XLIB_XRENDER_SURFACE */
#endif /* CAIRO_XLIB_XRENDER_PRIVATE_H */