1 /* 2 * This file is part of gtkD. 3 * 4 * gtkD is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Lesser General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version, with 8 * some exceptions, please read the COPYING file. 9 * 10 * gtkD is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with gtkD; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 18 */ 19 20 // generated automatically - do not change 21 // find conversion definition on APILookup.txt 22 // implement new conversion functionalities on the wrap.utils pakage 23 24 module gtkc.cairotypes; 25 26 27 public import gtkc.glibtypes; 28 29 //public import std.c.windows.windows; 30 private alias void* HDC; 31 public alias void cairo_path_data_t; 32 33 alias ubyte uchar; 34 35 /** 36 * typedef int cairo_bool_t; 37 * cairo_bool_t is used for boolean values. Returns of type 38 * cairo_bool_t will always be either 0 or 1, but testing against 39 * these values explicitly is not encouraged; just use the 40 * value as a boolean condition. 41 * $(DDOC_COMMENT example) 42 */ 43 public alias int cairo_bool_t; 44 /** 45 * Specifies the type of antialiasing to do when rendering text or shapes. 46 * CAIRO_ANTIALIAS_DEFAULT 47 * Use the default antialiasing for 48 * the subsystem and target device 49 * CAIRO_ANTIALIAS_NONE 50 * Use a bilevel alpha mask 51 * CAIRO_ANTIALIAS_GRAY 52 * Perform single-color antialiasing (using 53 * shades of gray for black text on a white background, for example). 54 * CAIRO_ANTIALIAS_SUBPIXEL 55 * Perform antialiasing by taking 56 * advantage of the order of subpixel elements on devices 57 * such as LCD panels 58 */ 59 public enum cairo_antialias_t 60 { 61 DEFAULT, 62 NONE, 63 GRAY, 64 SUBPIXEL 65 } 66 alias cairo_antialias_t CairoAntialias; 67 68 /** 69 * cairo_fill_rule_t is used to select how paths are filled. For both 70 * fill rules, whether or not a point is included in the fill is 71 * determined by taking a ray from that point to infinity and looking 72 * at intersections with the path. The ray can be in any direction, 73 * as long as it doesn't pass through the end point of a segment 74 * or have a tricky intersection such as intersecting tangent to the path. 75 * (Note that filling is not actually implemented in this way. This 76 * is just a description of the rule that is applied.) 77 * The default fill rule is CAIRO_FILL_RULE_WINDING. 78 * New entries may be added in future versions. 79 * CAIRO_FILL_RULE_WINDING 80 * If the path crosses the ray from 81 * left-to-right, counts +1. If the path crosses the ray 82 * from right to left, counts -1. (Left and right are determined 83 * from the perspective of looking along the ray from the starting 84 * point.) If the total count is non-zero, the point will be filled. 85 * CAIRO_FILL_RULE_EVEN_ODD 86 * Counts the total number of 87 * intersections, without regard to the orientation of the contour. If 88 * the total number of intersections is odd, the point will be 89 * filled. 90 */ 91 public enum cairo_fill_rule_t 92 { 93 WINDING, 94 EVEN_ODD 95 } 96 alias cairo_fill_rule_t CairoFillRule; 97 98 /** 99 * Specifies how to render the endpoints of the path when stroking. 100 * The default line cap style is CAIRO_LINE_CAP_BUTT. 101 * CAIRO_LINE_CAP_BUTT 102 * start(stop) the line exactly at the start(end) point 103 * CAIRO_LINE_CAP_ROUND 104 * use a round ending, the center of the circle is the end point 105 * CAIRO_LINE_CAP_SQUARE 106 * use squared ending, the center of the square is the end point 107 */ 108 public enum cairo_line_cap_t 109 { 110 BUTT, 111 ROUND, 112 SQUARE 113 } 114 alias cairo_line_cap_t CairoLineCap; 115 116 /** 117 * Specifies how to render the junction of two lines when stroking. 118 * The default line join style is CAIRO_LINE_JOIN_MITER. 119 * CAIRO_LINE_JOIN_MITER 120 * use a sharp (angled) corner, see 121 * cairo_set_miter_limit() 122 * CAIRO_LINE_JOIN_ROUND 123 * use a rounded join, the center of the circle is the 124 * joint point 125 * CAIRO_LINE_JOIN_BEVEL 126 * use a cut-off join, the join is cut off at half 127 * the line width from the joint point 128 */ 129 public enum cairo_line_join_t 130 { 131 MITER, 132 ROUND, 133 BEVEL 134 } 135 alias cairo_line_join_t CairoLineJoin; 136 137 /** 138 * cairo_operator_t is used to set the compositing operator for all cairo 139 * drawing operations. 140 * The default operator is CAIRO_OPERATOR_OVER. 141 * The operators marked as unbounded modify their 142 * destination even outside of the mask layer (that is, their effect is not 143 * bound by the mask layer). However, their effect can still be limited by 144 * way of clipping. 145 * To keep things simple, the operator descriptions here 146 * document the behavior for when both source and destination are either fully 147 * transparent or fully opaque. The actual implementation works for 148 * translucent layers too. 149 * For a more detailed explanation of the effects of each operator, including 150 * the mathematical definitions, see 151 * http://cairographics.org/operators/. 152 * CAIRO_OPERATOR_CLEAR 153 * clear destination layer (bounded) 154 * CAIRO_OPERATOR_SOURCE 155 * replace destination layer (bounded) 156 * CAIRO_OPERATOR_OVER 157 * draw source layer on top of destination layer 158 * (bounded) 159 * CAIRO_OPERATOR_IN 160 * draw source where there was destination content 161 * (unbounded) 162 * CAIRO_OPERATOR_OUT 163 * draw source where there was no destination 164 * content (unbounded) 165 * CAIRO_OPERATOR_ATOP 166 * draw source on top of destination content and 167 * only there 168 * CAIRO_OPERATOR_DEST 169 * ignore the source 170 * CAIRO_OPERATOR_DEST_OVER 171 * draw destination on top of source 172 * CAIRO_OPERATOR_DEST_IN 173 * leave destination only where there was 174 * source content (unbounded) 175 * CAIRO_OPERATOR_DEST_OUT 176 * leave destination only where there was no 177 * source content 178 * CAIRO_OPERATOR_DEST_ATOP 179 * leave destination on top of source content 180 * and only there (unbounded) 181 * CAIRO_OPERATOR_XOR 182 * source and destination are shown where there is only 183 * one of them 184 * CAIRO_OPERATOR_ADD 185 * source and destination layers are accumulated 186 * CAIRO_OPERATOR_SATURATE 187 * like over, but assuming source and dest are 188 * disjoint geometries 189 * CAIRO_OPERATOR_MULTIPLY 190 * source and destination layers are multiplied. 191 * This causes the result to be at least as dark as the darker inputs. 192 * CAIRO_OPERATOR_SCREEN 193 * source and destination are complemented and 194 * multiplied. This causes the result to be at least as light as the lighter 195 * inputs. 196 * CAIRO_OPERATOR_OVERLAY 197 * multiplies or screens, depending on the 198 * lightness of the destination color. 199 * CAIRO_OPERATOR_DARKEN 200 * replaces the destination with the source if it 201 * is darker, otherwise keeps the source. 202 * CAIRO_OPERATOR_LIGHTEN 203 * replaces the destination with the source if it 204 * is lighter, otherwise keeps the source. 205 * CAIRO_OPERATOR_COLOR_DODGE 206 * brightens the destination color to reflect 207 * the source color. 208 * CAIRO_OPERATOR_COLOR_BURN 209 * darkens the destination color to reflect 210 * the source color. 211 * CAIRO_OPERATOR_HARD_LIGHT 212 * Multiplies or screens, dependant on source 213 * color. 214 * CAIRO_OPERATOR_SOFT_LIGHT 215 * Darkens or lightens, dependant on source 216 * color. 217 * CAIRO_OPERATOR_DIFFERENCE 218 * Takes the difference of the source and 219 * destination color. 220 * CAIRO_OPERATOR_EXCLUSION 221 * Produces an effect similar to difference, but 222 * with lower contrast. 223 * CAIRO_OPERATOR_HSL_HUE 224 * Creates a color with the hue of the source 225 * and the saturation and luminosity of the target. 226 * CAIRO_OPERATOR_HSL_SATURATION 227 * Creates a color with the saturation 228 * of the source and the hue and luminosity of the target. Painting with 229 * this mode onto a gray area prduces no change. 230 * CAIRO_OPERATOR_HSL_COLOR 231 * Creates a color with the hue and saturation 232 * of the source and the luminosity of the target. This preserves the gray 233 * levels of the target and is useful for coloring monochrome images or 234 * tinting color images. 235 * CAIRO_OPERATOR_HSL_LUMINOSITY 236 * Creates a color with the luminosity of 237 * the source and the hue and saturation of the target. This produces an 238 * inverse effect to CAIRO_OPERATOR_HSL_COLOR. 239 */ 240 public enum cairo_operator_t 241 { 242 CLEAR, 243 SOURCE, 244 OVER, 245 IN, 246 OUT, 247 ATOP, 248 DEST, 249 DEST_OVER, 250 DEST_IN, 251 DEST_OUT, 252 DEST_ATOP, 253 XOR, 254 ADD, 255 SATURATE, 256 MULTIPLY, 257 SCREEN, 258 OVERLAY, 259 DARKEN, 260 LIGHTEN, 261 COLOR_DODGE, 262 COLOR_BURN, 263 HARD_LIGHT, 264 SOFT_LIGHT, 265 DIFFERENCE, 266 EXCLUSION, 267 HSL_HUE, 268 HSL_SATURATION, 269 HSL_COLOR, 270 HSL_LUMINOSITY 271 } 272 alias cairo_operator_t CairoOperator; 273 274 /** 275 * cairo_path_data_t is used to describe the type of one portion 276 * of a path when represented as a cairo_path_t. 277 * See cairo_path_data_t for details. 278 * CAIRO_PATH_MOVE_TO 279 * A move-to operation 280 * CAIRO_PATH_LINE_TO 281 * A line-to operation 282 * CAIRO_PATH_CURVE_TO 283 * A curve-to operation 284 * CAIRO_PATH_CLOSE_PATH 285 * A close-path operation 286 */ 287 public enum cairo_path_data_type_t 288 { 289 MOVE_TO, 290 LINE_TO, 291 CURVE_TO, 292 CLOSE_PATH 293 } 294 alias cairo_path_data_type_t CairoPathDataType; 295 296 /** 297 * Specifies variants of a font face based on their slant. 298 * CAIRO_FONT_SLANT_NORMAL 299 * Upright font style 300 * CAIRO_FONT_SLANT_ITALIC 301 * Italic font style 302 * CAIRO_FONT_SLANT_OBLIQUE 303 * Oblique font style 304 */ 305 public enum cairo_font_slant_t 306 { 307 NORMAL, 308 ITALIC, 309 OBLIQUE 310 } 311 alias cairo_font_slant_t CairoFontSlant; 312 313 /** 314 * Specifies variants of a font face based on their weight. 315 * CAIRO_FONT_WEIGHT_NORMAL 316 * Normal font weight 317 * CAIRO_FONT_WEIGHT_BOLD 318 * Bold font weight 319 */ 320 public enum cairo_font_weight_t 321 { 322 NORMAL, 323 BOLD 324 } 325 alias cairo_font_weight_t CairoFontWeight; 326 327 /** 328 * Specifies properties of a text cluster mapping. 329 * CAIRO_TEXT_CLUSTER_FLAG_BACKWARD 330 * The clusters in the cluster array 331 * map to glyphs in the glyph array from end to start. 332 * Since 1.8 333 */ 334 public enum cairo_text_cluster_flags_t 335 { 336 BACKWARD = 0x00000001 337 } 338 alias cairo_text_cluster_flags_t CairoTextClusterFlags; 339 340 /** 341 * cairo_extend_t is used to describe how pattern color/alpha will be 342 * determined for areas "outside" the pattern's natural area, (for 343 * example, outside the surface bounds or outside the gradient 344 * geometry). 345 * The default extend mode is CAIRO_EXTEND_NONE for surface patterns 346 * and CAIRO_EXTEND_PAD for gradient patterns. 347 * New entries may be added in future versions. 348 * CAIRO_EXTEND_NONE 349 * pixels outside of the source pattern 350 * are fully transparent 351 * CAIRO_EXTEND_REPEAT 352 * the pattern is tiled by repeating 353 * CAIRO_EXTEND_REFLECT 354 * the pattern is tiled by reflecting 355 * at the edges (Implemented for surface patterns since 1.6) 356 * CAIRO_EXTEND_PAD 357 * pixels outside of the pattern copy 358 * the closest pixel from the source (Since 1.2; but only 359 * implemented for surface patterns since 1.6) 360 */ 361 public enum cairo_extend_t 362 { 363 NONE, 364 REPEAT, 365 REFLECT, 366 PAD 367 } 368 alias cairo_extend_t CairoExtend; 369 370 /** 371 * cairo_filter_t is used to indicate what filtering should be 372 * applied when reading pixel values from patterns. See 373 * cairo_pattern_set_source() for indicating the desired filter to be 374 * used with a particular pattern. 375 * CAIRO_FILTER_FAST 376 * A high-performance filter, with quality similar 377 * to CAIRO_FILTER_NEAREST 378 * CAIRO_FILTER_GOOD 379 * A reasonable-performance filter, with quality 380 * similar to CAIRO_FILTER_BILINEAR 381 * CAIRO_FILTER_BEST 382 * The highest-quality available, performance may 383 * not be suitable for interactive use. 384 * CAIRO_FILTER_NEAREST 385 * Nearest-neighbor filtering 386 * CAIRO_FILTER_BILINEAR 387 * Linear interpolation in two dimensions 388 * CAIRO_FILTER_GAUSSIAN 389 * This filter value is currently 390 * unimplemented, and should not be used in current code. 391 */ 392 public enum cairo_filter_t 393 { 394 FAST, 395 GOOD, 396 BEST, 397 NEAREST, 398 BILINEAR, 399 GAUSSIAN 400 } 401 alias cairo_filter_t CairoFilter; 402 403 /** 404 * cairo_pattern_type_t is used to describe the type of a given pattern. 405 * The type of a pattern is determined by the function used to create 406 * it. The cairo_pattern_create_rgb() and cairo_pattern_create_rgba() 407 * functions create SOLID patterns. The remaining 408 * cairo_pattern_create functions map to pattern types in obvious 409 * ways. 410 * The pattern type can be queried with cairo_pattern_get_type() 411 * Most cairo_pattern_t functions can be called with a pattern of any 412 * type, (though trying to change the extend or filter for a solid 413 * pattern will have no effect). A notable exception is 414 * cairo_pattern_add_color_stop_rgb() and 415 * cairo_pattern_add_color_stop_rgba() which must only be called with 416 * gradient patterns (either LINEAR or RADIAL). Otherwise the pattern 417 * will be shutdown and put into an error state. 418 * New entries may be added in future versions. 419 * CAIRO_PATTERN_TYPE_SOLID 420 * The pattern is a solid (uniform) 421 * color. It may be opaque or translucent. 422 * CAIRO_PATTERN_TYPE_SURFACE 423 * The pattern is a based on a surface (an image). 424 * CAIRO_PATTERN_TYPE_LINEAR 425 * The pattern is a linear gradient. 426 * CAIRO_PATTERN_TYPE_RADIAL 427 * The pattern is a radial gradient. 428 * Since 1.2 429 */ 430 public enum cairo_pattern_type_t 431 { 432 SOLID, 433 SURFACE, 434 LINEAR, 435 RADIAL 436 } 437 alias cairo_pattern_type_t CairoPatternType; 438 439 /** 440 * Used as the return value for cairo_region_contains_rectangle(). 441 * CAIRO_REGION_OVERLAP_IN 442 * The contents are entirely inside the region 443 * CAIRO_REGION_OVERLAP_OUT 444 * The contents are entirely outside the region 445 * CAIRO_REGION_OVERLAP_PART 446 * The contents are partially inside and 447 * partially outside the region. 448 */ 449 public enum cairo_region_overlap_t 450 { 451 IN, /+* completely inside region +/ 452 OUT, /+* completely outside region +/ 453 PART /+* partly inside region +/ 454 } 455 alias cairo_region_overlap_t CairoRegionOverlap; 456 457 /** 458 * cairo_font_type_t is used to describe the type of a given font 459 * face or scaled font. The font types are also known as "font 460 * backends" within cairo. 461 * The type of a font face is determined by the function used to 462 * create it, which will generally be of the form 463 * cairo_type_font_face_create(). The font face type can be queried 464 * with cairo_font_face_get_type() 465 * The various cairo_font_face_t functions can be used with a font face 466 * of any type. 467 * The type of a scaled font is determined by the type of the font 468 * face passed to cairo_scaled_font_create(). The scaled font type can 469 * be queried with cairo_scaled_font_get_type() 470 * The various cairo_scaled_font_t functions can be used with scaled 471 * fonts of any type, but some font backends also provide 472 * type-specific functions that must only be called with a scaled font 473 * of the appropriate type. These functions have names that begin with 474 * cairo_type_scaled_font() such as cairo_ft_scaled_font_lock_face(). 475 * The behavior of calling a type-specific function with a scaled font 476 * of the wrong type is undefined. 477 * New entries may be added in future versions. 478 * CAIRO_FONT_TYPE_TOY 479 * The font was created using cairo's toy font api 480 * CAIRO_FONT_TYPE_FT 481 * The font is of type FreeType 482 * CAIRO_FONT_TYPE_WIN32 483 * The font is of type Win32 484 * CAIRO_FONT_TYPE_QUARTZ 485 * The font is of type Quartz (Since: 1.6) 486 * CAIRO_FONT_TYPE_USER 487 * The font was create using cairo's user font api (Since: 1.8) 488 * Since 1.2 489 */ 490 public enum cairo_font_type_t 491 { 492 TOY, 493 FT, 494 WIN32, 495 QUARTZ, 496 USER 497 } 498 alias cairo_font_type_t CairoFontType; 499 500 /** 501 * The subpixel order specifies the order of color elements within 502 * each pixel on the display device when rendering with an 503 * antialiasing mode of CAIRO_ANTIALIAS_SUBPIXEL. 504 * CAIRO_SUBPIXEL_ORDER_DEFAULT 505 * Use the default subpixel order for 506 * for the target device 507 * CAIRO_SUBPIXEL_ORDER_RGB 508 * Subpixel elements are arranged horizontally 509 * with red at the left 510 * CAIRO_SUBPIXEL_ORDER_BGR 511 * Subpixel elements are arranged horizontally 512 * with blue at the left 513 * CAIRO_SUBPIXEL_ORDER_VRGB 514 * Subpixel elements are arranged vertically 515 * with red at the top 516 * CAIRO_SUBPIXEL_ORDER_VBGR 517 * Subpixel elements are arranged vertically 518 * with blue at the top 519 */ 520 public enum cairo_subpixel_order_t 521 { 522 DEFAULT, 523 RGB, 524 BGR, 525 VRGB, 526 VBGR 527 } 528 alias cairo_subpixel_order_t CairoSubpixelOrder; 529 530 /** 531 * Specifies the type of hinting to do on font outlines. Hinting 532 * is the process of fitting outlines to the pixel grid in order 533 * to improve the appearance of the result. Since hinting outlines 534 * involves distorting them, it also reduces the faithfulness 535 * to the original outline shapes. Not all of the outline hinting 536 * styles are supported by all font backends. 537 * New entries may be added in future versions. 538 * CAIRO_HINT_STYLE_DEFAULT 539 * Use the default hint style for 540 * font backend and target device 541 * CAIRO_HINT_STYLE_NONE 542 * Do not hint outlines 543 * CAIRO_HINT_STYLE_SLIGHT 544 * Hint outlines slightly to improve 545 * contrast while retaining good fidelity to the original 546 * shapes. 547 * CAIRO_HINT_STYLE_MEDIUM 548 * Hint outlines with medium strength 549 * giving a compromise between fidelity to the original shapes 550 * and contrast 551 * CAIRO_HINT_STYLE_FULL 552 * Hint outlines to maximize contrast 553 */ 554 public enum cairo_hint_style_t 555 { 556 DEFAULT, 557 NONE, 558 SLIGHT, 559 MEDIUM, 560 FULL 561 } 562 alias cairo_hint_style_t CairoHintStyle; 563 564 /** 565 * Specifies whether to hint font metrics; hinting font metrics 566 * means quantizing them so that they are integer values in 567 * device space. Doing this improves the consistency of 568 * letter and line spacing, however it also means that text 569 * will be laid out differently at different zoom factors. 570 * CAIRO_HINT_METRICS_DEFAULT 571 * Hint metrics in the default 572 * manner for the font backend and target device 573 * CAIRO_HINT_METRICS_OFF 574 * Do not hint font metrics 575 * CAIRO_HINT_METRICS_ON 576 * Hint font metrics 577 */ 578 public enum cairo_hint_metrics_t 579 { 580 DEFAULT, 581 OFF, 582 ON 583 } 584 alias cairo_hint_metrics_t CairoHintMetrics; 585 586 /** 587 * cairo_device_type_t is used to describe the type of a given 588 * device. The devices types are also known as "backends" within cairo. 589 * The device type can be queried with cairo_device_get_type() 590 * The various cairo_device_t functions can be used with surfaces of 591 * any type, but some backends also provide type-specific functions 592 * that must only be called with a device of the appropriate 593 * type. These functions have names that begin with 594 * cairo_type_device such as cairo_xcb_device_debug_set_render_version(). 595 * The behavior of calling a type-specific function with a surface of 596 * the wrong type is undefined. 597 * New entries may be added in future versions. 598 * CAIRO_DEVICE_TYPE_DRM 599 * The surface is of type Direct Render Manager 600 * CAIRO_DEVICE_TYPE_GL 601 * The surface is of type OpenGL 602 * CAIRO_DEVICE_TYPE_SCRIPT 603 * The surface is of type script 604 * CAIRO_DEVICE_TYPE_XCB 605 * The surface is of type xcb 606 * CAIRO_DEVICE_TYPE_XLIB 607 * The surface is of type xlib 608 * CAIRO_DEVICE_TYPE_XML 609 * The surface is of type XML 610 * cairo_surface_create_for_rectangle() 611 * Since 1.10 612 */ 613 public enum cairo_device_type_t 614 { 615 DRM, 616 GL, 617 SCRIPT, 618 XCB, 619 XLIB, 620 XML 621 } 622 alias cairo_device_type_t CairoDeviceType; 623 624 /** 625 * cairo_content_t is used to describe the content that a surface will 626 * contain, whether color information, alpha information (translucence 627 * vs. opacity), or both. 628 * Note: The large values here are designed to keep cairo_content_t 629 * values distinct from cairo_format_t values so that the 630 * implementation can detect the error if users confuse the two types. 631 * CAIRO_CONTENT_COLOR 632 * The surface will hold color content only. 633 * CAIRO_CONTENT_ALPHA 634 * The surface will hold alpha content only. 635 * CAIRO_CONTENT_COLOR_ALPHA 636 * The surface will hold color and alpha content. 637 */ 638 public enum cairo_content_t 639 { 640 COLOR = 0x1000, 641 ALPHA = 0x2000, 642 COLOR_ALPHA = 0x3000 643 } 644 alias cairo_content_t CairoContent; 645 646 /** 647 * cairo_surface_type_t is used to describe the type of a given 648 * surface. The surface types are also known as "backends" or "surface 649 * backends" within cairo. 650 * The type of a surface is determined by the function used to create 651 * it, which will generally be of the form cairo_type_surface_create(), 652 * (though see cairo_surface_create_similar() as well). 653 * The surface type can be queried with cairo_surface_get_type() 654 * The various cairo_surface_t functions can be used with surfaces of 655 * any type, but some backends also provide type-specific functions 656 * that must only be called with a surface of the appropriate 657 * type. These functions have names that begin with 658 * cairo_type_surface such as cairo_image_surface_get_width(). 659 * The behavior of calling a type-specific function with a surface of 660 * the wrong type is undefined. 661 * New entries may be added in future versions. 662 * CAIRO_SURFACE_TYPE_IMAGE 663 * The surface is of type image 664 * CAIRO_SURFACE_TYPE_PDF 665 * The surface is of type pdf 666 * CAIRO_SURFACE_TYPE_PS 667 * The surface is of type ps 668 * CAIRO_SURFACE_TYPE_XLIB 669 * The surface is of type xlib 670 * CAIRO_SURFACE_TYPE_XCB 671 * The surface is of type xcb 672 * CAIRO_SURFACE_TYPE_GLITZ 673 * The surface is of type glitz 674 * CAIRO_SURFACE_TYPE_QUARTZ 675 * The surface is of type quartz 676 * CAIRO_SURFACE_TYPE_WIN32 677 * The surface is of type win32 678 * CAIRO_SURFACE_TYPE_BEOS 679 * The surface is of type beos 680 * CAIRO_SURFACE_TYPE_DIRECTFB 681 * The surface is of type directfb 682 * CAIRO_SURFACE_TYPE_SVG 683 * The surface is of type svg 684 * CAIRO_SURFACE_TYPE_OS2 685 * The surface is of type os2 686 * CAIRO_SURFACE_TYPE_WIN32_PRINTING 687 * The surface is a win32 printing surface 688 * CAIRO_SURFACE_TYPE_QUARTZ_IMAGE 689 * The surface is of type quartz_image 690 * CAIRO_SURFACE_TYPE_SCRIPT 691 * The surface is of type script, since 1.10 692 * CAIRO_SURFACE_TYPE_QT 693 * The surface is of type Qt, since 1.10 694 * CAIRO_SURFACE_TYPE_RECORDING 695 * The surface is of type recording, since 1.10 696 * CAIRO_SURFACE_TYPE_VG 697 * The surface is a OpenVG surface, since 1.10 698 * CAIRO_SURFACE_TYPE_GL 699 * The surface is of type OpenGL, since 1.10 700 * CAIRO_SURFACE_TYPE_DRM 701 * The surface is of type Direct Render Manager, since 1.10 702 * CAIRO_SURFACE_TYPE_TEE 703 * The surface is of type 'tee' (a multiplexing surface), since 1.10 704 * CAIRO_SURFACE_TYPE_XML 705 * The surface is of type XML (for debugging), since 1.10 706 * CAIRO_SURFACE_TYPE_SKIA 707 * The surface is of type Skia, since 1.10 708 * CAIRO_SURFACE_TYPE_SUBSURFACE 709 * The surface is a subsurface created with 710 * cairo_surface_create_for_rectangle(), since 1.10 711 * Since 1.2 712 */ 713 public enum cairo_surface_type_t 714 { 715 IMAGE, 716 PDF, 717 PS, 718 XLIB, 719 XCB, 720 GLITZ, 721 QUARTZ, 722 WIN32, 723 BEOS, 724 DIRECTFB, 725 SVG, 726 OS2, 727 WIN32_PRINTING, 728 QUARTZ_IMAGE, 729 SCRIPT, 730 QT, 731 RECORDING, 732 VG, 733 GL, 734 DRM, 735 TEE, 736 XML, 737 SKIA, 738 SUBSURFACE 739 } 740 alias cairo_surface_type_t CairoSurfaceType; 741 742 /** 743 * cairo_format_t is used to identify the memory format of 744 * image data. 745 * New entries may be added in future versions. 746 * CAIRO_FORMAT_INVALID 747 * no such format exists or is supported. 748 * CAIRO_FORMAT_ARGB32 749 * each pixel is a 32-bit quantity, with 750 * alpha in the upper 8 bits, then red, then green, then blue. 751 * The 32-bit quantities are stored native-endian. Pre-multiplied 752 * alpha is used. (That is, 50% transparent red is 0x80800000, 753 * not 0x80ff0000.) 754 * CAIRO_FORMAT_RGB24 755 * each pixel is a 32-bit quantity, with 756 * the upper 8 bits unused. Red, Green, and Blue are stored 757 * in the remaining 24 bits in that order. 758 * CAIRO_FORMAT_A8 759 * each pixel is a 8-bit quantity holding 760 * an alpha value. 761 * CAIRO_FORMAT_A1 762 * each pixel is a 1-bit quantity holding 763 * an alpha value. Pixels are packed together into 32-bit 764 * quantities. The ordering of the bits matches the 765 * endianess of the platform. On a big-endian machine, the 766 * first pixel is in the uppermost bit, on a little-endian 767 * machine the first pixel is in the least-significant bit. 768 * CAIRO_FORMAT_RGB16_565 769 * each pixel is a 16-bit quantity 770 * with red in the upper 5 bits, then green in the middle 771 * 6 bits, and blue in the lower 5 bits. 772 */ 773 public enum cairo_format_t 774 { 775 INVALID = -1, 776 ARGB32 = 0, 777 RGB24 = 1, 778 A8 = 2, 779 A1 = 3, 780 RGB16_565 = 4 781 } 782 alias cairo_format_t CairoFormat; 783 784 /** 785 * cairo_pdf_version_t is used to describe the version number of the PDF 786 * specification that a generated PDF file will conform to. 787 * Since 1.10 788 * CAIRO_PDF_VERSION_1_4 789 * The version 1.4 of the PDF specification. 790 * CAIRO_PDF_VERSION_1_5 791 * The version 1.5 of the PDF specification. 792 */ 793 public enum cairo_pdf_version_t 794 { 795 VERSION_1_4, 796 VERSION_1_5 797 } 798 alias cairo_pdf_version_t CairoPdfVersion; 799 800 /** 801 * cairo_ps_level_t is used to describe the language level of the 802 * PostScript Language Reference that a generated PostScript file will 803 * conform to. 804 * CAIRO_PS_LEVEL_2 805 * The language level 2 of the PostScript specification. 806 * CAIRO_PS_LEVEL_3 807 * The language level 3 of the PostScript specification. 808 */ 809 public enum cairo_ps_level_t 810 { 811 LEVEL_2, 812 LEVEL_3 813 } 814 alias cairo_ps_level_t CairoPsLevel; 815 816 /** 817 * cairo_svg_version_t is used to describe the version number of the SVG 818 * specification that a generated SVG file will conform to. 819 * CAIRO_SVG_VERSION_1_1 820 * The version 1.1 of the SVG specification. 821 * CAIRO_SVG_VERSION_1_2 822 * The version 1.2 of the SVG specification. 823 */ 824 public enum cairo_svg_version_t 825 { 826 VERSION_1_1, 827 VERSION_1_2 828 } 829 alias cairo_svg_version_t CairoSvgVersion; 830 831 /** 832 * cairo_status_t is used to indicate errors that can occur when 833 * using Cairo. In some cases it is returned directly by functions. 834 * but when using cairo_t, the last error, if any, is stored in 835 * the context and can be retrieved with cairo_status(). 836 * New entries may be added in future versions. Use cairo_status_to_string() 837 * to get a human-readable representation of an error message. 838 * CAIRO_STATUS_SUCCESS 839 * no error has occurred 840 * CAIRO_STATUS_NO_MEMORY 841 * out of memory 842 * CAIRO_STATUS_INVALID_RESTORE 843 * cairo_restore() called without matching cairo_save() 844 * CAIRO_STATUS_INVALID_POP_GROUP 845 * no saved group to pop, i.e. cairo_pop_group() without matching cairo_push_group() 846 * CAIRO_STATUS_NO_CURRENT_POINT 847 * no current point defined 848 * CAIRO_STATUS_INVALID_MATRIX 849 * invalid matrix (not invertible) 850 * CAIRO_STATUS_INVALID_STATUS 851 * invalid value for an input cairo_status_t 852 * CAIRO_STATUS_NULL_POINTER 853 * NULL pointer 854 * CAIRO_STATUS_INVALID_STRING 855 * input string not valid UTF-8 856 * CAIRO_STATUS_INVALID_PATH_DATA 857 * input path data not valid 858 * CAIRO_STATUS_READ_ERROR 859 * error while reading from input stream 860 * CAIRO_STATUS_WRITE_ERROR 861 * error while writing to output stream 862 * CAIRO_STATUS_SURFACE_FINISHED 863 * target surface has been finished 864 * CAIRO_STATUS_SURFACE_TYPE_MISMATCH 865 * the surface type is not appropriate for the operation 866 * CAIRO_STATUS_PATTERN_TYPE_MISMATCH 867 * the pattern type is not appropriate for the operation 868 * CAIRO_STATUS_INVALID_CONTENT 869 * invalid value for an input cairo_content_t 870 * CAIRO_STATUS_INVALID_FORMAT 871 * invalid value for an input cairo_format_t 872 * CAIRO_STATUS_INVALID_VISUAL 873 * invalid value for an input Visual* 874 * CAIRO_STATUS_FILE_NOT_FOUND 875 * file not found 876 * CAIRO_STATUS_INVALID_DASH 877 * invalid value for a dash setting 878 * CAIRO_STATUS_INVALID_DSC_COMMENT 879 * invalid value for a DSC comment (Since 1.2) 880 * CAIRO_STATUS_INVALID_INDEX 881 * invalid index passed to getter (Since 1.4) 882 * CAIRO_STATUS_CLIP_NOT_REPRESENTABLE 883 * clip region not representable in desired format (Since 1.4) 884 * CAIRO_STATUS_TEMP_FILE_ERROR 885 * error creating or writing to a temporary file (Since 1.6) 886 * CAIRO_STATUS_INVALID_STRIDE 887 * invalid value for stride (Since 1.6) 888 * CAIRO_STATUS_FONT_TYPE_MISMATCH 889 * the font type is not appropriate for the operation (Since 1.8) 890 * CAIRO_STATUS_USER_FONT_IMMUTABLE 891 * the user-font is immutable (Since 1.8) 892 * CAIRO_STATUS_USER_FONT_ERROR 893 * error occurred in a user-font callback function (Since 1.8) 894 * CAIRO_STATUS_NEGATIVE_COUNT 895 * negative number used where it is not allowed (Since 1.8) 896 * CAIRO_STATUS_INVALID_CLUSTERS 897 * input clusters do not represent the accompanying text and glyph array (Since 1.8) 898 * CAIRO_STATUS_INVALID_SLANT 899 * invalid value for an input cairo_font_slant_t (Since 1.8) 900 * CAIRO_STATUS_INVALID_WEIGHT 901 * invalid value for an input cairo_font_weight_t (Since 1.8) 902 * CAIRO_STATUS_INVALID_SIZE 903 * invalid value (typically too big) for the size of the input (surface, pattern, etc.) (Since 1.10) 904 * CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED 905 * user-font method not implemented (Since 1.10) 906 * CAIRO_STATUS_DEVICE_TYPE_MISMATCH 907 * the device type is not appropriate for the operation (Since 1.10) 908 * CAIRO_STATUS_DEVICE_ERROR 909 * an operation to the device caused an unspecified error (Since 1.10) 910 * CAIRO_STATUS_LAST_STATUS 911 * this is a special value indicating the number of 912 * status values defined in this enumeration. When using this value, note 913 * that the version of cairo at run-time may have additional status values 914 * defined than the value of this symbol at compile-time. (Since 1.10) 915 */ 916 public enum cairo_status_t 917 { 918 SUCCESS = 0, 919 NO_MEMORY, 920 INVALID_RESTORE, 921 INVALID_POP_GROUP, 922 NO_CURRENT_POINT, 923 INVALID_MATRIX, 924 INVALID_STATUS, 925 NULL_POINTER, 926 INVALID_STRING, 927 INVALID_PATH_DATA, 928 READ_ERROR, 929 WRITE_ERROR, 930 SURFACE_FINISHED, 931 SURFACE_TYPE_MISMATCH, 932 PATTERN_TYPE_MISMATCH, 933 INVALID_CONTENT, 934 INVALID_FORMAT, 935 INVALID_VISUAL, 936 FILE_NOT_FOUND, 937 INVALID_DASH, 938 INVALID_DSC_COMMENT, 939 INVALID_INDEX, 940 CLIP_NOT_REPRESENTABLE, 941 TEMP_FILE_ERROR, 942 INVALID_STRIDE, 943 FONT_TYPE_MISMATCH, 944 USER_FONT_IMMUTABLE, 945 USER_FONT_ERROR, 946 NEGATIVE_COUNT, 947 INVALID_CLUSTERS, 948 INVALID_SLANT, 949 INVALID_WEIGHT, 950 INVALID_SIZE, 951 USER_FONT_NOT_IMPLEMENTED, 952 DEVICE_TYPE_MISMATCH, 953 DEVICE_ERROR, 954 LAST_STATUS 955 } 956 alias cairo_status_t CairoStatus; 957 958 959 /** 960 * Main Gtk struct. 961 * A cairo_t contains the current state of the rendering device, 962 * including coordinates of yet to be drawn shapes. 963 * Cairo contexts, as cairo_t objects are named, are central to 964 * cairo and all drawing with cairo is always done to a cairo_t 965 * object. 966 * Memory management of cairo_t is done with 967 * cairo_reference() and cairo_destroy(). 968 */ 969 public struct cairo_t{} 970 971 972 /** 973 * A data structure for holding a rectangle. 974 * double x; 975 * X coordinate of the left side of the rectangle 976 * double y; 977 * Y coordinate of the the top side of the rectangle 978 * double width; 979 * width of the rectangle 980 * double height; 981 * height of the rectangle 982 * Since 1.4 983 */ 984 public struct cairo_rectangle_t 985 { 986 double x, y, width, height; 987 } 988 989 990 /** 991 * A data structure for holding a dynamically allocated 992 * array of rectangles. 993 * cairo_status_t status; 994 * Error status of the rectangle list 995 * cairo_rectangle_t *rectangles; 996 * Array containing the rectangles 997 * int num_rectangles; 998 * Number of rectangles in this list 999 * Since 1.4 1000 */ 1001 public struct cairo_rectangle_list_t 1002 { 1003 cairo_status_t status; 1004 cairo_rectangle_t *rectangles; 1005 int numRectangles; 1006 } 1007 1008 1009 /** 1010 * A data structure for holding a path. This data structure serves as 1011 * the return value for cairo_copy_path() and 1012 * cairo_copy_path_flat() as well the input value for 1013 * cairo_append_path(). 1014 * See cairo_path_data_t for hints on how to iterate over the 1015 * actual data within the path. 1016 * The num_data member gives the number of elements in the data 1017 * array. This number is larger than the number of independent path 1018 * portions (defined in cairo_path_data_type_t), since the data 1019 * includes both headers and coordinates for each portion. 1020 * cairo_status_t status; 1021 * the current error status 1022 * cairo_path_data_t *data; 1023 * the elements in the path 1024 * int num_data; 1025 * the number of elements in the data array 1026 */ 1027 public struct cairo_path_t 1028 { 1029 cairo_status_t status; 1030 cairo_path_data_t *data; 1031 int numData; 1032 } 1033 1034 1035 /** 1036 * The cairo_glyph_t structure holds information about a single glyph 1037 * when drawing or measuring text. A font is (in simple terms) a 1038 * collection of shapes used to draw text. A glyph is one of these 1039 * shapes. There can be multiple glyphs for a single character 1040 * (alternates to be used in different contexts, for example), or a 1041 * glyph can be a ligature of multiple 1042 * characters. Cairo doesn't expose any way of converting input text 1043 * into glyphs, so in order to use the Cairo interfaces that take 1044 * arrays of glyphs, you must directly access the appropriate 1045 * underlying font system. 1046 * Note that the offsets given by x and y are not cumulative. When 1047 * drawing or measuring text, each glyph is individually positioned 1048 * with respect to the overall origin 1049 * unsigned long index; 1050 * glyph index in the font. The exact interpretation of the 1051 */ 1052 public struct cairo_glyph_t 1053 { 1054 ulong index; 1055 double x; 1056 double y; 1057 } 1058 1059 1060 /** 1061 * The cairo_text_cluster_t structure holds information about a single 1062 * text cluster. A text cluster is a minimal 1063 * mapping of some glyphs corresponding to some UTF-8 text. 1064 * For a cluster to be valid, both num_bytes and num_glyphs should 1065 * be non-negative, and at least one should be non-zero. 1066 * Note that clusters with zero glyphs are not as well supported as 1067 * normal clusters. For example, PDF rendering applications typically 1068 * ignore those clusters when PDF text is being selected. 1069 * See cairo_show_text_glyphs() for how clusters are used in advanced 1070 * text operations. 1071 * int num_bytes; 1072 * the number of bytes of UTF-8 text covered by cluster 1073 * int num_glyphs; 1074 * the number of glyphs covered by cluster 1075 * Since 1.8 1076 */ 1077 public struct cairo_text_cluster_t 1078 { 1079 int numBytes; 1080 int numGlyphs; 1081 } 1082 1083 1084 /** 1085 * Main Gtk struct. 1086 * A cairo_pattern_t represents a source when drawing onto a 1087 * surface. There are different subtypes of cairo_pattern_t, 1088 * for different types of sources; for example, 1089 * cairo_pattern_create_rgb() creates a pattern for a solid 1090 * opaque color. 1091 * Other than various cairo_pattern_create_type() 1092 * functions, some of the pattern types can be implicitly created 1093 * using various cairo_set_source_type() functions; 1094 * for example cairo_set_source_rgb(). 1095 * The type of a pattern can be queried with cairo_pattern_get_type(). 1096 * Memory management of cairo_pattern_t is done with 1097 * cairo_pattern_reference() and cairo_pattern_destroy(). 1098 */ 1099 public struct cairo_pattern_t{} 1100 1101 1102 /** 1103 * Main Gtk struct. 1104 * A cairo_region_t represents a set of integer-aligned rectangles. 1105 * It allows set-theoretical operations like cairo_region_union() and 1106 * cairo_region_intersect() to be performed on them. 1107 * Memory management of cairo_region_t is done with 1108 * cairo_region_reference() and cairo_region_destroy(). 1109 * Since 1.10 1110 */ 1111 public struct cairo_region_t{} 1112 1113 1114 /** 1115 * Main Gtk struct. 1116 * A cairo_font_face_t specifies all aspects of a font other 1117 * than the size or font matrix (a font matrix is used to distort 1118 * a font by sheering it or scaling it unequally in the two 1119 * directions) . A font face can be set on a cairo_t by using 1120 * cairo_set_font_face(); the size and font matrix are set with 1121 * cairo_set_font_size() and cairo_set_font_matrix(). 1122 * There are various types of font faces, depending on the 1123 * font backend they use. The type of a 1124 * font face can be queried using cairo_font_face_get_type(). 1125 * Memory management of cairo_font_face_t is done with 1126 * cairo_font_face_reference() and cairo_font_face_destroy(). 1127 */ 1128 public struct cairo_font_face_t{} 1129 1130 1131 /** 1132 * Main Gtk struct. 1133 * A cairo_scaled_font_t is a font scaled to a particular size and device 1134 * resolution. A cairo_scaled_font_t is most useful for low-level font 1135 * usage where a library or application wants to cache a reference 1136 * to a scaled font to speed up the computation of metrics. 1137 * There are various types of scaled fonts, depending on the 1138 * font backend they use. The type of a 1139 * scaled font can be queried using cairo_scaled_font_get_type(). 1140 * Memory management of cairo_scaled_font_t is done with 1141 * cairo_scaled_font_reference() and cairo_scaled_font_destroy(). 1142 */ 1143 public struct cairo_scaled_font_t{} 1144 1145 1146 /** 1147 * The cairo_font_extents_t structure stores metric information for 1148 * a font. Values are given in the current user-space coordinate 1149 * system. 1150 * Because font metrics are in user-space coordinates, they are 1151 * mostly, but not entirely, independent of the current transformation 1152 * matrix. If you call cairo_scale(cr, 2.0, 2.0), 1153 * text will be drawn twice as big, but the reported text extents will 1154 * not be doubled. They will change slightly due to hinting (so you 1155 * can't assume that metrics are independent of the transformation 1156 * matrix), but otherwise will remain unchanged. 1157 * double ascent; 1158 * the distance that the font extends above the baseline. 1159 */ 1160 public struct cairo_font_extents_t 1161 { 1162 double ascent; 1163 double descent; 1164 double height; 1165 double maxXAdvance; 1166 double maxYAdvance; 1167 } 1168 1169 1170 /** 1171 * The cairo_text_extents_t structure stores the extents of a single 1172 * glyph or a string of glyphs in user-space coordinates. Because text 1173 * extents are in user-space coordinates, they are mostly, but not 1174 * entirely, independent of the current transformation matrix. If you call 1175 * cairo_scale(cr, 2.0, 2.0), text will 1176 * be drawn twice as big, but the reported text extents will not be 1177 * doubled. They will change slightly due to hinting (so you can't 1178 * assume that metrics are independent of the transformation matrix), 1179 * but otherwise will remain unchanged. 1180 * double x_bearing; 1181 * the horizontal distance from the origin to the 1182 */ 1183 public struct cairo_text_extents_t 1184 { 1185 double xBearing; 1186 double yBearing; 1187 double width; 1188 double height; 1189 double xAdvance; 1190 double yAdvance; 1191 } 1192 1193 1194 /** 1195 * Main Gtk struct. 1196 * An opaque structure holding all options that are used when 1197 * rendering fonts. 1198 * Individual features of a cairo_font_options_t can be set or 1199 * accessed using functions named 1200 * cairo_font_options_set_feature_name and 1201 * cairo_font_options_get_feature_name, like 1202 * cairo_font_options_set_antialias() and 1203 * cairo_font_options_get_antialias(). 1204 * New features may be added to a cairo_font_options_t in the 1205 * future. For this reason, cairo_font_options_copy(), 1206 * cairo_font_options_equal(), cairo_font_options_merge(), and 1207 * cairo_font_options_hash() should be used to copy, check 1208 * for equality, merge, or compute a hash value of 1209 * cairo_font_options_t objects. 1210 */ 1211 public struct cairo_font_options_t{} 1212 1213 1214 /** 1215 * Main Gtk struct. 1216 * A cairo_device_t represents the driver interface for drawing 1217 * operations to a cairo_surface_t. There are different subtypes of 1218 * cairo_device_t for different drawing backends; for example, 1219 * cairo_xcb_device_create() creates a device that wraps the connection 1220 * to an X Windows System using the XCB library. 1221 * The type of a device can be queried with cairo_device_get_type(). 1222 * Memory management of cairo_device_t is done with 1223 * cairo_device_reference() and cairo_device_destroy(). 1224 * Since 1.10 1225 */ 1226 public struct cairo_device_t{} 1227 1228 1229 /** 1230 * Main Gtk struct. 1231 * A cairo_surface_t represents an image, either as the destination 1232 * of a drawing operation or as source when drawing onto another 1233 * surface. To draw to a cairo_surface_t, create a cairo context 1234 * with the surface as the target, using cairo_create(). 1235 * There are different subtypes of cairo_surface_t for 1236 * different drawing backends; for example, cairo_image_surface_create() 1237 * creates a bitmap image in memory. 1238 * The type of a surface can be queried with cairo_surface_get_type(). 1239 * The initial contents of a surface after creation depend upon the manner 1240 * of its creation. If cairo creates the surface and backing storage for 1241 * the user, it will be initially cleared; for example, 1242 * cairo_image_surface_create() and cairo_surface_create_similar(). 1243 * Alternatively, if the user passes in a reference to some backing storage 1244 * and asks cairo to wrap that in a cairo_surface_t, then the contents are 1245 * not modified; for example, cairo_image_surface_create_for_data() and 1246 * cairo_xlib_surface_create(). 1247 * Memory management of cairo_surface_t is done with 1248 * cairo_surface_reference() and cairo_surface_destroy(). 1249 */ 1250 public struct cairo_surface_t{} 1251 1252 1253 /** 1254 * Main Gtk struct. 1255 * A cairo_matrix_t holds an affine transformation, such as a scale, 1256 * rotation, shear, or a combination of those. The transformation of 1257 * a point (x, y) is given by: 1258 */ 1259 public struct cairo_matrix_t 1260 { 1261 double xx; double yx; 1262 double xy; double yy; 1263 double x0; double y0; 1264 } 1265 1266 1267 /** 1268 * cairo_user_data_key_t is used for attaching user data to cairo 1269 * data structures. The actual contents of the struct is never used, 1270 * and there is no need to initialize the object; only the unique 1271 * address of a cairo_data_key_t object is used. Typically, you 1272 * would just use the address of a static cairo_data_key_t object. 1273 * int unused; 1274 * not used; ignore. 1275 */ 1276 public struct cairo_user_data_key_t 1277 { 1278 int unused; 1279 } 1280 1281 1282 /** 1283 * A data structure for holding a rectangle with integer coordinates. 1284 * int x; 1285 * X coordinate of the left side of the rectangle 1286 * int y; 1287 * Y coordinate of the the top side of the rectangle 1288 * int width; 1289 * width of the rectangle 1290 * int height; 1291 * height of the rectangle 1292 * Since 1.10 1293 */ 1294 public struct cairo_rectangle_int_t 1295 { 1296 int x, y; 1297 int width, height; 1298 } 1299 1300 1301 /* 1302 * This macro encodes the given cairo version into an integer. The numbers 1303 * returned by CAIRO_VERSION and cairo_version() are encoded using this macro. 1304 * Two encoded version numbers can be compared as integers. The encoding ensures 1305 * that later versions compare greater than earlier versions. 1306 * Returns: the encoded version. 1307 * major : 1308 * the major component of the version number 1309 * minor : 1310 * the minor component of the version number 1311 * micro : 1312 * the micro component of the version number 1313 */ 1314 // TODO 1315 // #define CAIRO_VERSION_ENCODE(major, minor, micro) 1316 1317 /* 1318 * This macro encodes the given cairo version into an string. The numbers 1319 * returned by CAIRO_VERSION_STRING and cairo_version_string() are encoded using this macro. 1320 * The parameters to this macro must expand to numerical literals. 1321 * Returns: a string literal containing the version. 1322 * Since: 1.8 1323 * major : 1324 * the major component of the version number 1325 * minor : 1326 * the minor component of the version number 1327 * micro : 1328 * the micro component of the version number 1329 */ 1330 // TODO 1331 // #define CAIRO_VERSION_STRINGIZE(major, minor, micro) 1332 1333 /* 1334 * cairo_user_scaled_font_init_func_t is the type of function which is 1335 * called when a scaled-font needs to be created for a user font-face. 1336 * The cairo context cr is not used by the caller, but is prepared in font 1337 * space, similar to what the cairo contexts passed to the render_glyph 1338 * method will look like. The callback can use this context for extents 1339 * computation for example. After the callback is called, cr is checked 1340 * for any error status. 1341 * The extents argument is where the user font sets the font extents for 1342 * scaled_font. It is in font space, which means that for most cases its 1343 * ascent and descent members should add to 1.0. extents is preset to 1344 * hold a value of 1.0 for ascent, height, and max_x_advance, and 0.0 for 1345 * descent and max_y_advance members. 1346 * The callback is optional. If not set, default font extents as described 1347 * in the previous paragraph will be used. 1348 * Note that scaled_font is not fully initialized at this 1349 * point and trying to use it for text operations in the callback will result 1350 * in deadlock. 1351 * scaled_font : 1352 * the scaled-font being created 1353 * cr : 1354 * a cairo context, in font space 1355 * extents : 1356 * font extents to fill in, in font space 1357 * Returns : 1358 * CAIRO_STATUS_SUCCESS upon success, or an error status on error. 1359 * Since 1.8 1360 */ 1361 // cairo_status_t (*cairo_user_scaled_font_init_func_t) (cairo_scaled_font_t *scaled_font, cairo_t *cr, cairo_font_extents_t *extents); 1362 public alias extern(C) cairo_status_t function(cairo_scaled_font_t* scaledFont, cairo_t* cr, cairo_font_extents_t* extents) cairo_user_scaled_font_init_func_t; 1363 1364 /* 1365 * cairo_user_scaled_font_render_glyph_func_t is the type of function which 1366 * is called when a user scaled-font needs to render a glyph. 1367 * The callback is mandatory, and expected to draw the glyph with code glyph to 1368 * the cairo context cr. cr is prepared such that the glyph drawing is done in 1369 * font space. That is, the matrix set on cr is the scale matrix of scaled_font, 1370 * The extents argument is where the user font sets the font extents for 1371 * scaled_font. However, if user prefers to draw in user space, they can 1372 * achieve that by changing the matrix on cr. All cairo rendering operations 1373 * to cr are permitted, however, the result is undefined if any source other 1374 * than the default source on cr is used. That means, glyph bitmaps should 1375 * be rendered using cairo_mask() instead of cairo_paint(). 1376 * Other non-default settings on cr include a font size of 1.0 (given that 1377 * it is set up to be in font space), and font options corresponding to 1378 * scaled_font. 1379 * The extents argument is preset to have x_bearing, 1380 * width, and y_advance of zero, 1381 * y_bearing set to -font_extents.ascent, 1382 * height to font_extents.ascent+font_extents.descent, 1383 * and x_advance to font_extents.max_x_advance. 1384 * The only field user needs to set in majority of cases is 1385 * x_advance. 1386 * If the width field is zero upon the callback returning 1387 * (which is its preset value), the glyph extents are automatically computed 1388 * based on the drawings done to cr. This is in most cases exactly what the 1389 * desired behavior is. However, if for any reason the callback sets the 1390 * extents, it must be ink extents, and include the extents of all drawing 1391 * done to cr in the callback. 1392 * scaled_font : 1393 * user scaled-font 1394 * glyph : 1395 * glyph code to render 1396 * cr : 1397 * cairo context to draw to, in font space 1398 * extents : 1399 * glyph extents to fill in, in font space 1400 * Returns : 1401 * CAIRO_STATUS_SUCCESS upon success, or 1402 * CAIRO_STATUS_USER_FONT_ERROR or any other error status on error. 1403 * Since 1.8 1404 */ 1405 // cairo_status_t (*cairo_user_scaled_font_render_glyph_func_t) (cairo_scaled_font_t *scaled_font, unsigned long glyph, cairo_t *cr, cairo_text_extents_t *extents); 1406 public alias extern(C) cairo_status_t function(cairo_scaled_font_t* scaledFont, ulong glyph, cairo_t* cr, cairo_text_extents_t* extents) cairo_user_scaled_font_render_glyph_func_t; 1407 1408 /* 1409 * cairo_user_scaled_font_text_to_glyphs_func_t is the type of function which 1410 * is called to convert input text to an array of glyphs. This is used by the 1411 * cairo_show_text() operation. 1412 * Using this callback the user-font has full control on glyphs and their 1413 * positions. That means, it allows for features like ligatures and kerning, 1414 * as well as complex shaping required for scripts like 1415 * Arabic and Indic. 1416 * The num_glyphs argument is preset to the number of glyph entries available 1417 * in the glyphs buffer. If the glyphs buffer is NULL, the value of 1418 * num_glyphs will be zero. If the provided glyph array is too short for 1419 * the conversion (or for convenience), a new glyph array may be allocated 1420 * using cairo_glyph_allocate() and placed in glyphs. Upon return, 1421 * num_glyphs should contain the number of generated glyphs. If the value 1422 * glyphs points at has changed after the call, the caller will free the 1423 * allocated glyph array using cairo_glyph_free(). 1424 * The callback should populate the glyph indices and positions (in font space) 1425 * assuming that the text is to be shown at the origin. 1426 * If clusters is not NULL, num_clusters and cluster_flags are also 1427 * non-NULL, and cluster mapping should be computed. The semantics of how 1428 * cluster array allocation works is similar to the glyph array. That is, 1429 * if clusters initially points to a non-NULL value, that array may be used 1430 * as a cluster buffer, and num_clusters points to the number of cluster 1431 * entries available there. If the provided cluster array is too short for 1432 * the conversion (or for convenience), a new cluster array may be allocated 1433 * using cairo_text_cluster_allocate() and placed in clusters. Upon return, 1434 * num_clusters should contain the number of generated clusters. 1435 * If the value clusters points at has changed after the call, the caller 1436 * will free the allocated cluster array using cairo_text_cluster_free(). 1437 * The callback is optional. If num_glyphs is negative upon 1438 * the callback returning or if the return value 1439 * is CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED, the unicode_to_glyph callback 1440 * is tried. See cairo_user_scaled_font_unicode_to_glyph_func_t. 1441 * Note: While cairo does not impose any limitation on glyph indices, 1442 * some applications may assume that a glyph index fits in a 16-bit 1443 * unsigned integer. As such, it is advised that user-fonts keep their 1444 * glyphs in the 0 to 65535 range. Furthermore, some applications may 1445 * assume that glyph 0 is a special glyph-not-found glyph. User-fonts 1446 * are advised to use glyph 0 for such purposes and do not use that 1447 * glyph value for other purposes. 1448 * scaled_font : 1449 * the scaled-font being created 1450 * utf8 : 1451 * a string of text encoded in UTF-8 1452 * utf8_len : 1453 * length of utf8 in bytes 1454 * glyphs : 1455 * pointer to array of glyphs to fill, in font space 1456 * num_glyphs : 1457 * pointer to number of glyphs 1458 * clusters : 1459 * pointer to array of cluster mapping information to fill, or NULL 1460 * num_clusters : 1461 * pointer to number of clusters 1462 * cluster_flags : 1463 * pointer to location to store cluster flags corresponding to the 1464 * output clusters 1465 * Returns : 1466 * CAIRO_STATUS_SUCCESS upon success, 1467 * CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED if fallback options should be tried, 1468 * or CAIRO_STATUS_USER_FONT_ERROR or any other error status on error. 1469 * Since 1.8 1470 */ 1471 // cairo_status_t (*cairo_user_scaled_font_text_to_glyphs_func_t) (cairo_scaled_font_t *scaled_font, const char *utf8, int utf8_len, cairo_glyph_t **glyphs, int *num_glyphs, cairo_text_cluster_t **clusters, int *num_clusters, cairo_text_cluster_flags_t *cluster_flags); 1472 public alias extern(C) cairo_status_t function(cairo_scaled_font_t* scaledFont, char* utf8, int utf8_Len, cairo_glyph_t** glyphs, int* numGlyphs, cairo_text_cluster_t** clusters, int* numClusters, cairo_text_cluster_flags_t* clusterFlags) cairo_user_scaled_font_text_to_glyphs_func_t; 1473 1474 /* 1475 * cairo_user_scaled_font_unicode_to_glyph_func_t is the type of function which 1476 * is called to convert an input Unicode character to a single glyph. 1477 * This is used by the cairo_show_text() operation. 1478 * This callback is used to provide the same functionality as the 1479 * text_to_glyphs callback does (see cairo_user_scaled_font_text_to_glyphs_func_t) 1480 * but has much less control on the output, 1481 * in exchange for increased ease of use. The inherent assumption to using 1482 * this callback is that each character maps to one glyph, and that the 1483 * mapping is context independent. It also assumes that glyphs are positioned 1484 * according to their advance width. These mean no ligatures, kerning, or 1485 * complex scripts can be implemented using this callback. 1486 * The callback is optional, and only used if text_to_glyphs callback is not 1487 * set or fails to return glyphs. If this callback is not set or if it returns 1488 * CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED, an identity mapping from Unicode 1489 * code-points to glyph indices is assumed. 1490 * Note: While cairo does not impose any limitation on glyph indices, 1491 * some applications may assume that a glyph index fits in a 16-bit 1492 * unsigned integer. As such, it is advised that user-fonts keep their 1493 * glyphs in the 0 to 65535 range. Furthermore, some applications may 1494 * assume that glyph 0 is a special glyph-not-found glyph. User-fonts 1495 * are advised to use glyph 0 for such purposes and do not use that 1496 * glyph value for other purposes. 1497 * scaled_font : 1498 * the scaled-font being created 1499 * unicode : 1500 * input unicode character code-point 1501 * glyph_index : 1502 * output glyph index 1503 * Returns : 1504 * CAIRO_STATUS_SUCCESS upon success, 1505 * CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED if fallback options should be tried, 1506 * or CAIRO_STATUS_USER_FONT_ERROR or any other error status on error. 1507 * Since 1.8 1508 */ 1509 // cairo_status_t (*cairo_user_scaled_font_unicode_to_glyph_func_t) (cairo_scaled_font_t *scaled_font, unsigned long unicode, unsigned long *glyph_index); 1510 public alias extern(C) cairo_status_t function(cairo_scaled_font_t* scaledFont, ulong unicode, ulong* glyphIndex) cairo_user_scaled_font_unicode_to_glyph_func_t; 1511 1512 /* 1513 * cairo_read_func_t is the type of function which is called when a 1514 * backend needs to read data from an input stream. It is passed the 1515 * closure which was specified by the user at the time the read 1516 * function was registered, the buffer to read the data into and the 1517 * length of the data in bytes. The read function should return 1518 * CAIRO_STATUS_SUCCESS if all the data was successfully read, 1519 * CAIRO_STATUS_READ_ERROR otherwise. 1520 * closure : 1521 * the input closure 1522 * data : 1523 * the buffer into which to read the data 1524 * length : 1525 * the amount of data to read 1526 * Returns : 1527 * the status code of the read operation 1528 */ 1529 // cairo_status_t (*cairo_read_func_t) (void *closure, unsigned char *data, unsigned int length); 1530 public alias extern(C) cairo_status_t function(void* closure, uchar* data, uint length) cairo_read_func_t; 1531 1532 /* 1533 * cairo_write_func_t is the type of function which is called when a 1534 * backend needs to write data to an output stream. It is passed the 1535 * closure which was specified by the user at the time the write 1536 * function was registered, the data to write and the length of the 1537 * data in bytes. The write function should return 1538 * CAIRO_STATUS_SUCCESS if all the data was successfully written, 1539 * CAIRO_STATUS_WRITE_ERROR otherwise. 1540 * closure : 1541 * the output closure 1542 * data : 1543 * the buffer containing the data to write 1544 * length : 1545 * the amount of data to write 1546 * Returns : 1547 * the status code of the write operation 1548 */ 1549 // cairo_status_t (*cairo_write_func_t) (void *closure, unsigned char *data, unsigned int length); 1550 public alias extern(C) cairo_status_t function(void* closure, uchar* data, uint length) cairo_write_func_t; 1551 1552 /* 1553 * cairo_destroy_func_t the type of function which is called when a 1554 * data element is destroyed. It is passed the pointer to the data 1555 * element and should free any memory and resources allocated for it. 1556 * data : 1557 * The data element being destroyed. 1558 */ 1559 // void (*cairo_destroy_func_t) (void *data); 1560 public alias extern(C) void function(void* data) cairo_destroy_func_t; 1561 1562 // skipped union cairo_path_data_t 1563