VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.4.2/picturestr.h@ 86603

Last change on this file since 86603 was 43272, checked in by vboxsync, 12 years ago

Additions/x11: more original X server headers.

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