#include <translator.h>
Public Types | |
typedef PapyrusPointer < Translator > | pointer |
Public Member Functions | |
virtual | ~Translator () |
unsigned | transforms () |
void | set_transforms (unsigned transforms) |
void | enable_transforms (unsigned transforms) |
void | disable_transforms (unsigned transforms) |
void | grid (double &x, double &y) |
Gets the current grid size. | |
void | set_grid (double x, double y) |
Sets the grid x and y sizes. | |
void | set_grid_x (double x) |
void | set_grid_y (double y) |
Static Public Member Functions | |
static Translator::pointer | create (unsigned transforms=TRANSLATE_X|TRANSLATE_Y) |
static Translator::pointer | create (const Glib::ustring &id, DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y) |
static Translator::pointer | create (const Glib::ustring &id, unsigned transforms=TRANSLATE_X|TRANSLATE_Y) |
static Translator::pointer | create (DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y) |
Protected Member Functions | |
Translator (const Glib::ustring &id, DrawableSet::pointer drawables, unsigned transforms=TRANSLATE_X|TRANSLATE_Y) | |
virtual bool | on_motion (const Event::Motion &event) |
virtual bool | on_button_press (const Event::ButtonPress &event) |
Protected Attributes | |
double | m_last_position [2] |
double | m_original_position [2] |
unsigned | m_transforms |
double | m_grid [2] |
typedef PapyrusPointer<Translator> Papyrus::Translator::pointer |
Reimplemented from Papyrus::AffineController.
Papyrus::Translator::Translator | ( | const Glib::ustring & | id, | |
DrawableSet::pointer | drawables, | |||
unsigned | transforms = TRANSLATE_X|TRANSLATE_Y | |||
) | [protected] |
References m_grid, m_original_position, and Papyrus::AffineController::recalculate_matrix().
Papyrus::Translator::~Translator | ( | ) | [virtual] |
Translator::pointer Papyrus::Translator::create | ( | DrawableSet::pointer | drawables, | |
unsigned | transforms = TRANSLATE_X|TRANSLATE_Y | |||
) | [static] |
References PAPYRUS_CREATE.
Translator::pointer Papyrus::Translator::create | ( | const Glib::ustring & | id, | |
unsigned | transforms = TRANSLATE_X|TRANSLATE_Y | |||
) | [static] |
References PAPYRUS_CREATE.
Translator::pointer Papyrus::Translator::create | ( | const Glib::ustring & | id, | |
DrawableSet::pointer | drawables, | |||
unsigned | transforms = TRANSLATE_X|TRANSLATE_Y | |||
) | [static] |
References PAPYRUS_CREATE.
Translator::pointer Papyrus::Translator::create | ( | unsigned | transforms = TRANSLATE_X|TRANSLATE_Y |
) | [static] |
References PAPYRUS_CREATE.
void Papyrus::Translator::disable_transforms | ( | unsigned | transforms | ) |
References m_transforms.
void Papyrus::Translator::enable_transforms | ( | unsigned | transforms | ) |
References m_transforms.
void Papyrus::Translator::grid | ( | double & | x, | |
double & | y | |||
) |
Gets the current grid size.
References m_grid.
bool Papyrus::Translator::on_button_press | ( | const Event::ButtonPress & | event | ) | [protected, virtual] |
Reimplemented from Papyrus::Controller.
References m_last_position, and m_original_position.
bool Papyrus::Translator::on_motion | ( | const Event::Motion & | event | ) | [protected, virtual] |
Reimplemented from Papyrus::Controller.
References m_grid, m_last_position, m_transforms, Papyrus::AffineController::translate(), Papyrus::TRANSLATE_X, and Papyrus::TRANSLATE_Y.
void Papyrus::Translator::set_grid | ( | double | x, | |
double | y | |||
) |
Sets the grid x and y sizes.
If either is <= 0.0 then the grid will be turned off for that dimension.
References m_grid.
void Papyrus::Translator::set_grid_x | ( | double | x | ) |
References m_grid.
void Papyrus::Translator::set_grid_y | ( | double | y | ) |
References m_grid.
void Papyrus::Translator::set_transforms | ( | unsigned | transforms | ) |
References m_transforms.
unsigned Papyrus::Translator::transforms | ( | ) |
References m_transforms.
double Papyrus::Translator::m_grid[2] [protected] |
Referenced by grid(), on_motion(), set_grid(), set_grid_x(), set_grid_y(), and Translator().
double Papyrus::Translator::m_last_position[2] [protected] |
Referenced by on_button_press(), and on_motion().
double Papyrus::Translator::m_original_position[2] [protected] |
Referenced by on_button_press(), and Translator().
unsigned Papyrus::Translator::m_transforms [protected] |
Referenced by disable_transforms(), enable_transforms(), on_motion(), set_transforms(), and transforms().