VirtualBox

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

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

Additions/x11/x11include: header files for building X.Org server 1.8 drivers

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

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