text.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCHEMPAINT_TEXT_H
00026 #define GCHEMPAINT_TEXT_H
00027
00028 #include <gcu/macros.h>
00029 #include <gcu/object.h>
00030 #include <libxml/tree.h>
00031 #include <gtk/gtk.h>
00032 #include "text-object.h"
00033
00034 namespace gcp {
00035
00036 class Text: public TextObject
00037 {
00038 public:
00039 Text ();
00040 Text (double x, double y);
00041 virtual ~Text ();
00042
00043 void GetCoords (double *x, double *y);
00044 void SetCoords (double x, double y);
00045 xmlNodePtr Save (xmlDocPtr xml) const;
00046 xmlNodePtr SaveSelection (xmlDocPtr xml) const;
00047 bool Load (xmlNodePtr);
00048 bool LoadSelection (xmlNodePtr node, unsigned pos);
00049 bool LoadNode (xmlNodePtr, unsigned &pos, int level = 0);
00050 void Add (GtkWidget* w) const;
00051 void Update (GtkWidget* w) const;
00052 void SetSelected (GtkWidget* w, int state);
00053 bool OnChanged (bool save);
00054 void Transform2D (gcu::Matrix2D& m, double x, double y);
00055 bool OnEvent (GdkEvent *event);
00056 void GetSize (double& x, double& y) {x = m_length; y = m_height;}
00057 double GetYAlign ();
00058 void SetText (char const *text) {m_buf = text;}
00059 bool SetProperty (unsigned property, char const *value);
00060
00061 GCU_RO_PROP (PangoAlignment, Align);
00062 };
00063
00064 }
00065
00066 #endif //GCHEMPAINT_TEXT_H