VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/7.1/xorg/picturestr.h@ 6202

Last change on this file since 6202 was 6202, checked in by vboxsync, 17 years ago

re-export x11

  • Property svn:eol-style set to native
File size: 17.1 KB
Line 
1/*
2 * $Id: picturestr.h,v 1.14 2005/08/24 11:18:33 daniels 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 _PICTURESTR_H_
27#define _PICTURESTR_H_
28
29#include "glyphstr.h"
30#include "scrnintstr.h"
31#include "resource.h"
32
33typedef struct _DirectFormat {
34 CARD16 red, redMask;
35 CARD16 green, greenMask;
36 CARD16 blue, blueMask;
37 CARD16 alpha, alphaMask;
38} DirectFormatRec;
39
40typedef struct _IndexFormat {
41 VisualID vid;
42 ColormapPtr pColormap;
43 int nvalues;
44 xIndexValue *pValues;
45 void *devPrivate;
46} IndexFormatRec;
47
48typedef struct _PictFormat {
49 CARD32 id;
50 CARD32 format; /* except bpp */
51 unsigned char type;
52 unsigned char depth;
53 DirectFormatRec direct;
54 IndexFormatRec index;
55} PictFormatRec;
56
57typedef struct _PictVector {
58 xFixed vector[3];
59} PictVector, *PictVectorPtr;
60
61typedef struct _PictTransform {
62 xFixed matrix[3][3];
63} PictTransform, *PictTransformPtr;
64
65#define PICT_GRADIENT_STOPTABLE_SIZE 1024
66#define SourcePictTypeSolidFill 0
67#define SourcePictTypeLinear 1
68#define SourcePictTypeRadial 2
69#define SourcePictTypeConical 3
70
71typedef struct _PictSolidFill {
72 unsigned int type;
73 CARD32 color;
74} PictSolidFill, *PictSolidFillPtr;
75
76typedef struct _PictGradientStop {
77 xFixed x;
78 xRenderColor color;
79} PictGradientStop, *PictGradientStopPtr;
80
81typedef struct _PictGradient {
82 unsigned int type;
83 int nstops;
84 PictGradientStopPtr stops;
85 CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
86} PictGradient, *PictGradientPtr;
87
88typedef struct _PictLinearGradient {
89 unsigned int type;
90 int nstops;
91 PictGradientStopPtr stops;
92 CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
93 xPointFixed p1;
94 xPointFixed p2;
95} PictLinearGradient, *PictLinearGradientPtr;
96
97typedef struct _PictRadialGradient {
98 unsigned int type;
99 int nstops;
100 PictGradientStopPtr stops;
101 CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
102 double fx;
103 double fy;
104 double dx;
105 double dy;
106 double a;
107 double m;
108 double b;
109} PictRadialGradient, *PictRadialGradientPtr;
110
111typedef struct _PictConicalGradient {
112 unsigned int type;
113 int nstops;
114 PictGradientStopPtr stops;
115 CARD32 colorTable[PICT_GRADIENT_STOPTABLE_SIZE];
116 xPointFixed center;
117 xFixed angle;
118} PictConicalGradient, *PictConicalGradientPtr;
119
120typedef union _SourcePict {
121 unsigned int type;
122 PictSolidFill solidFill;
123 PictGradient gradient;
124 PictLinearGradient linear;
125 PictRadialGradient radial;
126 PictConicalGradient conical;
127} SourcePict, *SourcePictPtr;
128
129typedef struct _Picture {
130 DrawablePtr pDrawable;
131 PictFormatPtr pFormat;
132 CARD32 format; /* PICT_FORMAT */
133 int refcnt;
134 CARD32 id;
135 PicturePtr pNext; /* chain on same drawable */
136
137 unsigned int repeat : 1;
138 unsigned int graphicsExposures : 1;
139 unsigned int subWindowMode : 1;
140 unsigned int polyEdge : 1;
141 unsigned int polyMode : 1;
142 unsigned int freeCompClip : 1;
143 unsigned int clientClipType : 2;
144 unsigned int componentAlpha : 1;
145 unsigned int repeatType : 2;
146 unsigned int unused : 21;
147
148 PicturePtr alphaMap;
149 DDXPointRec alphaOrigin;
150
151 DDXPointRec clipOrigin;
152 pointer clientClip;
153
154 Atom dither;
155
156 unsigned long stateChanges;
157 unsigned long serialNumber;
158
159 RegionPtr pCompositeClip;
160
161 DevUnion *devPrivates;
162
163 PictTransform *transform;
164
165 int filter;
166 xFixed *filter_params;
167 int filter_nparams;
168 SourcePictPtr pSourcePict;
169} PictureRec;
170
171typedef Bool (*PictFilterValidateParamsProcPtr) (PicturePtr pPicture, int id,
172 xFixed *params, int nparams);
173typedef struct {
174 char *name;
175 int id;
176 PictFilterValidateParamsProcPtr ValidateParams;
177} PictFilterRec, *PictFilterPtr;
178
179#define PictFilterNearest 0
180#define PictFilterBilinear 1
181
182#define PictFilterFast 2
183#define PictFilterGood 3
184#define PictFilterBest 4
185
186#define PictFilterConvolution 5
187
188typedef struct {
189 char *alias;
190 int alias_id;
191 int filter_id;
192} PictFilterAliasRec, *PictFilterAliasPtr;
193
194typedef int (*CreatePictureProcPtr) (PicturePtr pPicture);
195typedef void (*DestroyPictureProcPtr) (PicturePtr pPicture);
196typedef int (*ChangePictureClipProcPtr) (PicturePtr pPicture,
197 int clipType,
198 pointer value,
199 int n);
200typedef void (*DestroyPictureClipProcPtr)(PicturePtr pPicture);
201
202typedef int (*ChangePictureTransformProcPtr) (PicturePtr pPicture,
203 PictTransform *transform);
204
205typedef int (*ChangePictureFilterProcPtr) (PicturePtr pPicture,
206 int filter,
207 xFixed *params,
208 int nparams);
209
210typedef void (*DestroyPictureFilterProcPtr) (PicturePtr pPicture);
211
212typedef void (*ChangePictureProcPtr) (PicturePtr pPicture,
213 Mask mask);
214typedef void (*ValidatePictureProcPtr) (PicturePtr pPicture,
215 Mask mask);
216typedef void (*CompositeProcPtr) (CARD8 op,
217 PicturePtr pSrc,
218 PicturePtr pMask,
219 PicturePtr pDst,
220 INT16 xSrc,
221 INT16 ySrc,
222 INT16 xMask,
223 INT16 yMask,
224 INT16 xDst,
225 INT16 yDst,
226 CARD16 width,
227 CARD16 height);
228
229typedef void (*GlyphsProcPtr) (CARD8 op,
230 PicturePtr pSrc,
231 PicturePtr pDst,
232 PictFormatPtr maskFormat,
233 INT16 xSrc,
234 INT16 ySrc,
235 int nlists,
236 GlyphListPtr lists,
237 GlyphPtr *glyphs);
238
239typedef void (*CompositeRectsProcPtr) (CARD8 op,
240 PicturePtr pDst,
241 xRenderColor *color,
242 int nRect,
243 xRectangle *rects);
244
245typedef void (*RasterizeTrapezoidProcPtr)(PicturePtr pMask,
246 xTrapezoid *trap,
247 int x_off,
248 int y_off);
249
250typedef void (*TrapezoidsProcPtr) (CARD8 op,
251 PicturePtr pSrc,
252 PicturePtr pDst,
253 PictFormatPtr maskFormat,
254 INT16 xSrc,
255 INT16 ySrc,
256 int ntrap,
257 xTrapezoid *traps);
258
259typedef void (*TrianglesProcPtr) (CARD8 op,
260 PicturePtr pSrc,
261 PicturePtr pDst,
262 PictFormatPtr maskFormat,
263 INT16 xSrc,
264 INT16 ySrc,
265 int ntri,
266 xTriangle *tris);
267
268typedef void (*TriStripProcPtr) (CARD8 op,
269 PicturePtr pSrc,
270 PicturePtr pDst,
271 PictFormatPtr maskFormat,
272 INT16 xSrc,
273 INT16 ySrc,
274 int npoint,
275 xPointFixed *points);
276
277typedef void (*TriFanProcPtr) (CARD8 op,
278 PicturePtr pSrc,
279 PicturePtr pDst,
280 PictFormatPtr maskFormat,
281 INT16 xSrc,
282 INT16 ySrc,
283 int npoint,
284 xPointFixed *points);
285
286typedef Bool (*InitIndexedProcPtr) (ScreenPtr pScreen,
287 PictFormatPtr pFormat);
288
289typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen,
290 PictFormatPtr pFormat);
291
292typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
293 PictFormatPtr pFormat,
294 int ndef,
295 xColorItem *pdef);
296
297typedef void (*AddTrapsProcPtr) (PicturePtr pPicture,
298 INT16 xOff,
299 INT16 yOff,
300 int ntrap,
301 xTrap *traps);
302
303typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture,
304 INT16 xOff,
305 INT16 yOff,
306 int ntri,
307 xTriangle *tris);
308
309typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen,
310 GlyphPtr glyph);
311
312typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen,
313 GlyphPtr glyph);
314
315typedef struct _PictureScreen {
316 int totalPictureSize;
317 unsigned int *PicturePrivateSizes;
318 int PicturePrivateLen;
319
320 PictFormatPtr formats;
321 PictFormatPtr fallback;
322 int nformats;
323
324 CreatePictureProcPtr CreatePicture;
325 DestroyPictureProcPtr DestroyPicture;
326 ChangePictureClipProcPtr ChangePictureClip;
327 DestroyPictureClipProcPtr DestroyPictureClip;
328
329 ChangePictureProcPtr ChangePicture;
330 ValidatePictureProcPtr ValidatePicture;
331
332 CompositeProcPtr Composite;
333 GlyphsProcPtr Glyphs;
334 CompositeRectsProcPtr CompositeRects;
335
336 DestroyWindowProcPtr DestroyWindow;
337 CloseScreenProcPtr CloseScreen;
338
339 StoreColorsProcPtr StoreColors;
340
341 InitIndexedProcPtr InitIndexed;
342 CloseIndexedProcPtr CloseIndexed;
343 UpdateIndexedProcPtr UpdateIndexed;
344
345 int subpixel;
346
347 PictFilterPtr filters;
348 int nfilters;
349 PictFilterAliasPtr filterAliases;
350 int nfilterAliases;
351
352 ChangePictureTransformProcPtr ChangePictureTransform;
353 ChangePictureFilterProcPtr ChangePictureFilter;
354 DestroyPictureFilterProcPtr DestroyPictureFilter;
355
356 TrapezoidsProcPtr Trapezoids;
357 TrianglesProcPtr Triangles;
358 TriStripProcPtr TriStrip;
359 TriFanProcPtr TriFan;
360
361 RasterizeTrapezoidProcPtr RasterizeTrapezoid;
362
363 AddTrianglesProcPtr AddTriangles;
364
365 AddTrapsProcPtr AddTraps;
366
367 int totalGlyphPrivateSize;
368 unsigned int *glyphPrivateSizes;
369 int glyphPrivateLen;
370 int glyphPrivateOffset;
371
372 RealizeGlyphProcPtr RealizeGlyph;
373 UnrealizeGlyphProcPtr UnrealizeGlyph;
374
375} PictureScreenRec, *PictureScreenPtr;
376
377extern int PictureScreenPrivateIndex;
378extern int PictureWindowPrivateIndex;
379extern RESTYPE PictureType;
380extern RESTYPE PictFormatType;
381extern RESTYPE GlyphSetType;
382
383#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr))
384#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL)
385#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p))
386#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr))
387#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p))
388
389#define GetGlyphPrivatesForScreen(glyph, s) \
390 ((glyph)->devPrivates + (GetPictureScreen (s))->glyphPrivateOffset)
391
392#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\
393 pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\
394 if (!pPicture) { \
395 client->errorValue = pid; \
396 return err; \
397 } \
398}
399
400#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\
401 if (pid == None) \
402 pPicture = 0; \
403 else { \
404 VERIFY_PICTURE(pPicture, pid, client, mode, err); \
405 } \
406} \
407
408void
409ResetPicturePrivateIndex (void);
410
411int
412AllocatePicturePrivateIndex (void);
413
414Bool
415AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount);
416
417Bool
418PictureDestroyWindow (WindowPtr pWindow);
419
420Bool
421PictureCloseScreen (int Index, ScreenPtr pScreen);
422
423void
424PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
425
426Bool
427PictureInitIndexedFormats (ScreenPtr pScreen);
428
429Bool
430PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
431
432int
433PictureGetSubpixelOrder (ScreenPtr pScreen);
434
435PictFormatPtr
436PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
437
438PictFormatPtr
439PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
440
441PictFormatPtr
442PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
443
444Bool
445PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
446
447int
448PictureGetFilterId (char *filter, int len, Bool makeit);
449
450char *
451PictureGetFilterName (int id);
452
453int
454PictureAddFilter (ScreenPtr pScreen,
455 char *filter,
456 PictFilterValidateParamsProcPtr ValidateParams);
457
458Bool
459PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
460
461Bool
462PictureSetDefaultFilters (ScreenPtr pScreen);
463
464void
465PictureResetFilters (ScreenPtr pScreen);
466
467PictFilterPtr
468PictureFindFilter (ScreenPtr pScreen, char *name, int len);
469
470int
471SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams);
472
473Bool
474PictureFinishInit (void);
475
476void
477SetPictureToDefaults (PicturePtr pPicture);
478
479PicturePtr
480AllocatePicture (ScreenPtr pScreen);
481
482#if 0
483Bool
484miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
485#endif
486
487
488PicturePtr
489CreatePicture (Picture pid,
490 DrawablePtr pDrawable,
491 PictFormatPtr pFormat,
492 Mask mask,
493 XID *list,
494 ClientPtr client,
495 int *error);
496
497int
498ChangePicture (PicturePtr pPicture,
499 Mask vmask,
500 XID *vlist,
501 DevUnion *ulist,
502 ClientPtr client);
503
504int
505SetPictureClipRects (PicturePtr pPicture,
506 int xOrigin,
507 int yOrigin,
508 int nRect,
509 xRectangle *rects);
510
511int
512SetPictureClipRegion (PicturePtr pPicture,
513 int xOrigin,
514 int yOrigin,
515 RegionPtr pRegion);
516
517int
518SetPictureTransform (PicturePtr pPicture,
519 PictTransform *transform);
520
521void
522CopyPicture (PicturePtr pSrc,
523 Mask mask,
524 PicturePtr pDst);
525
526void
527ValidatePicture(PicturePtr pPicture);
528
529int
530FreePicture (pointer pPicture,
531 XID pid);
532
533int
534FreePictFormat (pointer pPictFormat,
535 XID pid);
536
537void
538CompositePicture (CARD8 op,
539 PicturePtr pSrc,
540 PicturePtr pMask,
541 PicturePtr pDst,
542 INT16 xSrc,
543 INT16 ySrc,
544 INT16 xMask,
545 INT16 yMask,
546 INT16 xDst,
547 INT16 yDst,
548 CARD16 width,
549 CARD16 height);
550
551void
552CompositeGlyphs (CARD8 op,
553 PicturePtr pSrc,
554 PicturePtr pDst,
555 PictFormatPtr maskFormat,
556 INT16 xSrc,
557 INT16 ySrc,
558 int nlist,
559 GlyphListPtr lists,
560 GlyphPtr *glyphs);
561
562void
563CompositeRects (CARD8 op,
564 PicturePtr pDst,
565 xRenderColor *color,
566 int nRect,
567 xRectangle *rects);
568
569void
570CompositeTrapezoids (CARD8 op,
571 PicturePtr pSrc,
572 PicturePtr pDst,
573 PictFormatPtr maskFormat,
574 INT16 xSrc,
575 INT16 ySrc,
576 int ntrap,
577 xTrapezoid *traps);
578
579void
580CompositeTriangles (CARD8 op,
581 PicturePtr pSrc,
582 PicturePtr pDst,
583 PictFormatPtr maskFormat,
584 INT16 xSrc,
585 INT16 ySrc,
586 int ntriangles,
587 xTriangle *triangles);
588
589void
590CompositeTriStrip (CARD8 op,
591 PicturePtr pSrc,
592 PicturePtr pDst,
593 PictFormatPtr maskFormat,
594 INT16 xSrc,
595 INT16 ySrc,
596 int npoints,
597 xPointFixed *points);
598
599void
600CompositeTriFan (CARD8 op,
601 PicturePtr pSrc,
602 PicturePtr pDst,
603 PictFormatPtr maskFormat,
604 INT16 xSrc,
605 INT16 ySrc,
606 int npoints,
607 xPointFixed *points);
608
609Bool
610PictureTransformPoint (PictTransformPtr transform,
611 PictVectorPtr vector);
612
613Bool
614PictureTransformPoint3d (PictTransformPtr transform,
615 PictVectorPtr vector);
616
617void RenderExtensionInit (void);
618
619Bool
620AnimCurInit (ScreenPtr pScreen);
621
622int
623AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
624
625void
626AddTraps (PicturePtr pPicture,
627 INT16 xOff,
628 INT16 yOff,
629 int ntraps,
630 xTrap *traps);
631
632PicturePtr
633CreateSolidPicture (Picture pid,
634 xRenderColor *color,
635 int *error);
636
637PicturePtr
638CreateLinearGradientPicture (Picture pid,
639 xPointFixed *p1,
640 xPointFixed *p2,
641 int nStops,
642 xFixed *stops,
643 xRenderColor *colors,
644 int *error);
645
646PicturePtr
647CreateRadialGradientPicture (Picture pid,
648 xPointFixed *inner,
649 xPointFixed *outer,
650 xFixed innerRadius,
651 xFixed outerRadius,
652 int nStops,
653 xFixed *stops,
654 xRenderColor *colors,
655 int *error);
656
657PicturePtr
658CreateConicalGradientPicture (Picture pid,
659 xPointFixed *center,
660 xFixed angle,
661 int nStops,
662 xFixed *stops,
663 xRenderColor *colors,
664 int *error);
665
666#ifdef PANORAMIX
667void PanoramiXRenderInit (void);
668void PanoramiXRenderReset (void);
669#endif
670
671#endif /* _PICTURESTR_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette