pangomm 2.40.2

Public Member Functions | Protected Attributes | Related Functions | List of all members
Pango::Rectangle Class Reference

A Pango::Rectangle represents a rectangle. More...

`#include <pangomm/rectangle.h>`

## Public Member Functions
| Rectangle ()
| Rectangle (int x, int y, int width, int height)
| Rectangle (const PangoRectangle* src)
void | set_x (int x)
| Sets the X coordinate of the left side of the rectangle. More...
void | set_y (int y)
| Sets the Y coordinate of the top side of the rectangle. More...
void | set_width (int w)
| Sets the width of the rectangle. More...
void | set_height (int h)
| Sets the height of the rectangle. More...
int | get_x () const
| Gets the X coordinate of the left side of the rectangle. More...
int | get_y () const
| Gets the Y coordinate of the top side of the rectangle. More...
int | get_width () const
| Gets the width of the rectangle. More...
int | get_height () const
| Gets the height of the rectangle. More...
int | get_ascent () const
| Extracts the ascent from a Pango::Rectangle representing glyph extents. More...
int | get_descent () const
| Extracts the descent from a Pango::Rectangle representing glyph extents. More...
int | get_lbearing () const
| Extracts the left bearing from a Pango::Rectangle representing glyph extents. More...
int | get_rbearing () const
| Extracts the right bearing from a Pango::Rectangle representing glyph extents. More...
bool | equal (const Rectangle& rhs) const
| Checks for equality of two Pango::Rectangles. More...
PangoRectangle* | gobj ()
| Provides access to the underlying C GObject. More...
const PangoRectangle* | gobj () const
| Provides access to the underlying C GObject. More...

## Protected Attributes
PangoRectangle | gobject_

## Related Functions
(Note that these are not member functions.)
bool | operator== (const Rectangle& lhs, const Rectangle& rhs)
bool | operator!= (const Rectangle& lhs, const Rectangle& rhs)
Pango::Rectangle& | wrap (PangoRectangle* object)
const Pango::Rectangle& | wrap (const PangoRectangle* object)

## Detailed Description

A Pango::Rectangle represents a rectangle.

It is frequently used to represent the logical or ink extents of a single glyph or section of text. The coordinate system for each rectangle has its origin at the base line and the horizontal origin of the character with increasing coordinates extending to the right and down. get_ascent(), get_descent(), get_lbearing(), and get_rbearing() can be used to convert from the extents rectangle to more traditional font metrics. The units of rectangles usually are in 1/PangoSCALE of a device unit.

## Constructor & Destructor Documentation

## ◆ Rectangle() [1/3]

Pango::Rectangle::Rectangle | ( |  | ) |

## ◆ Rectangle() [2/3]

Pango::Rectangle::Rectangle | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height
| ) |  |

## ◆ Rectangle() [3/3]

Pango::Rectangle::Rectangle | ( | const PangoRectangle * | src | ) |
| explicit

## Member Function Documentation

## ◆ equal()

bool Pango::Rectangle::equal | ( | const Rectangle& | rhs | ) | const

Checks for equality of two Pango::Rectangles.

Parameters

  rhs | The Pango::Rectangle to compare with.

Returns
  true if rhs is equal with the rectangle.

## ◆ get_ascent()

int Pango::Rectangle::get_ascent | ( |  | ) | const
| inline

Extracts the ascent from a Pango::Rectangle representing glyph extents.

The ascent is the distance from the baseline to the highest point of the character. This is positive if the glyph ascends above the baseline.

Returns
  The ascent of the character.

## ◆ get_descent()

int Pango::Rectangle::get_descent | ( |  | ) | const
| inline

Extracts the descent from a Pango::Rectangle representing glyph extents.

The descent is the distance from the baseline to the lowest point of the character. This is positive if the glyph descends below the baseline.

Returns
  The descent of the character.

## ◆ get_height()

int Pango::Rectangle::get_height | ( |  | ) | const
| inline

Gets the height of the rectangle.

Returns
  The height.

## ◆ get_lbearing()

int Pango::Rectangle::get_lbearing | ( |  | ) | const
| inline

Extracts the left bearing from a Pango::Rectangle representing glyph extents.

The left bearing is the distance from the horizontal origin to the farthest left point of the character. This is positive for characters drawn completely to the right of the glyph origin.

Returns
  The left bearing of the character.

## ◆ get_rbearing()

int Pango::Rectangle::get_rbearing | ( |  | ) | const
| inline

Extracts the right bearing from a Pango::Rectangle representing glyph extents.

The right bearing is the distance from the horizontal origin to the farthest right point of the character. This is positive except for characters drawn completely to the left of the horizontal origin.

Returns
  The right bearing of the character.

## ◆ get_width()

int Pango::Rectangle::get_width | ( |  | ) | const
| inline

Gets the width of the rectangle.

Returns
  The width.

## ◆ get_x()

int Pango::Rectangle::get_x | ( |  | ) | const
| inline

Gets the X coordinate of the left side of the rectangle.

Returns
  The X coordinate.

## ◆ get_y()

int Pango::Rectangle::get_y | ( |  | ) | const
| inline

Gets the Y coordinate of the top side of the rectangle.

Returns
  The Y coordinate.

## ◆ gobj() [1/2]

PangoRectangle* Pango::Rectangle::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const PangoRectangle* Pango::Rectangle::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ set_height()

void Pango::Rectangle::set_height | ( | int | h | ) |
| inline

Sets the height of the rectangle.

Parameters

  h | The new height.

## ◆ set_width()

void Pango::Rectangle::set_width | ( | int | w | ) |
| inline

Sets the width of the rectangle.

Parameters

  w | The new width.

## ◆ set_x()

void Pango::Rectangle::set_x | ( | int | x | ) |
| inline

Sets the X coordinate of the left side of the rectangle.

Parameters

  x | The new X coordinate.

## ◆ set_y()

void Pango::Rectangle::set_y | ( | int | y | ) |
| inline

Sets the Y coordinate of the top side of the rectangle.

Parameters

  y | The new Y coordinate.

## Friends And Related Function Documentation

## ◆ operator!=()

bool operator!= | ( | const Rectangle& | lhs,
|  | const Rectangle& | rhs
| ) |  |
| related

## ◆ operator==()

bool operator== | ( | const Rectangle& | lhs,
|  | const Rectangle& | rhs
| ) |  |
| related

## ◆ wrap() [1/2]

Pango::Rectangle& wrap | ( | PangoRectangle * | object | ) |
| related

## ◆ wrap() [2/2]

const Pango::Rectangle& wrap | ( | const PangoRectangle * | object | ) |
| related

## Member Data Documentation

## ◆ gobject_

PangoRectangle Pango::Rectangle::gobject_
| protected