VirtualBox

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

最後變更 在這個檔案從25078是 25078,由 vboxsync 提交於 15 年 前

Additions/x11/x11include: exported and set eol-style on new headers

  • 屬性 svn:eol-style 設為 native
檔案大小: 17.4 KB
 
1/*
2 * $Id$
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 PictFormatShort 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 /**
353 * Called immediately after a picture's transform is changed through the
354 * SetPictureTransform request. Not called for source-only pictures.
355 */
356 ChangePictureTransformProcPtr ChangePictureTransform;
357
358 /**
359 * Called immediately after a picture's transform is changed through the
360 * SetPictureFilter request. Not called for source-only pictures.
361 */
362 ChangePictureFilterProcPtr ChangePictureFilter;
363
364 DestroyPictureFilterProcPtr DestroyPictureFilter;
365
366 TrapezoidsProcPtr Trapezoids;
367 TrianglesProcPtr Triangles;
368 TriStripProcPtr TriStrip;
369 TriFanProcPtr TriFan;
370
371 RasterizeTrapezoidProcPtr RasterizeTrapezoid;
372
373 AddTrianglesProcPtr AddTriangles;
374
375 AddTrapsProcPtr AddTraps;
376
377 int totalGlyphPrivateSize;
378 unsigned int *glyphPrivateSizes;
379 int glyphPrivateLen;
380 int glyphPrivateOffset;
381
382 RealizeGlyphProcPtr RealizeGlyph;
383 UnrealizeGlyphProcPtr UnrealizeGlyph;
384
385} PictureScreenRec, *PictureScreenPtr;
386
387extern int PictureScreenPrivateIndex;
388extern int PictureWindowPrivateIndex;
389extern RESTYPE PictureType;
390extern RESTYPE PictFormatType;
391extern RESTYPE GlyphSetType;
392
393#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr))
394#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL)
395#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p))
396#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr))
397#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p))
398
399#define GetGlyphPrivatesForScreen(glyph, s) \
400 ((glyph)->devPrivates + (GetPictureScreen (s))->glyphPrivateOffset)
401
402#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\
403 pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\
404 if (!pPicture) { \
405 client->errorValue = pid; \
406 return err; \
407 } \
408}
409
410#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\
411 if (pid == None) \
412 pPicture = 0; \
413 else { \
414 VERIFY_PICTURE(pPicture, pid, client, mode, err); \
415 } \
416} \
417
418void
419ResetPicturePrivateIndex (void);
420
421int
422AllocatePicturePrivateIndex (void);
423
424Bool
425AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount);
426
427Bool
428PictureDestroyWindow (WindowPtr pWindow);
429
430Bool
431PictureCloseScreen (int Index, ScreenPtr pScreen);
432
433void
434PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
435
436Bool
437PictureInitIndexedFormats (ScreenPtr pScreen);
438
439Bool
440PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
441
442int
443PictureGetSubpixelOrder (ScreenPtr pScreen);
444
445PictFormatPtr
446PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
447
448PictFormatPtr
449PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
450
451PictFormatPtr
452PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
453
454Bool
455PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
456
457int
458PictureGetFilterId (char *filter, int len, Bool makeit);
459
460char *
461PictureGetFilterName (int id);
462
463int
464PictureAddFilter (ScreenPtr pScreen,
465 char *filter,
466 PictFilterValidateParamsProcPtr ValidateParams);
467
468Bool
469PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
470
471Bool
472PictureSetDefaultFilters (ScreenPtr pScreen);
473
474void
475PictureResetFilters (ScreenPtr pScreen);
476
477PictFilterPtr
478PictureFindFilter (ScreenPtr pScreen, char *name, int len);
479
480int
481SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams);
482
483Bool
484PictureFinishInit (void);
485
486void
487SetPictureToDefaults (PicturePtr pPicture);
488
489PicturePtr
490AllocatePicture (ScreenPtr pScreen);
491
492#if 0
493Bool
494miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
495#endif
496
497
498PicturePtr
499CreatePicture (Picture pid,
500 DrawablePtr pDrawable,
501 PictFormatPtr pFormat,
502 Mask mask,
503 XID *list,
504 ClientPtr client,
505 int *error);
506
507int
508ChangePicture (PicturePtr pPicture,
509 Mask vmask,
510 XID *vlist,
511 DevUnion *ulist,
512 ClientPtr client);
513
514int
515SetPictureClipRects (PicturePtr pPicture,
516 int xOrigin,
517 int yOrigin,
518 int nRect,
519 xRectangle *rects);
520
521int
522SetPictureClipRegion (PicturePtr pPicture,
523 int xOrigin,
524 int yOrigin,
525 RegionPtr pRegion);
526
527int
528SetPictureTransform (PicturePtr pPicture,
529 PictTransform *transform);
530
531void
532CopyPicture (PicturePtr pSrc,
533 Mask mask,
534 PicturePtr pDst);
535
536void
537ValidatePicture(PicturePtr pPicture);
538
539int
540FreePicture (pointer pPicture,
541 XID pid);
542
543int
544FreePictFormat (pointer pPictFormat,
545 XID pid);
546
547void
548CompositePicture (CARD8 op,
549 PicturePtr pSrc,
550 PicturePtr pMask,
551 PicturePtr pDst,
552 INT16 xSrc,
553 INT16 ySrc,
554 INT16 xMask,
555 INT16 yMask,
556 INT16 xDst,
557 INT16 yDst,
558 CARD16 width,
559 CARD16 height);
560
561void
562CompositeGlyphs (CARD8 op,
563 PicturePtr pSrc,
564 PicturePtr pDst,
565 PictFormatPtr maskFormat,
566 INT16 xSrc,
567 INT16 ySrc,
568 int nlist,
569 GlyphListPtr lists,
570 GlyphPtr *glyphs);
571
572void
573CompositeRects (CARD8 op,
574 PicturePtr pDst,
575 xRenderColor *color,
576 int nRect,
577 xRectangle *rects);
578
579void
580CompositeTrapezoids (CARD8 op,
581 PicturePtr pSrc,
582 PicturePtr pDst,
583 PictFormatPtr maskFormat,
584 INT16 xSrc,
585 INT16 ySrc,
586 int ntrap,
587 xTrapezoid *traps);
588
589void
590CompositeTriangles (CARD8 op,
591 PicturePtr pSrc,
592 PicturePtr pDst,
593 PictFormatPtr maskFormat,
594 INT16 xSrc,
595 INT16 ySrc,
596 int ntriangles,
597 xTriangle *triangles);
598
599void
600CompositeTriStrip (CARD8 op,
601 PicturePtr pSrc,
602 PicturePtr pDst,
603 PictFormatPtr maskFormat,
604 INT16 xSrc,
605 INT16 ySrc,
606 int npoints,
607 xPointFixed *points);
608
609void
610CompositeTriFan (CARD8 op,
611 PicturePtr pSrc,
612 PicturePtr pDst,
613 PictFormatPtr maskFormat,
614 INT16 xSrc,
615 INT16 ySrc,
616 int npoints,
617 xPointFixed *points);
618
619Bool
620PictureTransformPoint (PictTransformPtr transform,
621 PictVectorPtr vector);
622
623Bool
624PictureTransformPoint3d (PictTransformPtr transform,
625 PictVectorPtr vector);
626
627void RenderExtensionInit (void);
628
629Bool
630AnimCurInit (ScreenPtr pScreen);
631
632int
633AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
634
635void
636AddTraps (PicturePtr pPicture,
637 INT16 xOff,
638 INT16 yOff,
639 int ntraps,
640 xTrap *traps);
641
642PicturePtr
643CreateSolidPicture (Picture pid,
644 xRenderColor *color,
645 int *error);
646
647PicturePtr
648CreateLinearGradientPicture (Picture pid,
649 xPointFixed *p1,
650 xPointFixed *p2,
651 int nStops,
652 xFixed *stops,
653 xRenderColor *colors,
654 int *error);
655
656PicturePtr
657CreateRadialGradientPicture (Picture pid,
658 xPointFixed *inner,
659 xPointFixed *outer,
660 xFixed innerRadius,
661 xFixed outerRadius,
662 int nStops,
663 xFixed *stops,
664 xRenderColor *colors,
665 int *error);
666
667PicturePtr
668CreateConicalGradientPicture (Picture pid,
669 xPointFixed *center,
670 xFixed angle,
671 int nStops,
672 xFixed *stops,
673 xRenderColor *colors,
674 int *error);
675
676#ifdef PANORAMIX
677void PanoramiXRenderInit (void);
678void PanoramiXRenderReset (void);
679#endif
680
681#endif /* _PICTURESTR_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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