#include <gcp/text-object.h>
Public Member Functions | |
TextObject (gcu::TypeId Type) | |
TextObject (double x, double y, gcu::TypeId Type) | |
virtual | ~TextObject () |
void | GetSize (double &x, double &y) |
xmlNodePtr | SaveSelected () |
void | LoadSelected (xmlNodePtr node) |
virtual bool | OnChanged (bool save)=0 |
void | OnSelChanged (struct GnomeCanvasPangoSelBounds *bounds) |
bool | SaveNode (xmlDocPtr xml, xmlNodePtr node) const |
bool | Load (xmlNodePtr node) |
void | Move (double x, double y, double z=0) |
bool | IsLocked () |
void | GetSelectionBounds (unsigned &start, unsigned &end) |
std::string | GetBuffer () |
virtual std::string | GetProperty (unsigned property) const |
PangoLayout * | GetLayout (void) |
PangoAttrList * | GetAttrList (void) |
GtkAnchorType | GetAnchor (void) |
Protected Attributes | |
double | m_x |
double | m_y |
double | m_length |
double | m_height |
int | m_ascent |
int | m_InsertOffset |
std::string | m_buf |
bool | m_bLoading |
unsigned | m_StartSel |
unsigned | m_EndSel |
bool | m_RealSave |
PangoLayout * | m_Layout |
PangoAttrList * | m_AttrList |
GtkAnchorType | m_Anchor |
Definition at line 42 of file text-object.h.
gcp::TextObject::TextObject | ( | gcu::TypeId | Type | ) |
Type | the TypeId of the derived class. |
gcp::TextObject::TextObject | ( | double | x, | |
double | y, | |||
gcu::TypeId | Type | |||
) |
Type | the TypeId of the derived class. | |
x | the horizontal poisition. | |
y | the vertical poisition. |
virtual gcp::TextObject::~TextObject | ( | ) | [virtual] |
The destructor.
void gcp::TextObject::GetSize | ( | double & | x, | |
double & | y | |||
) | [inline] |
x | the variable to be set to the width value. | |
y | the variable to be set to the height value. |
Reimplemented in gcp::Text.
Definition at line 70 of file text-object.h.
xmlNodePtr gcp::TextObject::SaveSelected | ( | ) |
Saves the selection.
void gcp::TextObject::LoadSelected | ( | xmlNodePtr | node | ) |
node | the xml node representing the text to import. |
virtual bool gcp::TextObject::OnChanged | ( | bool | save | ) | [pure virtual] |
save | whether the text should be saved for undo/redo operations. |
Implemented in gcp::Fragment, and gcp::Text.
void gcp::TextObject::OnSelChanged | ( | struct GnomeCanvasPangoSelBounds * | bounds | ) |
bounds | the bounds of the selection. |
bool gcp::TextObject::SaveNode | ( | xmlDocPtr | xml, | |
xmlNodePtr | node | |||
) | const |
xml | the xml document. | |
node | the node representing the text. |
bool gcp::TextObject::Load | ( | xmlNodePtr | node | ) | [virtual] |
node | the xml node representing the text. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Fragment, and gcp::Text.
void gcp::TextObject::Move | ( | double | x, | |
double | y, | |||
double | z = 0 | |||
) | [virtual] |
x | the horizontal translation. | |
y | the vertical translation. | |
z | the depth translation. |
Reimplemented from gcu::Object.
Reimplemented in gcp::Fragment.
bool gcp::TextObject::IsLocked | ( | ) | [inline] |
This is used because updates are not needed while loading util the whole text has been loaded.
Reimplemented from gcu::Object.
Definition at line 123 of file text-object.h.
References m_bLoading.
void gcp::TextObject::GetSelectionBounds | ( | unsigned & | start, | |
unsigned & | end | |||
) | [inline] |
start | where to store the start of the selection. | |
end | where to store the end of the selection. |
Definition at line 130 of file text-object.h.
References m_EndSel, and m_StartSel.
std::string gcp::TextObject::GetBuffer | ( | ) | [inline] |
Definition at line 134 of file text-object.h.
References m_buf.
virtual std::string gcp::TextObject::GetProperty | ( | unsigned | property | ) | const [virtual] |
property | the property id as defined in gcu/objprops.h |
Reimplemented from gcu::Object.
gcp::TextObject::GetLayout | ( | void | ) | [inline] |
gcp::TextObject::GetAttrList | ( | void | ) | [inline] |
gcp::TextObject::GetAnchor | ( | void | ) | [inline] |
double gcp::TextObject::m_x [protected] |
The horizontal of the object in canvas units.
Definition at line 147 of file text-object.h.
double gcp::TextObject::m_y [protected] |
The vertical of the object in canvas units.
Definition at line 151 of file text-object.h.
double gcp::TextObject::m_length [protected] |
The width of the object in canvas units.
Definition at line 155 of file text-object.h.
Referenced by gcp::Text::GetSize(), and GetSize().
double gcp::TextObject::m_height [protected] |
The height of the object in canvas units.
Definition at line 159 of file text-object.h.
Referenced by gcp::Text::GetSize(), and GetSize().
int gcp::TextObject::m_ascent [protected] |
The ascent of the text.
Definition at line 163 of file text-object.h.
int gcp::TextObject::m_InsertOffset [protected] |
The current insertionposition.
Definition at line 167 of file text-object.h.
std::string gcp::TextObject::m_buf [protected] |
The text owned byt the object.
Definition at line 171 of file text-object.h.
Referenced by GetBuffer().
bool gcp::TextObject::m_bLoading [protected] |
treu on loading, false otherwise.
Definition at line 175 of file text-object.h.
Referenced by IsLocked().
unsigned gcp::TextObject::m_StartSel [protected] |
The index in bytes of the start of the selection.
Definition at line 179 of file text-object.h.
Referenced by GetSelectionBounds().
unsigned gcp::TextObject::m_EndSel [protected] |
The index in bytes of the end of the selection.
Definition at line 183 of file text-object.h.
Referenced by GetSelectionBounds().
bool gcp::TextObject::m_RealSave [protected] |
Tells whether the Save method is called for the whole text or just the selection.
Definition at line 188 of file text-object.h.
gcp::TextObject::m_Layout [protected] |
The PangoLayout associated with the object.
Definition at line 196 of file text-object.h.
gcp::TextObject::m_AttrList [protected] |
The PangoAttrList associated to the text.
Definition at line 203 of file text-object.h.
gcp::TextObject::m_Anchor [protected] |
The GtkAnchor used for the text object. Default is GTK_ANCHOR_W. When GTK_ANCHOR_W, GTK_ANCHOR_CENTER, or GTK_ANCHOR_E is used, the base of the first line is used for vertical alignment.
Definition at line 212 of file text-object.h.