VirtualBox

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

最後變更 在這個檔案是 40349,由 vboxsync 提交於 13 年 前

Additions/xorg: support X.Org Server 1.12.

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

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