Changeset 630

Show
Ignore:
Timestamp:
10/11/08 08:56:05 (2 months ago)
Author:
Mike Wey
Message:

Update Cairo to 1.8

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/build/gtkD.d

    r629 r630  
    178178private import cairo.ScaledFont; 
    179179private import cairo.FontOption; 
     180private import cairo.UserFontFace; 
    180181private import cairo.Surface; 
    181182private import cairo.PdfSurface; 
  • trunk/src/cairo/Context.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-cairo-t.html 
     25 * inFile  = cairo-context.html 
    2626 * outPack = cairo 
    2727 * outFile = Context 
     
    222222    } 
    223223     
     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    } 
    224265     
    225266    /** 
     
    264305     * surface should be constructed with a backend-specific function such 
    265306     * as cairo_image_surface_create() (or any other 
    266      * cairo_backend_surface_create variant). 
     307     * cairo_backend_surface_create() variant). 
    267308     * This function references target, so you can immediately 
    268309     * call cairo_surface_destroy() on it if you don't need to 
     
    492533     * clamped. 
    493534     * 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)). 
    495536     * Params: 
    496537     * red =  red component of color 
     
    512553     * will be clamped. 
    513554     * 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)). 
    515556     * Params: 
    516557     * red =  red component of color 
     
    534575     * will not affect the source pattern. See cairo_pattern_set_matrix(). 
    535576     * 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, 
    537578     * 0.0)). 
    538579     * Params: 
     
    11151156     * A drawing operator that strokes the current path according to the 
    11161157     * current line width, line join, line cap, and dash settings. After 
    1117      * cairo_stroke, the current path will be cleared from the cairo 
     1158     * cairo_stroke(), the current path will be cleared from the cairo 
    11181159     * context. See cairo_set_line_width(), cairo_set_line_join(), 
    11191160     * cairo_set_line_cap(), cairo_set_dash(), and 
     
    14771518     
    14781519    /** 
    1479      * Adds a cubic Bzier spline to the path from the current point to 
     1520     * Adds a cubic Bézier spline to the path from the current point to 
    14801521     * position (x3, y3) in user-space coordinates, using (x1, y1) and 
    14811522     * (x2, y2) as the control points. After this call the current point 
     
    14831524     * If there is no current point before the call to cairo_curve_to() 
    14841525     * 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). 
    14861527     * Params: 
    14871528     * x1 =  the X coordinate of the first control point 
     
    15031544     * will be (x, y). 
    15041545     * 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). 
    15061547     * Params: 
    15071548     * x =  the X coordinate of the end of the new line 
     
    15731614     * "real" text path API in cairo. 
    15741615     * Params: 
    1575      * utf8 =  a string of text encoded in UTF-8 
     1616     * utf8 =  a NUL-terminated string of text encoded in UTF-8, or NULL 
    15761617     */ 
    15771618    public void textPath(string utf8) 
     
    15831624    /** 
    15841625     * Relative-coordinate version of cairo_curve_to(). All offsets are 
    1585      * relative to the current point. Adds a cubic Bzier spline to the 
     1626     * relative to the current point. Adds a cubic Bézier spline to the 
    15861627     * path from the current point to a point offset from the current 
    15871628     * point by (dx3, dy3), using points offset by (dx1, dy1) and 
    15881629     * (dx2, dy2) as the control points. After this call the current 
    15891630     * 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, 
    15911632     * 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). 
    15941634     * It is an error to call this function with no current point. Doing 
    15951635     * so will cause cr to shutdown with a status of 
     
    16151655     * current point will be offset by (dx, dy). 
    16161656     * 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). 
    16181658     * It is an error to call this function with no current point. Doing 
    16191659     * so will cause cr to shutdown with a status of 
     
    16331673     * by (x, y). 
    16341674     * 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). 
    16361676     * It is an error to call this function with no current point. Doing 
    16371677     * so will cause cr to shutdown with a status of 
     
    18391879     * a family name, slant and weight. Cairo provides no operation to 
    18401880     * 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", 
    18421882     * "sans-serif", "cursive", "fantasy", "monospace"), are likely to 
    18431883     * work as expected. 
     
    18571897     * If text is drawn without a call to cairo_select_font_face(), (nor 
    18581898     * 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 
    18601901     * 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(). 
    18611904     * Params: 
    18621905     * family =  a font family name, encoded in UTF-8 
     
    19622005    /** 
    19632006     * 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). 
    19652008     */ 
    19662009    public FontFace getFontFace() 
     
    20272070     * "real" text display API in cairo. 
    20282071     * Params: 
    2029      * utf8 =  a string of text encoded in UTF-8 
     2072     * utf8 =  a NUL-terminated string of text encoded in UTF-8, or NULL 
    20302073     */ 
    20312074    public void showText(string utf8) 
     
    20372080    /** 
    20382081     * A drawing operator that generates the shape from an array of glyphs, 
    2039      * rendered according to the current font_face, font_size 
    2040      * (font_matrix), and font_options. 
     2082     * rendered according to the current font face, font size 
     2083     * (font matrix), and font options. 
    20412084     * Params: 
    20422085     * glyphs =  array of glyphs to show 
     
    20462089        // void cairo_show_glyphs (cairo_t *cr,  const cairo_glyph_t *glyphs,  int num_glyphs); 
    20472090        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); 
    20482123    } 
    20492124     
     
    20732148     * affect the x_advance and y_advance values. 
    20742149     * Params: 
    2075      * utf8 =  a string of text, encoded in UTF-8 
     2150     * utf8 =  a NUL-terminated string of text encoded in UTF-8, or NULL 
    20762151     * extents =  a cairo_text_extents_t object into which the results 
    20772152     * will be stored 
     
    20892164     * Additionally, the x_advance and y_advance values indicate the 
    20902165     * amount by which the current point would be advanced by 
    2091      * cairo_show_glyphs
     2166     * cairo_show_glyphs()
    20922167     * Note that whitespace glyphs do not contribute to the size of the 
    20932168     * rectangle (extents.width and extents.height). 
     
    21022177        cairo_glyph_extents(cairo, glyphs.ptr, glyphs.length, extents); 
    21032178    } 
     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    } 
    21042279} 
  • trunk/src/cairo/FontFace.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-cairo-font-face-t.html 
     25 * inFile  = cairo-font-face.html 
    2626 * outPack = cairo 
    2727 * outFile = FontFace 
  • trunk/src/cairo/FontOption.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Font-Options.html 
     25 * inFile  = cairo-font-options.html 
    2626 * outPack = cairo 
    2727 * outFile = FontOption 
  • trunk/src/cairo/ImageSurface.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Image-Surfaces.html 
     25 * inFile  = cairo-image-surface.html 
    2626 * outPack = cairo 
    2727 * outFile = ImageSurface 
  • trunk/src/cairo/Matrix.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-cairo-matrix-t.html 
     25 * inFile  = cairo-matrix.html 
    2626 * outPack = cairo 
    2727 * outFile = Matrix 
  • trunk/src/cairo/Pattern.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Patterns.html 
     25 * inFile  = cairo-pattern.html 
    2626 * outPack = cairo 
    2727 * outFile = Pattern 
  • trunk/src/cairo/PdfSurface.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-PDF-Surfaces.html 
     25 * inFile  = cairo-pdf-surface.html 
    2626 * outPack = cairo 
    2727 * outFile = PdfSurface 
  • trunk/src/cairo/PostScriptSurface.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-PostScript-Surfaces.html 
     25 * inFile  = cairo-ps-surface.html 
    2626 * outPack = cairo 
    2727 * outFile = PostScriptSurface 
  • trunk/src/cairo/ScaledFont.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Scaled-Fonts.html 
     25 * inFile  = cairo-scaled-font.html 
    2626 * outPack = cairo 
    2727 * outFile = ScaledFont 
     
    210210     * Since 1.2 
    211211     * Params: 
    212      * utf8 =  a string of text, encoded in UTF-8 
     212     * utf8 =  a NUL-terminated string of text, encoded in UTF-8 
    213213     * extents =  a cairo_text_extents_t which to store the retrieved extents. 
    214214     */ 
     
    241241     
    242242    /** 
     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    /** 
    243294     * Gets the font face that this scaled font was created for. 
    244295     * Since 1.2 
     
    295346     
    296347    /** 
     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    /** 
    297363     * This function returns the type of the backend used to create 
    298364     * a scaled font. See cairo_font_type_t for available types. 
  • trunk/src/cairo/Status.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Error-Handling.html 
     25 * inFile  = cairo-error-status.html 
    2626 * outPack = cairo 
    2727 * outFile = Status 
  • trunk/src/cairo/Surface.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-cairo-surface-t.html 
     25 * inFile  = cairo-surface.html 
    2626 * outPack = cairo 
    2727 * outFile = Surface 
     
    183183     * that cairo will no longer access the drawable, which can be freed. 
    184184     * 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 
    187188     * surface but will instead trigger a CAIRO_STATUS_SURFACE_FINISHED 
    188189     * error. 
     
    338339     
    339340    /** 
     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    /** 
    340356     * This function returns the type of the backend used to create 
    341357     * a surface. See cairo_surface_type_t for available types. 
     
    400416     * be retained for the next page. Use cairo_surface_show_page() if you 
    401417     * 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(). 
    402420     * Since 1.6 
    403421     */ 
     
    411429     * Emits and clears the current page for backends that support multiple 
    412430     * 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(). 
    413433     * Since 1.6 
    414434     */ 
     
    418438        cairo_surface_show_page(cairo_surface); 
    419439    } 
     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    } 
    420462} 
  • trunk/src/cairo/SvgSurface.d

    r585 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-SVG-Surfaces.html 
     25 * inFile  = cairo-svg-surface.html 
    2626 * outPack = cairo 
    2727 * outFile = SvgSurface 
     
    159159     * Since 1.2 
    160160     * Params: 
    161      * versio =  SVG version 
     161     * version =  SVG version 
    162162     */ 
    163163    public void restrictToVersion(cairo_svg_version_t versio) 
     
    191191     * Since 1.2 
    192192     * Params: 
    193      * versio =  a version id 
     193     * version =  a version id 
    194194     * Returns: the string associated to given version. 
    195195     */ 
  • trunk/src/cairo/Types.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Types.html 
     25 * inFile  = cairo-types.html 
    2626 * outPack = cairo 
    2727 * outFile = Types 
  • trunk/src/cairo/Version.d

    r540 r630  
    2323/* 
    2424 * Conversion parameters: 
    25  * inFile  = cairo-Version-Information.html 
     25 * inFile  = cairo-version-info.html 
    2626 * outPack = cairo 
    2727 * outFile = Version 
     
    107107 * Cairo provides the ability to examine the version at either 
    108108 * 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 a 
    110  * 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. 
    111111 * Compile-time 
    112112 * ------------ 
    113  * %CAIRO_VERSION_STRING  Human-readable 
    114  * %CAIRO_VERSION     Encoded, suitable for comparison 
     113 * CAIRO_VERSION_STRING   Human-readable 
     114 * CAIRO_VERSION      Encoded, suitable for comparison 
    115115 * Run-time 
    116116 * -------- 
     
    119119 * For example, checking that the cairo version is greater than or equal 
    120120 * 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); 
    123123 * ##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 ()); 
    126126 */ 
    127127public class Version 
  • trunk/src/gtkc/cairo.d

    r499 r630  
    170170    void function(cairo_t* cr, char* utf8)cairo_show_text; 
    171171    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; 
    172173    void function(cairo_t* cr, cairo_font_extents_t* extents)cairo_font_extents; 
    173174    void function(cairo_t* cr, char* utf8, cairo_text_extents_t* extents)cairo_text_extents; 
    174175    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; 
    175184     
    176185    // cairo.Pattern 
     
    222231    void function(cairo_scaled_font_t* scaledFont, char* utf8, cairo_text_extents_t* extents)cairo_scaled_font_text_extents; 
    223232    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; 
    224234    cairo_font_face_t* function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_font_face; 
    225235    void function(cairo_scaled_font_t* scaledFont, cairo_font_options_t* options)cairo_scaled_font_get_font_options; 
    226236    void function(cairo_scaled_font_t* scaledFont, cairo_matrix_t* fontMatrix)cairo_scaled_font_get_font_matrix; 
    227237    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; 
    228239    cairo_font_type_t function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_type; 
    229240    uint function(cairo_scaled_font_t* scaledFont)cairo_scaled_font_get_reference_count; 
     
    249260    cairo_hint_metrics_t function(cairo_font_options_t* options)cairo_font_options_get_hint_metrics; 
    250261     
     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     
    251274    // cairo.Surface 
    252275     
     
    264287    void function(cairo_surface_t* surface, double* xOffset, double* yOffset)cairo_surface_get_device_offset; 
    265288    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; 
    266290    cairo_surface_type_t function(cairo_surface_t* surface)cairo_surface_get_type; 
    267291    uint function(cairo_surface_t* surface)cairo_surface_get_reference_count; 
     
    270294    void function(cairo_surface_t* surface)cairo_surface_copy_page; 
    271295    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; 
    272297     
    273298    // cairo.ImageSurface 
     
    451476    { "cairo_show_text",  cast(void**)& cairo_show_text}, 
    452477    { "cairo_show_glyphs",  cast(void**)& cairo_show_glyphs}, 
     478    { "cairo_show_text_glyphs",  cast(void**)& cairo_show_text_glyphs}, 
    453479    { "cairo_font_extents",  cast(void**)& cairo_font_extents}, 
    454480    { "cairo_text_extents",  cast(void**)& cairo_text_extents}, 
    455481    { "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}, 
    456490    { "cairo_pattern_add_color_stop_rgb",  cast(void**)& cairo_pattern_add_color_stop_rgb}, 
    457491    { "cairo_pattern_add_color_stop_rgba",  cast(void**)& cairo_pattern_add_color_stop_rgba}, 
     
    494528    { "cairo_scaled_font_text_extents",  cast(void**)& cairo_scaled_font_text_extents}, 
    495529    { "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}, 
    496531    { "cairo_scaled_font_get_font_face",  cast(void**)& cairo_scaled_font_get_font_face}, 
    497532    { "cairo_scaled_font_get_font_options",  cast(void**)& cairo_scaled_font_get_font_options}, 
    498533    { "cairo_scaled_font_get_font_matrix",  cast(void**)& cairo_scaled_font_get_font_matrix}, 
    499534    { "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}, 
    500536    { "cairo_scaled_font_get_type",  cast(void**)& cairo_scaled_font_get_type}, 
    501537    { "cairo_scaled_font_get_reference_count",  cast(void**)& cairo_scaled_font_get_reference_count}, 
     
    517553    { "cairo_font_options_set_hint_metrics",  cast(void**)& cairo_font_options_set_hint_metrics}, 
    518554    { "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}, 
    519564    { "cairo_surface_create_similar",  cast(void**)& cairo_surface_create_similar}, 
    520565    { "cairo_surface_reference",  cast(void**)& cairo_surface_reference}, 
     
    530575    { "cairo_surface_get_device_offset",  cast(void**)& cairo_surface_get_device_offset}, 
    531576    { "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}, 
    532578    { "cairo_surface_get_type",  cast(void**)& cairo_surface_get_type}, 
    533579    { "cairo_surface_get_reference_count",  cast(void**)& cairo_surface_get_reference_count}, 
     
    536582    { "cairo_surface_copy_page",  cast(void**)& cairo_surface_copy_page}, 
    537583    { "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}, 
    538585    { "cairo_format_stride_for_width",  cast(void**)& cairo_format_stride_for_width}, 
    539586    { "cairo_image_surface_create",  cast(void**)& cairo_image_surface_create}, 
  • trunk/src/gtkc/cairotypes.d

    r602 r630  
    175175 
    176176/** 
     177 * Specifies properties of a text cluster mapping. 
     178 * CAIRO_TEXT_CLUSTER_FLAG_BACKWARD 
     179 */ 
     180public enum cairo_text_cluster_flags_t 
     181{ 
     182    BACKWARD = 0x00000001 
     183} 
     184alias cairo_text_cluster_flags_t CairoTextClusterFlags; 
     185 
     186/** 
    177187 * cairo_extend_t is used to describe how pattern color/alpha will be