mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 22:48:07 +02:00
[doc] Some documentation love
This commit is contained in:
parent
8a6308e144
commit
9be961eb0c
7 changed files with 154 additions and 14 deletions
|
|
@ -149,7 +149,7 @@ slim_hidden_def (cairo_font_face_destroy);
|
|||
|
||||
/**
|
||||
* cairo_font_face_get_type:
|
||||
* @font_face: a #cairo_font_face_t
|
||||
* @font_face: a font face
|
||||
*
|
||||
* This function returns the type of the backend used to create
|
||||
* a font face. See #cairo_font_type_t for available types.
|
||||
|
|
|
|||
|
|
@ -846,6 +846,15 @@ cairo_pattern_get_matrix (cairo_pattern_t *pattern, cairo_matrix_t *matrix)
|
|||
*matrix = pattern->matrix;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_pattern_set_filter:
|
||||
* @pattern: a #cairo_pattern_t
|
||||
* @filter: a #cairo_filter_t describing the filter to use for resizing
|
||||
* the pattern
|
||||
*
|
||||
* Sets the filter to be used for resizing when using this pattern.
|
||||
* See #cairo_filter_t for details on each filter.
|
||||
**/
|
||||
void
|
||||
cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter)
|
||||
{
|
||||
|
|
@ -855,6 +864,15 @@ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter)
|
|||
pattern->filter = filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_pattern_get_filter:
|
||||
* @pattern: a #cairo_pattern_t
|
||||
*
|
||||
* Gets the current filter for a pattern. See #cairo_filter_t
|
||||
* for details on each filter.
|
||||
*
|
||||
* Return value: the current filter used for resizing the pattern.
|
||||
**/
|
||||
cairo_filter_t
|
||||
cairo_pattern_get_filter (cairo_pattern_t *pattern)
|
||||
{
|
||||
|
|
@ -1740,6 +1758,7 @@ cairo_pattern_get_surface (cairo_pattern_t *pattern,
|
|||
* cairo_pattern_get_color_stop_rgba
|
||||
* @pattern: a #cairo_pattern_t
|
||||
* @index: index of the stop to return data for
|
||||
* @offset: return value for the offset of the stop, or %NULL
|
||||
* @red: return value for red component of color, or %NULL
|
||||
* @green: return value for green component of color, or %NULL
|
||||
* @blue: return value for blue component of color, or %NULL
|
||||
|
|
|
|||
|
|
@ -141,10 +141,12 @@ slim_hidden_def (cairo_surface_get_type);
|
|||
* cairo_surface_get_content:
|
||||
* @surface: a #cairo_surface_t
|
||||
*
|
||||
* Return value: The content type of @surface which indicates whether
|
||||
* the surface contains color and/or alpha information. See
|
||||
* This function returns the content type of @surface which indicates
|
||||
* whether the surface contains color and/or alpha information. See
|
||||
* #cairo_content_t.
|
||||
*
|
||||
* Return value: The content type of @surface.
|
||||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
cairo_content_t
|
||||
|
|
|
|||
|
|
@ -1664,7 +1664,7 @@ cairo_win32_scaled_font_select_font (cairo_scaled_font_t *scaled_font,
|
|||
|
||||
/**
|
||||
* cairo_win32_scaled_font_done_font:
|
||||
* @scaled_font: A #cairo_scaled_font_t from the Win32 font backend.
|
||||
* @scaled_font: A scaled font from the Win32 font backend.
|
||||
*
|
||||
* Releases any resources allocated by cairo_win32_scaled_font_select_font()
|
||||
**/
|
||||
|
|
@ -1675,7 +1675,7 @@ cairo_win32_scaled_font_done_font (cairo_scaled_font_t *scaled_font)
|
|||
|
||||
/**
|
||||
* cairo_win32_scaled_font_get_metrics_factor:
|
||||
* @scaled_font: a #cairo_scaled_font_t from the Win32 font backend
|
||||
* @scaled_font: a scaled font from the Win32 font backend
|
||||
*
|
||||
* Gets a scale factor between logical coordinates in the coordinate
|
||||
* space used by cairo_win32_scaled_font_select_font() (that is, the
|
||||
|
|
@ -1691,6 +1691,16 @@ cairo_win32_scaled_font_get_metrics_factor (cairo_scaled_font_t *scaled_font)
|
|||
return 1. / ((cairo_win32_scaled_font_t *)scaled_font)->logical_scale;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_win32_scaled_font_get_logical_to_device:
|
||||
* @scaled_font: a scaled font from the Win32 font backend
|
||||
* @logical_to_device: matrix to return
|
||||
*
|
||||
* Gets the transformation mapping the logical space used by @scaled_font
|
||||
* to device space.
|
||||
*
|
||||
* Since: 1.4
|
||||
**/
|
||||
void
|
||||
cairo_win32_scaled_font_get_logical_to_device (cairo_scaled_font_t *scaled_font,
|
||||
cairo_matrix_t *logical_to_device)
|
||||
|
|
@ -1699,6 +1709,16 @@ cairo_win32_scaled_font_get_logical_to_device (cairo_scaled_font_t *scaled_font,
|
|||
*logical_to_device = win_font->logical_to_device;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_win32_scaled_font_get_device_to_logical:
|
||||
* @scaled_font: a scaled font from the Win32 font backend
|
||||
* @device_to_logical: matrix to return
|
||||
*
|
||||
* Gets the transformation mapping device space to the logical space
|
||||
* used by @scaled_font.
|
||||
*
|
||||
* Since: 1.4
|
||||
**/
|
||||
void
|
||||
cairo_win32_scaled_font_get_device_to_logical (cairo_scaled_font_t *scaled_font,
|
||||
cairo_matrix_t *device_to_logical)
|
||||
|
|
|
|||
|
|
@ -1732,6 +1732,7 @@ cairo_win32_surface_create_with_dib (cairo_format_t format,
|
|||
|
||||
/**
|
||||
* cairo_win32_surface_create_with_ddb:
|
||||
* @hdc: the DC to create a surface for
|
||||
* @format: format of pixels in the surface to create
|
||||
* @width: width of the surface, in pixels
|
||||
* @height: height of the surface, in pixels
|
||||
|
|
|
|||
76
src/cairo.c
76
src/cairo.c
|
|
@ -941,8 +941,8 @@ cairo_set_line_width (cairo_t *cr, double width)
|
|||
|
||||
/**
|
||||
* cairo_set_line_cap:
|
||||
* @cr: a cairo context, as a #cairo_t
|
||||
* @line_cap: a line cap style, as a #cairo_line_cap_t
|
||||
* @cr: a cairo context
|
||||
* @line_cap: a line cap style
|
||||
*
|
||||
* Sets the current line cap style within the cairo context. See
|
||||
* #cairo_line_cap_t for details about how the available line cap
|
||||
|
|
@ -966,8 +966,8 @@ cairo_set_line_cap (cairo_t *cr, cairo_line_cap_t line_cap)
|
|||
|
||||
/**
|
||||
* cairo_set_line_join:
|
||||
* @cr: a cairo context, as a #cairo_t
|
||||
* @line_join: a line joint style, as a #cairo_line_join_t
|
||||
* @cr: a cairo context
|
||||
* @line_join: a line joint style
|
||||
*
|
||||
* Sets the current line join style within the cairo context. See
|
||||
* #cairo_line_join_t for details about how the available line join
|
||||
|
|
@ -1040,11 +1040,13 @@ cairo_set_dash (cairo_t *cr,
|
|||
* cairo_get_dash_count:
|
||||
* @cr: a #cairo_t
|
||||
*
|
||||
* Returns the length of the dash array in @cr (0 if dashing is not
|
||||
* currently in effect).
|
||||
* This function returns the length of the dash array in @cr (0 if dashing
|
||||
* is not currently in effect).
|
||||
*
|
||||
* See also cairo_set_dash() and cairo_get_dash().
|
||||
*
|
||||
* Return value: the length of the dash array, or 0 if no dash array set.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
int
|
||||
|
|
@ -1079,6 +1081,25 @@ cairo_get_dash (cairo_t *cr,
|
|||
*offset = cr->gstate->stroke_style.dash_offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_set_miter_limit:
|
||||
* @cr: a cairo context
|
||||
* @limit: miter limit to set
|
||||
*
|
||||
* Sets the current miter limit within the cairo context.
|
||||
*
|
||||
* If the current line join style is set to %CAIRO_LINE_JOIN_MITER
|
||||
* (see cairo_set_line_join()), the miter limit is used to determine
|
||||
* whether the lines should be joined with a bevel instead of a miter.
|
||||
* Cairo divides the length of the miter by the line width.
|
||||
* If the result is greater than the miter limit, the style is
|
||||
* converted to a bevel.
|
||||
*
|
||||
* As with the other stroke parameters, the current line miter limit is
|
||||
* examined by cairo_stroke(), cairo_stroke_extents(), and
|
||||
* cairo_stroke_to_path(), but does not have any effect during path
|
||||
* construction.
|
||||
**/
|
||||
void
|
||||
cairo_set_miter_limit (cairo_t *cr, double limit)
|
||||
{
|
||||
|
|
@ -2338,8 +2359,9 @@ _cairo_rectangle_list_create_in_error (cairo_status_t status)
|
|||
|
||||
/**
|
||||
* cairo_copy_clip_rectangle_list:
|
||||
* @cr: a cairo context
|
||||
*
|
||||
* Returns the current clip region as a list of rectangles in user coordinates.
|
||||
* Gets the current clip region as a list of rectangles in user coordinates.
|
||||
* Never returns %NULL.
|
||||
*
|
||||
* The status in the list may be CAIRO_STATUS_CLIP_NOT_REPRESENTABLE to
|
||||
|
|
@ -2350,6 +2372,8 @@ _cairo_rectangle_list_create_in_error (cairo_status_t status)
|
|||
* The caller must always call cairo_rectangle_list_destroy on the result of
|
||||
* this function.
|
||||
*
|
||||
* Returns: the current clip region as a list of rectangles in user coordinates.
|
||||
*
|
||||
* Since: 1.4
|
||||
**/
|
||||
cairo_rectangle_list_t *
|
||||
|
|
@ -2818,6 +2842,16 @@ cairo_show_text (cairo_t *cr, const char *utf8)
|
|||
_cairo_set_error (cr, cr->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_show_glyphs:
|
||||
* @cr: a cairo context
|
||||
* @glyphs: array of glyphs to show
|
||||
* @num_glyphs: number of glyphs to show
|
||||
*
|
||||
* A drawing operator that generates the shape from an array of glyphs,
|
||||
* rendered according to the current font_face, font_size
|
||||
* (font_matrix), and font_options.
|
||||
**/
|
||||
void
|
||||
cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
|
||||
{
|
||||
|
|
@ -2832,6 +2866,17 @@ cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
|
|||
_cairo_set_error (cr, cr->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_text_path:
|
||||
* @cr: a cairo context
|
||||
* @utf8: a string of text encoded in UTF-8
|
||||
*
|
||||
* Adds closed paths for text to the current path. The generated
|
||||
* path if filled, achieves an effect similar to that of
|
||||
* cairo_show_text().
|
||||
*
|
||||
* Text conversion and positioning is done similar to cairo_show_text().
|
||||
**/
|
||||
void
|
||||
cairo_text_path (cairo_t *cr, const char *utf8)
|
||||
{
|
||||
|
|
@ -2858,6 +2903,9 @@ cairo_text_path (cairo_t *cr, const char *utf8)
|
|||
cr->status = _cairo_gstate_glyph_path (cr->gstate,
|
||||
glyphs, num_glyphs,
|
||||
&cr->path);
|
||||
|
||||
/* XXX: set current point like in cairo_show_text() */
|
||||
|
||||
if (glyphs)
|
||||
free (glyphs);
|
||||
|
||||
|
|
@ -2865,6 +2913,16 @@ cairo_text_path (cairo_t *cr, const char *utf8)
|
|||
_cairo_set_error (cr, cr->status);
|
||||
}
|
||||
|
||||
/**
|
||||
* cairo_glyph_path:
|
||||
* @cr: a cairo context
|
||||
* @glyphs: array of glyphs to show
|
||||
* @num_glyphs: number of glyphs to show
|
||||
*
|
||||
* Adds closed paths for the glyphs to the current path. The generated
|
||||
* path if filled, achieves an effect similar to that of
|
||||
* cairo_show_glyphs().
|
||||
**/
|
||||
void
|
||||
cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
|
||||
{
|
||||
|
|
@ -2984,10 +3042,12 @@ cairo_get_fill_rule (cairo_t *cr)
|
|||
* cairo_get_line_width:
|
||||
* @cr: a cairo context
|
||||
*
|
||||
* Return value: the current line width value exactly as set by
|
||||
* This function returns the current line width value exactly as set by
|
||||
* cairo_set_line_width(). Note that the value is unchanged even if
|
||||
* the CTM has changed between the calls to cairo_set_line_width() and
|
||||
* cairo_get_line_width().
|
||||
*
|
||||
* Return value: the current line width.
|
||||
**/
|
||||
double
|
||||
cairo_get_line_width (cairo_t *cr)
|
||||
|
|
|
|||
40
src/cairo.h
40
src/cairo.h
|
|
@ -611,7 +611,11 @@ cairo_clip_extents (cairo_t *cr,
|
|||
|
||||
/**
|
||||
* cairo_rectangle_t:
|
||||
*
|
||||
* @x: X coordinate of the left side of the rectangle
|
||||
* @y: Y coordinate of the the top side of the rectangle
|
||||
* @width: width of the rectangle
|
||||
* @height: height of the rectangle
|
||||
*
|
||||
* A data structure for holding a rectangle.
|
||||
*
|
||||
* Since: 1.4
|
||||
|
|
@ -622,6 +626,9 @@ typedef struct _cairo_rectangle {
|
|||
|
||||
/**
|
||||
* cairo_rectangle_list_t:
|
||||
* @status: Error status of the rectangle list
|
||||
* @rectangles: Array containing the rectangles
|
||||
* @num_rectangles: Number of rectangles in this list
|
||||
*
|
||||
* A data structure for holding a dynamically allocated
|
||||
* array of rectangles.
|
||||
|
|
@ -864,6 +871,26 @@ typedef enum _cairo_hint_metrics {
|
|||
CAIRO_HINT_METRICS_ON
|
||||
} cairo_hint_metrics_t;
|
||||
|
||||
/**
|
||||
* cairo_font_options_t:
|
||||
*
|
||||
* An opaque structure holding all options that are used when
|
||||
* rendering fonts.
|
||||
*
|
||||
* Individual features of a #cairo_font_options_t can be set or
|
||||
* accessed using functions named
|
||||
* cairo_font_options_set_<emphasis>feature_name</emphasis> and
|
||||
* cairo_font_options_get_<emphasis>feature_name</emphasis>, like
|
||||
* cairo_font_options_set_antialias() and
|
||||
* cairo_font_options_get_antialias().
|
||||
*
|
||||
* New features may be added to a #cairo_font_options_t in the
|
||||
* future. For this reason, cairo_font_options_copy(),
|
||||
* cairo_font_options_equal(), cairo_font_options_merge(), and
|
||||
* cairo_font_options_hash() should be used to copy, check
|
||||
* for equality, merge, or compute a hash value of
|
||||
* #cairo_font_options_t objects.
|
||||
*/
|
||||
typedef struct _cairo_font_options cairo_font_options_t;
|
||||
|
||||
cairo_public cairo_font_options_t *
|
||||
|
|
@ -1160,6 +1187,17 @@ cairo_get_target (cairo_t *cr);
|
|||
cairo_public cairo_surface_t *
|
||||
cairo_get_group_target (cairo_t *cr);
|
||||
|
||||
/**
|
||||
* cairo_path_data_type_t:
|
||||
* @CAIRO_PATH_MOVE_TO: A move-to operation
|
||||
* @CAIRO_PATH_LINE_TO: A line-to operation
|
||||
* @CAIRO_PATH_CURVE_TO: A curve-to operation
|
||||
* @CAIRO_PATH_CLOSE_PATH: A close-path operation
|
||||
*
|
||||
* #cairo_path_data_t is used to describe the type of one portion
|
||||
* of a path when represented as a #cairo_path_t.
|
||||
* See #cairo_path_data_t for details.
|
||||
**/
|
||||
typedef enum _cairo_path_data_type {
|
||||
CAIRO_PATH_MOVE_TO,
|
||||
CAIRO_PATH_LINE_TO,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue