Path: blob/master/thirdparty/linuxbsd_headers/X11/extensions/Xrender.h
9905 views
/*1*2* Copyright © 2000 SuSE, Inc.3*4* Permission to use, copy, modify, distribute, and sell this software and its5* documentation for any purpose is hereby granted without fee, provided that6* the above copyright notice appear in all copies and that both that7* copyright notice and this permission notice appear in supporting8* documentation, and that the name of SuSE not be used in advertising or9* publicity pertaining to distribution of the software without specific,10* written prior permission. SuSE makes no representations about the11* 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 ALL15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE16* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES17* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION18* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN19* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.20*21* Author: Keith Packard, SuSE, Inc.22*/2324#ifndef _XRENDER_H_25#define _XRENDER_H_2627#include <X11/Xlib.h>28#include <X11/Xfuncproto.h>29#include <X11/Xosdefs.h>30#include <X11/Xutil.h>3132#include <X11/extensions/render.h>3334typedef struct {35short red;36short redMask;37short green;38short greenMask;39short blue;40short blueMask;41short alpha;42short alphaMask;43} XRenderDirectFormat;4445typedef struct {46PictFormat id;47int type;48int depth;49XRenderDirectFormat direct;50Colormap colormap;51} XRenderPictFormat;5253#define PictFormatID (1 << 0)54#define PictFormatType (1 << 1)55#define PictFormatDepth (1 << 2)56#define PictFormatRed (1 << 3)57#define PictFormatRedMask (1 << 4)58#define PictFormatGreen (1 << 5)59#define PictFormatGreenMask (1 << 6)60#define PictFormatBlue (1 << 7)61#define PictFormatBlueMask (1 << 8)62#define PictFormatAlpha (1 << 9)63#define PictFormatAlphaMask (1 << 10)64#define PictFormatColormap (1 << 11)6566typedef struct _XRenderPictureAttributes {67int repeat;68Picture alpha_map;69int alpha_x_origin;70int alpha_y_origin;71int clip_x_origin;72int clip_y_origin;73Pixmap clip_mask;74Bool graphics_exposures;75int subwindow_mode;76int poly_edge;77int poly_mode;78Atom dither;79Bool component_alpha;80} XRenderPictureAttributes;8182typedef struct {83unsigned short red;84unsigned short green;85unsigned short blue;86unsigned short alpha;87} XRenderColor;8889typedef struct _XGlyphInfo {90unsigned short width;91unsigned short height;92short x;93short y;94short xOff;95short yOff;96} XGlyphInfo;9798typedef struct _XGlyphElt8 {99GlyphSet glyphset;100_Xconst char *chars;101int nchars;102int xOff;103int yOff;104} XGlyphElt8;105106typedef struct _XGlyphElt16 {107GlyphSet glyphset;108_Xconst unsigned short *chars;109int nchars;110int xOff;111int yOff;112} XGlyphElt16;113114typedef struct _XGlyphElt32 {115GlyphSet glyphset;116_Xconst unsigned int *chars;117int nchars;118int xOff;119int yOff;120} XGlyphElt32;121122typedef double XDouble;123124typedef struct _XPointDouble {125XDouble x, y;126} XPointDouble;127128#define XDoubleToFixed(f) ((XFixed) ((f) * 65536))129#define XFixedToDouble(f) (((XDouble) (f)) / 65536)130131typedef int XFixed;132133typedef struct _XPointFixed {134XFixed x, y;135} XPointFixed;136137typedef struct _XLineFixed {138XPointFixed p1, p2;139} XLineFixed;140141typedef struct _XTriangle {142XPointFixed p1, p2, p3;143} XTriangle;144145typedef struct _XCircle {146XFixed x;147XFixed y;148XFixed radius;149} XCircle;150151typedef struct _XTrapezoid {152XFixed top, bottom;153XLineFixed left, right;154} XTrapezoid;155156typedef struct _XTransform {157XFixed matrix[3][3];158} XTransform;159160typedef struct _XFilters {161int nfilter;162char **filter;163int nalias;164short *alias;165} XFilters;166167typedef struct _XIndexValue {168unsigned long pixel;169unsigned short red, green, blue, alpha;170} XIndexValue;171172typedef struct _XAnimCursor {173Cursor cursor;174unsigned long delay;175} XAnimCursor;176177typedef struct _XSpanFix {178XFixed left, right, y;179} XSpanFix;180181typedef struct _XTrap {182XSpanFix top, bottom;183} XTrap;184185typedef struct _XLinearGradient {186XPointFixed p1;187XPointFixed p2;188} XLinearGradient;189190typedef struct _XRadialGradient {191XCircle inner;192XCircle outer;193} XRadialGradient;194195typedef struct _XConicalGradient {196XPointFixed center;197XFixed angle; /* in degrees */198} XConicalGradient;199200_XFUNCPROTOBEGIN201202Bool XRenderQueryExtension (Display *dpy, int *event_basep, int *error_basep);203204Status XRenderQueryVersion (Display *dpy,205int *major_versionp,206int *minor_versionp);207208Status XRenderQueryFormats (Display *dpy);209210int XRenderQuerySubpixelOrder (Display *dpy, int screen);211212Bool XRenderSetSubpixelOrder (Display *dpy, int screen, int subpixel);213214XRenderPictFormat *215XRenderFindVisualFormat (Display *dpy, _Xconst Visual *visual);216217XRenderPictFormat *218XRenderFindFormat (Display *dpy,219unsigned long mask,220_Xconst XRenderPictFormat *templ,221int count);222223#define PictStandardARGB32 0224#define PictStandardRGB24 1225#define PictStandardA8 2226#define PictStandardA4 3227#define PictStandardA1 4228#define PictStandardNUM 5229230XRenderPictFormat *231XRenderFindStandardFormat (Display *dpy,232int format);233234XIndexValue *235XRenderQueryPictIndexValues(Display *dpy,236_Xconst XRenderPictFormat *format,237int *num);238239Picture240XRenderCreatePicture (Display *dpy,241Drawable drawable,242_Xconst XRenderPictFormat *format,243unsigned long valuemask,244_Xconst XRenderPictureAttributes *attributes);245246void247XRenderChangePicture (Display *dpy,248Picture picture,249unsigned long valuemask,250_Xconst XRenderPictureAttributes *attributes);251252void253XRenderSetPictureClipRectangles (Display *dpy,254Picture picture,255int xOrigin,256int yOrigin,257_Xconst XRectangle *rects,258int n);259260void261XRenderSetPictureClipRegion (Display *dpy,262Picture picture,263Region r);264265void266XRenderSetPictureTransform (Display *dpy,267Picture picture,268XTransform *transform);269270void271XRenderFreePicture (Display *dpy,272Picture picture);273274void275XRenderComposite (Display *dpy,276int op,277Picture src,278Picture mask,279Picture dst,280int src_x,281int src_y,282int mask_x,283int mask_y,284int dst_x,285int dst_y,286unsigned int width,287unsigned int height);288289GlyphSet290XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format);291292GlyphSet293XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing);294295void296XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset);297298void299XRenderAddGlyphs (Display *dpy,300GlyphSet glyphset,301_Xconst Glyph *gids,302_Xconst XGlyphInfo *glyphs,303int nglyphs,304_Xconst char *images,305int nbyte_images);306307void308XRenderFreeGlyphs (Display *dpy,309GlyphSet glyphset,310_Xconst Glyph *gids,311int nglyphs);312313void314XRenderCompositeString8 (Display *dpy,315int op,316Picture src,317Picture dst,318_Xconst XRenderPictFormat *maskFormat,319GlyphSet glyphset,320int xSrc,321int ySrc,322int xDst,323int yDst,324_Xconst char *string,325int nchar);326327void328XRenderCompositeString16 (Display *dpy,329int op,330Picture src,331Picture dst,332_Xconst XRenderPictFormat *maskFormat,333GlyphSet glyphset,334int xSrc,335int ySrc,336int xDst,337int yDst,338_Xconst unsigned short *string,339int nchar);340341void342XRenderCompositeString32 (Display *dpy,343int op,344Picture src,345Picture dst,346_Xconst XRenderPictFormat *maskFormat,347GlyphSet glyphset,348int xSrc,349int ySrc,350int xDst,351int yDst,352_Xconst unsigned int *string,353int nchar);354355void356XRenderCompositeText8 (Display *dpy,357int op,358Picture src,359Picture dst,360_Xconst XRenderPictFormat *maskFormat,361int xSrc,362int ySrc,363int xDst,364int yDst,365_Xconst XGlyphElt8 *elts,366int nelt);367368void369XRenderCompositeText16 (Display *dpy,370int op,371Picture src,372Picture dst,373_Xconst XRenderPictFormat *maskFormat,374int xSrc,375int ySrc,376int xDst,377int yDst,378_Xconst XGlyphElt16 *elts,379int nelt);380381void382XRenderCompositeText32 (Display *dpy,383int op,384Picture src,385Picture dst,386_Xconst XRenderPictFormat *maskFormat,387int xSrc,388int ySrc,389int xDst,390int yDst,391_Xconst XGlyphElt32 *elts,392int nelt);393394void395XRenderFillRectangle (Display *dpy,396int op,397Picture dst,398_Xconst XRenderColor *color,399int x,400int y,401unsigned int width,402unsigned int height);403404void405XRenderFillRectangles (Display *dpy,406int op,407Picture dst,408_Xconst XRenderColor *color,409_Xconst XRectangle *rectangles,410int n_rects);411412void413XRenderCompositeTrapezoids (Display *dpy,414int op,415Picture src,416Picture dst,417_Xconst XRenderPictFormat *maskFormat,418int xSrc,419int ySrc,420_Xconst XTrapezoid *traps,421int ntrap);422423void424XRenderCompositeTriangles (Display *dpy,425int op,426Picture src,427Picture dst,428_Xconst XRenderPictFormat *maskFormat,429int xSrc,430int ySrc,431_Xconst XTriangle *triangles,432int ntriangle);433434void435XRenderCompositeTriStrip (Display *dpy,436int op,437Picture src,438Picture dst,439_Xconst XRenderPictFormat *maskFormat,440int xSrc,441int ySrc,442_Xconst XPointFixed *points,443int npoint);444445void446XRenderCompositeTriFan (Display *dpy,447int op,448Picture src,449Picture dst,450_Xconst XRenderPictFormat *maskFormat,451int xSrc,452int ySrc,453_Xconst XPointFixed *points,454int npoint);455456void457XRenderCompositeDoublePoly (Display *dpy,458int op,459Picture src,460Picture dst,461_Xconst XRenderPictFormat *maskFormat,462int xSrc,463int ySrc,464int xDst,465int yDst,466_Xconst XPointDouble *fpoints,467int npoints,468int winding);469Status470XRenderParseColor(Display *dpy,471char *spec,472XRenderColor *def);473474Cursor475XRenderCreateCursor (Display *dpy,476Picture source,477unsigned int x,478unsigned int y);479480XFilters *481XRenderQueryFilters (Display *dpy, Drawable drawable);482483void484XRenderSetPictureFilter (Display *dpy,485Picture picture,486const char *filter,487XFixed *params,488int nparams);489490Cursor491XRenderCreateAnimCursor (Display *dpy,492int ncursor,493XAnimCursor *cursors);494495496void497XRenderAddTraps (Display *dpy,498Picture picture,499int xOff,500int yOff,501_Xconst XTrap *traps,502int ntrap);503504Picture XRenderCreateSolidFill (Display *dpy,505const XRenderColor *color);506507Picture XRenderCreateLinearGradient (Display *dpy,508const XLinearGradient *gradient,509const XFixed *stops,510const XRenderColor *colors,511int nstops);512513Picture XRenderCreateRadialGradient (Display *dpy,514const XRadialGradient *gradient,515const XFixed *stops,516const XRenderColor *colors,517int nstops);518519Picture XRenderCreateConicalGradient (Display *dpy,520const XConicalGradient *gradient,521const XFixed *stops,522const XRenderColor *colors,523int nstops);524525_XFUNCPROTOEND526527#endif /* _XRENDER_H_ */528529530