Google

logo top
Main Page   Widgets   Namespaces   Book  

Pango::AttrList Class Reference

A Pango::AttrList represents a list of attributes that apply to a section of text. More...

List of all members.

Public Methods

 AttrList ()
 AttrList (PangoAttrList* gobject, bool make_a_copy=true)
 AttrList (const AttrList& other)
AttrList& operator= (const AttrList& other)
 ~AttrList ()
void swap (AttrList& other)
PangoAttrList* gobj ()
const PangoAttrList* gobj () const
PangoAttrList* gobj_copy () const
 AttrList (const Glib::ustring& markup_text, gunichar accel_marker=0)
 Constructs an attribute list by parsing a marked-up text (see markup format).

 AttrList (const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& accel_char)
 Constructs an attribute list by parsing a marked-up text (see markup format).

void insert (Attribute& attr)
 Insert the given attribute into the Pango::AttrList.

void insert_before (Attribute& attr)
 Insert the given attribute into the Pango::AttrList.

void change (Attribute& attr)
 Insert the given attribute into the Pango::AttrList.

void splice (AttrList& other, int pos, int len)
 This function splices attribute list other into list .

AttrIter get_iter ()
 Create a iterator initialized to the beginning of the list.


Protected Attributes

PangoAttrList* gobject_

Related Functions

(Note that these are not member functions.)

void swap (AttrList& lhs, AttrList& rhs)
Pango::AttrList wrap (PangoAttrList* object, bool take_copy=false)


Detailed Description

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.


Constructor & Destructor Documentation

Pango::AttrList::AttrList (  
 

Pango::AttrList::AttrList ( PangoAttrList*    gobject,
bool    make_a_copy = true
[explicit]
 

Pango::AttrList::AttrList ( const AttrList&    other
 

Pango::AttrList::~AttrList (  
 

Pango::AttrList::AttrList ( const Glib::ustring   markup_text,
gunichar    accel_marker = 0
[explicit]
 

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.

Pango::AttrList::AttrList ( const Glib::ustring   markup_text,
gunichar    accel_marker,
Glib::ustring   text,
gunichar&    accel_char
 

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.
text Return location for text with tags stripped.
accel_char Return location for accelerator char.


Member Function Documentation

void Pango::AttrList::change ( Attribute   attr
 

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.

AttrIter Pango::AttrList::get_iter (  
 

Create a iterator initialized to the beginning of the list.

Returns:
A new Pango::Iterator. list must not be modified until this iterator is freed with pango_attr_iterator_destroy().

const PangoAttrList* Pango::AttrList::gobj (   const [inline]
 

PangoAttrList* Pango::AttrList::gobj (   [inline]
 

PangoAttrList* Pango::AttrList::gobj_copy (   const
 

void Pango::AttrList::insert ( Attribute   attr
 

Insert the given attribute into the Pango::AttrList.

It will be inserted after all other attributes with a matching start_index .

Parameters:
attr The attribute to insert. Ownership of this value is assumed by the list.

void Pango::AttrList::insert_before ( Attribute   attr
 

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).

void Pango::AttrList::swap ( AttrList&    other
 


Friends And Related Function Documentation

void swap ( AttrList&    lhs,
AttrList&    rhs
[related]
 

Pango::AttrList wrap ( PangoAttrList*    object,
bool    take_copy = false
[related]
 


Member Data Documentation

PangoAttrList* Pango::AttrList::gobject_ [protected]
 


The documentation for this class was generated from the following file:
Generated for gtkmm by Doxygen 1.3-rc1 © 1997-2001