A Pango::AttrList represents a list of attributes that apply to a section of text.
The attributes are, in general, allowed to overlap in an arbitrary fashion, however, if the attributes are manipulated only through Pango::AttrList::change(), the overlap between properties will meet stricter criteria.
Since the Pango::AttrList structure is stored as a linear list, it is not suitable for storing attributes for large amounts of text. In general, you should not use a single Pango::AttrList for more than one paragraph of text.
Constructs an attribute list by parsing a marked-up text (see markup format).
If accel_marker is nonzero, the given character will mark the character following it as an accelerator. For example, the accel marker might be an ampersand or underscore. All characters marked as an accelerator will receive a Pango::UNDERLINE_LOW attribute. Two accel_marker characters following each other produce a single literal accel_marker character.
Parameters:
markup_text
Markup to parse (see markup format).
accel_marker
Character that precedes an accelerator, or 0 for none.
Constructs an attribute list by parsing a marked-up text (see markup format).
text is set to the plaintext string. If accel_marker is nonzero, the given character will mark the character following it as an accelerator. For example, the accel marker might be an ampersand or underscore. All characters marked as an accelerator will receive a Pango::UNDERLINE_LOW attribute. The first character so marked will be returned in accel_char. Two accel_marker characters following each other produce a single literal accel_marker character.
Parameters:
markup_text
Markup to parse (see markup format).
accel_marker
Character that precedes an accelerator, or 0 for none.
Insert the given attribute into the Pango::AttrList.
It will replace any attributes of the same type on that segment and be merged with any adjoining attributes that are identical.
This function is slower than pango_attr_list_insert() for creating a attribute list in order (potentially much slower for large lists). However, pango_attr_list_insert() is not suitable for continually changing a set of attributes since it never removes or combines existing attributes.
Parameters:
attr
The attribute to insert. Ownership of this value is assumed by the list.
Insert the given attribute into the Pango::AttrList.
It will be inserted before all other attributes with a matching start_index .
Parameters:
attr
The attribute to insert. Ownership of this value is assumed by the list.
AttrList& Pango::AttrList::operator=
(
const AttrList&
other
)
void Pango::AttrList::splice
(
AttrList&
other,
int
pos,
int
len
)
This function splices attribute list other into list .
This operation is equivalent to stretching every attribute applies at position pos in list by an amount len , and then calling pango_attr_list_change() with a copy of each attributes in other in sequence (offset in position by pos ).
This operation proves useful for, for instance, inserting a preedit string in the middle of an edit buffer.
Parameters:
other
Another Pango::AttrList.
pos
The position in list at which to insert other .
len
The length of the spliced segment. (Note that this must be specified since the attributes in other may only be present at some subsection of this range).