GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

GFC::Pango::AttrIterator Class Reference

A PangoAttrIterator C++ wrapper class. More...

#include <gfc/pango/attributes.hh>

Inheritance diagram for GFC::Pango::AttrIterator:

GFC::Object GFC::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A PangoAttrIterator C++ wrapper class.

AttrIterator is used to represent an iterator through an AttrList. A new iterator is created with Pango::AttrList::get_iterator(). Once the iterator is created, it can be advanced through the style changes in the text using next(). At each style change, the range of the current style segment and the attributes currently in effect can be queried.


Constructor & Destructor Documentation

GFC::Pango::AttrIterator::AttrIterator PangoAttrIterator *  iterator  )  [explicit]
 

Constructs a new attribute iterator from an existing PangoAttrIterator.

Parameters:
iterator A PangoAttrIterator.

AttrIterator takes over the ownership of the PangoAttrIterator and calls pango_attr_iterator_destroy() when it's no longer required.

GFC::Pango::AttrIterator::AttrIterator const AttrIterator src  ) 
 

Copy constructor.

Parameters:
src The source iterator.


Member Function Documentation

Pointer<Attribute> GFC::Pango::AttrIterator::get AttrType  type  ) 
 

Find the current attribute of a particular type at the iterator location.

Parameters:
type The type of attribute to find.
Returns:
The current attribute of the given type, or null if no attribute of that type applies to the current location.

When multiple attributes of the same type overlap, the attribute whose range starts closest to the current location is used.

bool GFC::Pango::AttrIterator::get_attrs std::vector< Pointer< Attribute > > &  attrs  )  const
 

Gets a list all attributes at the current position of the iterator.

Parameters:
attrs A reference to a vector of Pointer<Attribute> to hold the list of attributes.
Returns:
true if the vector is not empty.

void GFC::Pango::AttrIterator::get_font FontDescription desc,
PangoLanguage **  language,
std::vector< Pointer< Attribute > > *  extra_attrs
const
 

Get the font and other attributes at the current iterator position.

Parameters:
desc A FontDescription to fill in with the current values.
language If non-null, location to store the language tag for item, or null if none is found.
extra_attrs If non-null, a vector in which to store a list of non-font attributes at the current position; only the highest priority value of each attribute will be added to this list.

The family name in desc will be set by Pango using pango_font_description_set_family_static() using values from an attribute in the AttrList associated with the iterator, so if you plan to keep it around, you must call: desc.set_family(desc.get_family()).

bool GFC::Pango::AttrIterator::next  ) 
 

Advance the iterator until the next change of style.

Returns:
false if the iterator is at the end of the list, otherwise true.

AttrIterator& GFC::Pango::AttrIterator::operator= const AttrIterator src  ) 
 

Assignment operator.

Parameters:
src The source iterator.

void GFC::Pango::AttrIterator::range int *  start,
int *  end
const
 

Get the range of the current segment.

Parameters:
start The location to store the start of the range.
end The location to store the end of the range.


The documentation for this class was generated from the following file:
Generated on Tue Aug 24 00:34:45 2004 for GFC-UI by doxygen 1.3.8