Changeset 499

Show
Ignore:
Timestamp:
05/01/08 11:02:48 (7 months ago)
Author:
Mike Wey
Message:

update cairo to 1.6.4

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cairo/Context.d

    r480 r499  
    222222    /** 
    223223     * Description 
     224     * Paths are the most basic drawing tools and are primarily used to implicitly 
     225     * generate simple masks. 
    224226     */ 
    225227     
    226228    /** 
    227229     * Description 
     230     * The current transformation matrix, ctm, is a 
     231     * two-dimensional affine transformation that maps all coordinates and other 
     232     * drawing instruments from the user space into the 
     233     * surface's canonical coordinate system, also known as the device 
     234     * space. 
    228235     */ 
    229236     
    230237    /** 
    231238     * Description 
     239     * Cairo has two sets of text rendering capabilities: 
     240     *  The functions with text in their name form cairo's 
     241     *  toy text API. The toy API takes UTF-8 encoded 
     242     *  text and is limited in its functionality to rendering simple 
     243     *  left-to-right text with no advanced features. That means for example 
     244     *  that most complex scripts like Hebrew, Arabic, and Indic scripts are 
     245     *  out of question. No kerning or correct positioning of diacritical marks 
     246     *  either. The font selection is pretty limited too and doesn't handle the 
     247     *  case that the selected font does not cover the characters in the text. 
     248     *  This set of functions are really that, a toy text API, for testing and 
     249     *  demonstration purposes. Any serious application should avoid them. 
     250     *  The functions with glyphs in their name form cairo's 
     251     *  low-level text API. The low-level API relies on 
     252     *  the user to convert text to a set of glyph indexes and positions. This 
     253     *  is a very hard problem and is best handled by external libraries, like 
     254     *  the pangocairo that is part of the Pango text layout and rendering library. 
     255     *  Pango is available from http://www.pango.org/. 
    232256     */ 
    233257     
     
    237261     * surface should be constructed with a backend-specific function such 
    238262     * as cairo_image_surface_create() (or any other 
    239      * cairo_<backend>_surface_create variant). 
     263     * cairo_backend_surface_create variant). 
    240264     * This function references target, so you can immediately 
    241265     * call cairo_surface_destroy() on it if you don't need to 
     
    290314    /** 
    291315     * Checks whether an error has previously occurred for this context. 
    292      * Returns:the current status of this context, see cairo_status_t 
     316     * Returns: the current status of this context, see cairo_status_t 
    293317     */ 
    294318    public cairo_status_t status() 
     
    391415     * Since 1.2 
    392416     * Params: 
    393      * content =  a cairo_content_t indicating the type of group that 
     417     * content =  a %cairo_content_t indicating the type of group that 
    394418     *  will be created 
    395419     */ 
     
    432456     
    433457    /** 
    434      * Gets the target surface for the current group as started by the 
    435      * most recent call to cairo_push_group() or 
    436      * cairo_push_group_with_content(). 
    437      * This function will return NULL if called "outside" of any group 
    438      * rendering blocks, (that is, after the last balancing call to 
    439      * cairo_pop_group() or cairo_pop_group_to_source()). 
     458     * Gets the current destination surface for the context. This is either 
     459     * the original target surface as passed to cairo_create() or the target 
     460     * surface for the current group as started by the most recent call to 
     461     * cairo_push_group() or cairo_push_group_with_content(). 
     462     * This function will always return a valid pointer, but the result 
     463     * can be a "nil" surface if cr is already in an error state, 
     464     * (ie. cairo_status() != CAIRO_STATUS_SUCCESS). 
     465     * A nil surface is indicated by cairo_surface_status() 
     466     * != CAIRO_STATUS_SUCCESS. 
    440467     * Since 1.2 
    441      * Returns: the target group surface, or NULL if none. Thisobject is owned by cairo. To keep a reference to it, you must callcairo_surface_reference(). 
     468     * Returns: the target surface. This object is owned by cairo. Tokeep a reference to it, you must call cairo_surface_reference(). 
    442469     */ 
    443470    public Surface getGroupTarget() 
     
    460487     * 1. If the values passed in are outside that range, they will be 
    461488     * clamped. 
     489     * The default source pattern is opaque black, (that is, it is 
     490     * equivalent to cairo_set_source_rgb (cr, 0.0, 0.0, 0.0)). 
    462491     * Params: 
    463492     * red =  red component of color 
     
    478507     * range 0 to 1. If the values passed in are outside that range, they 
    479508     * will be clamped. 
     509     * The default source pattern is opaque black, (that is, it is 
     510     * equivalent to cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0)). 
    480511     * Params: 
    481512     * red =  red component of color 
     
    498529     * that further modifications of the current transformation matrix 
    499530     * will not affect the source pattern. See cairo_pattern_set_matrix(). 
    500      * XXX: I'd also like to direct the reader's attention to some 
    501      * (not-yet-written) section on cairo's imaging model. How would I do 
    502      * that if such a section existed? (cworth). 
     531     * The default source pattern is a solid pattern that is opaque black, 
     532     * (that is, it is equivalent to cairo_set_source_rgb (cr, 0.0, 0.0, 
     533     * 0.0)). 
    503534     * Params: 
    504535     * source =  a cairo_pattern_t to be used as the source for 
     
    590621     * dashes. 
    591622     * If any value in dashes is negative, or if all values are 0, then 
    592      * cairo_t will be put into an error state with a status of 
    593      * CAIRO_STATUS_INVALID_DASH. 
     623     * cr will be put into an error state with a status of 
     624     * #CAIRO_STATUS_INVALID_DASH. 
    594625     * Params: 
    595626     * dashes =  an array specifying alternate lengths of on and off stroke portions 
     
    637668     * both cairo_fill() and cairo_clip(). See cairo_fill_rule_t for details 
    638669     * on the semantics of each available fill rule. 
     670     * The default fill rule is CAIRO_FILL_RULE_WINDING. 
    639671     * Params: 
    640672     * fillRule =  a fill rule, specified as a cairo_fill_rule_t 
     
    664696     * cairo_stroke_to_path(), but does not have any effect during path 
    665697     * construction. 
     698     * The default line cap style is CAIRO_LINE_CAP_BUTT. 
    666699     * Params: 
    667700     * lineCap =  a line cap style 
     
    691724     * cairo_stroke_to_path(), but does not have any effect during path 
    692725     * construction. 
    693      * Params: 
    694      * lineJoin =  a line joint style 
     726     * The default line join style is CAIRO_LINE_JOIN_MITER. 
     727     * Params: 
     728     * lineJoin =  a line join style 
    695729     */ 
    696730    public void setLineJoin(cairo_line_join_t lineJoin) 
     
    762796     * cairo_stroke_to_path(), but does not have any effect during path 
    763797     * construction. 
     798     * The default miter limit value is 10.0, which will convert joins 
     799     * with interior angles less than 11 degrees to bevels instead of 
     800     * miters. For reference, a miter limit of 2.0 makes the miter cutoff 
     801     * at 60 degrees, and a miter limit of 1.414 makes the cutoff at 90 
     802     * degrees. 
     803     * A miter limit for a desired angle can be computed as: miter limit = 
     804     * 1/sin(angle/2) 
    764805     * Params: 
    765806     * limit =  miter limit to set 
     
    785826     * operations. See cairo_operator_t for details on the semantics of 
    786827     * each available compositing operator. 
    787      * XXX: I'd also like to direct the reader's attention to some 
    788      * (not-yet-written) section on cairo's imaging model. How would I do 
    789      * that if such a section existed? (cworth). 
     828     * The default operator is CAIRO_OPERATOR_OVER. 
    790829     * Params: 
    791830     * op =  a compositing operator, specified as a cairo_operator_t 
     
    838877     * region with the current path as it would be filled by cairo_fill() 
    839878     * and according to the current fill rule (see cairo_set_fill_rule()). 
    840      * After cairo_clip, the current path will be cleared from the cairo 
     879     * After cairo_clip(), the current path will be cleared from the cairo 
    841880     * context. 
    842881     * The current clip region affects all drawing operations by 
     
    860899     * region with the current path as it would be filled by cairo_fill() 
    861900     * and according to the current fill rule (see cairo_set_fill_rule()). 
    862      * Unlike cairo_clip(), cairo_clip_preserve preserves the path within 
     901     * Unlike cairo_clip(), cairo_clip_preserve() preserves the path within 
    863902     * the cairo context. 
    864903     * The current clip region affects all drawing operations by 
     
    933972     * user-space rectangles. The status may have other values to indicate 
    934973     * other errors. 
    935      * The caller must always call cairo_rectangle_list_destroy on the result of 
    936      * this function. 
    937974     * Since 1.4 
    938      * Returns: the current clip region as a list of rectangles in user coordinates
     975     * Returns: the current clip region as a list of rectangles in user coordinates,which should be destroyed using cairo_rectangle_list_destroy()
    939976     */ 
    940977    public cairo_rectangle_list_t* copyClipRectangleList() 
     
    947984     * A drawing operator that fills the current path according to the 
    948985     * current fill rule, (each sub-path is implicitly closed before being 
    949      * filled). After cairo_fill, the current path will be cleared from 
     986     * filled). After cairo_fill(), the current path will be cleared from 
    950987     * the cairo context. See cairo_set_fill_rule() and 
    951988     * cairo_fill_preserve(). 
     
    960997     * A drawing operator that fills the current path according to the 
    961998     * current fill rule, (each sub-path is implicitly closed before being 
    962      * filled). Unlike cairo_fill(), cairo_fill_preserve preserves the 
     999     * filled). Unlike cairo_fill(), cairo_fill_preserve() preserves the 
    9631000     * path within the cairo context. 
    9641001     * See cairo_set_fill_rule() and cairo_fill(). 
     
    9721009    /** 
    9731010     * Computes a bounding box in user coordinates covering the area that 
    974      * would be affected by a cairo_fill() operation given the current path 
    975      * and fill parameters. If the current path is empty, returns an empty 
    976      * rectangle (0,0, 0,0). Surface dimensions and clipping are not taken 
    977      * into account. 
     1011     * would be affected, (the "inked" area), by a cairo_fill() operation 
     1012     * given the current path and fill parameters. If the current path is 
     1013     * empty, returns an empty rectangle ((0,0), (0,0)). Surface 
     1014     * dimensions and clipping are not taken into account. 
     1015     * Contrast with cairo_path_extents(), which is similar, but returns 
     1016     * non-zero extents for some paths with no inked area, (such as a 
     1017     * simple line segment). 
     1018     * Note that cairo_fill_extents() must necessarily do more work to 
     1019     * compute the precise inked areas in light of the fill rule, so 
     1020     * cairo_path_extents() may be more desirable for sake of performance 
     1021     * if the non-inked path extents are desired. 
    9781022     * See cairo_fill(), cairo_set_fill_rule() and cairo_fill_preserve(). 
    9791023     * Params: 
     
    10791123     * A drawing operator that strokes the current path according to the 
    10801124     * current line width, line join, line cap, and dash settings. Unlike 
    1081      * cairo_stroke(), cairo_stroke_preserve preserves the path within the 
     1125     * cairo_stroke(), cairo_stroke_preserve() preserves the path within the 
    10821126     * cairo context. 
    10831127     * See cairo_set_line_width(), cairo_set_line_join(), 
     
    10931137    /** 
    10941138     * Computes a bounding box in user coordinates covering the area that 
    1095      * would be affected by a cairo_stroke() operation operation given the 
    1096      * current path and stroke parameters. If the current path is empty, 
     1139     * would be affected, (the "inked" area), by a cairo_stroke() 
     1140     * operation operation given the current path and stroke 
     1141     * parameters. If the current path is empty, returns an empty 
     1142     * rectangle ((0,0), (0,0)). Surface dimensions and clipping are not 
     1143     * taken into account. 
     1144     * Note that if the line width is set to exactly zero, then 
     1145     * cairo_stroke_extents() will return an empty rectangle. Contrast with 
     1146     * cairo_path_extents() which can be used to compute the non-empty 
     1147     * bounds as the line width approaches zero. 
     1148     * Note that cairo_stroke_extents() must necessarily do more work to 
     1149     * compute the precise inked areas in light of the stroke parameters, 
     1150     * so cairo_path_extents() may be more desirable for sake of 
     1151     * performance if non-inked path extents are desired. 
     1152     * See cairo_stroke(), cairo_set_line_width(), cairo_set_line_join(), 
     1153     * cairo_set_line_cap(), cairo_set_dash(), and 
     1154     * cairo_stroke_preserve(). 
    10971155     * Params: 
    10981156     * x1 =  left of the resulting extents 
     
    11311189     * for the next page too. Use cairo_show_page() if you want to get an 
    11321190     * empty page after the emission. 
     1191     * This is a convenience function that simply calls 
     1192     * cairo_surface_copy_page() on cr's target. 
    11331193     */ 
    11341194    public void copyPage() 
     
    11411201     * Emits and clears the current page for backends that support multiple 
    11421202     * pages. Use cairo_copy_page() if you don't want to clear the page. 
     1203     * This is a convenience function that simply calls 
     1204     * cairo_surface_show_page() on cr's target. 
    11431205     */ 
    11441206    public void showPage() 
     
    12341296     * to cairo_path_destroy() the path pointer is no longer valid and 
    12351297     * should not be used further. 
    1236      * NOTE: cairo_path_destroy function should only be called with a 
     1298     * Note: cairo_path_destroy() should only be called with a 
    12371299     * pointer to a cairo_path_t returned by a cairo function. Any path 
    12381300     * that is created manually (ie. outside of cairo) should be destroyed 
     
    12651327     
    12661328    /** 
     1329     * Returns whether a current point is defined on the current path. 
     1330     * See cairo_get_current_point() for details on the current point. 
     1331     * Since 1.6 
     1332     * Returns: whether a current point is defined. 
     1333     */ 
     1334    public cairo_bool_t hasCurrentPoint() 
     1335    { 
     1336        // cairo_bool_t cairo_has_current_point (cairo_t *cr); 
     1337        return cairo_has_current_point(cairo); 
     1338    } 
     1339     
     1340    /** 
    12671341     * Gets the current point of the current path, which is 
    12681342     * conceptually the final point reached by the path so far. 
    12691343     * The current point is returned in the user-space coordinate 
    1270      * system. If there is no defined current point then x and y will 
    1271      * both be set to 0.0. 
     1344     * system. If there is no defined current point or if cr is in an 
     1345     * error status, x and y will both be set to 0.0. It is possible to 
     1346     * check this in advance with cairo_has_current_point(). 
    12721347     * Most path construction functions alter the current point. See the 
    12731348     * Params: 
     
    13191394     * the ends of the sub-path. Instead, there is a line join connecting 
    13201395     * the final and initial segments of the sub-path. 
    1321      * If there is no current point before the call to cairo_close_path
     1396     * If there is no current point before the call to cairo_close_path()
    13221397     * this function will have no effect. 
    1323      * Note: As of cairo version 1.2.4 any call to cairo_close_path will 
     1398     * Note: As of cairo version 1.2.4 any call to cairo_close_path() will 
    13241399     * place an explicit MOVE_TO element into the path immediately after 
    13251400     * the CLOSE_PATH element, (which can be seen in cairo_copy_path() for 
     
    13431418     * If there is a current point, an initial line segment will be added 
    13441419     * to the path to connect the current point to the beginning of the 
    1345      * arc. 
     1420     * arc. If this initial line is undesired, it can be avoided by 
     1421     * calling cairo_new_sub_path() before calling cairo_arc(). 
    13461422     * Angles are measured in radians. An angle of 0.0 is in the direction 
    13471423     * of the positive X axis (in user space). An angle of M_PI/2.0 radians 
     
    14831559     * This allows for chaining multiple calls to to cairo_text_path() 
    14841560     * without having to set current point in between. 
    1485      * NOTE: The cairo_text_path() function call is part of what the cairo 
     1561     * Note: The cairo_text_path() function call is part of what the cairo 
    14861562     * designers call the "toy" text API. It is convenient for short demos 
    14871563     * and simple programs, but it is not expected to be adequate for 
     
    15641640     
    15651641    /** 
     1642     * Computes a bounding box in user-space coordinates covering the 
     1643     * points on the current path. If the current path is empty, returns 
     1644     * an empty rectangle ((0,0), (0,0)). Stroke parameters, fill rule, 
     1645     * surface dimensions and clipping are not taken into account. 
     1646     * Contrast with cairo_fill_extents() and cairo_stroke_extents() which 
     1647     * return the extents of only the area that would be "inked" by 
     1648     * the corresponding drawing operations. 
     1649     * The result of cairo_path_extents() is defined as equivalent to the 
     1650     * limit of cairo_stroke_extents() with CAIRO_LINE_CAP_ROUND as the 
     1651     * line width approaches 0.0, (but never reaching the empty-rectangle 
     1652     * returned by cairo_stroke_extents() for a line width of 0.0). 
     1653     * Specifically, this means that zero-area sub-paths such as 
     1654     * cairo_move_to();cairo_line_to() segments, (even degenerate cases 
     1655     * where the coordinates to both calls are identical), will be 
     1656     * considered as contributing to the extents. However, a lone 
     1657     * cairo_move_to() will not contribute to the results of 
     1658     * cairo_path_extents(). 
     1659     * Since 1.6 
     1660     * Params: 
     1661     * x1 =  left of the resulting extents 
     1662     * y1 =  top of the resulting extents 
     1663     * x2 =  right of the resulting extents 
     1664     * y2 =  bottom of the resulting extents 
     1665     */ 
     1666    public void pathExtents(double* x1, double* y1, double* x2, double* y2) 
     1667    { 
     1668        // void cairo_path_extents (cairo_t *cr,  double *x1,  double *y1,  double *x2,  double *y2); 
     1669        cairo_path_extents(cairo, x1, y1, x2, y2); 
     1670    } 
     1671     
     1672    /** 
    15661673     * Modifies the current transformation matrix (CTM) by translating the 
    15671674     * user-space origin by (tx, ty). This offset is interpreted as a 
    15681675     * user-space coordinate according to the CTM in place before the new 
    1569      * call to cairo_translate. In other words, the translation of the 
     1676     * call to cairo_translate(). In other words, the translation of the 
    15701677     * user-space origin takes place after any existing transformation. 
    15711678     * Params: 
     
    17171824     
    17181825    /** 
     1826     * Note: The cairo_select_font_face() function call is part of what 
     1827     * the cairo designers call the "toy" text API. It is convenient for 
     1828     * short demos and simple programs, but it is not expected to be 
     1829     * adequate for serious text-using applications. 
    17191830     * Selects a family and style of font from a simplified description as 
    1720      * a family name, slant and weight. This function is meant to be used 
    1721      * only for applications with simple font needs: Cairo doesn't provide 
    1722      * for operations such as listing all available fonts on the system, 
    1723      * and it is expected that most applications will need to use a more 
    1724      * comprehensive font handling and text layout library in addition to 
    1725      * cairo. 
     1831     * a family name, slant and weight. Cairo provides no operation to 
     1832     * list available family names on the system (this is a "toy", 
     1833     * remember"), but the standard CSS2 generic family names, ("serif", 
     1834     * "sans-serif", "cursive", "fantasy", "monospace"), are likely to 
     1835     * work as expected. 
     1836     * For "real" font selection, see the font-backend-specific 
     1837     * font_face_create functions for the font backend you are using. (For 
     1838     * example, if you are using the freetype-based cairo-ft font backend, 
     1839     * see cairo_ft_font_face_create_for_ft_face() or 
     1840     * cairo_ft_font_face_create_for_pattern().) The resulting font face 
     1841     * could then be used with cairo_scaled_font_create() and 
     1842     * cairo_set_scaled_font(). 
     1843     * Similarly, when using the "real" font support, you can call 
     1844     * directly into the underlying font system, (such as fontconfig or 
     1845     * freetype), for operations such as listing available fonts, etc. 
     1846     * It is expected that most applications will need to use a more 
     1847     * comprehensive font handling and text layout library, (for example, 
     1848     * pango), in conjunction with cairo. 
     1849     * If text is drawn without a call to cairo_select_font_face(), (nor 
     1850     * cairo_set_font_face() nor cairo_set_scaled_font()), the default 
     1851     * family is "sans", slant is CAIRO_FONT_SLANT_NORMAL, and weight is 
     1852     * CAIRO_FONT_WEIGHT_NORMAL. 
    17261853     * Params: 
    17271854     * family =  a font family name, encoded in UTF-8 
     
    17411868     * units. (More precisely, this matrix will result in the font's 
    17421869     * em-square being a size by size square in user space.) 
     1870     * If text is drawn without a call to cairo_set_font_size(), (nor 
     1871     * cairo_set_font_matrix() nor cairo_set_scaled_font()), the default 
     1872     * font size is 10.0. 
    17431873     * Params: 
    17441874     * size =  the new font size, in user space units 
     
    18852015     * by its advance values. This allows for easy display of a single 
    18862016     * logical string with multiple calls to cairo_show_text(). 
    1887      * NOTE: The cairo_show_text() function call is part of what the cairo 
     2017     * Note: The cairo_show_text() function call is part of what the cairo 
    18882018     * designers call the "toy" text API. It is convenient for short demos 
    18892019     * and simple programs, but it is not expected to be adequate for 
  • trunk/src/cairo/FontFace.d

    r480 r499  
    6363/** 
    6464 * Description 
     65 * cairo_font_face_t represents a particular font at a particular weight, 
     66 * slant, and other characteristic but no size, transformation, or size. 
     67 * Font faces are created using font-backend-specific 
     68 * constructors, typically of the form 
     69 * cairo_backend_font_face_create(), 
     70 * or implicitly using the toy text API by way of 
     71 * cairo_select_font_face(). The resulting face can be accessed using 
     72 * cairo_get_font_face(). 
    6573 */ 
    6674public class FontFace 
  • trunk/src/cairo/FontOption.d

    r480 r499  
    6363/** 
    6464 * Description 
     65 * The font options specify how fonts should be rendered. Most of the time the 
     66 * font options implied by a surface are just right and do not need any changes, 
     67 * but for pixel-based targets tweaking font options may result in superior 
     68 * output on a particular display. 
    6569 */ 
    6670public class FontOption 
     
    185189     * Params: 
    186190     * other =  another cairo_font_options_t 
    187      * Returns: TRUE if all fields of the two font options objects match 
     191     * Returns: TRUE if all fields of the two font options objects match.Note that this function will return FALSE if either object is inerror. 
    188192     */ 
    189193    public cairo_bool_t equal(FontOption other) 
  • trunk/src/cairo/ImageSurface.d

    r480 r499  
    3838 * prefixes: 
    3939 *  - cairo_image_surface_ 
     40 *  - cairo_ 
    4041 * omit structs: 
    4142 * omit prefixes: 
     
    6667/** 
    6768 * Description 
    68  * Image surfaces provide the ability to render to memory buffers 
    69  * either allocated by cairo or by the calling code. The supported 
    70  * image formats are those defined in cairo_format_t. 
     69 * Image surfaces provide the ability to render to memory buffers 
     70 * either allocated by cairo or by the calling code. The supported 
     71 * image formats are those defined in cairo_format_t. 
    7172 */ 
    7273public class ImageSurface : Surface 
     
    106107    /** 
    107108     * Description 
    108      */ 
     109     * The PNG functions allow reading PNG images into image surfaces, and writing 
     110     * any surface to a PNG file. 
     111     */ 
     112     
     113    /** 
     114     * This function provides a stride value that will respect all 
     115     * alignment requirements of the accelerated image-rendering code 
     116     * Since 1.6 
     117     * Params: 
     118     * format =  A cairo_format_t value 
     119     * width =  The desired width of an image surface to be created. 
     120     * Returns: the appropriate stride to use given the desiredformat and width, or -1 if either the format is invalid or the widthtoo large. 
     121     */ 
     122    public static int formatStrideForWidth(cairo_format_t format, int width) 
     123    { 
     124        // int cairo_format_stride_for_width (cairo_format_t format,  int width); 
     125        return cairo_format_stride_for_width(format, width); 
     126    } 
    109127     
    110128    /** 
     
    118136     * width =  width of the surface, in pixels 
    119137     * height =  height of the surface, in pixels 
    120      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
     138     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
    121139     */ 
    122140    public static ImageSurface create(cairo_format_t format, int width, int height) 
     
    139157     * must explicitly clear the buffer, using, for example, 
    140158     * cairo_rectangle() and cairo_fill() if you want it cleared. 
    141      * Params: 
    142      * data =  a pointer to a buffer supplied by the application 
    143      *  in which to write contents. 
     159     * Note that the stride may be larger than 
     160     * width*bytes_per_pixel to provide proper alignment for each pixel 
     161     * and row. This alignment is required to allow high-performance rendering 
     162     * within cairo. The correct way to obtain a legal stride value is to 
     163     * call cairo_format_stride_for_width() with the desired format and 
     164     * maximum image width value, and the use the resulting stride value 
     165     * to allocate the data and to create the image surface. See 
     166     * cairo_format_stride_for_width() for example code. 
     167     * Params: 
     168     * data =  a pointer to a buffer supplied by the application in which 
     169     *  to write contents. This pointer must be suitably aligned for any 
     170     *  kind of variable, (for example, a pointer returned by malloc). 
    144171     * format =  the format of pixels in the buffer 
    145172     * width =  the width of the image to be stored in the buffer 
    146173     * height =  the height of the image to be stored in the buffer 
    147      * stride =  the number of bytes between the start of rows 
    148      *  in the buffer. Having this be specified separate from width 
    149      *  allows for padding at the end of rows, or for writing 
    150      *  to a subportion of a larger image
    151      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this.See cairo_surface_set_user_data() for a means of attaching adestroy-notification fallback to the surface if necessary. 
     174     * stride =  the number of bytes between the start of rows in the 
     175     *  buffer as allocated. This value should always be computed by 
     176     *  cairo_format_stride_for_width() before allocating the data 
     177     *  buffer
     178     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface in the case of an error such as out ofmemory or an invalid stride value. In case of invalid stride valuethe error status of the returned surface will beCAIRO_STATUS_INVALID_STRIDE. You can usecairo_surface_status() to check for this.See cairo_surface_set_user_data() for a means of attaching adestroy-notification fallback to the surface if necessary. 
    152179     */ 
    153180    public static ImageSurface createForData(ubyte* data, cairo_format_t format, int width, int height, int stride) 
     
    260287     * image. 
    261288     * Params: 
     289     * surface =  a cairo_surface_t with pixel contents 
    262290     * filename =  the name of a file to write to 
    263291     * Returns: CAIRO_STATUS_SUCCESS if the PNG file was writtensuccessfully. Otherwise, CAIRO_STATUS_NO_MEMORY if memory could notbe allocated for the operation orCAIRO_STATUS_SURFACE_TYPE_MISMATCH if the surface does not havepixel contents, or CAIRO_STATUS_WRITE_ERROR if an I/O error occurswhile attempting to write the file. 
    264292     */ 
    265     public cairo_status_t writeToPng(string filename) 
     293    public cairo_status_t surfaceWriteToPng(string filename) 
    266294    { 
    267295        // cairo_status_t cairo_surface_write_to_png (cairo_surface_t *surface,  const char *filename); 
     
    272300     * Writes the image surface to the write function. 
    273301     * Params: 
     302     * surface =  a cairo_surface_t with pixel contents 
    274303     * writeFunc =  a cairo_write_func_t 
    275304     * closure =  closure data for the write function 
    276305     * Returns: CAIRO_STATUS_SUCCESS if the PNG file was writtensuccessfully. Otherwise, CAIRO_STATUS_NO_MEMORY is returned ifmemory could not be allocated for the operation,CAIRO_STATUS_SURFACE_TYPE_MISMATCH if the surface does not havepixel contents. 
    277306     */ 
    278     public cairo_status_t writeToPngStream(cairo_write_func_t writeFunc, void* closure) 
     307    public cairo_status_t surfaceWriteToPngStream(cairo_write_func_t writeFunc, void* closure) 
    279308    { 
    280309        // cairo_status_t cairo_surface_write_to_png_stream (cairo_surface_t *surface,  cairo_write_func_t write_func,  void *closure); 
  • trunk/src/cairo/Pattern.d

    r480 r499  
    6969/** 
    7070 * Description 
     71 * cairo_pattern_t is the paint with which cairo draws. 
     72 * The primary use of patterns is as the source for all cairo drawing operations, 
     73 * although they can also be used as masks, that is, as the brush too. 
     74 * A cairo pattern is created by using one of the many constructors, 
     75 * of the form cairo_pattern_create_type() 
     76 * or implicitly through 
     77 * cairo_set_source_type() functions. 
    7178 */ 
    7279public class Pattern 
     
    430437     * See cairo_extend_t for details on the semantics of each extend 
    431438     * strategy. 
     439     * The default extend mode is CAIRO_EXTEND_NONE for surface patterns 
     440     * and CAIRO_EXTEND_PAD for gradient patterns. 
    432441     * Params: 
    433442     * extend =  a cairo_extend_t describing how the area outside of the 
     
    454463     * Sets the filter to be used for resizing when using this pattern. 
    455464     * See cairo_filter_t for details on each filter. 
     465     * * Note that you might want to control filtering even when you do not 
     466     * have an explicit cairo_pattern_t object, (for example when using 
     467     * cairo_set_source_surface()). In these cases, it is convenient to 
     468     * use cairo_get_source() to get access to the pattern that cairo 
    456469     * Params: 
    457470     * filter =  a cairo_filter_t describing the filter to use for resizing 
  • trunk/src/cairo/PdfSurface.d

    r480 r499  
    6666/** 
    6767 * Description 
     68 * The PDF surface is used to render cairo graphics to Adobe 
     69 * PDF files and is a multi-page vector surface backend. 
    6870 */ 
    6971public class PdfSurface : Surface 
     
    112114     * widthInPoints =  width of the surface, in points (1 point == 1/72.0 inch) 
    113115     * heightInPoints =  height of the surface, in points (1 point == 1/72.0 inch) 
    114      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
     116     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
    115117     */ 
    116118    public static PdfSurface create(string filename, double widthInPoints, double heightInPoints) 
     
    135137     * widthInPoints =  width of the surface, in points (1 point == 1/72.0 inch) 
    136138     * heightInPoints =  height of the surface, in points (1 point == 1/72.0 inch) 
    137      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
     139     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
    138140     */ 
    139141    public static PdfSurface createForStream(cairo_write_func_t writeFunc, void* closure, double widthInPoints, double heightInPoints) 
  • trunk/src/cairo/PostScriptSurface.d

    r480 r499  
    6666/** 
    6767 * Description 
     68 * The PostScript surface is used to render cairo graphics to Adobe 
     69 * PostScript files and is a multi-page vector surface backend. 
    6870 */ 
    6971public class PostScriptSurface : Surface 
     
    116118     * widthInPoints =  width of the surface, in points (1 point == 1/72.0 inch) 
    117119     * heightInPoints =  height of the surface, in points (1 point == 1/72.0 inch) 
    118      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
     120     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
    119121     */ 
    120122    public static PostScriptSurface create(string filename, double widthInPoints, double heightInPoints) 
     
    143145     * widthInPoints =  width of the surface, in points (1 point == 1/72.0 inch) 
    144146     * heightInPoints =  height of the surface, in points (1 point == 1/72.0 inch) 
    145      * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
     147     * Returns: a pointer to the newly created surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if an error such as out of memoryoccurs. You can use cairo_surface_status() to check for this. 
    146148     */ 
    147149    public static PostScriptSurface createForStream(cairo_write_func_t writeFunc, void* closure, double widthInPoints, double heightInPoints) 
     
    155157        } 
    156158        return new PostScriptSurface(cast(cairo_surface_t*) p); 
     159    } 
     160     
     161    /** 
     162     * Restricts the generated PostSript file to level. See 
     163     * cairo_ps_get_levels() for a list of available level values that 
     164     * can be used here. 
     165     * This function should only be called before any drawing operations 
     166     * have been performed on the given surface. The simplest way to do 
     167     * this is to call this function immediately after creating the 
     168     * surface. 
     169     * Since 1.6 
     170     * Params: 
     171     * level =  PostScript level 
     172     */ 
     173    public void restrictToLevel(cairo_ps_level_t level) 
     174    { 
     175        // void cairo_ps_surface_restrict_to_level (cairo_surface_t *surface,  cairo_ps_level_t level); 
     176        cairo_ps_surface_restrict_to_level(cairo_surface, level); 
     177    } 
     178     
     179    /** 
     180     * Used to retrieve the list of supported levels. See 
     181     * cairo_ps_surface_restrict_to_level(). 
     182     * Since 1.6 
     183     * Params: 
     184     * levels =  supported level list 
     185     * numLevels =  list length 
     186     */ 
     187    public static void cairoPsGetLevels(cairo_ps_level_t** levels, int* numLevels) 
     188    { 
     189        // void cairo_ps_get_levels (cairo_ps_level_t const **levels,  int *num_levels); 
     190        cairo_ps_get_levels(levels, numLevels); 
     191    } 
     192     
     193    /** 
     194     * Get the string representation of the given level id. This function 
     195     * will return NULL if level id isn't valid. See cairo_ps_get_levels() 
     196     * for a way to get the list of valid level ids. 
     197     * Since 1.6 
     198     * Params: 
     199     * level =  a level id 
     200     * Returns: the string associated to given level. 
     201     */ 
     202    public static string cairoPsLevelToString(cairo_ps_level_t level) 
     203    { 
     204        // const char* cairo_ps_level_to_string (cairo_ps_level_t level); 
     205        return Str.toString(cairo_ps_level_to_string(level)); 
     206    } 
     207     
     208    /** 
     209     * If eps is TRUE, the PostScript surface will output Encapsulated 
     210     * PostScript. 
     211     * This function should only be called before any drawing operations 
     212     * have been performed on the current page. The simplest way to do 
     213     * this is to call this function immediately after creating the 
     214     * surface. An Encapsulated PostScript file should never contain more 
     215     * than one page. 
     216     * Since 1.6 
     217     * Params: 
     218     * eps =  TRUE to output EPS format PostScript 
     219     */ 
     220    public void setEps(cairo_bool_t eps) 
     221    { 
     222        // void cairo_ps_surface_set_eps (cairo_surface_t *surface,  cairo_bool_t eps); 
     223        cairo_ps_surface_set_eps(cairo_surface, eps); 
     224    } 
     225     
     226    /** 
     227     * Check whether the PostScript surface will output Encapsulated PostScript. 
     228     * Since 1.6 
     229     * Returns: TRUE if the surface will output Encapsulated PostScript. 
     230     */ 
     231    public cairo_bool_t getEps() 
     232    { 
     233        // cairo_bool_t cairo_ps_surface_get_eps (cairo_surface_t *surface); 
     234        return cairo_ps_surface_get_eps(cairo_surface); 
    157235    } 
    158236     
  • trunk/src/cairo/ScaledFont.d

    r480 r499  
    7474/** 
    7575 * Description 
     76 * cairo_scaled_font_t represents a realization of a font face at a particular 
     77 * size and transformation and a certain set of font options. 
    7678 */ 
    7779public class ScaledFont 
     
    125127     *  be used. 
    126128     * options =  options to use when getting metrics for the font and 
    127      *  rendering with it. 
     129     *  rendering with it. A NULL pointer will be interpreted as 
     130     *  meaning the default options. 
    128131     * Returns: a newly created cairo_scaled_font_t. Destroy with cairo_scaled_font_destroy() 
    129132     */ 
  • trunk/src/cairo/Status.d

    r480 r499  
    6565/** 
    6666 * Description 
     67 * Cairo uses a single status type to represent all kinds of errors. A status 
     68 * value of CAIRO_STATUS_SUCCESS represents no error and has an integer value 
     69 * of zero. All other status values represent an error. 
     70 * Cairo's error handling is designed to be easy to use and safe. All major 
     71 * cairo objects retain an error status internally which 
     72 * can be queried anytime by the users using cairo*_status() calls. In 
     73 * the mean time, it is safe to call all cairo functions normally even if the 
     74 * underlying object is in an error status. This means that no error handling 
     75 * code is required before or after each individual cairo function call. 
    6776 */ 
    6877public class Status 
     
    7685     * Params: 
    7786     * status =  a cairo status 
    78      * Returns:a string representation of the status 
     87     * Returns: a string representation of the status 
    7988     */ 
    8089    public static string oString(cairo_status_t status) 
     
    9099     * This function is intended to be useful when using memory-checking 
    91100     * tools such as valgrind. When valgrind's memcheck analyzes a 
    92      * cairo-using program without a call to cairo_debug_reset_static_data
     101     * cairo-using program without a call to cairo_debug_reset_static_data()
    93102     * it will report all data reachable via cairo's static objects as 
    94      * "still reachable". Calling cairo_debug_reset_static_data just prior 
     103     * "still reachable". Calling cairo_debug_reset_static_data() just prior 
    95104     * to program termination will make it easier to get squeaky clean 
    96105     * reports from valgrind. 
  • trunk/src/cairo/Surface.d

    <
    r480 r499  
    6565/** 
    6666 * Description 
     67 * cairo_surface_t is the abstract type representing all different drawing 
     68 * targets that cairo can render to. The actual drawings are 
     69 * performed using a cairo context. 
     70 * A cairo surface is created by using backend-specific 
     71 * constructors, typically of the form 
     72 * cairo_backend_surface_create(). 
    6773 */ 
    6874public class Surface 
     
    115121     * width =  width of the new surface, (in device-space units) 
    116122     * height =  height of the new surface (in device-space units) 
    117      * Returns: a pointer to the newly allocated surface. The callerowns the surface and should call cairo_surface_destroy when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if other is already in an error stateor any other error occurs. 
     123     * Returns: a pointer to the newly allocated surface. The callerowns the surface and should call cairo_surface_destroy() when donewith it.This function always returns a valid pointer, but it will return apointer to a "nil" surface if other is already in an error stateor any other error occurs. 
    118124     */ 
    119125    public Surface createSimilar(cairo_content_t content, int width, int height) 
     
    313319     * device resolution. So this function has no effect on those 
    314320     * backends. 
    315      * NOTE: The fallback resolution only takes effect at the time of 
     321     * Note: The fallback resolution only takes effect at the time of 
    316322     * completing a page (with cairo_show_page() or cairo_copy_page()) so 
    317323     * there is currently no way to have more than one fallback resolution 
    318324     * in effect on a single page. 
     325     * The default fallback resoultion is 300 pixels per inch in both 
     326     * dimensions. 
    319327     * Since 1.2 
    320328     * Params: 
     
    385393        return cairo_surface_get_user_data(cairo_surface, key); 
    386394    } 
     395     
     396    /** 
     397     * Emits the current page for backends that support multiple pages, 
     398     * but doesn't clear it, so that the contents of the current page will 
     399     * be retained for the next page. Use cairo_surface_show_page() if you 
     400     * want to get an empty page after the emission. 
     401     * Since 1.6 
     402     */ 
     403