31 #include <gdk/gdkkeysyms.h> 32 #include <pango/pango.h> 57 #define GCCV_TEXT_PROP(type,member) \ 59 void Set##member (type val) { \ 61 SetPosition (m_x, m_y); \ 63 type Get##member (void) const {return m_##member;} \ 81 friend class TextPrivate;
120 void SetText (
char const *text);
126 void SetText (std::string
const &text);
179 std::list <TextTag *>
const *
GetTags () {
return &m_Tags;}
204 void ReplaceText (std::string &str,
int pos,
unsigned length);
205 unsigned GetCursorPosition () {
return m_CurPos;}
206 void GetSelectionBounds (
unsigned &start,
unsigned &end);
207 void SetSelectionBounds (
unsigned start,
unsigned end);
208 unsigned GetIndexAt (
double x,
double y);
209 bool GetPositionAtIndex (
unsigned index,
Rect &rect);
218 void Draw (cairo_t *cr,
bool is_vector)
const;
225 void Move (
double x,
double y);
255 void OnDrag (
double x,
double y);
267 unsigned GetDefaultFontSize () {
return (m_FontDesc)? (double) pango_font_description_get_size (m_FontDesc) / PANGO_SCALE: 0; }
279 void SetInterline (
double interline,
bool emit_changed =
false);
287 void SetJustification (GtkJustification justification,
bool emit_changed =
false);
295 unsigned long m_BlinkSignal;
296 bool m_CursorVisible;
297 unsigned m_CurPos, m_StartSel;
298 std::list <TextRun *> m_Runs;
299 std::list <TextTag *> m_Tags;
301 GtkIMContext *m_ImContext;
302 PangoFontDescription *m_FontDesc;
305 unsigned m_LinesNumber;
365 #endif // GCCV_TEXT_H the base class for objects associated with a canvas item.
void GetBounds(Rect *ink, Rect *logical)
unsigned GetDefaultFontSize()
void SetText(char const *text)
#define GCU_RO_PROP(type, member)
void SetFontDescription(PangoFontDescription *desc)
bool OnKeyPressed(GdkEventKey *event)
#define GCCV_TEXT_PROP(type, member)
void OnDrag(double x, double y)
void SetCurTagList(TextTagList *l)
bool OnKeyReleased(GdkEventKey *event)
static PangoContext * GetContext()
std::list< TextTag * > const * GetTags()
void ApplyTagsToSelection(TextTagList const *l)
void OnButtonPressed(double x, double y)
Gnome Chemistry Canvas library namespace.
double GetMaxLineHeight()
void SetEditing(bool editing)
void Draw(cairo_t *cr, bool is_vector) const
void InsertTextTag(TextTag *tag, bool rebuild_attributes=true)
void DeleteTextTag(TextTag *tag, bool rebuild_attributes=true)
void ReplaceText(std::string &str, int pos, unsigned length)
class for text attributes
void SetColor(GOColor color)
Text(Canvas *canvas, double x, double y)
void SetPosition(double x, double y)
void Move(double x, double y)
void SetJustification(GtkJustification justification, bool emit_changed=false)
void SetInterline(double interline, bool emit_changed=false)