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

GFC::Pango::TabArray Class Reference

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

#include <gfc/pango/tabs.hh>

Inheritance diagram for GFC::Pango::TabArray:

GFC::G::Boxed GFC::Object GFC::Trackable 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

GFC::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.

GFC::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.

GFC::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.

GFC::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.

GFC::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.

GFC::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.

GFC::Pango::TabArray::TabArray (  const TabArray &  src  ) 
 

Copy constructor.

Parameters:
src The source TabArray.


Member Function Documentation

bool GFC::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 GFC::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 GFC::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> > GFC::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& GFC::Pango::TabArray::operator= (  const TabArray &  src  ) 
 

Assignment operator.

Parameters:
src The source TabArray.

void GFC::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 GFC::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:
Generated on Tue Aug 24 00:34:46 2004 for GFC-UI by doxygen 1.3.8