logo top
Main Page   Widgets   Namespaces   Book  

Pango::Layout Class Reference

A Pango::Layout represents and entire paragraph of text. More...

Inheritance diagram for Pango::Layout:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~Layout ()
PangoLayout* gobj ()
 Provides access to the underlying C GObject.

const PangoLayout* gobj () const
 Provides access to the underlying C GObject.

PangoLayout* gobj_copy ()
Glib::RefPtr<Layoutcopy ()
Glib::RefPtr<Contextget_context () const
void set_attributes (AttrList& attrs)
AttrList get_attributes () const
void set_text (const Glib::ustring& text)
 Set the text of the layout.

Glib::ustring get_text () const
void set_markup (const Glib::ustring& markup)
 Sets the layout text and attribute list from marked-up text (see markup format).

void set_markup (const Glib::ustring& markup, gunichar accel_marker, gunichar& accel_char)
 Sets the layout text and attribute list from marked-up text (see markup format).

void set_font_description (const FontDescription& desc)
void unset_font_description ()
void set_width (int width)
int get_width () const
void set_wrap (WrapMode wrap)
WrapMode get_wrap () const
void set_indent (int indent)
int get_indent () const
void set_spacing (int spacing)
int get_spacing () const
void set_justify (bool justify=true)
bool get_justify () const
void set_alignment (Alignment alignment)
Alignment get_alignment () const
void set_tabs (TabArray& tabs)
TabArray get_tabs () const
void set_single_paragraph_mode (bool setting=true)
bool get_single_paragraph_mode () const
void context_changed ()
Glib::ArrayHandle<LogAttrget_log_attrs () const
 Retrieve an array of logical attributes for each character in the layout.

Rectangle index_to_pos (int index) const
 Convert from an index within the layout to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle.

void get_cursor_pos (int index, Rectangle& strong_pos, Rectangle& weak_pos) const
Rectangle get_cursor_strong_pos (int index) const
 Given an index within the layout, determine the positions that of the strong cursors if the insertion point is at that index.

Rectangle get_cursor_weak_pos (int index) const
 Given an index within the layout, determine the positions that of the weak cursors if the insertion point is at that index.

void move_cursor_visually (bool strong, int old_index, int old_trailing, int direction, int& new_index, int& new_trailing) const
bool xy_to_index (int x, int y, int& index, int& trailing) const
void get_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
Rectangle get_ink_extents () const
 Compute the ink extents of layout.

Rectangle get_logical_extents () const
 Compute the logical extents of layout.

void get_pixel_extents (Rectangle& ink_rect, Rectangle& logical_rect) const
Rectangle get_pixel_ink_extents () const
 Compute the ink extents of the layout in device units.

Rectangle get_pixel_logical_extents () const
 Compute the logical extents of the layout in device units.

void get_size (int& width, int& height) const
void get_pixel_size (int& width, int& height) const
int get_line_count () const
Glib::RefPtr<LayoutLineget_line (int line) const
SListHandle_LayoutLine get_lines () const
void get_iter (LayoutIter& iter)
 Gets an iterator to iterate over the visual extents of the layout.


Static Public Member Functions

Glib::RefPtr<Layoutcreate (const Glib::RefPtr<Context>& context)

Protected Member Functions

 Layout (const Glib::RefPtr<Context>& context)

Related Functions

(Note that these are not member functions.)

Glib::RefPtr<Pango::Layoutwrap (PangoLayout* object, bool take_copy=false)

Detailed Description

A Pango::Layout represents and entire paragraph of text.

It is initialized with a Pango::Context, UTF-8 string and set of attributes for that string. Once that is done, the set of formatted lines can be extracted from the object, the layout can be rendered, and conversion between logical character positions within the layout's text, and the physical position of the resulting glyphs can be made.


Constructor & Destructor Documentation

virtual Pango::Layout::~Layout (  )  [virtual]
 

Pango::Layout::Layout ( const Glib::RefPtr<Context>&  context  )  [explicit, protected]
 


Member Function Documentation

void Pango::Layout::context_changed (  ) 
 

Glib::RefPtr<Layout> Pango::Layout::copy (  ) 
 

Glib::RefPtr<Layout> Pango::Layout::create ( const Glib::RefPtr<Context>&  context  )  [static]
 

Alignment Pango::Layout::get_alignment (  )  const
 

AttrList Pango::Layout::get_attributes (  )  const
 

Glib::RefPtr<Context> Pango::Layout::get_context (  )  const
 

void Pango::Layout::get_cursor_pos ( int  index,
Rectangle strong_pos,
Rectangle weak_pos
const
 

Rectangle Pango::Layout::get_cursor_strong_pos ( int  index  )  const
 

Given an index within the layout, determine the positions that of the strong cursors if the insertion point is at that index.

Parameters:
index The byte index of the cursor.
Returns:
The strong cursor position.

Rectangle Pango::Layout::get_cursor_weak_pos ( int  index  )  const
 

Given an index within the layout, determine the positions that of the weak cursors if the insertion point is at that index.

Parameters:
index The byte index of the cursor.
Returns:
The weak cursor position.

void Pango::Layout::get_extents ( Rectangle ink_rect,
Rectangle logical_rect
const
 

int Pango::Layout::get_indent (  )  const
 

Rectangle Pango::Layout::get_ink_extents (  )  const
 

Compute the ink extents of layout.

Returns:
The extents of the layout as drawn.

void Pango::Layout::get_iter ( LayoutIter iter  ) 
 

Gets an iterator to iterate over the visual extents of the layout.

Parameters:
iter Location to store the iterator.

bool Pango::Layout::get_justify (  )  const
 

Glib::RefPtr<LayoutLine> Pango::Layout::get_line ( int  line  )  const
 

int Pango::Layout::get_line_count (  )  const
 

SListHandle_LayoutLine Pango::Layout::get_lines (  )  const
 

Glib::ArrayHandle<LogAttr> Pango::Layout::get_log_attrs (  )  const
 

Retrieve an array of logical attributes for each character in the layout.

Returns:
An array of logical attributes.

Rectangle Pango::Layout::get_logical_extents (  )  const
 

Compute the logical extents of layout.

Returns:
The logical extents of the layout.

void Pango::Layout::get_pixel_extents ( Rectangle ink_rect,
Rectangle logical_rect
const
 

Rectangle Pango::Layout::get_pixel_ink_extents (  )  const
 

Compute the ink extents of the layout in device units.

Returns:
The extents of the layout as drawn.

Rectangle Pango::Layout::get_pixel_logical_extents (  )  const
 

Compute the logical extents of the layout in device units.

Returns:
The logical extents of the layout.

void Pango::Layout::get_pixel_size ( int&  width,
int&  height
const
 

bool Pango::Layout::get_single_paragraph_mode (  )  const
 

void Pango::Layout::get_size ( int&  width,
int&  height
const
 

int Pango::Layout::get_spacing (  )  const
 

TabArray Pango::Layout::get_tabs (  )  const
 

Glib::ustring Pango::Layout::get_text (  )  const
 

int Pango::Layout::get_width (  )  const
 

WrapMode Pango::Layout::get_wrap (  )  const
 

const PangoLayout* Pango::Layout::gobj (  )  const [inline]
 

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

PangoLayout* Pango::Layout::gobj (  )  [inline]
 

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

PangoLayout* Pango::Layout::gobj_copy (  ) 
 

Rectangle Pango::Layout::index_to_pos ( int  index  )  const
 

Convert from an index within the layout to the onscreen position corresponding to the grapheme at that index, which is represented as rectangle.

Note that x in the returned rectangle is always the leading edge of the grapheme and x + width the trailing edge of the grapheme. If the directionality of the grapheme is right-to-left, then width will be negative.

Parameters:
index Byte index within layout.
Returns:
The position of the grapheme.

void Pango::Layout::move_cursor_visually ( bool  strong,
int  old_index,
int  old_trailing,
int  direction,
int&  new_index,
int&  new_trailing
const
 

void Pango::Layout::set_alignment ( Alignment  alignment  ) 
 

void Pango::Layout::set_attributes ( AttrList attrs  ) 
 

void Pango::Layout::set_font_description ( const FontDescription desc  ) 
 

void Pango::Layout::set_indent ( int  indent  ) 
 

void Pango::Layout::set_justify ( bool  justify = true  ) 
 

void Pango::Layout::set_markup ( const Glib::ustring markup,
gunichar  accel_marker,
gunichar&  accel_char
 

Sets the layout text and attribute list from marked-up text (see markup format).

Replaces the current text and attribute list.

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, and 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 Some marked-up text.
accel_marker Marker for accelerators in the text.
accel_char Return location for any located accelerators.

void Pango::Layout::set_markup ( const Glib::ustring markup  ) 
 

Sets the layout text and attribute list from marked-up text (see markup format).

Replaces the current text and attribute list.

Parameters:
markup Some marked-up text.

void Pango::Layout::set_single_paragraph_mode ( bool  setting = true  ) 
 

void Pango::Layout::set_spacing ( int  spacing  ) 
 

void Pango::Layout::set_tabs ( TabArray tabs  ) 
 

void Pango::Layout::set_text ( const Glib::ustring text  ) 
 

Set the text of the layout.

Parameters:
text The text for the layout.

void Pango::Layout::set_width ( int  width  ) 
 

void Pango::Layout::set_wrap ( WrapMode  wrap  ) 
 

void Pango::Layout::unset_font_description (  ) 
 

bool Pango::Layout::xy_to_index ( int  x,
int  y,
int&  index,
int&  trailing
const
 


Friends And Related Function Documentation

Glib::RefPtr<Pango::Layout> wrap ( PangoLayout*  object,
bool  take_copy = false
[related]
 


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