Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1892 | serge | 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 |
||
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 |
||
56 | #include |
||
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 | |||
3959 | Serge | 99 | #if !HAVE_XRENDERCREATELINEARGRADIENT |
1892 | serge | 100 | #define XRenderCreateLinearGradient _int_consume |
3959 | Serge | 101 | |
102 | typedef struct _XLinearGradient { |
||
103 | XPointFixed p1; |
||
104 | XPointFixed p2; |
||
105 | } XLinearGradient; |
||
106 | #endif |
||
107 | |||
108 | #if !HAVE_XRENDERCREATERADIALGRADIENT |
||
1892 | serge | 109 | #define XRenderCreateRadialGradient _int_consume |
3959 | Serge | 110 | |
1892 | serge | 111 | typedef struct _XCircle { |
112 | XFixed x; |
||
113 | XFixed y; |
||
114 | XFixed radius; |
||
115 | } XCircle; |
||
116 | typedef struct _XRadialGradient { |
||
117 | XCircle inner; |
||
118 | XCircle outer; |
||
119 | } XRadialGradient; |
||
3959 | Serge | 120 | #endif |
1892 | serge | 121 | |
3959 | Serge | 122 | #if !HAVE_XRENDERCREATECONICALGRADIENT |
123 | #define XRenderCreateConicalGradient _int_consume |
||
124 | |||
1892 | serge | 125 | typedef struct _XConicalGradient { |
126 | XPointFixed center; |
||
127 | XFixed angle; /* in degrees */ |
||
128 | } XConicalGradient; |
||
129 | #endif |
||
130 | |||
131 | |||
132 | #else /* !CAIRO_HAS_XLIB_XRENDER_SURFACE */ |
||
133 | |||
134 | /* Provide dummy symbols and macros to get it compile and take the fallback |
||
135 | * route, just like as if Xrender is not available in the server at run-time. */ |
||
136 | |||
137 | |||
138 | /* Functions */ |
||
139 | |||
140 | #define XRenderQueryExtension _int_consume |
||
141 | #define XRenderQueryVersion _int_consume |
||
142 | #define XRenderQueryFormats _int_consume |
||
143 | #define XRenderQuerySubpixelOrder _int_consume |
||
144 | #define XRenderSetSubpixelOrder _int_consume |
||
145 | #define XRenderFindVisualFormat _voidp_consume |
||
146 | #define XRenderFindFormat _voidp_consume |
||
147 | #define XRenderFindStandardFormat _voidp_consume |
||
148 | #define XRenderQueryPictIndexValues _voidp_consume |
||
149 | #define XRenderCreatePicture _int_consume |
||
150 | #define XRenderChangePicture _void_consume |
||
151 | #define XRenderSetPictureClipRectangles _void_consume |
||
152 | #define XRenderSetPictureClipRegion _void_consume |
||
153 | #define XRenderSetPictureTransform _void_consume |
||
154 | #define XRenderFreePicture _void_consume_free |
||
155 | #define XRenderComposite _void_consume |
||
156 | #define XRenderCreateGlyphSet _int_consume |
||
157 | #define XRenderReferenceGlyphSet _int_consume |
||
158 | #define XRenderFreeGlyphSet _void_consume_free |
||
159 | #define XRenderAddGlyphs _void_consume |
||
160 | #define XRenderFreeGlyphs _void_consume |
||
161 | #define XRenderCompositeString8 _void_consume |
||
162 | #define XRenderCompositeString16 _void_consume |
||
163 | #define XRenderCompositeString32 _void_consume |
||
164 | #define XRenderCompositeText8 (cairo_xrender_composite_text_func_t) _void_consume |
||
165 | #define XRenderCompositeText16 _void_consume |
||
166 | #define XRenderCompositeText32 _void_consume |
||
167 | #define XRenderFillRectangle _void_consume |
||
168 | #define XRenderFillRectangles _void_consume |
||
169 | #define XRenderCompositeTrapezoids _void_consume |
||
170 | #define XRenderCompositeTriangles _void_consume |
||
171 | #define XRenderCompositeTriStrip _void_consume |
||
172 | #define XRenderCompositeTriFan _void_consume |
||
173 | #define XRenderCompositeDoublePoly _void_consume |
||
174 | #define XRenderParseColor _int_consume |
||
175 | #define XRenderCreateCursor _int_consume |
||
176 | #define XRenderQueryFilters _voidp_consume |
||
177 | #define XRenderSetPictureFilter _void_consume |
||
178 | #define XRenderCreateAnimCursor _int_consume |
||
179 | #define XRenderAddTraps _void_consume |
||
180 | #define XRenderCreateSolidFill _int_consume |
||
181 | #define XRenderCreateLinearGradient _int_consume |
||
182 | #define XRenderCreateRadialGradient _int_consume |
||
183 | #define XRenderCreateConicalGradient _int_consume |
||
184 | |||
185 | #define cairo_xlib_surface_create_with_xrender_format _voidp_consume |
||
186 | |||
187 | |||
188 | |||
189 | /* The rest of this file is copied from various Xrender header files, with |
||
190 | * the following copyright/license information: |
||
191 | * |
||
192 | * Copyright © 2000 SuSE, Inc. |
||
193 | * |
||
194 | * Permission to use, copy, modify, distribute, and sell this software and its |
||
195 | * documentation for any purpose is hereby granted without fee, provided that |
||
196 | * the above copyright notice appear in all copies and that both that |
||
197 | * copyright notice and this permission notice appear in supporting |
||
198 | * documentation, and that the name of SuSE not be used in advertising or |
||
199 | * publicity pertaining to distribution of the software without specific, |
||
200 | * written prior permission. SuSE makes no representations about the |
||
201 | * suitability of this software for any purpose. It is provided "as is" |
||
202 | * without express or implied warranty. |
||
203 | * |
||
204 | * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL |
||
205 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE |
||
206 | * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
||
207 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION |
||
208 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN |
||
209 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||
210 | * |
||
211 | * Author: Keith Packard, SuSE, Inc. |
||
212 | */ |
||
213 | |||
214 | |||
215 | /* Copied from X11/extensions/render.h */ |
||
216 | |||
217 | typedef unsigned long Glyph; |
||
218 | typedef unsigned long GlyphSet; |
||
219 | typedef unsigned long Picture; |
||
220 | typedef unsigned long PictFormat; |
||
221 | |||
222 | #define BadPictFormat 0 |
||
223 | #define BadPicture 1 |
||
224 | #define BadPictOp 2 |
||
225 | #define BadGlyphSet 3 |
||
226 | #define BadGlyph 4 |
||
227 | #define RenderNumberErrors (BadGlyph+1) |
||
228 | |||
229 | #define PictTypeIndexed 0 |
||
230 | #define PictTypeDirect 1 |
||
231 | |||
232 | #define PictOpMinimum 0 |
||
233 | #define PictOpClear 0 |
||
234 | #define PictOpSrc 1 |
||
235 | #define PictOpDst 2 |
||
236 | #define PictOpOver 3 |
||
237 | #define PictOpOverReverse 4 |
||
238 | #define PictOpIn 5 |
||
239 | #define PictOpInReverse 6 |
||
240 | #define PictOpOut 7 |
||
241 | #define PictOpOutReverse 8 |
||
242 | #define PictOpAtop 9 |
||
243 | #define PictOpAtopReverse 10 |
||
244 | #define PictOpXor 11 |
||
245 | #define PictOpAdd 12 |
||
246 | #define PictOpSaturate 13 |
||
247 | #define PictOpMaximum 13 |
||
248 | |||
249 | /* |
||
250 | * Operators only available in version 0.2 |
||
251 | */ |
||
252 | #define PictOpDisjointMinimum 0x10 |
||
253 | #define PictOpDisjointClear 0x10 |
||
254 | #define PictOpDisjointSrc 0x11 |
||
255 | #define PictOpDisjointDst 0x12 |
||
256 | #define PictOpDisjointOver 0x13 |
||
257 | #define PictOpDisjointOverReverse 0x14 |
||
258 | #define PictOpDisjointIn 0x15 |
||
259 | #define PictOpDisjointInReverse 0x16 |
||
260 | #define PictOpDisjointOut 0x17 |
||
261 | #define PictOpDisjointOutReverse 0x18 |
||
262 | #define PictOpDisjointAtop 0x19 |
||
263 | #define PictOpDisjointAtopReverse 0x1a |
||
264 | #define PictOpDisjointXor 0x1b |
||
265 | #define PictOpDisjointMaximum 0x1b |
||
266 | |||
267 | #define PictOpConjointMinimum 0x20 |
||
268 | #define PictOpConjointClear 0x20 |
||
269 | #define PictOpConjointSrc 0x21 |
||
270 | #define PictOpConjointDst 0x22 |
||
271 | #define PictOpConjointOver 0x23 |
||
272 | #define PictOpConjointOverReverse 0x24 |
||
273 | #define PictOpConjointIn 0x25 |
||
274 | #define PictOpConjointInReverse 0x26 |
||
275 | #define PictOpConjointOut 0x27 |
||
276 | #define PictOpConjointOutReverse 0x28 |
||
277 | #define PictOpConjointAtop 0x29 |
||
278 | #define PictOpConjointAtopReverse 0x2a |
||
279 | #define PictOpConjointXor 0x2b |
||
280 | #define PictOpConjointMaximum 0x2b |
||
281 | |||
282 | /* |
||
283 | * Operators only available in version 0.11 |
||
284 | */ |
||
285 | #define PictOpBlendMinimum 0x30 |
||
286 | #define PictOpMultiply 0x30 |
||
287 | #define PictOpScreen 0x31 |
||
288 | #define PictOpOverlay 0x32 |
||
289 | #define PictOpDarken 0x33 |
||
290 | #define PictOpLighten 0x34 |
||
291 | #define PictOpColorDodge 0x35 |
||
292 | #define PictOpColorBurn 0x36 |
||
293 | #define PictOpHardLight 0x37 |
||
294 | #define PictOpSoftLight 0x38 |
||
295 | #define PictOpDifference 0x39 |
||
296 | #define PictOpExclusion 0x3a |
||
297 | #define PictOpHSLHue 0x3b |
||
298 | #define PictOpHSLSaturation 0x3c |
||
299 | #define PictOpHSLColor 0x3d |
||
300 | #define PictOpHSLLuminosity 0x3e |
||
301 | #define PictOpBlendMaximum 0x3e |
||
302 | |||
303 | #define PolyEdgeSharp 0 |
||
304 | #define PolyEdgeSmooth 1 |
||
305 | |||
306 | #define PolyModePrecise 0 |
||
307 | #define PolyModeImprecise 1 |
||
308 | |||
309 | #define CPRepeat (1 << 0) |
||
310 | #define CPAlphaMap (1 << 1) |
||
311 | #define CPAlphaXOrigin (1 << 2) |
||
312 | #define CPAlphaYOrigin (1 << 3) |
||
313 | #define CPClipXOrigin (1 << 4) |
||
314 | #define CPClipYOrigin (1 << 5) |
||
315 | #define CPClipMask (1 << 6) |
||
316 | #define CPGraphicsExposure (1 << 7) |
||
317 | #define CPSubwindowMode (1 << 8) |
||
318 | #define CPPolyEdge (1 << 9) |
||
319 | #define CPPolyMode (1 << 10) |
||
320 | #define CPDither (1 << 11) |
||
321 | #define CPComponentAlpha (1 << 12) |
||
322 | #define CPLastBit 12 |
||
323 | |||
324 | /* Filters included in 0.6 */ |
||
325 | #define FilterNearest "nearest" |
||
326 | #define FilterBilinear "bilinear" |
||
327 | /* Filters included in 0.10 */ |
||
328 | #define FilterConvolution "convolution" |
||
329 | |||
330 | #define FilterFast "fast" |
||
331 | #define FilterGood "good" |
||
332 | #define FilterBest "best" |
||
333 | |||
334 | #define FilterAliasNone -1 |
||
335 | |||
336 | /* Subpixel orders included in 0.6 */ |
||
337 | #define SubPixelUnknown 0 |
||
338 | #define SubPixelHorizontalRGB 1 |
||
339 | #define SubPixelHorizontalBGR 2 |
||
340 | #define SubPixelVerticalRGB 3 |
||
341 | #define SubPixelVerticalBGR 4 |
||
342 | #define SubPixelNone 5 |
||
343 | |||
344 | /* Extended repeat attributes included in 0.10 */ |
||
345 | #define RepeatNone 0 |
||
346 | #define RepeatNormal 1 |
||
347 | #define RepeatPad 2 |
||
348 | #define RepeatReflect 3 |
||
349 | |||
350 | |||
351 | |||
352 | /* Copied from X11/extensions/Xrender.h */ |
||
353 | |||
354 | typedef struct { |
||
355 | short red; |
||
356 | short redMask; |
||
357 | short green; |
||
358 | short greenMask; |
||
359 | short blue; |
||
360 | short blueMask; |
||
361 | short alpha; |
||
362 | short alphaMask; |
||
363 | } XRenderDirectFormat; |
||
364 | |||
365 | typedef struct { |
||
366 | PictFormat id; |
||
367 | int type; |
||
368 | int depth; |
||
369 | XRenderDirectFormat direct; |
||
370 | Colormap colormap; |
||
371 | } XRenderPictFormat; |
||
372 | |||
373 | #define PictFormatID (1 << 0) |
||
374 | #define PictFormatType (1 << 1) |
||
375 | #define PictFormatDepth (1 << 2) |
||
376 | #define PictFormatRed (1 << 3) |
||
377 | #define PictFormatRedMask (1 << 4) |
||
378 | #define PictFormatGreen (1 << 5) |
||
379 | #define PictFormatGreenMask (1 << 6) |
||
380 | #define PictFormatBlue (1 << 7) |
||
381 | #define PictFormatBlueMask (1 << 8) |
||
382 | #define PictFormatAlpha (1 << 9) |
||
383 | #define PictFormatAlphaMask (1 << 10) |
||
384 | #define PictFormatColormap (1 << 11) |
||
385 | |||
386 | typedef struct _XRenderPictureAttributes { |
||
387 | int repeat; |
||
388 | Picture alpha_map; |
||
389 | int alpha_x_origin; |
||
390 | int alpha_y_origin; |
||
391 | int clip_x_origin; |
||
392 | int clip_y_origin; |
||
393 | Pixmap clip_mask; |
||
394 | Bool graphics_exposures; |
||
395 | int subwindow_mode; |
||
396 | int poly_edge; |
||
397 | int poly_mode; |
||
398 | Atom dither; |
||
399 | Bool component_alpha; |
||
400 | } XRenderPictureAttributes; |
||
401 | |||
402 | typedef struct { |
||
403 | unsigned short red; |
||
404 | unsigned short green; |
||
405 | unsigned short blue; |
||
406 | unsigned short alpha; |
||
407 | } XRenderColor; |
||
408 | |||
409 | typedef struct _XGlyphInfo { |
||
410 | unsigned short width; |
||
411 | unsigned short height; |
||
412 | short x; |
||
413 | short y; |
||
414 | short xOff; |
||
415 | short yOff; |
||
416 | } XGlyphInfo; |
||
417 | |||
418 | typedef struct _XGlyphElt8 { |
||
419 | GlyphSet glyphset; |
||
420 | _Xconst char *chars; |
||
421 | int nchars; |
||
422 | int xOff; |
||
423 | int yOff; |
||
424 | } XGlyphElt8; |
||
425 | |||
426 | typedef struct _XGlyphElt16 { |
||
427 | GlyphSet glyphset; |
||
428 | _Xconst unsigned short *chars; |
||
429 | int nchars; |
||
430 | int xOff; |
||
431 | int yOff; |
||
432 | } XGlyphElt16; |
||
433 | |||
434 | typedef struct _XGlyphElt32 { |
||
435 | GlyphSet glyphset; |
||
436 | _Xconst unsigned int *chars; |
||
437 | int nchars; |
||
438 | int xOff; |
||
439 | int yOff; |
||
440 | } XGlyphElt32; |
||
441 | |||
442 | typedef double XDouble; |
||
443 | |||
444 | typedef struct _XPointDouble { |
||
445 | XDouble x, y; |
||
446 | } XPointDouble; |
||
447 | |||
448 | #define XDoubleToFixed(f) ((XFixed) ((f) * 65536)) |
||
449 | #define XFixedToDouble(f) (((XDouble) (f)) / 65536) |
||
450 | |||
451 | typedef int XFixed; |
||
452 | |||
453 | typedef struct _XPointFixed { |
||
454 | XFixed x, y; |
||
455 | } XPointFixed; |
||
456 | |||
457 | typedef struct _XLineFixed { |
||
458 | XPointFixed p1, p2; |
||
459 | } XLineFixed; |
||
460 | |||
461 | typedef struct _XTriangle { |
||
462 | XPointFixed p1, p2, p3; |
||
463 | } XTriangle; |
||
464 | |||
465 | typedef struct _XCircle { |
||
466 | XFixed x; |
||
467 | XFixed y; |
||
468 | XFixed radius; |
||
469 | } XCircle; |
||
470 | |||
471 | typedef struct _XTrapezoid { |
||
472 | XFixed top, bottom; |
||
473 | XLineFixed left, right; |
||
474 | } XTrapezoid; |
||
475 | |||
476 | typedef struct _XTransform { |
||
477 | XFixed matrix[3][3]; |
||
478 | } XTransform; |
||
479 | |||
480 | typedef struct _XFilters { |
||
481 | int nfilter; |
||
482 | char **filter; |
||
483 | int nalias; |
||
484 | short *alias; |
||
485 | } XFilters; |
||
486 | |||
487 | typedef struct _XIndexValue { |
||
488 | unsigned long pixel; |
||
489 | unsigned short red, green, blue, alpha; |
||
490 | } XIndexValue; |
||
491 | |||
492 | typedef struct _XAnimCursor { |
||
493 | Cursor cursor; |
||
494 | unsigned long delay; |
||
495 | } XAnimCursor; |
||
496 | |||
497 | typedef struct _XSpanFix { |
||
498 | XFixed left, right, y; |
||
499 | } XSpanFix; |
||
500 | |||
501 | typedef struct _XTrap { |
||
502 | XSpanFix top, bottom; |
||
503 | } XTrap; |
||
504 | |||
505 | typedef struct _XLinearGradient { |
||
506 | XPointFixed p1; |
||
507 | XPointFixed p2; |
||
508 | } XLinearGradient; |
||
509 | |||
510 | typedef struct _XRadialGradient { |
||
511 | XCircle inner; |
||
512 | XCircle outer; |
||
513 | } XRadialGradient; |
||
514 | |||
515 | typedef struct _XConicalGradient { |
||
516 | XPointFixed center; |
||
517 | XFixed angle; /* in degrees */ |
||
518 | } XConicalGradient; |
||
519 | |||
520 | #define PictStandardARGB32 0 |
||
521 | #define PictStandardRGB24 1 |
||
522 | #define PictStandardA8 2 |
||
523 | #define PictStandardA4 3 |
||
524 | #define PictStandardA1 4 |
||
525 | #define PictStandardNUM 5 |
||
526 | |||
527 | |||
528 | |||
529 | /* Copied from X11/extensions/renderproto.h */ |
||
530 | |||
531 | #include |
||
532 | |||
533 | #define Window CARD32 |
||
534 | #define Drawable CARD32 |
||
535 | #define Font CARD32 |
||
536 | #define Pixmap CARD32 |
||
537 | #define Cursor CARD32 |
||
538 | #define Colormap CARD32 |
||
539 | #define GContext CARD32 |
||
540 | #define Atom CARD32 |
||
541 | #define VisualID CARD32 |
||
542 | #define Time CARD32 |
||
543 | #define KeyCode CARD8 |
||
544 | #define KeySym CARD32 |
||
545 | |||
546 | #define Picture CARD32 |
||
547 | #define PictFormat CARD32 |
||
548 | #define Fixed INT32 |
||
549 | #define Glyphset CARD32 |
||
550 | #define Glyph CARD32 |
||
551 | |||
552 | /* |
||
553 | * data structures |
||
554 | */ |
||
555 | |||
556 | typedef struct { |
||
557 | CARD16 red B16; |
||
558 | CARD16 redMask B16; |
||
559 | CARD16 green B16; |
||
560 | CARD16 greenMask B16; |
||
561 | CARD16 blue B16; |
||
562 | CARD16 blueMask B16; |
||
563 | CARD16 alpha B16; |
||
564 | CARD16 alphaMask B16; |
||
565 | } xDirectFormat; |
||
566 | |||
567 | #define sz_xDirectFormat 16 |
||
568 | |||
569 | typedef struct { |
||
570 | PictFormat id B32; |
||
571 | CARD8 type; |
||
572 | CARD8 depth; |
||
573 | CARD16 pad1 B16; |
||
574 | xDirectFormat direct; |
||
575 | Colormap colormap; |
||
576 | } xPictFormInfo; |
||
577 | |||
578 | #define sz_xPictFormInfo 28 |
||
579 | |||
580 | typedef struct { |
||
581 | VisualID visual; |
||
582 | PictFormat format; |
||
583 | } xPictVisual; |
||
584 | |||
585 | #define sz_xPictVisual 8 |
||
586 | |||
587 | typedef struct { |
||
588 | CARD8 depth; |
||
589 | CARD8 pad1; |
||
590 | CARD16 nPictVisuals B16; |
||
591 | CARD32 pad2 B32; |
||
592 | } xPictDepth; |
||
593 | |||
594 | #define sz_xPictDepth 8 |
||
595 | |||
596 | typedef struct { |
||
597 | CARD32 nDepth B32; |
||
598 | PictFormat fallback B32; |
||
599 | } xPictScreen; |
||
600 | |||
601 | #define sz_xPictScreen 8 |
||
602 | |||
603 | typedef struct { |
||
604 | CARD32 pixel B32; |
||
605 | CARD16 red B16; |
||
606 | CARD16 green B16; |
||
607 | CARD16 blue B16; |
||
608 | CARD16 alpha B16; |
||
609 | } xIndexValue; |
||
610 | |||
611 | #define sz_xIndexValue 12 |
||
612 | |||
613 | typedef struct { |
||
614 | CARD16 red B16; |
||
615 | CARD16 green B16; |
||
616 | CARD16 blue B16; |
||
617 | CARD16 alpha B16; |
||
618 | } xRenderColor; |
||
619 | |||
620 | #define sz_xRenderColor 8 |
||
621 | |||
622 | typedef struct { |
||
623 | Fixed x B32; |
||
624 | Fixed y B32; |
||
625 | } xPointFixed; |
||
626 | |||
627 | #define sz_xPointFixed 8 |
||
628 | |||
629 | typedef struct { |
||
630 | xPointFixed p1; |
||
631 | xPointFixed p2; |
||
632 | } xLineFixed; |
||
633 | |||
634 | #define sz_xLineFixed 16 |
||
635 | |||
636 | typedef struct { |
||
637 | xPointFixed p1, p2, p3; |
||
638 | } xTriangle; |
||
639 | |||
640 | #define sz_xTriangle 24 |
||
641 | |||
642 | typedef struct { |
||
643 | Fixed top B32; |
||
644 | Fixed bottom B32; |
||
645 | xLineFixed left; |
||
646 | xLineFixed right; |
||
647 | } xTrapezoid; |
||
648 | |||
649 | #define sz_xTrapezoid 40 |
||
650 | |||
651 | typedef struct { |
||
652 | CARD16 width B16; |
||
653 | CARD16 height B16; |
||
654 | INT16 x B16; |
||
655 | INT16 y B16; |
||
656 | INT16 xOff B16; |
||
657 | INT16 yOff B16; |
||
658 | } xGlyphInfo; |
||
659 | |||
660 | #define sz_xGlyphInfo 12 |
||
661 | |||
662 | typedef struct { |
||
663 | CARD8 len; |
||
664 | CARD8 pad1; |
||
665 | CARD16 pad2; |
||
666 | INT16 deltax; |
||
667 | INT16 deltay; |
||
668 | } xGlyphElt; |
||
669 | |||
670 | #define sz_xGlyphElt 8 |
||
671 | |||
672 | typedef struct { |
||
673 | Fixed l, r, y; |
||
674 | } xSpanFix; |
||
675 | |||
676 | #define sz_xSpanFix 12 |
||
677 | |||
678 | typedef struct { |
||
679 | xSpanFix top, bot; |
||
680 | } xTrap; |
||
681 | |||
682 | #define sz_xTrap 24 |
||
683 | |||
684 | /* |
||
685 | * requests and replies |
||
686 | */ |
||
687 | typedef struct { |
||
688 | CARD8 reqType; |
||
689 | CARD8 renderReqType; |
||
690 | CARD16 length B16; |
||
691 | CARD32 majorVersion B32; |
||
692 | CARD32 minorVersion B32; |
||
693 | } xRenderQueryVersionReq; |
||
694 | |||
695 | #define sz_xRenderQueryVersionReq 12 |
||
696 | |||
697 | typedef struct { |
||
698 | BYTE type; /* X_Reply */ |
||
699 | BYTE pad1; |
||
700 | CARD16 sequenceNumber B16; |
||
701 | CARD32 length B32; |
||
702 | CARD32 majorVersion B32; |
||
703 | CARD32 minorVersion B32; |
||
704 | CARD32 pad2 B32; |
||
705 | CARD32 pad3 B32; |
||
706 | CARD32 pad4 B32; |
||
707 | CARD32 pad5 B32; |
||
708 | } xRenderQueryVersionReply; |
||
709 | |||
710 | #define sz_xRenderQueryVersionReply 32 |
||
711 | |||
712 | typedef struct { |
||
713 | CARD8 reqType; |
||
714 | CARD8 renderReqType; |
||
715 | CARD16 length B16; |
||
716 | } xRenderQueryPictFormatsReq; |
||
717 | |||
718 | #define sz_xRenderQueryPictFormatsReq 4 |
||
719 | |||
720 | typedef struct { |
||
721 | BYTE type; /* X_Reply */ |
||
722 | BYTE pad1; |
||
723 | CARD16 sequenceNumber B16; |
||
724 | CARD32 length B32; |
||
725 | CARD32 numFormats B32; |
||
726 | CARD32 numScreens B32; |
||
727 | CARD32 numDepths B32; |
||
728 | CARD32 numVisuals B32; |
||
729 | CARD32 numSubpixel B32; /* Version 0.6 */ |
||
730 | CARD32 pad5 B32; |
||
731 | } xRenderQueryPictFormatsReply; |
||
732 | |||
733 | #define sz_xRenderQueryPictFormatsReply 32 |
||
734 | |||
735 | typedef struct { |
||
736 | CARD8 reqType; |
||
737 | CARD8 renderReqType; |
||
738 | CARD16 length B16; |
||
739 | PictFormat format B32; |
||
740 | } xRenderQueryPictIndexValuesReq; |
||
741 | |||
742 | #define sz_xRenderQueryPictIndexValuesReq 8 |
||
743 | |||
744 | typedef struct { |
||
745 | BYTE type; /* X_Reply */ |
||
746 | BYTE pad1; |
||
747 | CARD16 sequenceNumber B16; |
||
748 | CARD32 length B32; |
||
749 | CARD32 numIndexValues; |
||
750 | CARD32 pad2 B32; |
||
751 | CARD32 pad3 B32; |
||
752 | CARD32 pad4 B32; |
||
753 | CARD32 pad5 B32; |
||
754 | CARD32 pad6 B32; |
||
755 | } xRenderQueryPictIndexValuesReply; |
||
756 | |||
757 | #define sz_xRenderQueryPictIndexValuesReply 32 |
||
758 | |||
759 | typedef struct { |
||
760 | CARD8 reqType; |
||
761 | CARD8 renderReqType; |
||
762 | CARD16 length B16; |
||
763 | Picture pid B32; |
||
764 | Drawable drawable B32; |
||
765 | PictFormat format B32; |
||
766 | CARD32 mask B32; |
||
767 | } xRenderCreatePictureReq; |
||
768 | |||
769 | #define sz_xRenderCreatePictureReq 20 |
||
770 | |||
771 | typedef struct { |
||
772 | CARD8 reqType; |
||
773 | CARD8 renderReqType; |
||
774 | CARD16 length B16; |
||
775 | Picture picture B32; |
||
776 | CARD32 mask B32; |
||
777 | } xRenderChangePictureReq; |
||
778 | |||
779 | #define sz_xRenderChangePictureReq 12 |
||
780 | |||
781 | typedef struct { |
||
782 | CARD8 reqType; |
||
783 | CARD8 renderReqType; |
||
784 | CARD16 length B16; |
||
785 | Picture picture B32; |
||
786 | INT16 xOrigin B16; |
||
787 | INT16 yOrigin B16; |
||
788 | } xRenderSetPictureClipRectanglesReq; |
||
789 | |||
790 | #define sz_xRenderSetPictureClipRectanglesReq 12 |
||
791 | |||
792 | typedef struct { |
||
793 | CARD8 reqType; |
||
794 | CARD8 renderReqType; |
||
795 | CARD16 length B16; |
||
796 | Picture picture B32; |
||
797 | } xRenderFreePictureReq; |
||
798 | |||
799 | #define sz_xRenderFreePictureReq 8 |
||
800 | |||
801 | typedef struct { |
||
802 | CARD8 reqType; |
||
803 | CARD8 renderReqType; |
||
804 | CARD16 length B16; |
||
805 | CARD8 op; |
||
806 | CARD8 pad1; |
||
807 | CARD16 pad2 B16; |
||
808 | Picture src B32; |
||
809 | Picture mask B32; |
||
810 | Picture dst B32; |
||
811 | INT16 xSrc B16; |
||
812 | INT16 ySrc B16; |
||
813 | INT16 xMask B16; |
||
814 | INT16 yMask B16; |
||
815 | INT16 xDst B16; |
||
816 | INT16 yDst B16; |
||
817 | CARD16 width B16; |
||
818 | CARD16 height B16; |
||
819 | } xRenderCompositeReq; |
||
820 | |||
821 | #define sz_xRenderCompositeReq 36 |
||
822 | |||
823 | typedef struct { |
||
824 | CARD8 reqType; |
||
825 | CARD8 renderReqType; |
||
826 | CARD16 length B16; |
||
827 | Picture src B32; |
||
828 | Picture dst B32; |
||
829 | CARD32 colorScale B32; |
||
830 | CARD32 alphaScale B32; |
||
831 | INT16 xSrc B16; |
||
832 | INT16 ySrc B16; |
||
833 | INT16 xDst B16; |
||
834 | INT16 yDst B16; |
||
835 | CARD16 width B16; |
||
836 | CARD16 height B16; |
||
837 | } xRenderScaleReq; |
||
838 | |||
839 | #define sz_xRenderScaleReq 32 |
||
840 | |||
841 | typedef struct { |
||
842 | CARD8 reqType; |
||
843 | CARD8 renderReqType; |
||
844 | CARD16 length B16; |
||
845 | CARD8 op; |
||
846 | CARD8 pad1; |
||
847 | CARD16 pad2 B16; |
||
848 | Picture src B32; |
||
849 | Picture dst B32; |
||
850 | PictFormat maskFormat B32; |
||
851 | INT16 xSrc B16; |
||
852 | INT16 ySrc B16; |
||
853 | } xRenderTrapezoidsReq; |
||
854 | |||
855 | #define sz_xRenderTrapezoidsReq 24 |
||
856 | |||
857 | typedef struct { |
||
858 | CARD8 reqType; |
||
859 | CARD8 renderReqType; |
||
860 | CARD16 length B16; |
||
861 | CARD8 op; |
||
862 | CARD8 pad1; |
||
863 | CARD16 pad2 B16; |
||
864 | Picture src B32; |
||
865 | Picture dst B32; |
||
866 | PictFormat maskFormat B32; |
||
867 | INT16 xSrc B16; |
||
868 | INT16 ySrc B16; |
||
869 | } xRenderTrianglesReq; |
||
870 | |||
871 | #define sz_xRenderTrianglesReq 24 |
||
872 | |||
873 | typedef struct { |
||
874 | CARD8 reqType; |
||
875 | CARD8 renderReqType; |
||
876 | CARD16 length B16; |
||
877 | CARD8 op; |
||
878 | CARD8 pad1; |
||
879 | CARD16 pad2 B16; |
||
880 | Picture src B32; |
||
881 | Picture dst B32; |
||
882 | PictFormat maskFormat B32; |
||
883 | INT16 xSrc B16; |
||
884 | INT16 ySrc B16; |
||
885 | } xRenderTriStripReq; |
||
886 | |||
887 | #define sz_xRenderTriStripReq 24 |
||
888 | |||
889 | typedef struct { |
||
890 | CARD8 reqType; |
||
891 | CARD8 renderReqType; |
||
892 | CARD16 length B16; |
||
893 | CARD8 op; |
||
894 | CARD8 pad1; |
||
895 | CARD16 pad2 B16; |
||
896 | Picture src B32; |
||
897 | Picture dst B32; |
||
898 | PictFormat maskFormat B32; |
||
899 | INT16 xSrc B16; |
||
900 | INT16 ySrc B16; |
||
901 | } xRenderTriFanReq; |
||
902 | |||
903 | #define sz_xRenderTriFanReq 24 |
||
904 | |||
905 | typedef struct { |
||
906 | CARD8 reqType; |
||
907 | CARD8 renderReqType; |
||
908 | CARD16 length B16; |
||
909 | Glyphset gsid B32; |
||
910 | PictFormat format B32; |
||
911 | } xRenderCreateGlyphSetReq; |
||
912 | |||
913 | #define sz_xRenderCreateGlyphSetReq 12 |
||
914 | |||
915 | typedef struct { |
||
916 | CARD8 reqType; |
||
917 | CARD8 renderReqType; |
||
918 | CARD16 length B16; |
||
919 | Glyphset gsid B32; |
||
920 | Glyphset existing B32; |
||
921 | } xRenderReferenceGlyphSetReq; |
||
922 | |||
923 | #define sz_xRenderReferenceGlyphSetReq 24 |
||
924 | |||
925 | typedef struct { |
||
926 | CARD8 reqType; |
||
927 | CARD8 renderReqType; |
||
928 | CARD16 length B16; |
||
929 | Glyphset glyphset B32; |
||
930 | } xRenderFreeGlyphSetReq; |
||
931 | |||
932 | #define sz_xRenderFreeGlyphSetReq 8 |
||
933 | |||
934 | typedef struct { |
||
935 | CARD8 reqType; |
||
936 | CARD8 renderReqType; |
||
937 | CARD16 length B16; |
||
938 | Glyphset glyphset B32; |
||
939 | CARD32 nglyphs; |
||
940 | } xRenderAddGlyphsReq; |
||
941 | |||
942 | #define sz_xRenderAddGlyphsReq 12 |
||
943 | |||
944 | typedef struct { |
||
945 | CARD8 reqType; |
||
946 | CARD8 renderReqType; |
||
947 | CARD16 length B16; |
||
948 | Glyphset glyphset B32; |
||
949 | } xRenderFreeGlyphsReq; |
||
950 | |||
951 | #define sz_xRenderFreeGlyphsReq 8 |
||
952 | |||
953 | typedef struct { |
||
954 | CARD8 reqType; |
||
955 | CARD8 renderReqType; |
||
956 | CARD16 length B16; |
||
957 | CARD8 op; |
||
958 | CARD8 pad1; |
||
959 | CARD16 pad2 B16; |
||
960 | Picture src B32; |
||
961 | Picture dst B32; |
||
962 | PictFormat maskFormat B32; |
||
963 | Glyphset glyphset B32; |
||
964 | INT16 xSrc B16; |
||
965 | INT16 ySrc B16; |
||
966 | } xRenderCompositeGlyphsReq, xRenderCompositeGlyphs8Req, |
||
967 | xRenderCompositeGlyphs16Req, xRenderCompositeGlyphs32Req; |
||
968 | |||
969 | #define sz_xRenderCompositeGlyphs8Req 28 |
||
970 | #define sz_xRenderCompositeGlyphs16Req 28 |
||
971 | #define sz_xRenderCompositeGlyphs32Req 28 |
||
972 | |||
973 | /* 0.1 and higher */ |
||
974 | |||
975 | typedef struct { |
||
976 | CARD8 reqType; |
||
977 | CARD8 renderReqType; |
||
978 | CARD16 length B16; |
||
979 | CARD8 op; |
||
980 | CARD8 pad1; |
||
981 | CARD16 pad2 B16; |
||
982 | Picture dst B32; |
||
983 | xRenderColor color; |
||
984 | } xRenderFillRectanglesReq; |
||
985 | |||
986 | #define sz_xRenderFillRectanglesReq 20 |
||
987 | |||
988 | /* 0.5 and higher */ |
||
989 | |||
990 | typedef struct { |
||
991 | CARD8 reqType; |
||
992 | CARD8 renderReqType; |
||
993 | CARD16 length B16; |
||
994 | Cursor cid B32; |
||
995 | Picture src B32; |
||
996 | CARD16 x B16; |
||
997 | CARD16 y B16; |
||
998 | } xRenderCreateCursorReq; |
||
999 | |||
1000 | #define sz_xRenderCreateCursorReq 16 |
||
1001 | |||
1002 | /* 0.6 and higher */ |
||
1003 | |||
1004 | /* |
||
1005 | * This can't use an array because 32-bit values may be in bitfields |
||
1006 | */ |
||
1007 | typedef struct { |
||
1008 | Fixed matrix11 B32; |
||
1009 | Fixed matrix12 B32; |
||
1010 | Fixed matrix13 B32; |
||
1011 | Fixed matrix21 B32; |
||
1012 | Fixed matrix22 B32; |
||
1013 | Fixed matrix23 B32; |
||
1014 | Fixed matrix31 B32; |
||
1015 | Fixed matrix32 B32; |
||
1016 | Fixed matrix33 B32; |
||
1017 | } xRenderTransform; |
||
1018 | |||
1019 | #define sz_xRenderTransform 36 |
||
1020 | |||
1021 | typedef struct { |
||
1022 | CARD8 reqType; |
||
1023 | CARD8 renderReqType; |
||
1024 | CARD16 length B16; |
||
1025 | Picture picture B32; |
||
1026 | xRenderTransform transform; |
||
1027 | } xRenderSetPictureTransformReq; |
||
1028 | |||
1029 | #define sz_xRenderSetPictureTransformReq 44 |
||
1030 | |||
1031 | typedef struct { |
||
1032 | CARD8 reqType; |
||
1033 | CARD8 renderReqType; |
||
1034 | CARD16 length B16; |
||
1035 | Drawable drawable B32; |
||
1036 | } xRenderQueryFiltersReq; |
||
1037 | |||
1038 | #define sz_xRenderQueryFiltersReq 8 |
||
1039 | |||
1040 | typedef struct { |
||
1041 | BYTE type; /* X_Reply */ |
||
1042 | BYTE pad1; |
||
1043 | CARD16 sequenceNumber B16; |
||
1044 | CARD32 length B32; |
||
1045 | CARD32 numAliases B32; /* LISTofCARD16 */ |
||
1046 | CARD32 numFilters B32; /* LISTofSTRING8 */ |
||
1047 | CARD32 pad2 B32; |
||
1048 | CARD32 pad3 B32; |
||
1049 | CARD32 pad4 B32; |
||
1050 | CARD32 pad5 B32; |
||
1051 | } xRenderQueryFiltersReply; |
||
1052 | |||
1053 | #define sz_xRenderQueryFiltersReply 32 |
||
1054 | |||
1055 | typedef struct { |
||
1056 | CARD8 reqType; |
||
1057 | CARD8 renderReqType; |
||
1058 | CARD16 length B16; |
||
1059 | Picture picture B32; |
||
1060 | CARD16 nbytes B16; /* number of bytes in name */ |
||
1061 | CARD16 pad B16; |
||
1062 | } xRenderSetPictureFilterReq; |
||
1063 | |||
1064 | #define sz_xRenderSetPictureFilterReq 12 |
||
1065 | |||
1066 | /* 0.8 and higher */ |
||
1067 | |||
1068 | typedef struct { |
||
1069 | Cursor cursor B32; |
||
1070 | CARD32 delay B32; |
||
1071 | } xAnimCursorElt; |
||
1072 | |||
1073 | #define sz_xAnimCursorElt 8 |
||
1074 | |||
1075 | typedef struct { |
||
1076 | CARD8 reqType; |
||
1077 | CARD8 renderReqType; |
||
1078 | CARD16 length B16; |
||
1079 | Cursor cid B32; |
||
1080 | } xRenderCreateAnimCursorReq; |
||
1081 | |||
1082 | #define sz_xRenderCreateAnimCursorReq 8 |
||
1083 | |||
1084 | /* 0.9 and higher */ |
||
1085 | |||
1086 | typedef struct { |
||
1087 | CARD8 reqType; |
||
1088 | CARD8 renderReqType; |
||
1089 | CARD16 length B16; |
||
1090 | Picture picture; |
||
1091 | INT16 xOff B16; |
||
1092 | INT16 yOff B16; |
||
1093 | } xRenderAddTrapsReq; |
||
1094 | |||
1095 | #define sz_xRenderAddTrapsReq 12 |
||
1096 | |||
1097 | /* 0.10 and higher */ |
||
1098 | |||
1099 | typedef struct { |
||
1100 | CARD8 reqType; |
||
1101 | CARD8 renderReqType; |
||
1102 | CARD16 length B16; |
||
1103 | Picture pid B32; |
||
1104 | xRenderColor color; |
||
1105 | } xRenderCreateSolidFillReq; |
||
1106 | |||
1107 | #define sz_xRenderCreateSolidFillReq 16 |
||
1108 | |||
1109 | typedef struct { |
||
1110 | CARD8 reqType; |
||
1111 | CARD8 renderReqType; |
||
1112 | CARD16 length B16; |
||
1113 | Picture pid B32; |
||
1114 | xPointFixed p1; |
||
1115 | xPointFixed p2; |
||
1116 | CARD32 nStops; |
||
1117 | } xRenderCreateLinearGradientReq; |
||
1118 | |||
1119 | #define sz_xRenderCreateLinearGradientReq 28 |
||
1120 | |||
1121 | typedef struct { |
||
1122 | CARD8 reqType; |
||
1123 | CARD8 renderReqType; |
||
1124 | CARD16 length B16; |
||
1125 | Picture pid B32; |
||
1126 | xPointFixed inner; |
||
1127 | xPointFixed outer; |
||
1128 | Fixed inner_radius; |
||
1129 | Fixed outer_radius; |
||
1130 | CARD32 nStops; |
||
1131 | } xRenderCreateRadialGradientReq; |
||
1132 | |||
1133 | #define sz_xRenderCreateRadialGradientReq 36 |
||
1134 | |||
1135 | typedef struct { |
||
1136 | CARD8 reqType; |
||
1137 | CARD8 renderReqType; |
||
1138 | CARD16 length B16; |
||
1139 | Picture pid B32; |
||
1140 | xPointFixed center; |
||
1141 | Fixed angle; /* in degrees */ |
||
1142 | CARD32 nStops; |
||
1143 | } xRenderCreateConicalGradientReq; |
||
1144 | |||
1145 | #define sz_xRenderCreateConicalGradientReq 24 |
||
1146 | |||
1147 | #undef Window |
||
1148 | #undef Drawable |
||
1149 | #undef Font |
||
1150 | #undef Pixmap |
||
1151 | #undef Cursor |
||
1152 | #undef Colormap |
||
1153 | #undef GContext |
||
1154 | #undef Atom |
||
1155 | #undef VisualID |
||
1156 | #undef Time |
||
1157 | #undef KeyCode |
||
1158 | #undef KeySym |
||
1159 | |||
1160 | #undef Picture |
||
1161 | #undef PictFormat |
||
1162 | #undef Fixed |
||
1163 | #undef Glyphset |
||
1164 | #undef Glyph |
||
1165 | |||
1166 | |||
1167 | #endif /* CAIRO_HAS_XLIB_XRENDER_SURFACE */ |
||
1168 | |||
1169 | #endif /* CAIRO_XLIB_XRENDER_PRIVATE_H */><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><>><> |