|
||||
File indexing completed on 2025-01-30 10:26:34
0001 /* 0002 * 0003 * Copyright © 2000 SuSE, Inc. 0004 * 0005 * Permission to use, copy, modify, distribute, and sell this software and its 0006 * documentation for any purpose is hereby granted without fee, provided that 0007 * the above copyright notice appear in all copies and that both that 0008 * copyright notice and this permission notice appear in supporting 0009 * documentation, and that the name of SuSE not be used in advertising or 0010 * publicity pertaining to distribution of the software without specific, 0011 * written prior permission. SuSE makes no representations about the 0012 * suitability of this software for any purpose. It is provided "as is" 0013 * without express or implied warranty. 0014 * 0015 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL 0016 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE 0017 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 0018 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 0019 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 0020 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 0021 * 0022 * Author: Keith Packard, SuSE, Inc. 0023 */ 0024 0025 /** 0026 * @file Xrender.h 0027 * @brief XRender library API. 0028 */ 0029 0030 #ifndef _XRENDER_H_ 0031 #define _XRENDER_H_ 0032 0033 #include <X11/Xfuncproto.h> 0034 #include <X11/Xlib.h> 0035 #include <X11/Xosdefs.h> 0036 #include <X11/Xutil.h> 0037 0038 #include <X11/extensions/render.h> 0039 0040 /** 0041 * @mainpage libXrender API Documentation. 0042 * 0043 * Dummy text down here. 0044 */ 0045 0046 /** 0047 * The direct component of a PictFormat. 0048 * 0049 * It contains a binary description of the color format used by the Picture. 0050 * 0051 * * A Zero bit alphaMask is declared to have an opaque alpha everywhere. 0052 * * A Zero bit redMask, greenMask and blueMask is declared to have red, green, 0053 * blue == 0 everywhere. 0054 * * If any of redMask, greenMask or blueMask are zero, all other masks are 0055 * zero. 0056 */ 0057 typedef struct { 0058 /** Red component binary displacement. */ 0059 short red; 0060 /** Red component bit mask. */ 0061 short redMask; 0062 /** Green component binary displacement. */ 0063 short green; 0064 /** Green component bit mask. */ 0065 short greenMask; 0066 /** Blue component binary displacement. */ 0067 short blue; 0068 /** Blue component bit mask. */ 0069 short blueMask; 0070 /** Alpha component binary displacement. */ 0071 short alpha; 0072 /** Alpha component bit mask. */ 0073 short alphaMask; 0074 } XRenderDirectFormat; 0075 0076 /** 0077 * A Picture pixel format description. 0078 * 0079 * It describes the format used by the server to display colors. 0080 * 0081 * There are two types: 0082 * * Direct: Doesn't have a Colormap and the DirectFormat structure describes 0083 * the pixel format. 0084 * * Indexed: Has a Colormap and it's DirectFormat structure is filled with 0085 * zeros. 0086 */ 0087 typedef struct { 0088 /** XID of this structure server instance. */ 0089 PictFormat id; 0090 /** Color management type. */ 0091 int type; 0092 /** Pixel bit depth. */ 0093 int depth; 0094 /** Color component description. */ 0095 XRenderDirectFormat direct; 0096 /** XID of the map of indexed colors on the server. */ 0097 Colormap colormap; 0098 } XRenderPictFormat; 0099 0100 /*< XRenderPictFormat template field masks. 0101 * @{ 0102 */ 0103 /** Include ID field. @hideinitializer */ 0104 #define PictFormatID (1 << 0) 0105 /** Include Type field. @hideinitializer */ 0106 #define PictFormatType (1 << 1) 0107 /** Include Depth field. @hideinitializer */ 0108 #define PictFormatDepth (1 << 2) 0109 0110 /*<--- XRenderPictFormat->direct fields. */ 0111 /** Include Direct->Red field. @hideinitializer */ 0112 #define PictFormatRed (1 << 3) 0113 /** Include Direct->RedMask field. @hideinitializer */ 0114 #define PictFormatRedMask (1 << 4) 0115 /** Include Direct->Green field. @hideinitializer */ 0116 #define PictFormatGreen (1 << 5) 0117 /** Include Direct->GreenMask field. @hideinitializer */ 0118 #define PictFormatGreenMask (1 << 6) 0119 /** Include Direct->Blue field. @hideinitializer */ 0120 #define PictFormatBlue (1 << 7) 0121 /** Include Direct->BlueMask field. @hideinitializer */ 0122 #define PictFormatBlueMask (1 << 8) 0123 /** Include Direct->Alpha field. @hideinitializer */ 0124 #define PictFormatAlpha (1 << 9) 0125 /** Include Direct->AlphaMask field. @hideinitializer */ 0126 #define PictFormatAlphaMask (1 << 10) 0127 0128 /** Include Colormap field. @hideinitializer */ 0129 #define PictFormatColormap (1 << 11) 0130 /** @} */ 0131 0132 /** 0133 * Picture rendering attributes. 0134 */ 0135 typedef struct _XRenderPictureAttributes { 0136 /** How to repeat the picture. */ 0137 int repeat; 0138 0139 /** A replacement alpha-map. Must be a pixmap-containing Picture. */ 0140 Picture alpha_map; 0141 /** Horizontal displacement of the replacement alpha-map. */ 0142 int alpha_x_origin; 0143 /** Vertical displacement of the replacement alpha-map. */ 0144 int alpha_y_origin; 0145 0146 /** Horizontal displacement of the clip mask. */ 0147 int clip_x_origin; 0148 /** Vertical displacement of the clip mask. */ 0149 int clip_y_origin; 0150 /** A r/w restriction to the drawable. */ 0151 Pixmap clip_mask; 0152 0153 /** Whether to receive GraphicsExpose events. @note Ignored field. */ 0154 Bool graphics_exposures; 0155 /** How to clip pixels on subwindow overlap. */ 0156 int subwindow_mode; 0157 /** Alpha mask generation mode. */ 0158 int poly_edge; 0159 /** Alpha value rasterization mode. */ 0160 int poly_mode; 0161 /** Dithering mode. @note Ignored field. */ 0162 Atom dither; 0163 /** Treat alpha channels independently. */ 0164 Bool component_alpha; 0165 } XRenderPictureAttributes; 0166 0167 /** An alpha-blended color with premultiplied components. 0168 * 0169 * Values are in the range from 0 to 65535 inclusive, scaled down to the right 0170 * hardware values by the server. Colors must be premultiplied by alpha by the 0171 * client in all cases but gradient operations. 0172 */ 0173 typedef struct { 0174 /** Red color channel. */ 0175 unsigned short red; 0176 /** Green color channel. */ 0177 unsigned short green; 0178 /** Blue color channel. */ 0179 unsigned short blue; 0180 /** Alpha color channel. */ 0181 unsigned short alpha; 0182 } XRenderColor; 0183 0184 /** 0185 * Glyph positioning and sizing information. 0186 * 0187 * A glyph is positioned by taking the requested position and substracting the 0188 * center offset. 0189 */ 0190 typedef struct _XGlyphInfo { 0191 /** Glyph width. */ 0192 unsigned short width; 0193 /** Glyph height. */ 0194 unsigned short height; 0195 0196 /** Horizontal Glyph center offset relative to the upper-left corner. */ 0197 short x; 0198 /** Vertical Glyph center offset relative to the upper-left corner. */ 0199 short y; 0200 0201 /** Horizontal margin to the next Glyph. */ 0202 short xOff; 0203 /** Vertical margin to the next Glyph. */ 0204 short yOff; 0205 } XGlyphInfo; 0206 0207 /*< Glyph Elements. 0208 * Group of glyphs to be rendered. 0209 * While selecting the right element type, you should use as a reference the 0210 * largest identifier in Elt->glyphset. 0211 */ 0212 /** @{ */ 0213 0214 /** 0215 * 8-bit Glyph Element. 0216 */ 0217 typedef struct _XGlyphElt8 { 0218 /** Set of available glyphs. */ 0219 GlyphSet glyphset; 0220 0221 /** 8-bit glyph id array. */ 0222 _Xconst char *chars; 0223 /** Glyph array size. */ 0224 int nchars; 0225 0226 /** Horizontal offset. */ 0227 int xOff; 0228 /** Vertical offset. */ 0229 int yOff; 0230 } XGlyphElt8; 0231 0232 /** 0233 * 16-bit Glyph Element. 0234 */ 0235 typedef struct _XGlyphElt16 { 0236 /** Set of available glyphs. */ 0237 GlyphSet glyphset; 0238 0239 /** 16-bit glyph id array. */ 0240 _Xconst unsigned short *chars; 0241 /** Glyph array size. */ 0242 int nchars; 0243 0244 /** Horizontal offset. */ 0245 int xOff; 0246 /** Vertical offset. */ 0247 int yOff; 0248 } XGlyphElt16; 0249 0250 /** 0251 * 32-bit Glyph Element. 0252 */ 0253 typedef struct _XGlyphElt32 { 0254 /** Set of available glyphs. */ 0255 GlyphSet glyphset; 0256 0257 /** 32-bit glyph id array. */ 0258 _Xconst unsigned int *chars; 0259 /** Glyph array size. */ 0260 int nchars; 0261 0262 /** Horizontal offset. */ 0263 int xOff; 0264 /** Vertical offset. */ 0265 int yOff; 0266 } XGlyphElt32; 0267 /**@} */ 0268 0269 /*< Utility number types. 0270 * 0271 */ 0272 /**@{ */ 0273 0274 /** 0275 * Floating-point number. 0276 */ 0277 typedef double XDouble; 0278 0279 /** 0280 * Fixed-point number. 0281 */ 0282 typedef int XFixed; 0283 0284 /** Turn XDouble into XFixed. @hideinitializer */ 0285 #define XDoubleToFixed(f) ((XFixed)((f)*65536)) 0286 /** Turn XFixed into XDouble. @hideinitializer */ 0287 #define XFixedToDouble(f) (((XDouble)(f)) / 65536) 0288 /** @} */ 0289 0290 /** 0291 * Point coordinates stored as floats. 0292 */ 0293 typedef struct _XPointDouble { 0294 XDouble x, y; 0295 } XPointDouble; 0296 0297 /** 0298 * Point coordinates as integers. 0299 */ 0300 typedef struct _XPointFixed { 0301 XFixed x, y; 0302 } XPointFixed; 0303 0304 /** 0305 * Line described by two points. 0306 */ 0307 typedef struct _XLineFixed { 0308 XPointFixed p1, p2; 0309 } XLineFixed; 0310 0311 /** 0312 * Triangle described by it's vertices. 0313 * @see XTrap 0314 */ 0315 typedef struct _XTriangle { 0316 XPointFixed p1, p2, p3; 0317 } XTriangle; 0318 0319 /** 0320 * Circle described by it's center point and a radius. 0321 */ 0322 typedef struct _XCircle { 0323 XFixed x; 0324 XFixed y; 0325 XFixed radius; 0326 } XCircle; 0327 0328 /** A trapezoid. 0329 * 0330 * @deprecated Use XTrap instead 0331 * @see 0332 * * XTriangle 0333 * * XTrap 0334 */ 0335 typedef struct _XTrapezoid { 0336 XFixed top, bottom; 0337 XLineFixed left, right; 0338 } XTrapezoid; 0339 0340 /** 0341 * A transform matrix. 0342 */ 0343 typedef struct _XTransform { 0344 XFixed matrix[3][3]; 0345 } XTransform; 0346 0347 /** 0348 * Group filters and filter aliases. 0349 */ 0350 typedef struct _XFilters { 0351 /** Filter names count. */ 0352 int nfilter; 0353 /** Filter names array. */ 0354 char **filter; 0355 /** Aliases array count. */ 0356 int nalias; 0357 /** Array of «Index in .filter of the aliased filter or 0xffff». */ 0358 short *alias; 0359 } XFilters; 0360 0361 /** 0362 * The value of an indexed color. 0363 */ 0364 typedef struct _XIndexValue { 0365 /** Index ID. */ 0366 unsigned long pixel; 0367 /** Color components. */ 0368 unsigned short red, green, blue, alpha; 0369 } XIndexValue; 0370 0371 /** 0372 * A single cursor frame. 0373 */ 0374 typedef struct _XAnimCursor { 0375 /** Existing cursor. */ 0376 Cursor cursor; 0377 /** Animation delay. */ 0378 unsigned long delay; 0379 } XAnimCursor; 0380 0381 /** 0382 * An horizontal line. 0383 */ 0384 typedef struct _XSpanFix { 0385 XFixed left, right, y; 0386 } XSpanFix; 0387 0388 /** 0389 * A trapezoid defined by two lines. 0390 * @see XTriangle 0391 */ 0392 typedef struct _XTrap { 0393 XSpanFix top, bottom; 0394 } XTrap; 0395 0396 /** 0397 * Linear gradient shape. 0398 */ 0399 typedef struct _XLinearGradient { 0400 XPointFixed p1; 0401 XPointFixed p2; 0402 } XLinearGradient; 0403 0404 /** 0405 * Radial gradient shape. 0406 */ 0407 typedef struct _XRadialGradient { 0408 XCircle inner; 0409 XCircle outer; 0410 } XRadialGradient; 0411 0412 /** 0413 * Conical gradient shape. 0414 */ 0415 typedef struct _XConicalGradient { 0416 XPointFixed center; 0417 XFixed angle; /* in degrees */ 0418 } XConicalGradient; 0419 0420 _XFUNCPROTOBEGIN 0421 0422 /** @defgroup queries Early check queries. 0423 * @{ 0424 */ 0425 0426 /** 0427 * Ask for the Render extension presence and its base numbers. 0428 * 0429 * @param dpy Connection to the X server. 0430 * @param[out] event_basep first event number for the extension. 0431 * @param[out] error_basep first error number for the extension. 0432 * @return True if Render is present. 0433 */ 0434 Bool XRenderQueryExtension(Display *dpy, int *event_basep, int *error_basep); 0435 0436 /** 0437 * Ask for the extension version. 0438 * 0439 * @param dpy Connection to the X server. 0440 * @param[out] major_versionp Extension's major version. 0441 * @param[out] minor_versionp Extension's major version. 0442 * @return Status «1» on success. 0443 */ 0444 Status XRenderQueryVersion(Display *dpy, int *major_versionp, 0445 int *minor_versionp); 0446 0447 /** 0448 * Check for and cache compatible picture formats. 0449 * 0450 * @param dpy Connection to the X server. 0451 * @return Status «1» on success. 0452 */ 0453 Status XRenderQueryFormats(Display *dpy); 0454 0455 /** 0456 * Ask for the current subpixel order of a screen. 0457 * 0458 * @param dpy Connection to the X server. 0459 * @param[in] screen Target screen number. 0460 * @return SubPixelUnknown on error, else a subpixel order. 0461 */ 0462 int XRenderQuerySubpixelOrder(Display *dpy, int screen); 0463 0464 /** 0465 * Change the subpixel order of a screen. 0466 * 0467 * @param dpy Connection to the X server 0468 * @param[in] screen Target screen number. 0469 * @param[in] subpixel Requested subpixel order. 0470 * @return True if the operation was successful. 0471 */ 0472 Bool XRenderSetSubpixelOrder(Display *dpy, int screen, int subpixel); 0473 /** @} */ 0474 0475 /** 0476 * Ask for the Picture format for a Visual. 0477 * 0478 * @param dpy Connection to the X server. 0479 * @param[in] visual Reference Visual object. 0480 * @return The requested Picture format. 0481 */ 0482 XRenderPictFormat *XRenderFindVisualFormat(Display *dpy, 0483 _Xconst Visual *visual); 0484 0485 /** 0486 * Ask for matching Picture formats from a template. 0487 * 0488 * @param dpy Connection to the X server. 0489 * @param[in] mask `templ` fields mask to use. 0490 * @param[in] templ Requested Picture format template. 0491 * @param[in] count Skip `count` formats. 0492 * @return NULL if no matching format found, else a Picture format. 0493 */ 0494 XRenderPictFormat *XRenderFindFormat(Display *dpy, unsigned long mask, 0495 _Xconst XRenderPictFormat *templ, 0496 int count); 0497 0498 /** Standard format specifiers. 0499 * @{ 0500 */ 0501 /** 8-bit RGB with Alpha. @hideinitializer */ 0502 #define PictStandardARGB32 0 0503 /** 8-bit RGB. @hideinitializer */ 0504 #define PictStandardRGB24 1 0505 /** 8-bit Alpha map. @hideinitializer */ 0506 #define PictStandardA8 2 0507 /** 4-bit Alpha map. @hideinitializer */ 0508 #define PictStandardA4 3 0509 /** 1-bit Alpha map. @hideinitializer */ 0510 #define PictStandardA1 4 0511 /** Supported standard formats count. @hideinitializer */ 0512 #define PictStandardNUM 5 0513 /** @} */ 0514 0515 /** 0516 * Ask for a predefined standard picture format. 0517 * 0518 * This is a shorthand to XRenderFindFormat for finding common formats. 0519 * 0520 * @param dpy Connection to the X server. 0521 * @param[in] format Desired format specifier. 0522 * @return NULL if no matching format found, else a Picture format. 0523 */ 0524 XRenderPictFormat *XRenderFindStandardFormat(Display *dpy, int format); 0525 0526 /** 0527 * Ask for the indexed colors of a Picture format. 0528 * 0529 * @param dpy Connection to the X server. 0530 * @param[in] format Queried picture format. 0531 * @param[out] num Size of the output array. 0532 * @return An array of XIndexValue. 0533 */ 0534 XIndexValue *XRenderQueryPictIndexValues(Display *dpy, 0535 _Xconst XRenderPictFormat *format, 0536 int *num); 0537 0538 /** 0539 * Creates a Picture for a drawable. 0540 * 0541 * @param dpy Connection to the X server. 0542 * @param[in] drawable Target Drawable. 0543 * @param[in] format Format for the Picture. 0544 * @param[in] valuemask `attributes` fields mask to use. 0545 * @param[in] attributes Desired attributes for the Picture. 0546 * @return A Picture tied to the drawable. 0547 */ 0548 Picture XRenderCreatePicture(Display *dpy, Drawable drawable, 0549 _Xconst XRenderPictFormat *format, 0550 unsigned long valuemask, 0551 _Xconst XRenderPictureAttributes *attributes); 0552 0553 /** 0554 * Free allocated structures for a Picture. 0555 * 0556 * @warning A freed Picture shouldn't be used again. 0557 * 0558 * @param dpy Connection to the X server. 0559 * @param[in] picture Target Picture. 0560 */ 0561 void XRenderFreePicture(Display *dpy, Picture picture); 0562 0563 /** 0564 * Change a Picture's attributes structure. 0565 * 0566 * @param dpy Connection to the X server. 0567 * @param[in] picture Target Picture. 0568 * @param[in] valuemask `attributes` fields mask to use. 0569 * @param[in] attributes Desired attributes for the Picture. 0570 */ 0571 void XRenderChangePicture(Display *dpy, Picture picture, 0572 unsigned long valuemask, 0573 _Xconst XRenderPictureAttributes *attributes); 0574 0575 /** 0576 * Change a Picture's clip mask to the specified rectangles. 0577 * 0578 * @param dpy Connection to the X server. 0579 * @param[in] picture Target Picture. 0580 * @param[in] xOrigin Horizontal mask origin. 0581 * @param[in] yOrigin Vertical mask origin. 0582 * @param[in] rects Array of rectangles to clip with. 0583 * @param[in] n `rects` array size. 0584 */ 0585 void XRenderSetPictureClipRectangles(Display *dpy, Picture picture, int xOrigin, 0586 int yOrigin, _Xconst XRectangle *rects, 0587 int n); 0588 0589 /** 0590 * Change a Picture's clip mask to the specified Region. 0591 * 0592 * @param dpy Connection to the X server. 0593 * @param[in] picture Target Picture. 0594 * @param[in] r Region to clip with. 0595 */ 0596 void XRenderSetPictureClipRegion(Display *dpy, Picture picture, Region r); 0597 0598 /** 0599 * Change a Picture's Transform matrix. 0600 * 0601 * @param dpy Connection to the X server 0602 * @param[in] picture Target Picture. 0603 * @param[in] transform Transform matrix to use. 0604 */ 0605 void XRenderSetPictureTransform(Display *dpy, Picture picture, 0606 XTransform *transform); 0607 0608 /** 0609 * Combines two Pictures with the specified compositing operation. 0610 * 0611 * @param dpy Connection to the X server. 0612 * @param[in] op Compositing operation to perform. 0613 * @param[in] src Picture to combine with. 0614 * @param[in] mask Composition mask. 0615 * @param[in] dst Picture to combine into. 0616 * @param[in] src_x Horizontal `src` origin offset. 0617 * @param[in] src_y Vertical `src` origin offset 0618 * @param[in] mask_x Horizontal `mask` origin offset. 0619 * @param[in] mask_y Vertical `mask` origin offset. 0620 * @param[in] dst_x Horizontal `dst` origin offset. 0621 * @param[in] dst_y Vertical `dst` origin offset. 0622 * @param[in] width Maximum composition width. 0623 * @param[in] height Maximum composition height. 0624 */ 0625 void XRenderComposite(Display *dpy, int op, Picture src, Picture mask, 0626 Picture dst, int src_x, int src_y, int mask_x, int mask_y, 0627 int dst_x, int dst_y, unsigned int width, 0628 unsigned int height); 0629 0630 /** 0631 * Create a Glyph Set. 0632 * 0633 * @param dpy Connection to the X server. 0634 * @param[in] format Desired format for the Glyphs Picture. 0635 * @return A GlyphSet. 0636 */ 0637 GlyphSet XRenderCreateGlyphSet(Display *dpy, _Xconst XRenderPictFormat *format); 0638 0639 /** 0640 * Generate a new reference for an existing Glyph Set. 0641 * 0642 * @param dpy Connection to the X server. 0643 * @param[in] existing Target Glyph Set. 0644 * @return A GlyphSet identical to `existing`. 0645 */ 0646 GlyphSet XRenderReferenceGlyphSet(Display *dpy, GlyphSet existing); 0647 0648 /** 0649 * Free allocated structures for a GlyphSet. 0650 * 0651 * If there's more references to the underlying GlyphSet structures, this will 0652 * remove only the specified GlyphSet reference. 0653 * 0654 * @warning A freed GlyphSet shouldn't be used again. 0655 * 0656 * @param dpy Connection to the X server. 0657 * @param[in] glyphset Target GlyphSet. 0658 */ 0659 void XRenderFreeGlyphSet(Display *dpy, GlyphSet glyphset); 0660 0661 /** 0662 * Add new Glyphs to a GlyphSet. 0663 * 0664 * @param dpy Connection to the X server. 0665 * @param[in] glyphset Glyph storage destination. 0666 * @param[in] gids Array of ids for the new Glyphs. 0667 * @param[in] glyphs Array of new Glyphs info. 0668 * @param[in] nglyphs Number of Glyphs to add. 0669 * @param[in] images Byte array containing the Glyphs graphics. 0670 * @param[in] nbyte_images Size of the `images` byte array. 0671 */ 0672 void XRenderAddGlyphs(Display *dpy, GlyphSet glyphset, _Xconst Glyph *gids, 0673 _Xconst XGlyphInfo *glyphs, int nglyphs, 0674 _Xconst char *images, int nbyte_images); 0675 0676 /** 0677 * Free allocated Glyphs. 0678 * 0679 * @param dpy Connection to the X server. 0680 * @param[in] glyphset GlyphSet storing the Glyphs. 0681 * @param[in] gids Identifier array of the Glyphs to dellocate. 0682 * @param[in] nglyphs Glyph count. 0683 */ 0684 void XRenderFreeGlyphs(Display *dpy, GlyphSet glyphset, _Xconst Glyph *gids, 0685 int nglyphs); 0686 0687 /** 0688 * Draw a 8-bit character string into a Picture. 0689 * 0690 * @param dpy Connection to the X server. 0691 * @param[in] op Compositing operation to perform. 0692 * @param[in] src Picture to combine with. 0693 * @param[in] dst Picture to combine into. 0694 * @param[in] maskFormat Picture format of the generated Picture mask. 0695 * @param[in] glyphset Glyph Source. 0696 * @param[in] xSrc Horizontal `src` origin offset. 0697 * @param[in] ySrc Vertical `src` origin offset. 0698 * @param[in] xDst Horizontal `dst` origin offset. 0699 * @param[in] yDst Vertical `dst` origin offset. 0700 * @param[in] string String to clip to. 0701 * @param[in] nchar String length. 0702 */ 0703 void XRenderCompositeString8(Display *dpy, int op, Picture src, Picture dst, 0704 _Xconst XRenderPictFormat *maskFormat, 0705 GlyphSet glyphset, int xSrc, int ySrc, int xDst, 0706 int yDst, _Xconst char *string, int nchar); 0707 0708 /** 0709 * Draw a 16-bit character string into a Picture. 0710 * 0711 * @param dpy Connection to the X server. 0712 * @param[in] op Compositing operation to perform. 0713 * @param[in] src Picture to combine with. 0714 * @param[in] dst Picture to combine into. 0715 * @param[in] maskFormat Picture format of the generated Picture mask. 0716 * @param[in] glyphset Glyph Source. 0717 * @param[in] xSrc Horizontal `src` origin offset. 0718 * @param[in] ySrc Vertical `src` origin offset. 0719 * @param[in] xDst Horizontal `dst` origin offset. 0720 * @param[in] yDst Vertical `dst` origin offset. 0721 * @param[in] string String to clip to. 0722 * @param[in] nchar String length. 0723 */ 0724 void XRenderCompositeString16(Display *dpy, int op, Picture src, Picture dst, 0725 _Xconst XRenderPictFormat *maskFormat, 0726 GlyphSet glyphset, int xSrc, int ySrc, int xDst, 0727 int yDst, _Xconst unsigned short *string, 0728 int nchar); 0729 0730 /** 0731 * Draw a 32-bit character string into a Picture. 0732 * 0733 * @param dpy Connection to the X server. 0734 * @param[in] op Compositing operation to perform. 0735 * @param[in] src Picture to combine with. 0736 * @param[in] dst Picture to combine into. 0737 * @param[in] maskFormat Picture format of the generated Picture mask. 0738 * @param[in] glyphset Glyph Source. 0739 * @param[in] xSrc Horizontal `src` origin offset. 0740 * @param[in] ySrc Vertical `src` origin offset. 0741 * @param[in] xDst Horizontal `dst` origin offset. 0742 * @param[in] yDst Vertical `dst` origin offset. 0743 * @param[in] string String to clip to. 0744 * @param[in] nchar String length. 0745 */ 0746 void XRenderCompositeString32(Display *dpy, int op, Picture src, Picture dst, 0747 _Xconst XRenderPictFormat *maskFormat, 0748 GlyphSet glyphset, int xSrc, int ySrc, int xDst, 0749 int yDst, _Xconst unsigned int *string, 0750 int nchar); 0751 0752 /** 0753 * Draw several 8-bit Glyph Elements into a Picture. 0754 * 0755 * @param dpy Connection to the X server. 0756 * @param[in] op Compositing operation to perform. 0757 * @param[in] src Picture to combine with. 0758 * @param[in] dst Picture to combine into. 0759 * @param[in] maskFormat Picture format of the generated Picture mask. 0760 * @param[in] xSrc Horizontal `src` origin offset. 0761 * @param[in] ySrc Vertical `src` origin offset. 0762 * @param[in] xDst Horizontal `dst` origin offset. 0763 * @param[in] yDst Vertical `dst` origin offset. 0764 * @param[in] elts Glyph Elements array to clip with. 0765 * @param[in] nelt Glyph Elements array size. 0766 */ 0767 void XRenderCompositeText8(Display *dpy, int op, Picture src, Picture dst, 0768 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0769 int ySrc, int xDst, int yDst, 0770 _Xconst XGlyphElt8 *elts, int nelt); 0771 0772 /** 0773 * Draw several 16-bit Glyph Elements into a Picture. 0774 * 0775 * @param dpy Connection to the X server. 0776 * @param[in] op Compositing operation to perform. 0777 * @param[in] src Picture to combine with. 0778 * @param[in] dst Picture to combine into. 0779 * @param[in] maskFormat Picture format of the generated Picture mask. 0780 * @param[in] xSrc Horizontal `src` origin offset. 0781 * @param[in] ySrc Vertical `src` origin offset. 0782 * @param[in] xDst Horizontal `dst` origin offset. 0783 * @param[in] yDst Vertical `dst` origin offset. 0784 * @param[in] elts Glyph Elements array to clip with. 0785 * @param[in] nelt Glyph Elements array size. 0786 */ 0787 void XRenderCompositeText16(Display *dpy, int op, Picture src, Picture dst, 0788 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0789 int ySrc, int xDst, int yDst, 0790 _Xconst XGlyphElt16 *elts, int nelt); 0791 0792 /** 0793 * Draw several 32-bit Glyph Elements into a Picture. 0794 * 0795 * @param dpy Connection to the X server. 0796 * @param[in] op Compositing operation to perform. 0797 * @param[in] src Picture to combine with. 0798 * @param[in] dst Picture to combine into. 0799 * @param[in] maskFormat Picture format of the generated Picture mask. 0800 * @param[in] xSrc Horizontal `src` origin offset. 0801 * @param[in] ySrc Vertical `src` origin offset. 0802 * @param[in] xDst Horizontal `dst` origin offset. 0803 * @param[in] yDst Vertical `dst` origin offset. 0804 * @param[in] elts Glyph Elements to clip with. 0805 * @param[in] nelt Glyph Elements array size. 0806 */ 0807 void XRenderCompositeText32(Display *dpy, int op, Picture src, Picture dst, 0808 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0809 int ySrc, int xDst, int yDst, 0810 _Xconst XGlyphElt32 *elts, int nelt); 0811 0812 /** 0813 * Fill a Rectangle with the given color. 0814 * 0815 * @param dpy Connection to the X server. 0816 * @param[in] op Compositing operation to perform. 0817 * @param[in] dst Picture to draw into. 0818 * @param[in] color Color to fill with. 0819 * @param[in] x Horizontal offset. 0820 * @param[in] y Vertical offset. 0821 * @param[in] width Rectangle width. 0822 * @param[in] height Rectangle height. 0823 */ 0824 void XRenderFillRectangle(Display *dpy, int op, Picture dst, 0825 _Xconst XRenderColor *color, int x, int y, 0826 unsigned int width, unsigned int height); 0827 0828 /** 0829 * Fill a bunch of Rectangle with the given color. 0830 * 0831 * @param dpy Connection to the X server. 0832 * @param[in] op Compositing operation to perform. 0833 * @param[in] dst Picture to draw into. 0834 * @param[in] color Color to fill with. 0835 * @param[in] rectangles Array of Rectangles to fill. 0836 * @param[in] n_rects `rectangles` array size. 0837 */ 0838 void XRenderFillRectangles(Display *dpy, int op, Picture dst, 0839 _Xconst XRenderColor *color, 0840 _Xconst XRectangle *rectangles, int n_rects); 0841 0842 /** 0843 * Combine two Pictures using a bunch of Trapezoids as the mask. 0844 * 0845 * @param dpy Connection to the X server. 0846 * @param[in] op Compositing operation to perform. 0847 * @param[in] src Picture to combine with. 0848 * @param[in] dst Picture to combine into. 0849 * @param[in] maskFormat Picture format of the generated Picture mask. 0850 * @param[in] xSrc Horizontal `src` origin offset. 0851 * @param[in] ySrc Vertical `src` origin offset. 0852 * @param[in] traps Array of Trapezoids to clip with. 0853 * @param[in] ntrap `traps` Array size. 0854 */ 0855 void XRenderCompositeTrapezoids(Display *dpy, int op, Picture src, Picture dst, 0856 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0857 int ySrc, _Xconst XTrapezoid *traps, int ntrap); 0858 0859 /** 0860 * Combine two Pictures using a bunch of Triangles as the mask. 0861 * 0862 * @param dpy Connection to the X server. 0863 * @param[in] op Compositing operation to perform. 0864 * @param[in] src Picture to combine with. 0865 * @param[in] dst Picture to combine into. 0866 * @param[in] maskFormat Picture format of the generated Picture mask. 0867 * @param[in] xSrc Horizontal `src` origin offset. 0868 * @param[in] ySrc Vertical `src` origin offset. 0869 * @param[in] triangles Array of Triangles to clip with. 0870 * @param[in] ntriangle `triangles` array size. 0871 */ 0872 void XRenderCompositeTriangles(Display *dpy, int op, Picture src, Picture dst, 0873 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0874 int ySrc, _Xconst XTriangle *triangles, 0875 int ntriangle); 0876 0877 /** 0878 * Combine two Pictures using a Triangle Strip as the mask. 0879 * 0880 * @param dpy Connection to the X server. 0881 * @param[in] op Compositing operation to perform. 0882 * @param[in] src Picture to combine with. 0883 * @param[in] dst Picture to combine into. 0884 * @param[in] maskFormat Picture format of the generated Picture mask. 0885 * @param[in] xSrc Horizontal `src` origin offset. 0886 * @param[in] ySrc Vertical `src` origin offset. 0887 * @param[in] points Array of Points to create Triangles with. 0888 * @param[in] npoint `points` array size. 0889 */ 0890 void XRenderCompositeTriStrip(Display *dpy, int op, Picture src, Picture dst, 0891 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0892 int ySrc, _Xconst XPointFixed *points, 0893 int npoint); 0894 0895 /** 0896 * Combine two Pictures using a Triangle Fan as the mask. 0897 * 0898 * @param dpy Connection to the X server. 0899 * @param[in] op Compositing operation to perform. 0900 * @param[in] src Picture to combine with. 0901 * @param[in] dst Picture to combine into. 0902 * @param[in] maskFormat Picture format of the generated Picture mask. 0903 * @param[in] xSrc Horizontal `src` origin offset. 0904 * @param[in] ySrc Vertical `src` origin offset. 0905 * @param[in] points Array of Points to create Triangles with. 0906 * @param[in] npoint `points` array size. 0907 */ 0908 void XRenderCompositeTriFan(Display *dpy, int op, Picture src, Picture dst, 0909 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0910 int ySrc, _Xconst XPointFixed *points, int npoint); 0911 0912 /** 0913 * Combine two Pictures using a Polygon as the mask. 0914 * 0915 * @param dpy Connection to the X server. 0916 * @param[in] op Compositing operation to perform. 0917 * @param[in] src Picture to combine with. 0918 * @param[in] dst Picture to combine into. 0919 * @param[in] maskFormat Picture format of the generated Picture mask. 0920 * @param[in] xSrc Horizontal `src` origin offset. 0921 * @param[in] ySrc Vertical `src` origin offset. 0922 * @param[in] xDst Horizontal `dst` origin offset. 0923 * @param[in] yDst Vertical `dst` origin offset. 0924 * @param[in] fpoints Array of DoublePoints to create a Polygon with. 0925 * @param[in] npoints `points` array size. 0926 * @param winding Unused. 0927 */ 0928 void XRenderCompositeDoublePoly(Display *dpy, int op, Picture src, Picture dst, 0929 _Xconst XRenderPictFormat *maskFormat, int xSrc, 0930 int ySrc, int xDst, int yDst, 0931 _Xconst XPointDouble *fpoints, int npoints, 0932 int winding); 0933 0934 /** 0935 * Parse a color string. 0936 * 0937 * @param dpy Connection to the X server. 0938 * @param[in] spec Null-terminated string. 0939 * @param[out] def Parsing result. 0940 * @return Status «1» on success. 0941 */ 0942 Status XRenderParseColor(Display *dpy, char *spec, XRenderColor *def); 0943 0944 /** 0945 * Creates a cursor looking like a Picture. 0946 * 0947 * @param dpy Connection to the X server. 0948 * @param[in] source Picture defining the cursor look. 0949 * @param[in] x Horizontal offset. 0950 * @param[in] y Vertical offset. 0951 * @return A Cursor. 0952 */ 0953 Cursor XRenderCreateCursor(Display *dpy, Picture source, unsigned int x, 0954 unsigned int y); 0955 0956 /** 0957 * Ask for Filters applicable to some Drawable. 0958 * 0959 * @param dpy Connection to the X server. 0960 * @param[in] drawable Target Drawable. 0961 * @return Available Filters and Aliases. 0962 */ 0963 XFilters *XRenderQueryFilters(Display *dpy, Drawable drawable); 0964 0965 /** 0966 * Set the current filter of a Picture. 0967 * 0968 * @note On Picture creation, the «Nearest» filter is set by default. 0969 * 0970 * @param dpy Connection to the X server. 0971 * @param[in] picture Target. 0972 * @param[in] filter Filter name. 0973 * @param[in] params Filter parameters array. 0974 * @param[in] nparams `params` array size. 0975 */ 0976 void XRenderSetPictureFilter(Display *dpy, Picture picture, const char *filter, 0977 XFixed *params, int nparams); 0978 0979 /** 0980 * Create an animated Cursor from the given Cursor frames. 0981 * 0982 * @param dpy Connection to the X server. 0983 * @param[in] ncursor Cursor frames count. 0984 * @param[in] cursors Cursor frames array. 0985 * @return An animated Cursor. 0986 */ 0987 Cursor XRenderCreateAnimCursor(Display *dpy, int ncursor, XAnimCursor *cursors); 0988 0989 /** 0990 * Add the given Trapezoids to a single-channel Picture. 0991 * 0992 * @param dpy Connection to the X server. 0993 * @param[in] picture An alpha-only Picture. 0994 * @param[in] xOff Horizontal offset. 0995 * @param[in] yOff Vertical offset. 0996 * @param[in] traps Array of trapezoids. 0997 * @param[in] ntrap `traps` array size. 0998 */ 0999 void XRenderAddTraps(Display *dpy, Picture picture, int xOff, int yOff, 1000 _Xconst XTrap *traps, int ntrap); 1001 1002 /** 1003 * Create a Picture filled with a single Color. 1004 * 1005 * @param dpy Connection to the X server. 1006 * @param[in] color Desired filling. 1007 * @return A single Color Picture. 1008 */ 1009 Picture XRenderCreateSolidFill(Display *dpy, const XRenderColor *color); 1010 1011 /** 1012 * Create a Picture filled with a Linear Gradient. 1013 * 1014 * @param dpy Connection to the X server. 1015 * @param[in] gradient Gradient geometry. 1016 * @param[in] stops Stop sections. 1017 * @param[in] colors Stop colors. 1018 * @param[in] nstops Stops count. 1019 * @return A Picture filled with a Linear Gradient. 1020 */ 1021 Picture XRenderCreateLinearGradient(Display *dpy, 1022 const XLinearGradient *gradient, 1023 const XFixed *stops, 1024 const XRenderColor *colors, int nstops); 1025 1026 /** 1027 * Create a Picture filled with a Radial Gradient. 1028 * 1029 * @param dpy Connection to the X server. 1030 * @param[in] gradient Gradient geometry. 1031 * @param[in] stops Stop sections. 1032 * @param[in] colors Stop colors. 1033 * @param[in] nstops Stops count. 1034 * @return A Picture filled with a Radial Gradient. 1035 */ 1036 Picture XRenderCreateRadialGradient(Display *dpy, 1037 const XRadialGradient *gradient, 1038 const XFixed *stops, 1039 const XRenderColor *colors, int nstops); 1040 1041 /** 1042 * Create a Picture filled with a Conical Gradient. 1043 * 1044 * @param dpy Connection to the X server. 1045 * @param[in] gradient Gradient geometry. 1046 * @param[in] stops Stop sections. 1047 * @param[in] colors Stop colors. 1048 * @param[in] nstops Stops count. 1049 * @return A Picture filled with a Conical Gradient. 1050 */ 1051 Picture XRenderCreateConicalGradient(Display *dpy, 1052 const XConicalGradient *gradient, 1053 const XFixed *stops, 1054 const XRenderColor *colors, int nstops); 1055 1056 _XFUNCPROTOEND 1057 1058 #endif /* _XRENDER_H_ */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |