VirtualBox

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

Last change on this file since 77138 was 17471, checked in by vboxsync, 16 years ago

export to OSE

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