VirtualBox

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

Last change on this file since 77138 was 38824, checked in by vboxsync, 13 years ago

Additions/x11: header files for building X.Org Server 1.11 modules

  • Property svn:eol-style set to native
File size: 17.7 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_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 Bool (*InitIndexedProcPtr) (ScreenPtr pScreen,
264 PictFormatPtr pFormat);
265
266typedef void (*CloseIndexedProcPtr) (ScreenPtr pScreen,
267 PictFormatPtr pFormat);
268
269typedef void (*UpdateIndexedProcPtr) (ScreenPtr pScreen,
270 PictFormatPtr pFormat,
271 int ndef,
272 xColorItem *pdef);
273
274typedef void (*AddTrapsProcPtr) (PicturePtr pPicture,
275 INT16 xOff,
276 INT16 yOff,
277 int ntrap,
278 xTrap *traps);
279
280typedef void (*AddTrianglesProcPtr) (PicturePtr pPicture,
281 INT16 xOff,
282 INT16 yOff,
283 int ntri,
284 xTriangle *tris);
285
286typedef Bool (*RealizeGlyphProcPtr) (ScreenPtr pScreen,
287 GlyphPtr glyph);
288
289typedef void (*UnrealizeGlyphProcPtr) (ScreenPtr pScreen,
290 GlyphPtr glyph);
291
292typedef struct _PictureScreen {
293 PictFormatPtr formats;
294 PictFormatPtr fallback;
295 int nformats;
296
297 CreatePictureProcPtr CreatePicture;
298 DestroyPictureProcPtr DestroyPicture;
299 ChangePictureClipProcPtr ChangePictureClip;
300 DestroyPictureClipProcPtr DestroyPictureClip;
301
302 ChangePictureProcPtr ChangePicture;
303 ValidatePictureProcPtr ValidatePicture;
304
305 CompositeProcPtr Composite;
306 GlyphsProcPtr Glyphs; /* unused */
307 CompositeRectsProcPtr CompositeRects;
308
309 DestroyWindowProcPtr DestroyWindow;
310 CloseScreenProcPtr CloseScreen;
311
312 StoreColorsProcPtr StoreColors;
313
314 InitIndexedProcPtr InitIndexed;
315 CloseIndexedProcPtr CloseIndexed;
316 UpdateIndexedProcPtr UpdateIndexed;
317
318 int subpixel;
319
320 PictFilterPtr filters;
321 int nfilters;
322 PictFilterAliasPtr filterAliases;
323 int nfilterAliases;
324
325 /**
326 * Called immediately after a picture's transform is changed through the
327 * SetPictureTransform request. Not called for source-only pictures.
328 */
329 ChangePictureTransformProcPtr ChangePictureTransform;
330
331 /**
332 * Called immediately after a picture's transform is changed through the
333 * SetPictureFilter request. Not called for source-only pictures.
334 */
335 ChangePictureFilterProcPtr ChangePictureFilter;
336
337 DestroyPictureFilterProcPtr DestroyPictureFilter;
338
339 TrapezoidsProcPtr Trapezoids;
340 TrianglesProcPtr Triangles;
341
342 RasterizeTrapezoidProcPtr RasterizeTrapezoid;
343
344 AddTrianglesProcPtr AddTriangles;
345
346 AddTrapsProcPtr AddTraps;
347
348 RealizeGlyphProcPtr RealizeGlyph;
349 UnrealizeGlyphProcPtr UnrealizeGlyph;
350
351} PictureScreenRec, *PictureScreenPtr;
352
353extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
354#define PictureScreenPrivateKey (&PictureScreenPrivateKeyRec)
355
356extern _X_EXPORT DevPrivateKeyRec PictureWindowPrivateKeyRec;
357#define PictureWindowPrivateKey (&PictureWindowPrivateKeyRec)
358
359extern _X_EXPORT RESTYPE PictureType;
360extern _X_EXPORT RESTYPE PictFormatType;
361extern _X_EXPORT RESTYPE GlyphSetType;
362
363#define GetPictureScreen(s) ((PictureScreenPtr)dixLookupPrivate(&(s)->devPrivates, PictureScreenPrivateKey))
364#define GetPictureScreenIfSet(s) (dixPrivateKeyRegistered(PictureScreenPrivateKey) ? GetPictureScreen(s) : NULL)
365#define SetPictureScreen(s,p) dixSetPrivate(&(s)->devPrivates, PictureScreenPrivateKey, p)
366#define GetPictureWindow(w) ((PicturePtr)dixLookupPrivate(&(w)->devPrivates, PictureWindowPrivateKey))
367#define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)
368
369#define VERIFY_PICTURE(pPicture, pid, client, mode) {\
370 int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\
371 PictureType, client, mode);\
372 if (rc != Success)\
373 return rc;\
374}
375
376#define VERIFY_ALPHA(pPicture, pid, client, mode) {\
377 if (pid == None) \
378 pPicture = 0; \
379 else { \
380 VERIFY_PICTURE(pPicture, pid, client, mode); \
381 } \
382} \
383
384extern _X_EXPORT Bool
385PictureDestroyWindow (WindowPtr pWindow);
386
387extern _X_EXPORT Bool
388PictureCloseScreen (int Index, ScreenPtr pScreen);
389
390extern _X_EXPORT void
391PictureStoreColors (ColormapPtr pColormap, int ndef, xColorItem *pdef);
392
393extern _X_EXPORT Bool
394PictureInitIndexedFormat (ScreenPtr pScreen, PictFormatPtr format);
395
396extern _X_EXPORT Bool
397PictureSetSubpixelOrder (ScreenPtr pScreen, int subpixel);
398
399extern _X_EXPORT int
400PictureGetSubpixelOrder (ScreenPtr pScreen);
401
402extern _X_EXPORT PictFormatPtr
403PictureCreateDefaultFormats (ScreenPtr pScreen, int *nformatp);
404
405extern _X_EXPORT PictFormatPtr
406PictureMatchVisual (ScreenPtr pScreen, int depth, VisualPtr pVisual);
407
408extern _X_EXPORT PictFormatPtr
409PictureMatchFormat (ScreenPtr pScreen, int depth, CARD32 format);
410
411extern _X_EXPORT Bool
412PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats);
413
414extern _X_EXPORT int
415PictureGetFilterId (char *filter, int len, Bool makeit);
416
417extern _X_EXPORT char *
418PictureGetFilterName (int id);
419
420extern _X_EXPORT int
421PictureAddFilter (ScreenPtr pScreen,
422 char *filter,
423 PictFilterValidateParamsProcPtr ValidateParams,
424 int width,
425 int height);
426
427extern _X_EXPORT Bool
428PictureSetFilterAlias (ScreenPtr pScreen, char *filter, char *alias);
429
430extern _X_EXPORT Bool
431PictureSetDefaultFilters (ScreenPtr pScreen);
432
433extern _X_EXPORT void
434PictureResetFilters (ScreenPtr pScreen);
435
436extern _X_EXPORT PictFilterPtr
437PictureFindFilter (ScreenPtr pScreen, char *name, int len);
438
439extern _X_EXPORT int
440SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
441 xFixed *params, int nparams);
442
443extern _X_EXPORT int
444SetPictureFilter (PicturePtr pPicture, char *name, int len,
445 xFixed *params, int nparams);
446
447extern _X_EXPORT Bool
448PictureFinishInit (void);
449
450extern _X_EXPORT void
451SetPictureToDefaults (PicturePtr pPicture);
452
453extern _X_EXPORT PicturePtr
454CreatePicture (Picture pid,
455 DrawablePtr pDrawable,
456 PictFormatPtr pFormat,
457 Mask mask,
458 XID *list,
459 ClientPtr client,
460 int *error);
461
462extern _X_EXPORT int
463ChangePicture (PicturePtr pPicture,
464 Mask vmask,
465 XID *vlist,
466 DevUnion *ulist,
467 ClientPtr client);
468
469extern _X_EXPORT int
470SetPictureClipRects (PicturePtr pPicture,
471 int xOrigin,
472 int yOrigin,
473 int nRect,
474 xRectangle *rects);
475
476extern _X_EXPORT int
477SetPictureClipRegion (PicturePtr pPicture,
478 int xOrigin,
479 int yOrigin,
480 RegionPtr pRegion);
481
482extern _X_EXPORT int
483SetPictureTransform (PicturePtr pPicture,
484 PictTransform *transform);
485
486extern _X_EXPORT void
487CopyPicture (PicturePtr pSrc,
488 Mask mask,
489 PicturePtr pDst);
490
491extern _X_EXPORT void
492ValidatePicture(PicturePtr pPicture);
493
494extern _X_EXPORT int
495FreePicture (pointer pPicture,
496 XID pid);
497
498extern _X_EXPORT int
499FreePictFormat (pointer pPictFormat,
500 XID pid);
501
502extern _X_EXPORT void
503CompositePicture (CARD8 op,
504 PicturePtr pSrc,
505 PicturePtr pMask,
506 PicturePtr pDst,
507 INT16 xSrc,
508 INT16 ySrc,
509 INT16 xMask,
510 INT16 yMask,
511 INT16 xDst,
512 INT16 yDst,
513 CARD16 width,
514 CARD16 height);
515
516extern _X_EXPORT void
517CompositeGlyphs (CARD8 op,
518 PicturePtr pSrc,
519 PicturePtr pDst,
520 PictFormatPtr maskFormat,
521 INT16 xSrc,
522 INT16 ySrc,
523 int nlist,
524 GlyphListPtr lists,
525 GlyphPtr *glyphs);
526
527extern _X_EXPORT void
528CompositeRects (CARD8 op,
529 PicturePtr pDst,
530 xRenderColor *color,
531 int nRect,
532 xRectangle *rects);
533
534extern _X_EXPORT void
535CompositeTrapezoids (CARD8 op,
536 PicturePtr pSrc,
537 PicturePtr pDst,
538 PictFormatPtr maskFormat,
539 INT16 xSrc,
540 INT16 ySrc,
541 int ntrap,
542 xTrapezoid *traps);
543
544extern _X_EXPORT void
545CompositeTriangles (CARD8 op,
546 PicturePtr pSrc,
547 PicturePtr pDst,
548 PictFormatPtr maskFormat,
549 INT16 xSrc,
550 INT16 ySrc,
551 int ntriangles,
552 xTriangle *triangles);
553
554extern _X_EXPORT void
555CompositeTriStrip (CARD8 op,
556 PicturePtr pSrc,
557 PicturePtr pDst,
558 PictFormatPtr maskFormat,
559 INT16 xSrc,
560 INT16 ySrc,
561 int npoints,
562 xPointFixed *points);
563
564extern _X_EXPORT void
565CompositeTriFan (CARD8 op,
566 PicturePtr pSrc,
567 PicturePtr pDst,
568 PictFormatPtr maskFormat,
569 INT16 xSrc,
570 INT16 ySrc,
571 int npoints,
572 xPointFixed *points);
573
574extern _X_EXPORT void RenderExtensionInit (void);
575
576Bool
577AnimCurInit (ScreenPtr pScreen);
578
579int
580AnimCursorCreate (CursorPtr *cursors, CARD32 *deltas, int ncursor, CursorPtr *ppCursor, ClientPtr client, XID cid);
581
582extern _X_EXPORT void
583AddTraps (PicturePtr pPicture,
584 INT16 xOff,
585 INT16 yOff,
586 int ntraps,
587 xTrap *traps);
588
589extern _X_EXPORT PicturePtr
590CreateSolidPicture (Picture pid,
591 xRenderColor *color,
592 int *error);
593
594extern _X_EXPORT PicturePtr
595CreateLinearGradientPicture (Picture pid,
596 xPointFixed *p1,
597 xPointFixed *p2,
598 int nStops,
599 xFixed *stops,
600 xRenderColor *colors,
601 int *error);
602
603extern _X_EXPORT PicturePtr
604CreateRadialGradientPicture (Picture pid,
605 xPointFixed *inner,
606 xPointFixed *outer,
607 xFixed innerRadius,
608 xFixed outerRadius,
609 int nStops,
610 xFixed *stops,
611 xRenderColor *colors,
612 int *error);
613
614extern _X_EXPORT PicturePtr
615CreateConicalGradientPicture (Picture pid,
616 xPointFixed *center,
617 xFixed angle,
618 int nStops,
619 xFixed *stops,
620 xRenderColor *colors,
621 int *error);
622
623#ifdef PANORAMIX
624extern _X_EXPORT void PanoramiXRenderInit (void);
625extern _X_EXPORT void PanoramiXRenderReset (void);
626#endif
627
628/*
629 * matrix.c
630 */
631
632extern _X_EXPORT void
633PictTransform_from_xRenderTransform (PictTransformPtr pict,
634 xRenderTransform *render);
635
636extern _X_EXPORT void
637xRenderTransform_from_PictTransform (xRenderTransform *render,
638 PictTransformPtr pict);
639
640extern _X_EXPORT Bool
641PictureTransformPoint (PictTransformPtr transform,
642 PictVectorPtr vector);
643
644extern _X_EXPORT Bool
645PictureTransformPoint3d (PictTransformPtr transform,
646 PictVectorPtr vector);
647
648#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