Changeset 630
- Timestamp:
- 10/11/08 08:56:05 (2 months ago)
- Files:
-
- trunk/src/build/gtkD.d (modified) (1 diff)
- trunk/src/cairo/Context.d (modified) (23 diffs)
- trunk/src/cairo/FontFace.d (modified) (1 diff)
- trunk/src/cairo/FontOption.d (modified) (1 diff)
- trunk/src/cairo/ImageSurface.d (modified) (1 diff)
- trunk/src/cairo/Matrix.d (modified) (1 diff)
- trunk/src/cairo/Pattern.d (modified) (1 diff)
- trunk/src/cairo/PdfSurface.d (modified) (1 diff)
- trunk/src/cairo/PostScriptSurface.d (modified) (1 diff)
- trunk/src/cairo/ScaledFont.d (modified) (4 diffs)
- trunk/src/cairo/Status.d (modified) (1 diff)
- trunk/src/cairo/Surface.d (modified) (6 diffs)
- trunk/src/cairo/SvgSurface.d (modified) (3 diffs)
- trunk/src/cairo/Types.d (modified) (1 diff)
- trunk/src/cairo/UserFontFace.d (added)
- trunk/src/cairo/Version.d (modified) (3 diffs)
- trunk/src/gtkc/cairo.d (modified) (10 diffs)
- trunk/src/gtkc/cairotypes.d (modified) (17 diffs)
- trunk/wrap/APILookupCairo.txt (modified) (18 diffs)
- trunk/wrap/downloadFiles.sh (modified) (2 diffs)
- trunk/wrap/utils/GtkDClass.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/build/gtkD.d
r629 r630 178 178 private import cairo.ScaledFont; 179 179 private import cairo.FontOption; 180 private import cairo.UserFontFace; 180 181 private import cairo.Surface; 181 182 private import cairo.PdfSurface; trunk/src/cairo/Context.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo-c airo-t.html25 * inFile = cairo-context.html 26 26 * outPack = cairo 27 27 * outFile = Context … … 222 222 } 223 223 224 /** 225 * Allocates an array of cairo_glyph_t's. 226 * This function is only useful in implementations of 227 * cairo_user_scaled_font_text_to_glyphs_func_t where the user 228 * needs to allocate an array of glyphs that cairo will free. 229 * For all other uses, user can use their own allocation method 230 * for glyphs. 231 * This function returns NULL if num_glyphs is not positive, 232 * or if out of memory. That means, the NULL return value 233 * signals out-of-memory only if num_glyphs was positive. 234 * Since 1.8 235 * Params: 236 * numGlyphs = number of glyphs to allocate 237 * Returns: the newly allocated array of glyphs that should be freed using cairo_glyph_free() 238 */ 239 public static cairo_glyph_t[] glyphAllocate(int numGlyphs) 240 { 241 // cairo_glyph_t* cairo_glyph_allocate (int num_glyphs); 242 return cairo_glyph_allocate(numGlyphs)[0 .. numGlyphs]; 243 } 244 245 /** 246 * Allocates an array of cairo_text_cluster_t's. 247 * This function is only useful in implementations of 248 * cairo_user_scaled_font_text_to_glyphs_func_t where the user 249 * needs to allocate an array of text clusters that cairo will free. 250 * For all other uses, user can use their own allocation method 251 * for text clusters. 252 * This function returns NULL if num_clusters is not positive, 253 * or if out of memory. That means, the NULL return value 254 * signals out-of-memory only if num_clusters was positive. 255 * Since 1.8 256 * Params: 257 * numClusters = number of text_clusters to allocate 258 * Returns: the newly allocated array of text clusters that should be freed using cairo_text_cluster_free() 259 */ 260 public static cairo_text_cluster_t[] textClusterAllocate(int numClusters) 261 { 262 // cairo_text_cluster_t* cairo_text_cluster_allocate (int num_clusters); 263 return cairo_text_cluster_allocate(numClusters)[0 .. numClusters]; 264 } 224 265 225 266 /** … … 264 305 * surface should be constructed with a backend-specific function such 265 306 * as cairo_image_surface_create() (or any other 266 * cairo_backend_surface_create variant).307 * cairo_backend_surface_create() variant). 267 308 * This function references target, so you can immediately 268 309 * call cairo_surface_destroy() on it if you don't need to … … 492 533 * clamped. 493 534 * The default source pattern is opaque black, (that is, it is 494 * equivalent to cairo_set_source_rgb (cr, 0.0, 0.0, 0.0)).535 * equivalent to cairo_set_source_rgb(cr, 0.0, 0.0, 0.0)). 495 536 * Params: 496 537 * red = red component of color … … 512 553 * will be clamped. 513 554 * The default source pattern is opaque black, (that is, it is 514 * equivalent to cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0)).555 * equivalent to cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 1.0)). 515 556 * Params: 516 557 * red = red component of color … … 534 575 * will not affect the source pattern. See cairo_pattern_set_matrix(). 535 576 * The default source pattern is a solid pattern that is opaque black, 536 * (that is, it is equivalent to cairo_set_source_rgb (cr, 0.0, 0.0,577 * (that is, it is equivalent to cairo_set_source_rgb(cr, 0.0, 0.0, 537 578 * 0.0)). 538 579 * Params: … … 1115 1156 * A drawing operator that strokes the current path according to the 1116 1157 * current line width, line join, line cap, and dash settings. After 1117 * cairo_stroke , the current path will be cleared from the cairo1158 * cairo_stroke(), the current path will be cleared from the cairo 1118 1159 * context. See cairo_set_line_width(), cairo_set_line_join(), 1119 1160 * cairo_set_line_cap(), cairo_set_dash(), and … … 1477 1518 1478 1519 /** 1479 * Adds a cubic B zier spline to the path from the current point to1520 * Adds a cubic Bézier spline to the path from the current point to 1480 1521 * position (x3, y3) in user-space coordinates, using (x1, y1) and 1481 1522 * (x2, y2) as the control points. After this call the current point … … 1483 1524 * If there is no current point before the call to cairo_curve_to() 1484 1525 * this function will behave as if preceded by a call to 1485 * cairo_move_to (cr, x1, y1).1526 * cairo_move_to(cr, x1, y1). 1486 1527 * Params: 1487 1528 * x1 = the X coordinate of the first control point … … 1503 1544 * will be (x, y). 1504 1545 * If there is no current point before the call to cairo_line_to() 1505 * this function will behave as cairo_move_to (cr, x, y).1546 * this function will behave as cairo_move_to(cr, x, y). 1506 1547 * Params: 1507 1548 * x = the X coordinate of the end of the new line … … 1573 1614 * "real" text path API in cairo. 1574 1615 * Params: 1575 * utf8 = a string of text encoded in UTF-81616 * utf8 = a NUL-terminated string of text encoded in UTF-8, or NULL 1576 1617 */ 1577 1618 public void textPath(string utf8) … … 1583 1624 /** 1584 1625 * Relative-coordinate version of cairo_curve_to(). All offsets are 1585 * relative to the current point. Adds a cubic B zier spline to the1626 * relative to the current point. Adds a cubic Bézier spline to the 1586 1627 * path from the current point to a point offset from the current 1587 1628 * point by (dx3, dy3), using points offset by (dx1, dy1) and 1588 1629 * (dx2, dy2) as the control points. After this call the current 1589 1630 * point will be offset by (dx3, dy3). 1590 * Given a current point of (x, y), cairo_rel_curve_to (cr, dx1,1631 * Given a current point of (x, y), cairo_rel_curve_to(cr, dx1, 1591 1632 * dy1, dx2, dy2, dx3, dy3) is logically equivalent to 1592 * cairo_curve_to (cr, x + dx1, y + dy1, x + dx2, y + dy2, x + 1593 * dx3, y + dy3). 1633 * cairo_curve_to(cr, x+dx1, y+dy1, x+dx2, y+dy2, x+dx3, y+dy3). 1594 1634 * It is an error to call this function with no current point. Doing 1595 1635 * so will cause cr to shutdown with a status of … … 1615 1655 * current point will be offset by (dx, dy). 1616 1656 * Given a current point of (x, y), cairo_rel_line_to(cr, dx, dy) 1617 * is logically equivalent to cairo_line_to (cr, x + dx, y + dy).1657 * is logically equivalent to cairo_line_to(cr, x + dx, y + dy). 1618 1658 * It is an error to call this function with no current point. Doing 1619 1659 * so will cause cr to shutdown with a status of … … 1633 1673 * by (x, y). 1634 1674 * Given a current point of (x, y), cairo_rel_move_to(cr, dx, dy) 1635 * is logically equivalent to cairo_move_to (cr, x + dx, y + dy).1675 * is logically equivalent to cairo_move_to(cr, x + dx, y + dy). 1636 1676 * It is an error to call this function with no current point. Doing 1637 1677 * so will cause cr to shutdown with a status of … … 1839 1879 * a family name, slant and weight. Cairo provides no operation to 1840 1880 * list available family names on the system (this is a "toy", 1841 * remember "), but the standard CSS2 generic family names, ("serif",1881 * remember), but the standard CSS2 generic family names, ("serif", 1842 1882 * "sans-serif", "cursive", "fantasy", "monospace"), are likely to 1843 1883 * work as expected. … … 1857 1897 * If text is drawn without a call to cairo_select_font_face(), (nor 1858 1898 * cairo_set_font_face() nor cairo_set_scaled_font()), the default 1859 * family is "sans", slant is CAIRO_FONT_SLANT_NORMAL, and weight is 1899 * family is platform-specific, but is essentially "sans-serif". 1900 * Default slant is CAIRO_FONT_SLANT_NORMAL, and default weight is 1860 1901 * CAIRO_FONT_WEIGHT_NORMAL. 1902 * This function is equivalent to a call to cairo_toy_font_face_create() 1903 * followed by cairo_set_font_face(). 1861 1904 * Params: 1862 1905 * family = a font family name, encoded in UTF-8 … … 1962 2005 /** 1963 2006 * Gets the current font face for a cairo_t. 1964 * Returns: the current font face. This object is owned bycairo. To keep a reference to it, you must callcairo_font_face_reference .This function never returns NULL. If memory cannot be allocated, aspecial "nil" cairo_font_face_t object will be returned on whichcairo_font_face_status() returns CAIRO_STATUS_NO_MEMORY. Usingthis nil object will cause its error state to propagate to otherobjects it is passed to, (for example, callingcairo_set_font_face() with a nil font will trigger an error thatwill shutdown the cairo_t object).2007 * Returns: the current font face. This object is owned bycairo. To keep a reference to it, you must callcairo_font_face_reference().This function never returns NULL. If memory cannot be allocated, aspecial "nil" cairo_font_face_t object will be returned on whichcairo_font_face_status() returns CAIRO_STATUS_NO_MEMORY. Usingthis nil object will cause its error state to propagate to otherobjects it is passed to, (for example, callingcairo_set_font_face() with a nil font will trigger an error thatwill shutdown the cairo_t object). 1965 2008 */ 1966 2009 public FontFace getFontFace() … … 2027 2070 * "real" text display API in cairo. 2028 2071 * Params: 2029 * utf8 = a string of text encoded in UTF-82072 * utf8 = a NUL-terminated string of text encoded in UTF-8, or NULL 2030 2073 */ 2031 2074 public void showText(string utf8) … … 2037 2080 /** 2038 2081 * A drawing operator that generates the shape from an array of glyphs, 2039 * rendered according to the current font _face, font_size2040 * (font _matrix), and font_options.2082 * rendered according to the current font face, font size 2083 * (font matrix), and font options. 2041 2084 * Params: 2042 2085 * glyphs = array of glyphs to show … … 2046 2089 // void cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs); 2047 2090 cairo_show_glyphs(cairo, glyphs.ptr, glyphs.length); 2091 } 2092 2093 /** 2094 * This operation has rendering effects similar to cairo_show_glyphs() 2095 * but, if the target surface supports it, uses the provided text and 2096 * cluster mapping to embed the text for the glyphs shown in the output. 2097 * The cairo_has_show_text_glyphs() function can be used to query that. 2098 * If the target does not support it, this function acts like 2099 * cairo_show_glyphs(). 2100 * The mapping between utf8 and glyphs is provided by an array of 2101 * clusters. Each cluster covers a number of 2102 * text bytes and glyphs, and neighboring clusters cover neighboring 2103 * areas of utf8 and glyphs. The clusters should collectively cover utf8 2104 * and glyphs in entirety. 2105 * The first cluster always covers bytes from the beginning of utf8. 2106 * If cluster_flags do not have the CAIRO_TEXT_CLUSTER_FLAG_BACKWARD 2107 * set, the first cluster also covers the beginning 2108 * of glyphs, otherwise it covers the end of the glyphs array and 2109 * following clusters move backward. 2110 * See cairo_text_cluster_t for constraints on valid clusters. 2111 * Since 1.8 2112 * Params: 2113 * utf8 = a string of text encoded in UTF-8 2114 * utf8_Len = length of utf8 in bytes, or -1 if it is NUL-terminated 2115 * glyphs = array of glyphs to show 2116 * clusters = array of cluster mapping information 2117 * clusterFlags = cluster mapping flags 2118 */ 2119 public void showTextGlyphs(string utf8, int utf8_Len, cairo_glyph_t[] glyphs, cairo_text_cluster_t[] clusters, cairo_text_cluster_flags_t clusterFlags) 2120 { 2121 // void cairo_show_text_glyphs (cairo_t *cr, const char *utf8, int utf8_len, const cairo_glyph_t *glyphs, int num_glyphs, const cairo_text_cluster_t *clusters, int num_clusters, cairo_text_cluster_flags_t cluster_flags); 2122 cairo_show_text_glyphs(cairo, Str.toStringz(utf8), utf8_Len, glyphs.ptr, glyphs.length, clusters.ptr, clusters.length, clusterFlags); 2048 2123 } 2049 2124 … … 2073 2148 * affect the x_advance and y_advance values. 2074 2149 * Params: 2075 * utf8 = a string of text, encoded in UTF-82150 * utf8 = a NUL-terminated string of text encoded in UTF-8, or NULL 2076 2151 * extents = a cairo_text_extents_t object into which the results 2077 2152 * will be stored … … 2089 2164 * Additionally, the x_advance and y_advance values indicate the 2090 2165 * amount by which the current point would be advanced by 2091 * cairo_show_glyphs .2166 * cairo_show_glyphs(). 2092 2167 * Note that whitespace glyphs do not contribute to the size of the 2093 2168 * rectangle (extents.width and extents.height). … … 2102 2177 cairo_glyph_extents(cairo, glyphs.ptr, glyphs.length, extents); 2103 2178 } 2179 2180 /** 2181 * Creates a font face from a triplet of family, slant, and weight. 2182 * These font faces are used in implementation of the the cairo_t "toy" 2183 * font API. 2184 * If family is the zero-length string "", the platform-specific default 2185 * family is assumed. The default family then can be queried using 2186 * cairo_toy_font_face_get_family(). 2187 * The cairo_select_font_face() function uses this to create font faces. 2188 * See that function for limitations of toy font faces. 2189 * Since 1.8 2190 * Params: 2191 * family = a font family name, encoded in UTF-8 2192 * slant = the slant for the font 2193 * weight = the weight for the font 2194 * Returns: a newly created cairo_font_face_t. Free with cairo_font_face_destroy() when you are done using it. 2195 */ 2196 public static FontFace toyFontFaceCreate(string family, cairo_font_slant_t slant, cairo_font_weight_t weight) 2197 { 2198 // cairo_font_face_t* cairo_toy_font_face_create (const char *family, cairo_font_slant_t slant, cairo_font_weight_t weight); 2199 auto p = cairo_toy_font_face_create(Str.toStringz(family), slant, weight); 2200 if(p is null) 2201 { 2202 return null; 2203 } 2204 return new FontFace(cast(cairo_font_face_t*) p); 2205 } 2206 2207 /** 2208 * Gets the familly name of a toy font. 2209 * Since 1.8 2210 * Params: 2211 * fontFace = A toy font face 2212 * Returns: The family name. This string is owned by the font faceand remains valid as long as the font face is alive (referenced). 2213 */ 2214 public static string toyFontFaceGetFamily(FontFace fontFace) 2215 { 2216 // const char* cairo_toy_font_face_get_family (cairo_font_face_t *font_face); 2217 return Str.toString(cairo_toy_font_face_get_family((fontFace is null) ? null : fontFace.getFontFaceStruct())); 2218 } 2219 2220 /** 2221 * Gets the slant a toy font. 2222 * Since 1.8 2223 * Params: 2224 * fontFace = A toy font face 2225 * Returns: The slant value 2226 */ 2227 public static cairo_font_slant_t toyFontFaceGetSlant(FontFace fontFace) 2228 { 2229 // cairo_font_slant_t cairo_toy_font_face_get_slant (cairo_font_face_t *font_face); 2230 return cairo_toy_font_face_get_slant((fontFace is null) ? null : fontFace.getFontFaceStruct()); 2231 } 2232 2233 /** 2234 * Gets the weight a toy font. 2235 * Since 1.8 2236 * Params: 2237 * fontFace = A toy font face 2238 * Returns: The weight value 2239 */ 2240 public static cairo_font_weight_t toyFontFaceGetWeight(FontFace fontFace) 2241 { 2242 // cairo_font_weight_t cairo_toy_font_face_get_weight (cairo_font_face_t *font_face); 2243 return cairo_toy_font_face_get_weight((fontFace is null) ? null : fontFace.getFontFaceStruct()); 2244 } 2245 2246 /** 2247 * Frees an array of cairo_glyph_t's allocated using cairo_glyph_allocate(). 2248 * This function is only useful to free glyph array returned 2249 * by cairo_scaled_font_text_to_glyphs() where cairo returns 2250 * an array of glyphs that the user will free. 2251 * For all other uses, user can use their own allocation method 2252 * for glyphs. 2253 * Since 1.8 2254 * Params: 2255 * glyphs = array of glyphs to free, or NULL 2256 */ 2257 public static void glyphFree(cairo_glyph_t[] glyphs) 2258 { 2259 // void cairo_glyph_free (cairo_glyph_t *glyphs); 2260 cairo_glyph_free(glyphs.ptr); 2261 } 2262 2263 /** 2264 * Frees an array of cairo_text_cluster's allocated using cairo_text_cluster_allocate(). 2265 * This function is only useful to free text cluster array returned 2266 * by cairo_scaled_font_text_to_glyphs() where cairo returns 2267 * an array of text clusters that the user will free. 2268 * For all other uses, user can use their own allocation method 2269 * for text clusters. 2270 * Since 1.8 2271 * Params: 2272 * clusters = array of text clusters to free, or NULL 2273 */ 2274 public static void textClusterFree(cairo_text_cluster_t[] clusters) 2275 { 2276 // void cairo_text_cluster_free (cairo_text_cluster_t *clusters); 2277 cairo_text_cluster_free(clusters.ptr); 2278 } 2104 2279 } trunk/src/cairo/FontFace.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- cairo-font-face-t.html25 * inFile = cairo-font-face.html 26 26 * outPack = cairo 27 27 * outFile = FontFace trunk/src/cairo/FontOption.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Font-Options.html25 * inFile = cairo-font-options.html 26 26 * outPack = cairo 27 27 * outFile = FontOption trunk/src/cairo/ImageSurface.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Image-Surfaces.html25 * inFile = cairo-image-surface.html 26 26 * outPack = cairo 27 27 * outFile = ImageSurface trunk/src/cairo/Matrix.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- cairo-matrix-t.html25 * inFile = cairo-matrix.html 26 26 * outPack = cairo 27 27 * outFile = Matrix trunk/src/cairo/Pattern.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Patterns.html25 * inFile = cairo-pattern.html 26 26 * outPack = cairo 27 27 * outFile = Pattern trunk/src/cairo/PdfSurface.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- PDF-Surfaces.html25 * inFile = cairo-pdf-surface.html 26 26 * outPack = cairo 27 27 * outFile = PdfSurface trunk/src/cairo/PostScriptSurface.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- PostScript-Surfaces.html25 * inFile = cairo-ps-surface.html 26 26 * outPack = cairo 27 27 * outFile = PostScriptSurface trunk/src/cairo/ScaledFont.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Scaled-Fonts.html25 * inFile = cairo-scaled-font.html 26 26 * outPack = cairo 27 27 * outFile = ScaledFont … … 210 210 * Since 1.2 211 211 * Params: 212 * utf8 = a string of text, encoded in UTF-8212 * utf8 = a NUL-terminated string of text, encoded in UTF-8 213 213 * extents = a cairo_text_extents_t which to store the retrieved extents. 214 214 */ … … 241 241 242 242 /** 243 * Converts UTF-8 text to an array of glyphs, optionally with cluster 244 * mapping, that can be used to render later using scaled_font. 245 * If glyphs initially points to a non-NULL value, that array is used 246 * as a glyph buffer, and num_glyphs should point to the number of glyph 247 * entries available there. If the provided glyph array is too short for 248 * the conversion, a new glyph array is allocated using cairo_glyph_allocate() 249 * and placed in glyphs. Upon return, num_glyphs always contains the 250 * number of generated glyphs. If the value glyphs points at has changed 251 * after the call, the user is responsible for freeing the allocated glyph 252 * array using cairo_glyph_free(). 253 * If clusters is not NULL, num_clusters and cluster_flags should not be NULL, 254 * and cluster mapping will be computed. 255 * The semantics of how cluster array allocation works is similar to the glyph 256 * array. That is, 257 * if clusters initially points to a non-NULL value, that array is used 258 * as a cluster buffer, and num_clusters should point to the number of cluster 259 * entries available there. If the provided cluster array is too short for 260 * the conversion, a new cluster array is allocated using cairo_text_cluster_allocate() 261 * and placed in clusters. Upon return, num_clusters always contains the 262 * number of generated clusters. If the value clusters points at has changed 263 * after the call, the user is responsible for freeing the allocated cluster 264 * array using cairo_text_cluster_free(). 265 * In the simplest case, glyphs and clusters can point to NULL initially 266 * Since 1.8 267 * Params: 268 * x = X position to place first glyph 269 * y = Y position to place first glyph 270 * utf8 = a string of text encoded in UTF-8 271 * utf8_Len = length of utf8 in bytes, or -1 if it is NUL-terminated 272 * glyphs = pointer to array of glyphs to fill 273 * clusters = pointer to array of cluster mapping information to fill, or NULL 274 * clusterFlags = pointer to location to store cluster flags corresponding to the 275 * output clusters, or NULL 276 * Returns: CAIRO_STATUS_SUCCESS upon success, or an error statusif the input values are wrong or if conversion failed. If the inputvalues are correct but the conversion failed, the error status is alsoset on scaled_font. 277 */ 278 public cairo_status_t textToGlyphs(double x, double y, string utf8, int utf8_Len, out cairo_glyph_t[] glyphs, out cairo_text_cluster_t[] clusters, out cairo_text_cluster_flags_t clusterFlags) 279 { 280 // cairo_status_t cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font, double x, double y, 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); 281 cairo_glyph_t* outglyphs = null; 282 int numGlyphs; 283 cairo_text_cluster_t* outclusters = null; 284 int numClusters; 285 286 auto p = cairo_scaled_font_text_to_glyphs(cairo_scaled_font, x, y, Str.toStringz(utf8), utf8_Len, &outglyphs, &numGlyphs, &outclusters, &numClusters, &clusterFlags); 287 288 glyphs = outglyphs[0 .. numGlyphs]; 289 clusters = outclusters[0 .. numClusters]; 290 return p; 291 } 292 293 /** 243 294 * Gets the font face that this scaled font was created for. 244 295 * Since 1.2 … … 295 346 296 347 /** 348 * Stores the scale matrix of scaled_font into matrix. 349 * The scale matrix is product of the font matrix and the ctm 350 * associated with the scaled font, and hence is the matrix mapping from 351 * font space to device space. 352 * Since 1.8 353 * Params: 354 * scaleMatrix = return value for the matrix 355 */ 356 public void getScaleMatrix(Matrix scaleMatrix) 357 { 358 // void cairo_scaled_font_get_scale_matrix (cairo_scaled_font_t *scaled_font, cairo_matrix_t *scale_matrix); 359 cairo_scaled_font_get_scale_matrix(cairo_scaled_font, (scaleMatrix is null) ? null : scaleMatrix.getMatrixStruct()); 360 } 361 362 /** 297 363 * This function returns the type of the backend used to create 298 364 * a scaled font. See cairo_font_type_t for available types. trunk/src/cairo/Status.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Error-Handling.html25 * inFile = cairo-error-status.html 26 26 * outPack = cairo 27 27 * outFile = Status trunk/src/cairo/Surface.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- cairo-surface-t.html25 * inFile = cairo-surface.html 26 26 * outPack = cairo 27 27 * outFile = Surface … … 183 183 * that cairo will no longer access the drawable, which can be freed. 184 184 * After calling cairo_surface_finish() the only valid operations on a 185 * surface are getting and setting user data and referencing and 186 * destroying it. Further drawing to the surface will not affect the 185 * surface are getting and setting user, referencing and 186 * destroying, and flushing and finishing it. 187 * Further drawing to the surface will not affect the 187 188 * surface but will instead trigger a CAIRO_STATUS_SURFACE_FINISHED 188 189 * error. … … 338 339 339 340 /** 341 * This function returns the previous fallback resolution set by 342 * cairo_surface_set_fallback_resolution(), or default fallback 343 * resolution if never set. 344 * Since 1.8 345 * Params: 346 * xPixelsPerInch = horizontal pixels per inch 347 * yPixelsPerInch = vertical pixels per inch 348 */ 349 public void getFallbackResolution(out double xPixelsPerInch, out double yPixelsPerInch) 350 { 351 // void cairo_surface_get_fallback_resolution (cairo_surface_t *surface, double *x_pixels_per_inch, double *y_pixels_per_inch); 352 cairo_surface_get_fallback_resolution(cairo_surface, &xPixelsPerInch, &yPixelsPerInch); 353 } 354 355 /** 340 356 * This function returns the type of the backend used to create 341 357 * a surface. See cairo_surface_type_t for available types. … … 400 416 * be retained for the next page. Use cairo_surface_show_page() if you 401 417 * want to get an empty page after the emission. 418 * There is a convenience function for this that takes a cairo_t, 419 * namely cairo_copy_page(). 402 420 * Since 1.6 403 421 */ … … 411 429 * Emits and clears the current page for backends that support multiple 412 430 * pages. Use cairo_surface_copy_page() if you don't want to clear the page. 431 * There is a convenience function for this that takes a cairo_t, 432 * namely cairo_show_page(). 413 433 * Since 1.6 414 434 */ … … 418 438 cairo_surface_show_page(cairo_surface); 419 439 } 440 441 /** 442 * Returns whether the surface supports 443 * sophisticated cairo_show_text_glyphs() operations. That is, 444 * whether it actually uses the provided text and cluster data 445 * to a cairo_show_text_glyphs() call. 446 * Note: Even if this function returns FALSE, a 447 * cairo_show_text_glyphs() operation targeted at surface will 448 * still succeed. It just will 449 * act like a cairo_show_glyphs() operation. Users can use this 450 * function to avoid computing UTF-8 text and cluster mapping if the 451 * target surface does not use it. 452 * There is a convenience function for this that takes a cairo_t, 453 * namely cairo_has_show_text_glyphs(). 454 * Since 1.8 455 * Returns: TRUE if surface supports cairo_show_text_glyphs(), FALSE otherwise 456 */ 457 public cairo_bool_t hasShowTextGlyphs() 458 { 459 // cairo_bool_t cairo_surface_has_show_text_glyphs (cairo_surface_t *surface); 460 return cairo_surface_has_show_text_glyphs(cairo_surface); 461 } 420 462 } trunk/src/cairo/SvgSurface.d
r585 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- SVG-Surfaces.html25 * inFile = cairo-svg-surface.html 26 26 * outPack = cairo 27 27 * outFile = SvgSurface … … 159 159 * Since 1.2 160 160 * Params: 161 * versio = SVG version161 * version = SVG version 162 162 */ 163 163 public void restrictToVersion(cairo_svg_version_t versio) … … 191 191 * Since 1.2 192 192 * Params: 193 * versio = a version id193 * version = a version id 194 194 * Returns: the string associated to given version. 195 195 */ trunk/src/cairo/Types.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Types.html25 * inFile = cairo-types.html 26 26 * outPack = cairo 27 27 * outFile = Types trunk/src/cairo/Version.d
r540 r630 23 23 /* 24 24 * Conversion parameters: 25 * inFile = cairo- Version-Information.html25 * inFile = cairo-version-info.html 26 26 * outPack = cairo 27 27 * outFile = Version … … 107 107 * Cairo provides the ability to examine the version at either 108 108 * compile-time or run-time and in both a human-readable form as well as 109 * an encoded form suitable for direct comparison. Cairo also provides a110 * macro (CAIRO_VERSION_ENCODE()) to perform the encoding.109 * an encoded form suitable for direct comparison. Cairo also provides the 110 * macro CAIRO_VERSION_ENCODE() to perform the encoding. 111 111 * Compile-time 112 112 * ------------ 113 * %CAIRO_VERSION_STRING Human-readable114 * %CAIRO_VERSION Encoded, suitable for comparison113 * CAIRO_VERSION_STRING Human-readable 114 * CAIRO_VERSION Encoded, suitable for comparison 115 115 * Run-time 116 116 * -------- … … 119 119 * For example, checking that the cairo version is greater than or equal 120 120 * to 1.0.0 could be achieved at compile-time or run-time as follows: 121 * ##if %CAIRO_VERSION >= %CAIRO_VERSION_ENCODE(1, 0, 0)122 * printf ("Compiling with suitable cairo version: % %s\n", %CAIRO_VERSION_STRING);121 * ##if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 0, 0) 122 * printf ("Compiling with suitable cairo version: %s\n", %CAIRO_VERSION_STRING); 123 123 * ##endif 124 * if (cairo_version() >= %CAIRO_VERSION_ENCODE(1, 0, 0))125 * printf ("Running with suitable cairo version: % %s\n", cairo_version_string ());124 * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0)) 125 * printf ("Running with suitable cairo version: %s\n", cairo_version_string ()); 126 126 */ 127 127 public class Version trunk/src/gtkc/cairo.d
r499 r630 170 170 void function(cairo_t* cr, char* utf8)cairo_show_text; 171 171 void function(cairo_t* cr, cairo_glyph_t* glyphs, int numGlyphs)cairo_show_glyphs; 172 void function(cairo_t* cr, 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_show_text_glyphs; 172 173 void function(cairo_t* cr, cairo_font_extents_t* extents)cairo_font_extents; 173 174 void function(cairo_t* cr, char* utf8, cairo_text_extents_t* extents)cairo_text_extents; 174 175 void function(cairo_t* cr, cairo_glyph_t* glyphs, int numGlyphs, cairo_text_extents_t* extents)cairo_glyph_extents; 176 cairo_font_face_t* function(char* family, cairo_font_slant_t slant, cairo_font_weight_t weight)cairo_toy_font_face_create; 177 char* function(cairo_font_face_t* fontFace)cairo_toy_font_face_get_family; 178 cairo_font_slant_t function(cairo_font_face_t* fontFace)cairo_toy_font_face_get_slant; 179 cairo_font_weight_t function(cairo_font_face_t* fontFace)cairo_toy_font_face_get_weight; 180 cairo_glyph_t* function(int numGlyphs)cairo_glyph_allocate; 181 void function(cairo_glyph_t* glyphs)cairo_glyph_free; 182 cairo_text_cluster_t* function(int numClusters)cairo_text_cluster_allocate; 183 void function(cairo_text_cluster_t* clusters)cairo_text_cluster_free; 175 184 176 185 // cairo.Pattern … … 222 231 void function(cairo_scaled_font_t* scaledFont, char* utf8, cairo_text_extents_t* extents)cairo_scaled_font_text_extents; 223 232 void function(cairo_scaled_font_t* scaledFont, cairo_glyph_t* glyphs, int numGlyphs, cairo_text_extents_t* extents)cairo_scaled_font_glyph_extents; 233 cairo_status_t function(cairo_scaled_font_t* scaledFont, double x, double y, 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_scaled_font_text_to_glyphs; 224 234 cairo_font_face_t* function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_font_face; 225 235 void function(cairo_scaled_font_t* scaledFont, cairo_font_options_t* options)cairo_scaled_font_get_font_options; 226 236 void function(cairo_scaled_font_t* scaledFont, cairo_matrix_t* fontMatrix)cairo_scaled_font_get_font_matrix; 227 237 void function(cairo_scaled_font_t* scaledFont, cairo_matrix_t* ctm)cairo_scaled_font_get_ctm; 238 void function(cairo_scaled_font_t* scaledFont, cairo_matrix_t* scaleMatrix)cairo_scaled_font_get_scale_matrix; 228 239 cairo_font_type_t function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_type; 229 240 uint function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_reference_count; … … 249 260 cairo_hint_metrics_t function(cairo_font_options_t* options)cairo_font_options_get_hint_metrics; 250 261 262 // cairo.UserFontFace 263 264 cairo_font_face_t* function()cairo_user_font_face_create; 265 void function(cairo_font_face_t* fontFace, cairo_user_scaled_font_init_func_t initFunc)cairo_user_font_face_set_init_func; 266 cairo_user_scaled_font_init_func_t function(cairo_font_face_t* fontFace)cairo_user_font_face_get_init_func; 267 void function(cairo_font_face_t* fontFace, cairo_user_scaled_font_render_glyph_func_t renderGlyphFunc)cairo_user_font_face_set_render_glyph_func; 268 cairo_user_scaled_font_render_glyph_func_t function(cairo_font_face_t* fontFace)cairo_user_font_face_get_render_glyph_func; 269 void function(cairo_font_face_t* fontFace, cairo_user_scaled_font_unicode_to_glyph_func_t unicodeToGlyphFunc)cairo_user_font_face_set_unicode_to_glyph_func; 270 cairo_user_scaled_font_unicode_to_glyph_func_t function(cairo_font_face_t* fontFace)cairo_user_font_face_get_unicode_to_glyph_func; 271 void function(cairo_font_face_t* fontFace, cairo_user_scaled_font_text_to_glyphs_func_t textToGlyphsFunc)cairo_user_font_face_set_text_to_glyphs_func; 272 cairo_user_scaled_font_text_to_glyphs_func_t function(cairo_font_face_t* fontFace)cairo_user_font_face_get_text_to_glyphs_func; 273 251 274 // cairo.Surface 252 275 … … 264 287 void function(cairo_surface_t* surface, double* xOffset, double* yOffset)cairo_surface_get_device_offset; 265 288 void function(cairo_surface_t* surface, double xPixelsPerInch, double yPixelsPerInch)cairo_surface_set_fallback_resolution; 289 void function(cairo_surface_t* surface, double* xPixelsPerInch, double* yPixelsPerInch)cairo_surface_get_fallback_resolution; 266 290 cairo_surface_type_t function(cairo_surface_t* surface)cairo_surface_get_type; 267 291 uint function(cairo_surface_t* surface)cairo_surface_get_reference_count; … … 270 294 void function(cairo_surface_t* surface)cairo_surface_copy_page; 271 295 void function(cairo_surface_t* surface)cairo_surface_show_page; 296 cairo_bool_t function(cairo_surface_t* surface)cairo_surface_has_show_text_glyphs; 272 297 273 298 // cairo.ImageSurface … … 451 476 { "cairo_show_text", cast(void**)& cairo_show_text}, 452 477 { "cairo_show_glyphs", cast(void**)& cairo_show_glyphs}, 478 { "cairo_show_text_glyphs", cast(void**)& cairo_show_text_glyphs}, 453 479 { "cairo_font_extents", cast(void**)& cairo_font_extents}, 454 480 { "cairo_text_extents", cast(void**)& cairo_text_extents}, 455 481 { "cairo_glyph_extents", cast(void**)& cairo_glyph_extents}, 482 { "cairo_toy_font_face_create", cast(void**)& cairo_toy_font_face_create}, 483 { "cairo_toy_font_face_get_family", cast(void**)& cairo_toy_font_face_get_family}, 484 { "cairo_toy_font_face_get_slant", cast(void**)& cairo_toy_font_face_get_slant}, 485 { "cairo_toy_font_face_get_weight", cast(void**)& cairo_toy_font_face_get_weight}, 486 { "cairo_glyph_allocate", cast(void**)& cairo_glyph_allocate}, 487 { "cairo_glyph_free", cast(void**)& cairo_glyph_free}, 488 { "cairo_text_cluster_allocate", cast(void**)& cairo_text_cluster_allocate}, 489 { "cairo_text_cluster_free", cast(void**)& cairo_text_cluster_free}, 456 490 { "cairo_pattern_add_color_stop_rgb", cast(void**)& cairo_pattern_add_color_stop_rgb}, 457 491 { "cairo_pattern_add_color_stop_rgba", cast(void**)& cairo_pattern_add_color_stop_rgba}, … … 494 528 { "cairo_scaled_font_text_extents", cast(void**)& cairo_scaled_font_text_extents}, 495 529 { "cairo_scaled_font_glyph_extents", cast(void**)& cairo_scaled_font_glyph_extents}, 530 { "cairo_scaled_font_text_to_glyphs", cast(void**)& cairo_scaled_font_text_to_glyphs}, 496 531 { "cairo_scaled_font_get_font_face", cast(void**)& cairo_scaled_font_get_font_face}, 497 532 { "cairo_scaled_font_get_font_options", cast(void**)& cairo_scaled_font_get_font_options}, 498 533 { "cairo_scaled_font_get_font_matrix", cast(void**)& cairo_scaled_font_get_font_matrix}, 499 534 { "cairo_scaled_font_get_ctm", cast(void**)& cairo_scaled_font_get_ctm}, 535 { "cairo_scaled_font_get_scale_matrix", cast(void**)& cairo_scaled_font_get_scale_matrix}, 500 536 { "cairo_scaled_font_get_type", cast(void**)& cairo_scaled_font_get_type}, 501 537 { "cairo_scaled_font_get_reference_count", cast(void**)& cairo_scaled_font_get_reference_count}, … … 517 553 { "cairo_font_options_set_hint_metrics", cast(void**)& cairo_font_options_set_hint_metrics}, 518 554 { "cairo_font_options_get_hint_metrics", cast(void**)& cairo_font_options_get_hint_metrics}, 555 { "cairo_user_font_face_create", cast(void**)& cairo_user_font_face_create}, 556 { "cairo_user_font_face_set_init_func", cast(void**)& cairo_user_font_face_set_init_func}, 557 { "cairo_user_font_face_get_init_func", cast(void**)& cairo_user_font_face_get_init_func}, 558 { "cairo_user_font_face_set_render_glyph_func", cast(void**)& cairo_user_font_face_set_render_glyph_func}, 559 { "cairo_user_font_face_get_render_glyph_func", cast(void**)& cairo_user_font_face_get_render_glyph_func}, 560 { "cairo_user_font_face_set_unicode_to_glyph_func", cast(void**)& cairo_user_font_face_set_unicode_to_glyph_func}, 561 { "cairo_user_font_face_get_unicode_to_glyph_func", cast(void**)& cairo_user_font_face_get_unicode_to_glyph_func}, 562 { "cairo_user_font_face_set_text_to_glyphs_func", cast(void**)& cairo_user_font_face_set_text_to_glyphs_func}, 563 { "cairo_user_font_face_get_text_to_glyphs_func", cast(void**)& cairo_user_font_face_get_text_to_glyphs_func}, 519 564 { "cairo_surface_create_similar", cast(void**)& cairo_surface_create_similar}, 520 565 { "cairo_surface_reference", cast(void**)& cairo_surface_reference}, … … 530 575 { "cairo_surface_get_device_offset", cast(void**)& cairo_surface_get_device_offset}, 531 576 { "cairo_surface_set_fallback_resolution", cast(void**)& cairo_surface_set_fallback_resolution}, 577 { "cairo_surface_get_fallback_resolution", cast(void**)& cairo_surface_get_fallback_resolution}, 532 578 { "cairo_surface_get_type", cast(void**)& cairo_surface_get_type}, 533 579 { "cairo_surface_get_reference_count", cast(void**)& cairo_surface_get_reference_count}, … … 536 582 { "cairo_surface_copy_page", cast(void**)& cairo_surface_copy_page}, 537 583 { "cairo_surface_show_page", cast(void**)& cairo_surface_show_page}, 584 { "cairo_surface_has_show_text_glyphs", cast(void**)& cairo_surface_has_show_text_glyphs}, 538 585 { "cairo_format_stride_for_width", cast(void**)& cairo_format_stride_for_width}, 539 586 { "cairo_image_surface_create", cast(void**)& cairo_image_surface_create}, trunk/src/gtkc/cairotypes.d
r602 r630 175 175 176 176 /** 177 * Specifies properties of a text cluster mapping. 178 * CAIRO_TEXT_CLUSTER_FLAG_BACKWARD 179 */ 180 public enum cairo_text_cluster_flags_t 181 { 182 BACKWARD = 0x00000001 183 } 184 alias cairo_text_cluster_flags_t CairoTextClusterFlags; 185 186 /** 177 187 * cairo_extend_t is used to describe how pattern color/alpha will be 
