Google

logo top
Main Page   Widgets   Namespaces   Book  

Pango::LayoutIter Class Reference

A Pango::LayoutIter can be used to iterate over the visual extents of a Pango::Layout. More...

List of all members.

Public Methods

 LayoutIter ()
 ~LayoutIter ()
int get_index () const
 Gets the current byte index.

LayoutRun get_run () const
 Gets the current run.

Glib::RefPtr<LayoutLineget_line () const
 Gets the current line.

bool at_last_line () const
 Determines whether iter is on the last line of the layout.

bool next_char ()
 Moves iter forward to the next character in visual order.

bool next_cluster ()
 Moves iter forward to the next cluster in visual order.

bool next_run ()
 Moves iter forward to the next run in visual order.

bool next_line ()
 Moves iter forward to the start of the next line.

Rectangle get_char_extents () const
 Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout).

void get_cluster_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
 Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

Rectangle get_cluster_ink_extents () const
 Gets the ink extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

Rectangle get_cluster_logical_extents () const
 Gets the logical extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

void get_run_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
 Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).

Rectangle get_run_ink_extents () const
 Gets the ink extents of the current run in layout coordinates (origin is the top left of the entire layout).

Rectangle get_run_logical_extents () const
 Gets the logical extents of the current run in layout coordinates (origin is the top left of the entire layout).

void get_line_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
 Obtains the extents of the current line.

Rectangle get_line_ink_extents () const
 Obtains the ink extents of the current line.

Rectangle get_line_logical_extents () const
 Obtains the logical extents of the current line.

void get_line_yrange (int& y0, int& y1) const
 Divides the vertical space in the Pango::Layout being iterated over between the lines in the layout, and returns the space belonging to the current line.

void get_layout_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
 Obtains the extents of the Pango::Layout being iterated over.

Rectangle get_layout_ink_extents () const
 Obtains the ink extents of the Pango::Layout being iterated over.

Rectangle get_layout_logical_extents () const
 Obtains the logical extents of the Pango::Layout being iterated over.

int get_baseline () const
 Gets the y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).

PangoLayoutIter* gobj ()
const PangoLayoutIter* gobj () const

Protected Attributes

PangoLayoutIter* gobject_


Detailed Description

A Pango::LayoutIter can be used to iterate over the visual extents of a Pango::Layout.


Constructor & Destructor Documentation

Pango::LayoutIter::LayoutIter (  
 

Pango::LayoutIter::~LayoutIter (  
 


Member Function Documentation

bool Pango::LayoutIter::at_last_line (   const
 

Determines whether iter is on the last line of the layout.

Returns:
true if iter is on the last line.

int Pango::LayoutIter::get_baseline (   const
 

Gets the y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).

Returns:
Baseline of current line.

Rectangle Pango::LayoutIter::get_char_extents (   const
 

Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout).

Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.

Returns:
The logical extents of the current character.

void Pango::LayoutIter::get_cluster_extents ( Rectangle   ink_rect,
Rectangle   logical_rect
const
 

Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

Parameters:
ink_rect Rectangle to fill with ink extents.
logical_rect Rectangle to fill with logical extents.

Rectangle Pango::LayoutIter::get_cluster_ink_extents (   const
 

Gets the ink extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

Returns:
The extents of the current cluster as drawn.

Rectangle Pango::LayoutIter::get_cluster_logical_extents (   const
 

Gets the logical extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).

Returns:
The logical extents of the current cluster.

int Pango::LayoutIter::get_index (   const
 

Gets the current byte index.

Note that iterating forward by char moves in visual order, not logical order, so indexes may not be sequential. Also, the index may be equal to the length of the text in the layout, if on the 0 run (see pango_layout_iter_get_run()).

Returns:
Current byte index.

void Pango::LayoutIter::get_layout_extents ( Rectangle   ink_rect,
Rectangle   logical_rect
const
 

Obtains the extents of the Pango::Layout being iterated over.

ink_rect or logical_rect can be 0 if you aren't interested in them.

Parameters:
ink_rect Rectangle to fill with ink extents.
logical_rect Rectangle to fill with logical extents.

Rectangle Pango::LayoutIter::get_layout_ink_extents (   const
 

Obtains the ink extents of the Pango::Layout being iterated over.

Returns:
The extents of the layout as drawn.

Rectangle Pango::LayoutIter::get_layout_logical_extents (   const
 

Obtains the logical extents of the Pango::Layout being iterated over.

Returns:
The logical extents of the layout.

Glib::RefPtr<LayoutLine> Pango::LayoutIter::get_line (   const
 

Gets the current line.

Returns:
The current line.

void Pango::LayoutIter::get_line_extents ( Rectangle   ink_rect,
Rectangle   logical_rect
const
 

Obtains the extents of the current line.

ink_rect or logical_rect can be 0 if you aren't interested in them. Extents are in layout coordinates (origin is the top-left corner of the entire Pango::Layout). Thus the extents returned by this function will be the same width/height but not at the same x/y as the extents returned from pango_layout_line_get_extents().

Parameters:
ink_rect Rectangle to fill with ink extents.
logical_rect Rectangle to fill with logical extents.

Rectangle Pango::LayoutIter::get_line_ink_extents (   const
 

Obtains the ink extents of the current line.

Returns:
The extents of the current line as drawn.

Rectangle Pango::LayoutIter::get_line_logical_extents (   const
 

Obtains the logical extents of the current line.

Returns:
The logical extents of the current line.

void Pango::LayoutIter::get_line_yrange ( int&    y0,
int&    y1
const
 

Divides the vertical space in the Pango::Layout being iterated over between the lines in the layout, and returns the space belonging to the current line.

A line's range includes the line's logical extents, plus half of the spacing above and below the line, if pango_layout_set_spacing() has been called to set layout spacing. The y positions are in layout coordinates (origin at top left of the entire layout).

Parameters:
y0_ Start of line.
y1_ End of line.

LayoutRun Pango::LayoutIter::get_run (   const
 

Gets the current run.

When iterating by run, at the end of each line, there's a position with a 0 run, so this function can return 0. The 0 run at the end of each line ensures that all lines have at least one run, even lines consisting of only a newline.

Returns:
The current run.

void Pango::LayoutIter::get_run_extents ( Rectangle   ink_rect,
Rectangle   logical_rect
const
 

Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).

Parameters:
ink_rect Rectangle to fill with ink extents.
logical_rect Rectangle to fill with logical extents.

Rectangle Pango::LayoutIter::get_run_ink_extents (   const
 

Gets the ink extents of the current run in layout coordinates (origin is the top left of the entire layout).

Returns:
The extents of the current run as drawn.

Rectangle Pango::LayoutIter::get_run_logical_extents (   const
 

Gets the logical extents of the current run in layout coordinates (origin is the top left of the entire layout).

Returns:
The logical extents of the current run.

const PangoLayoutIter* Pango::LayoutIter::gobj (   const [inline]
 

PangoLayoutIter* Pango::LayoutIter::gobj (   [inline]
 

bool Pango::LayoutIter::next_char (  
 

Moves iter forward to the next character in visual order.

If iter was already at the end of the layout, returns false.

Returns:
Whether motion was possible.

bool Pango::LayoutIter::next_cluster (  
 

Moves iter forward to the next cluster in visual order.

If iter was already at the end of the layout, returns false.

Returns:
Whether motion was possible.

bool Pango::LayoutIter::next_line (  
 

Moves iter forward to the start of the next line.

If iter is already on the last line, returns false.

Returns:
Whether motion was possible.

bool Pango::LayoutIter::next_run (  
 

Moves iter forward to the next run in visual order.

If iter was already at the end of the layout, returns false.

Returns:
Whether motion was possible.


Member Data Documentation

PangoLayoutIter* Pango::LayoutIter::gobject_ [protected]
 


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