Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Inti::Pango::TabArray Class Reference

A PangoTabArray C++ wrapper class. More...

#include <inti/pango/tabs.h>

Inheritance diagram for Inti::Pango::TabArray:

Inti::G::Boxed Inti::ReferencedObject Inti::ReferencedBase List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A PangoTabArray C++ wrapper class.

TabArray is an object that stores Tab Stops.


Constructor & Destructor Documentation

Inti::Pango::TabArray::TabArray int  initial_size,
bool  positions_in_pixels = true
 

Construct an array of initial_size tab stops.

Parameters:
initial_size The initial number of tab stops to allocate, can be 0.
positions_in_pixels Whether positions are in pixel units.

Tab stops are specified in pixel units if positions_in_pixels is true, otherwise in Pango units. All stops are initially at position 0.

Inti::Pango::TabArray::TabArray int  size,
bool  positions_in_pixels,
int  first_position,
... 
 

This is a convenience constructor that creates a tab array with left alignment and allows you to specify the position of each tab stop.

Parameters:
size The number of tab stops in the array.
positions_in_pixels Whether positions are in pixel units.
first_position The position of first tab stop.
... Additional positions.

You must provide a position for all size tab stops. This constructor is the same as the next, but uses the default tab alignment TAB_LEFT.

Inti::Pango::TabArray::TabArray int  size,
bool  positions_in_pixels,
TabAlign  first_alignment,
int  first_position,
... 
 

This is a convenience constructor that creates a tab array and allows you to specify the alignment and position of each tab stop.

Parameters:
size The number of tab stops in the array.
positions_in_pixels Whether positions are in pixel units.
first_alignment The alignment of first tab stop.
first_position The position of first tab stop.
... Additional alignment/position pairs.

You must provide an alignment and position for all size tab stops.

Inti::Pango::TabArray::TabArray const std::vector< std::pair< TabAlign, int > > &  tabs,
bool  positions_in_pixels = true
 

This is a convenience constructor that creates a tab array and allows you to specify the alignment and position of each tab stop.

Parameters:
tabs A reference to a vector of TabAlign/int pairs that holds the alignment and position of each tab stop.
positions_in_pixels Whether positions are in pixel units.

Inti::Pango::TabArray::TabArray PangoTabArray *  tab_array  )  [explicit]
 

Construct a new tab array from an existing PangoTabArray.

Parameters:
tab_array A pointer to a PangoTabArray.

The tab_array can be a newly created PangoTabArray or an existing PangoTabArray. The TabArray object created is a temporary object. It doesn't take over the ownership of PangoTabArray and PangoTabArray is not freed by the destructor.

Inti::Pango::TabArray::TabArray PangoTabArray *  tab_array,
bool  copy
 

Construct a new tab array from an existing PangoTabArray.

Parameters:
tab_array A pointer to a PangoTabArray.
copy Whether the TabArray object should make a copy of PangoTabArray or not.

The tab_array can be a newly created PangoTabArray or an existing PangoTabArray. If copy is true TabArray will make a copy of PangoTabArray. If copy is false TabArray wont make a copy but instead takes over the ownership of PangoTabArray. Either way, the destructor will free PangoTabArray when the TabArray object is destroyed. This constructor is used by G::Boxed::wrap() to wrap PangoTabArray objects in a C++ wrapper.

Inti::Pango::TabArray::TabArray const TabArray src  ) 
 

Copy constructor.

Parameters:
src The source TabArray.


Member Function Documentation

bool Inti::Pango::TabArray::get_positions_in_pixels  )  const
 

Returns true if the tab positions are in pixels, false if they are in Pango units.

Returns:
Whether positions are in pixels.

int Inti::Pango::TabArray::get_size  )  const
 

Get the number of tab stops in the tab array.

Returns:
The number of tab stops in the array.

int Inti::Pango::TabArray::get_tab int  tab_index,
TabAlign alignment = 0
const
 

Gets the alignment and position of a tab stop.

Parameters:
tab_index The tab stop index.
alignment The location to store the alignment, or null.
Returns:
The tab position.

The alignment may be null if you aren't interested in the value.

std::vector<std::pair<TabAlign, int> > Inti::Pango::TabArray::get_tabs  )  const
 

Returns a vector of alignment/locations pairs (see Pango::LayoutLine::get_x_ranges() for an example of using a vector of pairs).

Returns:
A vector of TabAlign/int pairs.

In the current implementation TabAlign is always TAB_LEFT and so can be ignored.

TabArray& Inti::Pango::TabArray::operator= const TabArray src  ) 
 

Assignment operator.

Parameters:
src The source TabArray.

void Inti::Pango::TabArray::resize int  new_size  ) 
 

Resizes a tab array.

Parameters:
new_size The new size of the array.

You must subsequently initialize any tabs that were added as a result of growing the array.

void Inti::Pango::TabArray::set_tab int  tab_index,
int  location,
TabAlign  alignment = TAB_LEFT
 

Sets the location of a tab stop.

Parameters:
tab_index The index of a tab stop.
alignment The tab alignment
location The tab location in pango units.

The alignment must always be TAB_LEFT in the current implementation.


The documentation for this class was generated from the following file: Main Page - Footer


Generated on Sun Sep 14 20:08:25 2003 for Inti by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002