annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/X11/extensions/Xrender.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /*
jpayne@69 2 *
jpayne@69 3 * Copyright © 2000 SuSE, Inc.
jpayne@69 4 *
jpayne@69 5 * Permission to use, copy, modify, distribute, and sell this software and its
jpayne@69 6 * documentation for any purpose is hereby granted without fee, provided that
jpayne@69 7 * the above copyright notice appear in all copies and that both that
jpayne@69 8 * copyright notice and this permission notice appear in supporting
jpayne@69 9 * documentation, and that the name of SuSE not be used in advertising or
jpayne@69 10 * publicity pertaining to distribution of the software without specific,
jpayne@69 11 * written prior permission. SuSE makes no representations about the
jpayne@69 12 * suitability of this software for any purpose. It is provided "as is"
jpayne@69 13 * without express or implied warranty.
jpayne@69 14 *
jpayne@69 15 * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
jpayne@69 16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
jpayne@69 17 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
jpayne@69 18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
jpayne@69 19 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
jpayne@69 20 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
jpayne@69 21 *
jpayne@69 22 * Author: Keith Packard, SuSE, Inc.
jpayne@69 23 */
jpayne@69 24
jpayne@69 25 /**
jpayne@69 26 * @file Xrender.h
jpayne@69 27 * @brief XRender library API.
jpayne@69 28 */
jpayne@69 29
jpayne@69 30 #ifndef _XRENDER_H_
jpayne@69 31 #define _XRENDER_H_
jpayne@69 32
jpayne@69 33 #include <X11/Xfuncproto.h>
jpayne@69 34 #include <X11/Xlib.h>
jpayne@69 35 #include <X11/Xosdefs.h>
jpayne@69 36 #include <X11/Xutil.h>
jpayne@69 37
jpayne@69 38 #include <X11/extensions/render.h>
jpayne@69 39
jpayne@69 40 /**
jpayne@69 41 * @mainpage libXrender API Documentation.
jpayne@69 42 *
jpayne@69 43 * Dummy text down here.
jpayne@69 44 */
jpayne@69 45
jpayne@69 46 /**
jpayne@69 47 * The direct component of a PictFormat.
jpayne@69 48 *
jpayne@69 49 * It contains a binary description of the color format used by the Picture.
jpayne@69 50 *
jpayne@69 51 * * A Zero bit alphaMask is declared to have an opaque alpha everywhere.
jpayne@69 52 * * A Zero bit redMask, greenMask and blueMask is declared to have red, green,
jpayne@69 53 * blue == 0 everywhere.
jpayne@69 54 * * If any of redMask, greenMask or blueMask are zero, all other masks are
jpayne@69 55 * zero.
jpayne@69 56 */
jpayne@69 57 typedef struct {
jpayne@69 58 /** Red component binary displacement. */
jpayne@69 59 short red;
jpayne@69 60 /** Red component bit mask. */
jpayne@69 61 short redMask;
jpayne@69 62 /** Green component binary displacement. */
jpayne@69 63 short green;
jpayne@69 64 /** Green component bit mask. */
jpayne@69 65 short greenMask;
jpayne@69 66 /** Blue component binary displacement. */
jpayne@69 67 short blue;
jpayne@69 68 /** Blue component bit mask. */
jpayne@69 69 short blueMask;
jpayne@69 70 /** Alpha component binary displacement. */
jpayne@69 71 short alpha;
jpayne@69 72 /** Alpha component bit mask. */
jpayne@69 73 short alphaMask;
jpayne@69 74 } XRenderDirectFormat;
jpayne@69 75
jpayne@69 76 /**
jpayne@69 77 * A Picture pixel format description.
jpayne@69 78 *
jpayne@69 79 * It describes the format used by the server to display colors.
jpayne@69 80 *
jpayne@69 81 * There are two types:
jpayne@69 82 * * Direct: Doesn't have a Colormap and the DirectFormat structure describes
jpayne@69 83 * the pixel format.
jpayne@69 84 * * Indexed: Has a Colormap and it's DirectFormat structure is filled with
jpayne@69 85 * zeros.
jpayne@69 86 */
jpayne@69 87 typedef struct {
jpayne@69 88 /** XID of this structure server instance. */
jpayne@69 89 PictFormat id;
jpayne@69 90 /** Color management type. */
jpayne@69 91 int type;
jpayne@69 92 /** Pixel bit depth. */
jpayne@69 93 int depth;
jpayne@69 94 /** Color component description. */
jpayne@69 95 XRenderDirectFormat direct;
jpayne@69 96 /** XID of the map of indexed colors on the server. */
jpayne@69 97 Colormap colormap;
jpayne@69 98 } XRenderPictFormat;
jpayne@69 99
jpayne@69 100 /*< XRenderPictFormat template field masks.
jpayne@69 101 * @{
jpayne@69 102 */
jpayne@69 103 /** Include ID field. @hideinitializer */
jpayne@69 104 #define PictFormatID (1 << 0)
jpayne@69 105 /** Include Type field. @hideinitializer */
jpayne@69 106 #define PictFormatType (1 << 1)
jpayne@69 107 /** Include Depth field. @hideinitializer */
jpayne@69 108 #define PictFormatDepth (1 << 2)
jpayne@69 109
jpayne@69 110 /*<--- XRenderPictFormat->direct fields. */
jpayne@69 111 /** Include Direct->Red field. @hideinitializer */
jpayne@69 112 #define PictFormatRed (1 << 3)
jpayne@69 113 /** Include Direct->RedMask field. @hideinitializer */
jpayne@69 114 #define PictFormatRedMask (1 << 4)
jpayne@69 115 /** Include Direct->Green field. @hideinitializer */
jpayne@69 116 #define PictFormatGreen (1 << 5)
jpayne@69 117 /** Include Direct->GreenMask field. @hideinitializer */
jpayne@69 118 #define PictFormatGreenMask (1 << 6)
jpayne@69 119 /** Include Direct->Blue field. @hideinitializer */
jpayne@69 120 #define PictFormatBlue (1 << 7)
jpayne@69 121 /** Include Direct->BlueMask field. @hideinitializer */
jpayne@69 122 #define PictFormatBlueMask (1 << 8)
jpayne@69 123 /** Include Direct->Alpha field. @hideinitializer */
jpayne@69 124 #define PictFormatAlpha (1 << 9)
jpayne@69 125 /** Include Direct->AlphaMask field. @hideinitializer */
jpayne@69 126 #define PictFormatAlphaMask (1 << 10)
jpayne@69 127
jpayne@69 128 /** Include Colormap field. @hideinitializer */
jpayne@69 129 #define PictFormatColormap (1 << 11)
jpayne@69 130 /** @} */
jpayne@69 131
jpayne@69 132 /**
jpayne@69 133 * Picture rendering attributes.
jpayne@69 134 */
jpayne@69 135 typedef struct _XRenderPictureAttributes {
jpayne@69 136 /** How to repeat the picture. */
jpayne@69 137 int repeat;
jpayne@69 138
jpayne@69 139 /** A replacement alpha-map. Must be a pixmap-containing Picture. */
jpayne@69 140 Picture alpha_map;
jpayne@69 141 /** Horizontal displacement of the replacement alpha-map. */
jpayne@69 142 int alpha_x_origin;
jpayne@69 143 /** Vertical displacement of the replacement alpha-map. */
jpayne@69 144 int alpha_y_origin;
jpayne@69 145
jpayne@69 146 /** Horizontal displacement of the clip mask. */
jpayne@69 147 int clip_x_origin;
jpayne@69 148 /** Vertical displacement of the clip mask. */
jpayne@69 149 int clip_y_origin;
jpayne@69 150 /** A r/w restriction to the drawable. */
jpayne@69 151 Pixmap clip_mask;
jpayne@69 152
jpayne@69 153 /** Whether to receive GraphicsExpose events. @note Ignored field. */
jpayne@69 154 Bool graphics_exposures;
jpayne@69 155 /** How to clip pixels on subwindow overlap. */
jpayne@69 156 int subwindow_mode;
jpayne@69 157 /** Alpha mask generation mode. */
jpayne@69 158 int poly_edge;
jpayne@69 159 /** Alpha value rasterization mode. */
jpayne@69 160 int poly_mode;
jpayne@69 161 /** Dithering mode. @note Ignored field. */
jpayne@69 162 Atom dither;
jpayne@69 163 /** Treat alpha channels independently. */
jpayne@69 164 Bool component_alpha;
jpayne@69 165 } XRenderPictureAttributes;
jpayne@69 166
jpayne@69 167 /** An alpha-blended color with premultiplied components.
jpayne@69 168 *
jpayne@69 169 * Values are in the range from 0 to 65535 inclusive, scaled down to the right
jpayne@69 170 * hardware values by the server. Colors must be premultiplied by alpha by the
jpayne@69 171 * client in all cases but gradient operations.
jpayne@69 172 */
jpayne@69 173 typedef struct {
jpayne@69 174 /** Red color channel. */
jpayne@69 175 unsigned short red;
jpayne@69 176 /** Green color channel. */
jpayne@69 177 unsigned short green;
jpayne@69 178 /** Blue color channel. */
jpayne@69 179 unsigned short blue;
jpayne@69 180 /** Alpha color channel. */
jpayne@69 181 unsigned short alpha;
jpayne@69 182 } XRenderColor;
jpayne@69 183
jpayne@69 184 /**
jpayne@69 185 * Glyph positioning and sizing information.
jpayne@69 186 *
jpayne@69 187 * A glyph is positioned by taking the requested position and substracting the
jpayne@69 188 * center offset.
jpayne@69 189 */
jpayne@69 190 typedef struct _XGlyphInfo {
jpayne@69 191 /** Glyph width. */
jpayne@69 192 unsigned short width;
jpayne@69 193 /** Glyph height. */
jpayne@69 194 unsigned short height;
jpayne@69 195
jpayne@69 196 /** Horizontal Glyph center offset relative to the upper-left corner. */
jpayne@69 197 short x;
jpayne@69 198 /** Vertical Glyph center offset relative to the upper-left corner. */
jpayne@69 199 short y;
jpayne@69 200
jpayne@69 201 /** Horizontal margin to the next Glyph. */
jpayne@69 202 short xOff;
jpayne@69 203 /** Vertical margin to the next Glyph. */
jpayne@69 204 short yOff;
jpayne@69 205 } XGlyphInfo;
jpayne@69 206
jpayne@69 207 /*< Glyph Elements.
jpayne@69 208 * Group of glyphs to be rendered.
jpayne@69 209 * While selecting the right element type, you should use as a reference the
jpayne@69 210 * largest identifier in Elt->glyphset.
jpayne@69 211 */
jpayne@69 212 /** @{ */
jpayne@69 213
jpayne@69 214 /**
jpayne@69 215 * 8-bit Glyph Element.
jpayne@69 216 */
jpayne@69 217 typedef struct _XGlyphElt8 {
jpayne@69 218 /** Set of available glyphs. */
jpayne@69 219 GlyphSet glyphset;
jpayne@69 220
jpayne@69 221 /** 8-bit glyph id array. */
jpayne@69 222 _Xconst char *chars;
jpayne@69 223 /** Glyph array size. */
jpayne@69 224 int nchars;
jpayne@69 225
jpayne@69 226 /** Horizontal offset. */
jpayne@69 227 int xOff;
jpayne@69 228 /** Vertical offset. */
jpayne@69 229 int yOff;
jpayne@69 230 } XGlyphElt8;
jpayne@69 231
jpayne@69 232 /**
jpayne@69 233 * 16-bit Glyph Element.
jpayne@69 234 */
jpayne@69 235 typedef struct _XGlyphElt16 {
jpayne@69 236 /** Set of available glyphs. */
jpayne@69 237 GlyphSet glyphset;
jpayne@69 238
jpayne@69 239 /** 16-bit glyph id array. */
jpayne@69 240 _Xconst unsigned short *chars;
jpayne@69 241 /** Glyph array size. */
jpayne@69 242 int nchars;
jpayne@69 243
jpayne@69 244 /** Horizontal offset. */
jpayne@69 245 int xOff;
jpayne@69 246 /** Vertical offset. */
jpayne@69 247 int yOff;
jpayne@69 248 } XGlyphElt16;
jpayne@69 249
jpayne@69 250 /**
jpayne@69 251 * 32-bit Glyph Element.
jpayne@69 252 */
jpayne@69 253 typedef struct _XGlyphElt32 {
jpayne@69 254 /** Set of available glyphs. */
jpayne@69 255 GlyphSet glyphset;
jpayne@69 256
jpayne@69 257 /** 32-bit glyph id array. */
jpayne@69 258 _Xconst unsigned int *chars;
jpayne@69 259 /** Glyph array size. */
jpayne@69 260 int nchars;
jpayne@69 261
jpayne@69 262 /** Horizontal offset. */
jpayne@69 263 int xOff;
jpayne@69 264 /** Vertical offset. */
jpayne@69 265 int yOff;
jpayne@69 266 } XGlyphElt32;
jpayne@69 267 /**@} */
jpayne@69 268
jpayne@69 269 /*< Utility number types.
jpayne@69 270 *
jpayne@69 271 */
jpayne@69 272 /**@{ */
jpayne@69 273
jpayne@69 274 /**
jpayne@69 275 * Floating-point number.
jpayne@69 276 */
jpayne@69 277 typedef double XDouble;
jpayne@69 278
jpayne@69 279 /**
jpayne@69 280 * Fixed-point number.
jpayne@69 281 */
jpayne@69 282 typedef int XFixed;
jpayne@69 283
jpayne@69 284 /** Turn XDouble into XFixed. @hideinitializer */
jpayne@69 285 #define XDoubleToFixed(f) ((XFixed)((f)*65536))
jpayne@69 286 /** Turn XFixed into XDouble. @hideinitializer */
jpayne@69 287 #define XFixedToDouble(f) (((XDouble)(f)) / 65536)
jpayne@69 288 /** @} */
jpayne@69 289
jpayne@69 290 /**
jpayne@69 291 * Point coordinates stored as floats.
jpayne@69 292 */
jpayne@69 293 typedef struct _XPointDouble {
jpayne@69 294 XDouble x, y;
jpayne@69 295 } XPointDouble;
jpayne@69 296
jpayne@69 297 /**
jpayne@69 298 * Point coordinates as integers.
jpayne@69 299 */
jpayne@69 300 typedef struct _XPointFixed {
jpayne@69 301 XFixed x, y;
jpayne@69 302 } XPointFixed;
jpayne@69 303
jpayne@69 304 /**
jpayne@69 305 * Line described by two points.
jpayne@69 306 */
jpayne@69 307 typedef struct _XLineFixed {
jpayne@69 308 XPointFixed p1, p2;
jpayne@69 309 } XLineFixed;
jpayne@69 310
jpayne@69 311 /**
jpayne@69 312 * Triangle described by it's vertices.
jpayne@69 313 * @see XTrap
jpayne@69 314 */
jpayne@69 315 typedef struct _XTriangle {
jpayne@69 316 XPointFixed p1, p2, p3;
jpayne@69 317 } XTriangle;
jpayne@69 318
jpayne@69 319 /**
jpayne@69 320 * Circle described by it's center point and a radius.
jpayne@69 321 */
jpayne@69 322 typedef struct _XCircle {
jpayne@69 323 XFixed x;
jpayne@69 324 XFixed y;
jpayne@69 325 XFixed radius;
jpayne@69 326 } XCircle;
jpayne@69 327
jpayne@69 328 /** A trapezoid.
jpayne@69 329 *
jpayne@69 330 * @deprecated Use XTrap instead
jpayne@69 331 * @see
jpayne@69 332 * * XTriangle
jpayne@69 333 * * XTrap
jpayne@69 334 */
jpayne@69 335 typedef struct _XTrapezoid {
jpayne@69 336 XFixed top, bottom;
jpayne@69 337 XLineFixed left, right;
jpayne@69 338 } XTrapezoid;
jpayne@69 339
jpayne@69 340 /**
jpayne@69 341 * A transform matrix.
jpayne@69 342 */
jpayne@69 343 typedef struct _XTransform {
jpayne@69 344 XFixed matrix[3][3];
jpayne@69 345 } XTransform;
jpayne@69 346
jpayne@69 347 /**
jpayne@69 348 * Group filters and filter aliases.
jpayne@69 349 */
jpayne@69 350 typedef struct _XFilters {
jpayne@69 351 /** Filter names count. */
jpayne@69 352 int nfilter;
jpayne@69 353 /** Filter names array. */
jpayne@69 354 char **filter;
jpayne@69 355 /** Aliases array count. */
jpayne@69 356 int nalias;
jpayne@69 357 /** Array of «Index in .filter of the aliased filter or 0xffff». */
jpayne@69 358 short *alias;
jpayne@69 359 } XFilters;
jpayne@69 360
jpayne@69 361 /**
jpayne@69 362 * The value of an indexed color.
jpayne@69 363 */
jpayne@69 364 typedef struct _XIndexValue {
jpayne@69 365 /** Index ID. */
jpayne@69 366 unsigned long pixel;
jpayne@69 367 /** Color components. */
jpayne@69 368 unsigned short red, green, blue, alpha;
jpayne@69 369 } XIndexValue;
jpayne@69 370
jpayne@69 371 /**
jpayne@69 372 * A single cursor frame.
jpayne@69 373 */
jpayne@69 374 typedef struct _XAnimCursor {
jpayne@69 375 /** Existing cursor. */
jpayne@69 376 Cursor cursor;
jpayne@69 377 /** Animation delay. */
jpayne@69 378 unsigned long delay;
jpayne@69 379 } XAnimCursor;
jpayne@69 380
jpayne@69 381 /**
jpayne@69 382 * An horizontal line.
jpayne@69 383 */
jpayne@69 384 typedef struct _XSpanFix {
jpayne@69 385 XFixed left, right, y;
jpayne@69 386 } XSpanFix;
jpayne@69 387
jpayne@69 388 /**
jpayne@69 389 * A trapezoid defined by two lines.
jpayne@69 390 * @see XTriangle
jpayne@69 391 */
jpayne@69 392 typedef struct _XTrap {
jpayne@69 393 XSpanFix top, bottom;
jpayne@69 394 } XTrap;
jpayne@69 395
jpayne@69 396 /**
jpayne@69 397 * Linear gradient shape.
jpayne@69 398 */
jpayne@69 399 typedef struct _XLinearGradient {
jpayne@69 400 XPointFixed p1;
jpayne@69 401 XPointFixed p2;
jpayne@69 402 } XLinearGradient;
jpayne@69 403
jpayne@69 404 /**
jpayne@69 405 * Radial gradient shape.
jpayne@69 406 */
jpayne@69 407 typedef struct _XRadialGradient {
jpayne@69 408 XCircle inner;
jpayne@69 409 XCircle outer;
jpayne@69 410 } XRadialGradient;
jpayne@69 411
jpayne@69 412 /**
jpayne@69 413 * Conical gradient shape.
jpayne@69 414 */
jpayne@69 415 typedef struct _XConicalGradient {
jpayne@69 416 XPointFixed center;
jpayne@69 417 XFixed angle; /* in degrees */
jpayne@69 418 } XConicalGradient;
jpayne@69 419
jpayne@69 420 _XFUNCPROTOBEGIN
jpayne@69 421
jpayne@69 422 /** @defgroup queries Early check queries.
jpayne@69 423 * @{
jpayne@69 424 */
jpayne@69 425
jpayne@69 426 /**
jpayne@69 427 * Ask for the Render extension presence and its base numbers.
jpayne@69 428 *
jpayne@69 429 * @param dpy Connection to the X server.
jpayne@69 430 * @param[out] event_basep first event number for the extension.
jpayne@69 431 * @param[out] error_basep first error number for the extension.
jpayne@69 432 * @return True if Render is present.
jpayne@69 433 */
jpayne@69 434 Bool XRenderQueryExtension(Display *dpy, int *event_basep, int *error_basep);
jpayne@69 435
jpayne@69 436 /**
jpayne@69 437 * Ask for the extension version.
jpayne@69 438 *
jpayne@69 439 * @param dpy Connection to the X server.
jpayne@69 440 * @param[out] major_versionp Extension's major version.
jpayne@69 441 * @param[out] minor_versionp Extension's major version.
jpayne@69 442 * @return Status «1» on success.
jpayne@69 443 */
jpayne@69 444 Status XRenderQueryVersion(Display *dpy, int *major_versionp,
jpayne@69 445 int *minor_versionp);
jpayne@69 446
jpayne@69 447 /**
jpayne@69 448 * Check for and cache compatible picture formats.
jpayne@69 449 *
jpayne@69 450 * @param dpy Connection to the X server.
jpayne@69 451 * @return Status «1» on success.
jpayne@69 452 */
jpayne@69 453 Status XRenderQueryFormats(Display *dpy);
jpayne@69 454
jpayne@69 455 /**
jpayne@69 456 * Ask for the current subpixel order of a screen.
jpayne@69 457 *
jpayne@69 458 * @param dpy Connection to the X server.
jpayne@69 459 * @param[in] screen Target screen number.
jpayne@69 460 * @return SubPixelUnknown on error, else a subpixel order.
jpayne@69 461 */
jpayne@69 462 int XRenderQuerySubpixelOrder(Display *dpy, int screen);
jpayne@69 463
jpayne@69 464 /**
jpayne@69 465 * Change the subpixel order of a screen.
jpayne@69 466 *
jpayne@69 467 * @param dpy Connection to the X server
jpayne@69 468 * @param[in] screen Target screen number.
jpayne@69 469 * @param[in] subpixel Requested subpixel order.
jpayne@69 470 * @return True if the operation was successful.
jpayne@69 471 */
jpayne@69 472 Bool XRenderSetSubpixelOrder(Display *dpy, int screen, int subpixel);
jpayne@69 473 /** @} */
jpayne@69 474
jpayne@69 475 /**
jpayne@69 476 * Ask for the Picture format for a Visual.
jpayne@69 477 *
jpayne@69 478 * @param dpy Connection to the X server.
jpayne@69 479 * @param[in] visual Reference Visual object.
jpayne@69 480 * @return The requested Picture format.
jpayne@69 481 */
jpayne@69 482 XRenderPictFormat *XRenderFindVisualFormat(Display *dpy,
jpayne@69 483 _Xconst Visual *visual);
jpayne@69 484
jpayne@69 485 /**
jpayne@69 486 * Ask for matching Picture formats from a template.
jpayne@69 487 *
jpayne@69 488 * @param dpy Connection to the X server.
jpayne@69 489 * @param[in] mask `templ` fields mask to use.
jpayne@69 490 * @param[in] templ Requested Picture format template.
jpayne@69 491 * @param[in] count Skip `count` formats.
jpayne@69 492 * @return NULL if no matching format found, else a Picture format.
jpayne@69 493 */
jpayne@69 494 XRenderPictFormat *XRenderFindFormat(Display *dpy, unsigned long mask,
jpayne@69 495 _Xconst XRenderPictFormat *templ,
jpayne@69 496 int count);
jpayne@69 497
jpayne@69 498 /** Standard format specifiers.
jpayne@69 499 * @{
jpayne@69 500 */
jpayne@69 501 /** 8-bit RGB with Alpha. @hideinitializer */
jpayne@69 502 #define PictStandardARGB32 0
jpayne@69 503 /** 8-bit RGB. @hideinitializer */
jpayne@69 504 #define PictStandardRGB24 1
jpayne@69 505 /** 8-bit Alpha map. @hideinitializer */
jpayne@69 506 #define PictStandardA8 2
jpayne@69 507 /** 4-bit Alpha map. @hideinitializer */
jpayne@69 508 #define PictStandardA4 3
jpayne@69 509 /** 1-bit Alpha map. @hideinitializer */
jpayne@69 510 #define PictStandardA1 4
jpayne@69 511 /** Supported standard formats count. @hideinitializer */
jpayne@69 512 #define PictStandardNUM 5
jpayne@69 513 /** @} */
jpayne@69 514
jpayne@69 515 /**
jpayne@69 516 * Ask for a predefined standard picture format.
jpayne@69 517 *
jpayne@69 518 * This is a shorthand to XRenderFindFormat for finding common formats.
jpayne@69 519 *
jpayne@69 520 * @param dpy Connection to the X server.
jpayne@69 521 * @param[in] format Desired format specifier.
jpayne@69 522 * @return NULL if no matching format found, else a Picture format.
jpayne@69 523 */
jpayne@69 524 XRenderPictFormat *XRenderFindStandardFormat(Display *dpy, int format);
jpayne@69 525
jpayne@69 526 /**
jpayne@69 527 * Ask for the indexed colors of a Picture format.
jpayne@69 528 *
jpayne@69 529 * @param dpy Connection to the X server.
jpayne@69 530 * @param[in] format Queried picture format.
jpayne@69 531 * @param[out] num Size of the output array.
jpayne@69 532 * @return An array of XIndexValue.
jpayne@69 533 */
jpayne@69 534 XIndexValue *XRenderQueryPictIndexValues(Display *dpy,
jpayne@69 535 _Xconst XRenderPictFormat *format,
jpayne@69 536 int *num);
jpayne@69 537
jpayne@69 538 /**
jpayne@69 539 * Creates a Picture for a drawable.
jpayne@69 540 *
jpayne@69 541 * @param dpy Connection to the X server.
jpayne@69 542 * @param[in] drawable Target Drawable.
jpayne@69 543 * @param[in] format Format for the Picture.
jpayne@69 544 * @param[in] valuemask `attributes` fields mask to use.
jpayne@69 545 * @param[in] attributes Desired attributes for the Picture.
jpayne@69 546 * @return A Picture tied to the drawable.
jpayne@69 547 */
jpayne@69 548 Picture XRenderCreatePicture(Display *dpy, Drawable drawable,
jpayne@69 549 _Xconst XRenderPictFormat *format,
jpayne@69 550 unsigned long valuemask,
jpayne@69 551 _Xconst XRenderPictureAttributes *attributes);
jpayne@69 552
jpayne@69 553 /**
jpayne@69 554 * Free allocated structures for a Picture.
jpayne@69 555 *
jpayne@69 556 * @warning A freed Picture shouldn't be used again.
jpayne@69 557 *
jpayne@69 558 * @param dpy Connection to the X server.
jpayne@69 559 * @param[in] picture Target Picture.
jpayne@69 560 */
jpayne@69 561 void XRenderFreePicture(Display *dpy, Picture picture);
jpayne@69 562
jpayne@69 563 /**
jpayne@69 564 * Change a Picture's attributes structure.
jpayne@69 565 *
jpayne@69 566 * @param dpy Connection to the X server.
jpayne@69 567 * @param[in] picture Target Picture.
jpayne@69 568 * @param[in] valuemask `attributes` fields mask to use.
jpayne@69 569 * @param[in] attributes Desired attributes for the Picture.
jpayne@69 570 */
jpayne@69 571 void XRenderChangePicture(Display *dpy, Picture picture,
jpayne@69 572 unsigned long valuemask,
jpayne@69 573 _Xconst XRenderPictureAttributes *attributes);
jpayne@69 574
jpayne@69 575 /**
jpayne@69 576 * Change a Picture's clip mask to the specified rectangles.
jpayne@69 577 *
jpayne@69 578 * @param dpy Connection to the X server.
jpayne@69 579 * @param[in] picture Target Picture.
jpayne@69 580 * @param[in] xOrigin Horizontal mask origin.
jpayne@69 581 * @param[in] yOrigin Vertical mask origin.
jpayne@69 582 * @param[in] rects Array of rectangles to clip with.
jpayne@69 583 * @param[in] n `rects` array size.
jpayne@69 584 */
jpayne@69 585 void XRenderSetPictureClipRectangles(Display *dpy, Picture picture, int xOrigin,
jpayne@69 586 int yOrigin, _Xconst XRectangle *rects,
jpayne@69 587 int n);
jpayne@69 588
jpayne@69 589 /**
jpayne@69 590 * Change a Picture's clip mask to the specified Region.
jpayne@69 591 *
jpayne@69 592 * @param dpy Connection to the X server.
jpayne@69 593 * @param[in] picture Target Picture.
jpayne@69 594 * @param[in] r Region to clip with.
jpayne@69 595 */
jpayne@69 596 void XRenderSetPictureClipRegion(Display *dpy, Picture picture, Region r);
jpayne@69 597
jpayne@69 598 /**
jpayne@69 599 * Change a Picture's Transform matrix.
jpayne@69 600 *
jpayne@69 601 * @param dpy Connection to the X server
jpayne@69 602 * @param[in] picture Target Picture.
jpayne@69 603 * @param[in] transform Transform matrix to use.
jpayne@69 604 */
jpayne@69 605 void XRenderSetPictureTransform(Display *dpy, Picture picture,
jpayne@69 606 XTransform *transform);
jpayne@69 607
jpayne@69 608 /**
jpayne@69 609 * Combines two Pictures with the specified compositing operation.
jpayne@69 610 *
jpayne@69 611 * @param dpy Connection to the X server.
jpayne@69 612 * @param[in] op Compositing operation to perform.
jpayne@69 613 * @param[in] src Picture to combine with.
jpayne@69 614 * @param[in] mask Composition mask.
jpayne@69 615 * @param[in] dst Picture to combine into.
jpayne@69 616 * @param[in] src_x Horizontal `src` origin offset.
jpayne@69 617 * @param[in] src_y Vertical `src` origin offset
jpayne@69 618 * @param[in] mask_x Horizontal `mask` origin offset.
jpayne@69 619 * @param[in] mask_y Vertical `mask` origin offset.
jpayne@69 620 * @param[in] dst_x Horizontal `dst` origin offset.
jpayne@69 621 * @param[in] dst_y Vertical `dst` origin offset.
jpayne@69 622 * @param[in] width Maximum composition width.
jpayne@69 623 * @param[in] height Maximum composition height.
jpayne@69 624 */
jpayne@69 625 void XRenderComposite(Display *dpy, int op, Picture src, Picture mask,
jpayne@69 626 Picture dst, int src_x, int src_y, int mask_x, int mask_y,
jpayne@69 627 int dst_x, int dst_y, unsigned int width,
jpayne@69 628 unsigned int height);
jpayne@69 629
jpayne@69 630 /**
jpayne@69 631 * Create a Glyph Set.
jpayne@69 632 *
jpayne@69 633 * @param dpy Connection to the X server.
jpayne@69 634 * @param[in] format Desired format for the Glyphs Picture.
jpayne@69 635 * @return A GlyphSet.
jpayne@69 636 */
jpayne@69 637 GlyphSet XRenderCreateGlyphSet(Display *dpy, _Xconst XRenderPictFormat *format);
jpayne@69 638
jpayne@69 639 /**
jpayne@69 640 * Generate a new reference for an existing Glyph Set.
jpayne@69 641 *
jpayne@69 642 * @param dpy Connection to the X server.
jpayne@69 643 * @param[in] existing Target Glyph Set.
jpayne@69 644 * @return A GlyphSet identical to `existing`.
jpayne@69 645 */
jpayne@69 646 GlyphSet XRenderReferenceGlyphSet(Display *dpy, GlyphSet existing);
jpayne@69 647
jpayne@69 648 /**
jpayne@69 649 * Free allocated structures for a GlyphSet.
jpayne@69 650 *
jpayne@69 651 * If there's more references to the underlying GlyphSet structures, this will
jpayne@69 652 * remove only the specified GlyphSet reference.
jpayne@69 653 *
jpayne@69 654 * @warning A freed GlyphSet shouldn't be used again.
jpayne@69 655 *
jpayne@69 656 * @param dpy Connection to the X server.
jpayne@69 657 * @param[in] glyphset Target GlyphSet.
jpayne@69 658 */
jpayne@69 659 void XRenderFreeGlyphSet(Display *dpy, GlyphSet glyphset);
jpayne@69 660
jpayne@69 661 /**
jpayne@69 662 * Add new Glyphs to a GlyphSet.
jpayne@69 663 *
jpayne@69 664 * @param dpy Connection to the X server.
jpayne@69 665 * @param[in] glyphset Glyph storage destination.
jpayne@69 666 * @param[in] gids Array of ids for the new Glyphs.
jpayne@69 667 * @param[in] glyphs Array of new Glyphs info.
jpayne@69 668 * @param[in] nglyphs Number of Glyphs to add.
jpayne@69 669 * @param[in] images Byte array containing the Glyphs graphics.
jpayne@69 670 * @param[in] nbyte_images Size of the `images` byte array.
jpayne@69 671 */
jpayne@69 672 void XRenderAddGlyphs(Display *dpy, GlyphSet glyphset, _Xconst Glyph *gids,
jpayne@69 673 _Xconst XGlyphInfo *glyphs, int nglyphs,
jpayne@69 674 _Xconst char *images, int nbyte_images);
jpayne@69 675
jpayne@69 676 /**
jpayne@69 677 * Free allocated Glyphs.
jpayne@69 678 *
jpayne@69 679 * @param dpy Connection to the X server.
jpayne@69 680 * @param[in] glyphset GlyphSet storing the Glyphs.
jpayne@69 681 * @param[in] gids Identifier array of the Glyphs to dellocate.
jpayne@69 682 * @param[in] nglyphs Glyph count.
jpayne@69 683 */
jpayne@69 684 void XRenderFreeGlyphs(Display *dpy, GlyphSet glyphset, _Xconst Glyph *gids,
jpayne@69 685 int nglyphs);
jpayne@69 686
jpayne@69 687 /**
jpayne@69 688 * Draw a 8-bit character string into a Picture.
jpayne@69 689 *
jpayne@69 690 * @param dpy Connection to the X server.
jpayne@69 691 * @param[in] op Compositing operation to perform.
jpayne@69 692 * @param[in] src Picture to combine with.
jpayne@69 693 * @param[in] dst Picture to combine into.
jpayne@69 694 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 695 * @param[in] glyphset Glyph Source.
jpayne@69 696 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 697 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 698 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 699 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 700 * @param[in] string String to clip to.
jpayne@69 701 * @param[in] nchar String length.
jpayne@69 702 */
jpayne@69 703 void XRenderCompositeString8(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 704 _Xconst XRenderPictFormat *maskFormat,
jpayne@69 705 GlyphSet glyphset, int xSrc, int ySrc, int xDst,
jpayne@69 706 int yDst, _Xconst char *string, int nchar);
jpayne@69 707
jpayne@69 708 /**
jpayne@69 709 * Draw a 16-bit character string into a Picture.
jpayne@69 710 *
jpayne@69 711 * @param dpy Connection to the X server.
jpayne@69 712 * @param[in] op Compositing operation to perform.
jpayne@69 713 * @param[in] src Picture to combine with.
jpayne@69 714 * @param[in] dst Picture to combine into.
jpayne@69 715 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 716 * @param[in] glyphset Glyph Source.
jpayne@69 717 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 718 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 719 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 720 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 721 * @param[in] string String to clip to.
jpayne@69 722 * @param[in] nchar String length.
jpayne@69 723 */
jpayne@69 724 void XRenderCompositeString16(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 725 _Xconst XRenderPictFormat *maskFormat,
jpayne@69 726 GlyphSet glyphset, int xSrc, int ySrc, int xDst,
jpayne@69 727 int yDst, _Xconst unsigned short *string,
jpayne@69 728 int nchar);
jpayne@69 729
jpayne@69 730 /**
jpayne@69 731 * Draw a 32-bit character string into a Picture.
jpayne@69 732 *
jpayne@69 733 * @param dpy Connection to the X server.
jpayne@69 734 * @param[in] op Compositing operation to perform.
jpayne@69 735 * @param[in] src Picture to combine with.
jpayne@69 736 * @param[in] dst Picture to combine into.
jpayne@69 737 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 738 * @param[in] glyphset Glyph Source.
jpayne@69 739 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 740 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 741 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 742 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 743 * @param[in] string String to clip to.
jpayne@69 744 * @param[in] nchar String length.
jpayne@69 745 */
jpayne@69 746 void XRenderCompositeString32(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 747 _Xconst XRenderPictFormat *maskFormat,
jpayne@69 748 GlyphSet glyphset, int xSrc, int ySrc, int xDst,
jpayne@69 749 int yDst, _Xconst unsigned int *string,
jpayne@69 750 int nchar);
jpayne@69 751
jpayne@69 752 /**
jpayne@69 753 * Draw several 8-bit Glyph Elements into a Picture.
jpayne@69 754 *
jpayne@69 755 * @param dpy Connection to the X server.
jpayne@69 756 * @param[in] op Compositing operation to perform.
jpayne@69 757 * @param[in] src Picture to combine with.
jpayne@69 758 * @param[in] dst Picture to combine into.
jpayne@69 759 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 760 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 761 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 762 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 763 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 764 * @param[in] elts Glyph Elements array to clip with.
jpayne@69 765 * @param[in] nelt Glyph Elements array size.
jpayne@69 766 */
jpayne@69 767 void XRenderCompositeText8(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 768 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 769 int ySrc, int xDst, int yDst,
jpayne@69 770 _Xconst XGlyphElt8 *elts, int nelt);
jpayne@69 771
jpayne@69 772 /**
jpayne@69 773 * Draw several 16-bit Glyph Elements into a Picture.
jpayne@69 774 *
jpayne@69 775 * @param dpy Connection to the X server.
jpayne@69 776 * @param[in] op Compositing operation to perform.
jpayne@69 777 * @param[in] src Picture to combine with.
jpayne@69 778 * @param[in] dst Picture to combine into.
jpayne@69 779 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 780 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 781 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 782 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 783 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 784 * @param[in] elts Glyph Elements array to clip with.
jpayne@69 785 * @param[in] nelt Glyph Elements array size.
jpayne@69 786 */
jpayne@69 787 void XRenderCompositeText16(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 788 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 789 int ySrc, int xDst, int yDst,
jpayne@69 790 _Xconst XGlyphElt16 *elts, int nelt);
jpayne@69 791
jpayne@69 792 /**
jpayne@69 793 * Draw several 32-bit Glyph Elements into a Picture.
jpayne@69 794 *
jpayne@69 795 * @param dpy Connection to the X server.
jpayne@69 796 * @param[in] op Compositing operation to perform.
jpayne@69 797 * @param[in] src Picture to combine with.
jpayne@69 798 * @param[in] dst Picture to combine into.
jpayne@69 799 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 800 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 801 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 802 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 803 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 804 * @param[in] elts Glyph Elements to clip with.
jpayne@69 805 * @param[in] nelt Glyph Elements array size.
jpayne@69 806 */
jpayne@69 807 void XRenderCompositeText32(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 808 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 809 int ySrc, int xDst, int yDst,
jpayne@69 810 _Xconst XGlyphElt32 *elts, int nelt);
jpayne@69 811
jpayne@69 812 /**
jpayne@69 813 * Fill a Rectangle with the given color.
jpayne@69 814 *
jpayne@69 815 * @param dpy Connection to the X server.
jpayne@69 816 * @param[in] op Compositing operation to perform.
jpayne@69 817 * @param[in] dst Picture to draw into.
jpayne@69 818 * @param[in] color Color to fill with.
jpayne@69 819 * @param[in] x Horizontal offset.
jpayne@69 820 * @param[in] y Vertical offset.
jpayne@69 821 * @param[in] width Rectangle width.
jpayne@69 822 * @param[in] height Rectangle height.
jpayne@69 823 */
jpayne@69 824 void XRenderFillRectangle(Display *dpy, int op, Picture dst,
jpayne@69 825 _Xconst XRenderColor *color, int x, int y,
jpayne@69 826 unsigned int width, unsigned int height);
jpayne@69 827
jpayne@69 828 /**
jpayne@69 829 * Fill a bunch of Rectangle with the given color.
jpayne@69 830 *
jpayne@69 831 * @param dpy Connection to the X server.
jpayne@69 832 * @param[in] op Compositing operation to perform.
jpayne@69 833 * @param[in] dst Picture to draw into.
jpayne@69 834 * @param[in] color Color to fill with.
jpayne@69 835 * @param[in] rectangles Array of Rectangles to fill.
jpayne@69 836 * @param[in] n_rects `rectangles` array size.
jpayne@69 837 */
jpayne@69 838 void XRenderFillRectangles(Display *dpy, int op, Picture dst,
jpayne@69 839 _Xconst XRenderColor *color,
jpayne@69 840 _Xconst XRectangle *rectangles, int n_rects);
jpayne@69 841
jpayne@69 842 /**
jpayne@69 843 * Combine two Pictures using a bunch of Trapezoids as the mask.
jpayne@69 844 *
jpayne@69 845 * @param dpy Connection to the X server.
jpayne@69 846 * @param[in] op Compositing operation to perform.
jpayne@69 847 * @param[in] src Picture to combine with.
jpayne@69 848 * @param[in] dst Picture to combine into.
jpayne@69 849 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 850 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 851 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 852 * @param[in] traps Array of Trapezoids to clip with.
jpayne@69 853 * @param[in] ntrap `traps` Array size.
jpayne@69 854 */
jpayne@69 855 void XRenderCompositeTrapezoids(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 856 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 857 int ySrc, _Xconst XTrapezoid *traps, int ntrap);
jpayne@69 858
jpayne@69 859 /**
jpayne@69 860 * Combine two Pictures using a bunch of Triangles as the mask.
jpayne@69 861 *
jpayne@69 862 * @param dpy Connection to the X server.
jpayne@69 863 * @param[in] op Compositing operation to perform.
jpayne@69 864 * @param[in] src Picture to combine with.
jpayne@69 865 * @param[in] dst Picture to combine into.
jpayne@69 866 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 867 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 868 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 869 * @param[in] triangles Array of Triangles to clip with.
jpayne@69 870 * @param[in] ntriangle `triangles` array size.
jpayne@69 871 */
jpayne@69 872 void XRenderCompositeTriangles(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 873 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 874 int ySrc, _Xconst XTriangle *triangles,
jpayne@69 875 int ntriangle);
jpayne@69 876
jpayne@69 877 /**
jpayne@69 878 * Combine two Pictures using a Triangle Strip as the mask.
jpayne@69 879 *
jpayne@69 880 * @param dpy Connection to the X server.
jpayne@69 881 * @param[in] op Compositing operation to perform.
jpayne@69 882 * @param[in] src Picture to combine with.
jpayne@69 883 * @param[in] dst Picture to combine into.
jpayne@69 884 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 885 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 886 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 887 * @param[in] points Array of Points to create Triangles with.
jpayne@69 888 * @param[in] npoint `points` array size.
jpayne@69 889 */
jpayne@69 890 void XRenderCompositeTriStrip(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 891 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 892 int ySrc, _Xconst XPointFixed *points,
jpayne@69 893 int npoint);
jpayne@69 894
jpayne@69 895 /**
jpayne@69 896 * Combine two Pictures using a Triangle Fan as the mask.
jpayne@69 897 *
jpayne@69 898 * @param dpy Connection to the X server.
jpayne@69 899 * @param[in] op Compositing operation to perform.
jpayne@69 900 * @param[in] src Picture to combine with.
jpayne@69 901 * @param[in] dst Picture to combine into.
jpayne@69 902 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 903 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 904 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 905 * @param[in] points Array of Points to create Triangles with.
jpayne@69 906 * @param[in] npoint `points` array size.
jpayne@69 907 */
jpayne@69 908 void XRenderCompositeTriFan(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 909 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 910 int ySrc, _Xconst XPointFixed *points, int npoint);
jpayne@69 911
jpayne@69 912 /**
jpayne@69 913 * Combine two Pictures using a Polygon as the mask.
jpayne@69 914 *
jpayne@69 915 * @param dpy Connection to the X server.
jpayne@69 916 * @param[in] op Compositing operation to perform.
jpayne@69 917 * @param[in] src Picture to combine with.
jpayne@69 918 * @param[in] dst Picture to combine into.
jpayne@69 919 * @param[in] maskFormat Picture format of the generated Picture mask.
jpayne@69 920 * @param[in] xSrc Horizontal `src` origin offset.
jpayne@69 921 * @param[in] ySrc Vertical `src` origin offset.
jpayne@69 922 * @param[in] xDst Horizontal `dst` origin offset.
jpayne@69 923 * @param[in] yDst Vertical `dst` origin offset.
jpayne@69 924 * @param[in] fpoints Array of DoublePoints to create a Polygon with.
jpayne@69 925 * @param[in] npoints `points` array size.
jpayne@69 926 * @param winding Unused.
jpayne@69 927 */
jpayne@69 928 void XRenderCompositeDoublePoly(Display *dpy, int op, Picture src, Picture dst,
jpayne@69 929 _Xconst XRenderPictFormat *maskFormat, int xSrc,
jpayne@69 930 int ySrc, int xDst, int yDst,
jpayne@69 931 _Xconst XPointDouble *fpoints, int npoints,
jpayne@69 932 int winding);
jpayne@69 933
jpayne@69 934 /**
jpayne@69 935 * Parse a color string.
jpayne@69 936 *
jpayne@69 937 * @param dpy Connection to the X server.
jpayne@69 938 * @param[in] spec Null-terminated string.
jpayne@69 939 * @param[out] def Parsing result.
jpayne@69 940 * @return Status «1» on success.
jpayne@69 941 */
jpayne@69 942 Status XRenderParseColor(Display *dpy, char *spec, XRenderColor *def);
jpayne@69 943
jpayne@69 944 /**
jpayne@69 945 * Creates a cursor looking like a Picture.
jpayne@69 946 *
jpayne@69 947 * @param dpy Connection to the X server.
jpayne@69 948 * @param[in] source Picture defining the cursor look.
jpayne@69 949 * @param[in] x Horizontal offset.
jpayne@69 950 * @param[in] y Vertical offset.
jpayne@69 951 * @return A Cursor.
jpayne@69 952 */
jpayne@69 953 Cursor XRenderCreateCursor(Display *dpy, Picture source, unsigned int x,
jpayne@69 954 unsigned int y);
jpayne@69 955
jpayne@69 956 /**
jpayne@69 957 * Ask for Filters applicable to some Drawable.
jpayne@69 958 *
jpayne@69 959 * @param dpy Connection to the X server.
jpayne@69 960 * @param[in] drawable Target Drawable.
jpayne@69 961 * @return Available Filters and Aliases.
jpayne@69 962 */
jpayne@69 963 XFilters *XRenderQueryFilters(Display *dpy, Drawable drawable);
jpayne@69 964
jpayne@69 965 /**
jpayne@69 966 * Set the current filter of a Picture.
jpayne@69 967 *
jpayne@69 968 * @note On Picture creation, the «Nearest» filter is set by default.
jpayne@69 969 *
jpayne@69 970 * @param dpy Connection to the X server.
jpayne@69 971 * @param[in] picture Target.
jpayne@69 972 * @param[in] filter Filter name.
jpayne@69 973 * @param[in] params Filter parameters array.
jpayne@69 974 * @param[in] nparams `params` array size.
jpayne@69 975 */
jpayne@69 976 void XRenderSetPictureFilter(Display *dpy, Picture picture, const char *filter,
jpayne@69 977 XFixed *params, int nparams);
jpayne@69 978
jpayne@69 979 /**
jpayne@69 980 * Create an animated Cursor from the given Cursor frames.
jpayne@69 981 *
jpayne@69 982 * @param dpy Connection to the X server.
jpayne@69 983 * @param[in] ncursor Cursor frames count.
jpayne@69 984 * @param[in] cursors Cursor frames array.
jpayne@69 985 * @return An animated Cursor.
jpayne@69 986 */
jpayne@69 987 Cursor XRenderCreateAnimCursor(Display *dpy, int ncursor, XAnimCursor *cursors);
jpayne@69 988
jpayne@69 989 /**
jpayne@69 990 * Add the given Trapezoids to a single-channel Picture.
jpayne@69 991 *
jpayne@69 992 * @param dpy Connection to the X server.
jpayne@69 993 * @param[in] picture An alpha-only Picture.
jpayne@69 994 * @param[in] xOff Horizontal offset.
jpayne@69 995 * @param[in] yOff Vertical offset.
jpayne@69 996 * @param[in] traps Array of trapezoids.
jpayne@69 997 * @param[in] ntrap `traps` array size.
jpayne@69 998 */
jpayne@69 999 void XRenderAddTraps(Display *dpy, Picture picture, int xOff, int yOff,
jpayne@69 1000 _Xconst XTrap *traps, int ntrap);
jpayne@69 1001
jpayne@69 1002 /**
jpayne@69 1003 * Create a Picture filled with a single Color.
jpayne@69 1004 *
jpayne@69 1005 * @param dpy Connection to the X server.
jpayne@69 1006 * @param[in] color Desired filling.
jpayne@69 1007 * @return A single Color Picture.
jpayne@69 1008 */
jpayne@69 1009 Picture XRenderCreateSolidFill(Display *dpy, const XRenderColor *color);
jpayne@69 1010
jpayne@69 1011 /**
jpayne@69 1012 * Create a Picture filled with a Linear Gradient.
jpayne@69 1013 *
jpayne@69 1014 * @param dpy Connection to the X server.
jpayne@69 1015 * @param[in] gradient Gradient geometry.
jpayne@69 1016 * @param[in] stops Stop sections.
jpayne@69 1017 * @param[in] colors Stop colors.
jpayne@69 1018 * @param[in] nstops Stops count.
jpayne@69 1019 * @return A Picture filled with a Linear Gradient.
jpayne@69 1020 */
jpayne@69 1021 Picture XRenderCreateLinearGradient(Display *dpy,
jpayne@69 1022 const XLinearGradient *gradient,
jpayne@69 1023 const XFixed *stops,
jpayne@69 1024 const XRenderColor *colors, int nstops);
jpayne@69 1025
jpayne@69 1026 /**
jpayne@69 1027 * Create a Picture filled with a Radial Gradient.
jpayne@69 1028 *
jpayne@69 1029 * @param dpy Connection to the X server.
jpayne@69 1030 * @param[in] gradient Gradient geometry.
jpayne@69 1031 * @param[in] stops Stop sections.
jpayne@69 1032 * @param[in] colors Stop colors.
jpayne@69 1033 * @param[in] nstops Stops count.
jpayne@69 1034 * @return A Picture filled with a Radial Gradient.
jpayne@69 1035 */
jpayne@69 1036 Picture XRenderCreateRadialGradient(Display *dpy,
jpayne@69 1037 const XRadialGradient *gradient,
jpayne@69 1038 const XFixed *stops,
jpayne@69 1039 const XRenderColor *colors, int nstops);
jpayne@69 1040
jpayne@69 1041 /**
jpayne@69 1042 * Create a Picture filled with a Conical Gradient.
jpayne@69 1043 *
jpayne@69 1044 * @param dpy Connection to the X server.
jpayne@69 1045 * @param[in] gradient Gradient geometry.
jpayne@69 1046 * @param[in] stops Stop sections.
jpayne@69 1047 * @param[in] colors Stop colors.
jpayne@69 1048 * @param[in] nstops Stops count.
jpayne@69 1049 * @return A Picture filled with a Conical Gradient.
jpayne@69 1050 */
jpayne@69 1051 Picture XRenderCreateConicalGradient(Display *dpy,
jpayne@69 1052 const XConicalGradient *gradient,
jpayne@69 1053 const XFixed *stops,
jpayne@69 1054 const XRenderColor *colors, int nstops);
jpayne@69 1055
jpayne@69 1056 _XFUNCPROTOEND
jpayne@69 1057
jpayne@69 1058 #endif /* _XRENDER_H_ */