VirtualBox

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

最後變更 在這個檔案從67129是 51223,由 vboxsync 提交於 11 年 前

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • 屬性 svn:eol-style 設為 native
檔案大小: 16.6 KB
 
1/*
2 * $Id: picturestr.h,v 1.15 2005/12/09 18:35:21 ajax Exp $
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 CARD32 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 struct _PictureScreen {
310 int totalPictureSize;
311 unsigned int *PicturePrivateSizes;
312 int PicturePrivateLen;
313
314 PictFormatPtr formats;
315 PictFormatPtr fallback;
316 int nformats;
317
318 CreatePictureProcPtr CreatePicture;
319 DestroyPictureProcPtr DestroyPicture;
320 ChangePictureClipProcPtr ChangePictureClip;
321 DestroyPictureClipProcPtr DestroyPictureClip;
322
323 ChangePictureProcPtr ChangePicture;
324 ValidatePictureProcPtr ValidatePicture;
325
326 CompositeProcPtr Composite;
327 GlyphsProcPtr Glyphs;
328 CompositeRectsProcPtr CompositeRects;
329
330 DestroyWindowProcPtr DestroyWindow;
331 CloseScreenProcPtr CloseScreen;
332
333 StoreColorsProcPtr StoreColors;
334
335 InitIndexedProcPtr InitIndexed;
336 CloseIndexedProcPtr CloseIndexed;
337 UpdateIndexedProcPtr UpdateIndexed;
338
339 int subpixel;
340
341 PictFilterPtr filters;
342 int nfilters;
343 PictFilterAliasPtr filterAliases;
344 int nfilterAliases;
345
346 ChangePictureTransformProcPtr ChangePictureTransform;
347 ChangePictureFilterProcPtr ChangePictureFilter;
348 DestroyPictureFilterProcPtr DestroyPictureFilter;
349
350 TrapezoidsProcPtr Trapezoids;
351 TrianglesProcPtr Triangles;
352 TriStripProcPtr TriStrip;
353 TriFanProcPtr TriFan;
354
355 RasterizeTrapezoidProcPtr RasterizeTrapezoid;
356
357 AddTrianglesProcPtr AddTriangles;
358
359 AddTrapsProcPtr AddTraps;
360
361} PictureScreenRec, *PictureScreenPtr;
362
363extern int PictureScreenPrivateIndex;
364extern int PictureWindowPrivateIndex;
365extern RESTYPE PictureType;
366extern RESTYPE PictFormatType;
367extern RESTYPE GlyphSetType;
368
369#define GetPictureScreen(s) ((PictureScreenPtr) ((s)->devPrivates[PictureScreenPrivateIndex].ptr))
370#define GetPictureScreenIfSet(s) ((PictureScreenPrivateIndex != -1) ? GetPictureScreen(s) : NULL)
371#define SetPictureScreen(s,p) ((s)->devPrivates[PictureScreenPrivateIndex].ptr = (pointer) (p))
372#define GetPictureWindow(w) ((PicturePtr) ((w)->devPrivates[PictureWindowPrivateIndex].ptr))
373#define SetPictureWindow(w,p) ((w)->devPrivates[PictureWindowPrivateIndex].ptr = (pointer) (p))
374
375#define VERIFY_PICTURE(pPicture, pid, client, mode, err) {\
376 pPicture = SecurityLookupIDByType(client, pid, PictureType, mode);\
377 if (!pPicture) { \
378 client->errorValue = pid; \
379 return err; \
380 } \
381}
382
383#define VERIFY_ALPHA(pPicture, pid, client, mode, err) {\
384 if (pid == None) \
385 pPicture = 0; \
386 else { \
387 VERIFY_PICTURE(pPicture, pid, client, mode, err); \
388 } \
389} \
390
391void
392ResetPicturePrivateIndex (void);
393
394int
395AllocatePicturePrivateIndex (void);
396
397Bool
398AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount);
399
400Bool
401PictureDestroyWindow (WindowPtr pWindow);
402
403Bool
404PictureCloseScreen (int Index, ScreenPtr pScreen);
405
406void
407PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
408
409Bool
410PictureInitIndexedFormats (ScreenPtr pScreen);
411
412Bool
413PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
414
415int
416PictureGetSubpixelOrder (ScreenPtr pScreen);
417
418PictFormatPtr
419PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
420
421PictFormatPtr
422PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
423
424PictFormatPtr
425PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
426
427Bool
428PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
429
430int
431PictureGetFilterId (char *filter, int len, Bool makeit);
432
433char *
434PictureGetFilterName (int id);
435
436int
437PictureAddFilter (ScreenPtr pScreen,
438 char *filter,
439 PictFilterValidateParamsProcPtr ValidateParams);
440
441Bool
442PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
443
444Bool
445PictureSetDefaultFilters (ScreenPtr pScreen);
446
447void
448PictureResetFilters (ScreenPtr pScreen);
449
450PictFilterPtr
451PictureFindFilter (ScreenPtr pScreen, char *name, int len);
452
453int
454SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams);
455
456Bool
457PictureFinishInit (void);
458
459void
460SetPictureToDefaults (PicturePtr pPicture);
461
462PicturePtr
463AllocatePicture (ScreenPtr pScreen);
464
465#if 0
466Bool
467miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
468#endif
469
470
471PicturePtr
472CreatePicture (Picture pid,
473 DrawablePtr pDrawable,
474 PictFormatPtr pFormat,
475 Mask mask,
476 XID *list,
477 ClientPtr client,
478 int *error);
479
480int
481ChangePicture (PicturePtr pPicture,
482 Mask vmask,
483 XID *vlist,
484 DevUnion *ulist,
485 ClientPtr client);
486
487int
488SetPictureClipRects (PicturePtr pPicture,
489 int xOrigin,
490 int yOrigin,
491 int nRect,
492 xRectangle *rects);
493
494int
495SetPictureClipRegion (PicturePtr pPicture,
496 int xOrigin,
497 int yOrigin,
498 RegionPtr pRegion);
499
500int
501SetPictureTransform (PicturePtr pPicture,
502 PictTransform *transform);
503
504void
505CopyPicture (PicturePtr pSrc,
506 Mask mask,
507 PicturePtr pDst);
508
509void
510ValidatePicture(PicturePtr pPicture);
511
512int
513FreePicture (pointer pPicture,
514 XID pid);
515
516int
517FreePictFormat (pointer pPictFormat,
518 XID pid);
519
520void
521CompositePicture (CARD8 op,
522 PicturePtr pSrc,
523 PicturePtr pMask,
524 PicturePtr pDst,
525 INT16 xSrc,
526 INT16 ySrc,
527 INT16 xMask,
528 INT16 yMask,
529 INT16 xDst,
530 INT16 yDst,
531 CARD16 width,
532 CARD16 height);
533
534void
535CompositeGlyphs (CARD8 op,
536 PicturePtr pSrc,
537 PicturePtr pDst,
538 PictFormatPtr maskFormat,
539 INT16 xSrc,
540 INT16 ySrc,
541 int nlist,
542 GlyphListPtr lists,
543 GlyphPtr *glyphs);
544
545void
546CompositeRects (CARD8 op,
547 PicturePtr pDst,
548 xRenderColor *color,
549 int nRect,
550 xRectangle *rects);
551
552void
553CompositeTrapezoids (CARD8 op,
554 PicturePtr pSrc,
555 PicturePtr pDst,
556 PictFormatPtr maskFormat,
557 INT16 xSrc,
558 INT16 ySrc,
559 int ntrap,
560 xTrapezoid *traps);
561
562void
563CompositeTriangles (CARD8 op,
564 PicturePtr pSrc,
565 PicturePtr pDst,
566 PictFormatPtr maskFormat,
567 INT16 xSrc,
568 INT16 ySrc,
569 int ntriangles,
570 xTriangle *triangles);
571
572void
573CompositeTriStrip (CARD8 op,
574 PicturePtr pSrc,
575 PicturePtr pDst,
576 PictFormatPtr maskFormat,
577 INT16 xSrc,
578 INT16 ySrc,
579 int npoints,
580 xPointFixed *points);
581
582void
583CompositeTriFan (CARD8 op,
584 PicturePtr pSrc,
585 PicturePtr pDst,
586 PictFormatPtr maskFormat,
587 INT16 xSrc,
588 INT16 ySrc,
589 int npoints,
590 xPointFixed *points);
591
592Bool
593PictureTransformPoint (PictTransformPtr transform,
594 PictVectorPtr vector);
595
596Bool
597PictureTransformPoint3d (PictTransformPtr transform,
598 PictVectorPtr vector);
599
600void RenderExtensionInit (void);
601
602Bool
603AnimCurInit (ScreenPtr pScreen);
604
605int
606AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor);
607
608void
609AddTraps (PicturePtr pPicture,
610 INT16 xOff,
611 INT16 yOff,
612 int ntraps,
613 xTrap *traps);
614
615PicturePtr
616CreateSolidPicture (Picture pid,
617 xRenderColor *color,
618 int *error);
619
620PicturePtr
621CreateLinearGradientPicture (Picture pid,
622 xPointFixed *p1,
623 xPointFixed *p2,
624 int nStops,
625 xFixed *stops,
626 xRenderColor *colors,
627 int *error);
628
629PicturePtr
630CreateRadialGradientPicture (Picture pid,
631 xPointFixed *inner,
632 xPointFixed *outer,
633 xFixed innerRadius,
634 xFixed outerRadius,
635 int nStops,
636 xFixed *stops,
637 xRenderColor *colors,
638 int *error);
639
640PicturePtr
641CreateConicalGradientPicture (Picture pid,
642 xPointFixed *center,
643 xFixed angle,
644 int nStops,
645 xFixed *stops,
646 xRenderColor *colors,
647 int *error);
648
649#ifdef PANORAMIX
650void PanoramiXRenderInit (void);
651void PanoramiXRenderReset (void);
652#endif
653
654#endif /* _PICTURESTR_H_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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