Function
Gdkpango_layout_line_get_clip_region
Declaration [src]
cairo_region_t*
gdk_pango_layout_line_get_clip_region (
PangoLayoutLine* line,
gint x_origin,
gint y_origin,
const gint* index_ranges,
gint n_ranges
)
Description [src]
Obtains a clip region which contains the areas where the given
ranges of text would be drawn. x_origin
and y_origin
are the top left
position of the layout. index_ranges
should contain ranges of bytes in the layout’s text. The clip
region will include space to the left or right of the line (to the
layout bounding box) if you have indexes above or below the indexes
contained inside the line. This is to draw the selection all the way
to the side of the layout. However, the clip region is in line coordinates,
not layout coordinates.
Note that the regions returned correspond to logical extents of the text ranges, not ink extents. So the drawn line may in fact touch areas out of the clip region. The clip region is mainly useful for highlightling parts of text, such as when text is selected.
This function is not directly available to language bindings.
Parameters
line
-
Type:
PangoLayoutLine
A
PangoLayoutLine
.The data is owned by the caller of the function. x_origin
-
Type:
gint
X pixel where you intend to draw the layout line with this clip.
y_origin
-
Type:
gint
Baseline pixel where you intend to draw the layout line with this clip.
index_ranges
-
Type: An array of
gint
Array of byte indexes into the layout, where even members of array are start indexes and odd elements are end indexes.
The data is owned by the caller of the function. n_ranges
-
Type:
gint
Number of ranges in
index_ranges
, i.e. half the size ofindex_ranges
.
Return value
Type: cairo_region_t
A clip region containing the given ranges.
The caller of the function takes ownership of the data, and is responsible for freeing it. |