-
public void context_changed ()
Forces recomputation of any state in the Layout that might
depend on the layout's context. This function should be called if you make changes to the context subsequent to creating the layout.
-
public Layout copy ()
Does a deep copy-by-value of the src layout. The attribute list, tab array, and text from
the original layout are all copied by value.
-
public Alignment get_alignment ()
Gets the alignment for the layout: how partial lines are positioned within the horizontal space
available.
-
public weak AttrList get_attributes ()
Gets the attribute list for the layout, if any.
-
public bool get_auto_dir ()
Gets whether to calculate the bidirectional base direction for the layout according to the contents of
the layout. See set_auto_dir.
-
public int get_baseline ()
Gets the Y position of baseline of the first line in layout.
-
public weak Context get_context ()
Retrieves the Context used for this layout.
-
public void get_cursor_pos (int index_, out Rectangle strong_pos, out Rectangle weak_pos)
Given an index within a layout, determines the positions that of the strong and weak cursors if the
insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the
location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is
the location where characters of the directionality opposite to the base direction of the layout are inserted.
-
public EllipsizeMode get_ellipsize ()
Gets the type of ellipsization being performed for layout. See
set_ellipsize
-
public void get_extents (out Rectangle ink_rect, out Rectangle logical_rect)
Computes the logical and ink extents of layout. Logical extents are usually what you want
for positioning things. Note that both extents may have non-zero x and y. You may want to use those to offset where you render the
layout. Not doing that is a very typical bug that shows up as right-to-left layouts not being correctly positioned in a layout with a
set width.
-
public unowned FontDescription? get_font_description ()
Gets the font description for the layout, if any.
-
public int get_height ()
Gets the height of layout used for ellipsization. See
set_height for details.
-
public int get_indent ()
Gets the paragraph indent width in Pango units. A negative value indicates a hanging indentation.
-
public unowned LayoutIter get_iter ()
Returns an iterator to iterate over the visual extents of the layout.
-
public bool get_justify ()
Gets whether each complete line should be stretched to fill the entire width of the layout.
-
public weak LayoutLine get_line (int line)
Retrieves a particular line from a Layout.
-
public int get_line_count ()
Retrieves the count of lines for the layout.
-
public weak LayoutLine get_line_readonly (int line)
Retrieves a particular line from a Layout.
-
public unowned SList<weak LayoutLine> get_lines ()
Returns the lines of the layout as a list.
-
public unowned SList<weak LayoutLine> get_lines_readonly ()
Returns the lines of the layout as a list.
-
public void get_log_attrs (out LogAttr[] attrs)
Retrieves an array of logical attributes for each character in the layout.
-
public void get_pixel_extents (out Rectangle ink_rect, out Rectangle logical_rect)
Computes the logical and ink extents of layout in device units. This function just calls
get_extents followed by two
extents_to_pixels calls, rounding ink_rect and
logical_rect such that the rounded rectangles fully contain the unrounded one (that is, passes them as first argument to
extents_to_pixels).
-
public void get_pixel_size (out int width, out int height)
Determines the logical width and height of a Layout in
device units. (pango_layout_get_size() returns the width and height scaled by SCALE.)
This is simply a convenience function around get_pixel_extents.
-
public bool get_single_paragraph_mode ()
-
public void get_size (out int width, out int height)
Determines the logical width and height of a Layout in
Pango units (device units scaled by SCALE). This is simply a convenience function
around get_extents.
-
public int get_spacing ()
Gets the amount of spacing between the lines of the layout.
-
public unowned TabArray get_tabs ()
Gets the current TabArray used by this layout. If no
TabArray has been set, then the default tabs are in use and null is
returned. Default tabs are every 8 spaces. The return value should be freed with pango_tab_array_free.
-
public unowned string get_text ()
Gets the text in the layout. The returned text should not be freed or modified.
-
public int get_unknown_glyphs_count ()
Counts the number unknown glyphs in layout. That is, zero if glyphs for all characters in
the layout text were found, or more than zero otherwise.
-
public int get_width ()
Gets the width to which the lines of the Layout should
wrap.
-
public WrapMode get_wrap ()
Gets the wrap mode for the layout.
-
public void index_to_line_x (int index_, bool trailing, out int line, out int x_pos)
Converts from byte index_ within the layout to line and X position. (X
position is measured from the left edge of the line)
-
public void index_to_pos (int index_, out Rectangle pos)
Converts from an index within a Layout to the onscreen
position corresponding to the grapheme at that index, which is represented as rectangle. Note that pos->x is always the
leading edge of the grapheme and pos->x + pos->width the trailing edge of the grapheme. If the directionality of the
grapheme is right-to-left, then pos->width will be negative.
-
public bool is_ellipsized ()
Queries whether the layout had to ellipsize any paragraphs.
-
public bool is_wrapped ()
Queries whether the layout had to wrap any paragraphs.
-
public void move_cursor_visually (bool strong, int old_index, int old_trailing, int direction, out int new_index, out int new_trailing)
Computes a new cursor position from an old position and a count of positions to move visually. If
direction is positive, then the new strong cursor position will be one position to the right of the old cursor position. If
direction is negative, then the new strong cursor position will be one position to the left of the old cursor position.
-
public void set_alignment (Alignment alignment)
Sets the alignment for the layout: how partial lines are positioned within the horizontal space
available.
-
public void set_attributes (AttrList attrs)
Sets the text attributes for a layout object. References attrs, so the caller can unref its
reference.
-
public void set_auto_dir (bool auto_dir)
Sets whether to calculate the bidirectional base direction for the layout according to the contents of
the layout; when this flag is on (the default), then paragraphs in (Arabic and Hebrew principally), will have right-to-left layout,
paragraphs with letters from other scripts will have left-to-right layout. Paragraphs with only neutral characters get their direction
from the surrounding paragraphs.
-
public void set_ellipsize (EllipsizeMode ellipsize)
Sets the type of ellipsization being performed for layout. Depending on the ellipsization
mode ellipsize text is removed from the start, middle, or end of text so they fit within the width and height of layout
set with set_width and
set_height.
-
public void set_font_description (FontDescription? desc)
Sets the default font description for the layout. If no font description is set on the layout, the font
description from the layout's context is used.
-
public void set_height (int height)
Sets the height to which the Layout should be ellipsized
at. There are two different behaviors, based on whether height is positive or negative.
-
public void set_indent (int indent)
Sets the width in Pango units to indent each paragraph. A negative value of indent will
produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute
value of indent.
-
public void set_justify (bool justify)
Sets whether each complete line should be stretched to fill the entire width of the layout. This
stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification may be done in more
complex ways, like extending the characters.
-
public void set_markup (string markup, int length)
-
public void set_markup_with_accel (string markup, int length, unichar accel_marker, unichar accel_char)
Sets the layout text and attribute list from marked-up text (see markup
format). Replaces the current text and attribute list.
-
public void set_single_paragraph_mode (bool setting)
If setting is true, do not treat newlines and similar characters as paragraph
separators; instead, keep all text in a single paragraph, and display a glyph for paragraph separator characters. Used when you want
to allow editing of newlines on a single text line.
-
public void set_spacing (int spacing)
Sets the amount of spacing in Pango unit between the lines of the layout.
-
public void set_tabs (TabArray tabs)
Sets the tabs to use for layout, overriding the default tabs (by default, tabs are every 8
spaces). If tabs is null, the default tabs are reinstated. tabs is copied into the layout; you
must free your copy of tabs yourself.
-
public void set_text (string text, int length)
Sets the text of the layout.
-
public void set_width (int width)
Sets the width to which the lines of the Layout should
wrap or ellipsized. The default value is -1: no width set.
-
public void set_wrap (WrapMode wrap)
Sets the wrap mode; the wrap mode only has effect if a width is set on the layout with
set_width. To turn off wrapping, set the width to -1.
-
public bool xy_to_index (int x, int y, out int index_, out int trailing)
Converts from X and Y position within a layout to the byte index to the character at that logical
position. If the Y position is not inside the layout, the closest position is chosen (the position will be clamped inside the layout).
If the X position is not within the layout, then the start or the end of the line is chosen as described for
pango_layout_x_to_index. If either the X or Y positions were not inside the layout, then the function returns false
; on an exact hit, it returns true.