00001
00002
00003 #ifndef _GOOCANVASMM_ITEMMODEL_H
00004 #define _GOOCANVASMM_ITEMMODEL_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <cairomm/cairomm.h>
00028 #include <goocanvasitemmodel.h>
00029 #include <goocanvasmm/style.h>
00030
00031
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 extern "C" { typedef union _GooCanvasPathCommand GooCanvasPathCommand; }
00034 #endif
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GooCanvasItemModel GooCanvasItemModel;
00038 typedef struct _GooCanvasItemModelClass GooCanvasItemModelClass;
00039 #endif
00040
00041
00042 namespace Goocanvas
00043 { class ItemModel_Class; }
00044 namespace Goocanvas
00045 {
00046
00052 enum AnimateType
00053 {
00054 CANVAS_ANIMATE_FREEZE,
00055 CANVAS_ANIMATE_RESET,
00056 CANVAS_ANIMATE_RESTART,
00057 CANVAS_ANIMATE_BOUNCE
00058 };
00059
00060 }
00061
00062
00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00064 namespace Glib
00065 {
00066
00067 template <>
00068 class Value<Goocanvas::AnimateType> : public Glib::Value_Enum<Goocanvas::AnimateType>
00069 {
00070 public:
00071 static GType value_type() G_GNUC_CONST;
00072 };
00073
00074 }
00075 #endif
00076
00077
00078 namespace Goocanvas
00079 {
00080
00081
00082 class ItemModel : public Glib::Interface
00083 {
00084
00085 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00086
00087 public:
00088 typedef ItemModel CppObjectType;
00089 typedef ItemModel_Class CppClassType;
00090 typedef GooCanvasItemModel BaseObjectType;
00091 typedef GooCanvasItemModelIface BaseClassType;
00092
00093 private:
00094 friend class ItemModel_Class;
00095 static CppClassType itemmodel_class_;
00096
00097
00098 ItemModel(const ItemModel&);
00099 ItemModel& operator=(const ItemModel&);
00100
00101 protected:
00102 ItemModel();
00103
00104 public:
00105
00106
00107
00108 explicit ItemModel(GooCanvasItemModel* castitem);
00109
00110 protected:
00111 #endif
00112
00113 public:
00114 virtual ~ItemModel();
00115
00116 static void add_interface(GType gtype_implementer);
00117
00118 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00119 static GType get_type() G_GNUC_CONST;
00120 static GType get_base_type() G_GNUC_CONST;
00121 #endif
00122
00124 GooCanvasItemModel* gobj() { return reinterpret_cast<GooCanvasItemModel*>(gobject_); }
00125
00127 const GooCanvasItemModel* gobj() const { return reinterpret_cast<GooCanvasItemModel*>(gobject_); }
00128
00129 private:
00130
00131
00132 public:
00133
00134
00135 int get_n_children();
00136
00137 int get_n_children() const;
00138
00139 Glib::RefPtr<ItemModel> get_child(int child_num);
00140
00141 Glib::RefPtr<const ItemModel> get_child(int child_num) const;
00142
00143
00144 void add_child(const Glib::RefPtr<ItemModel>& child, int position);
00145 void add_child(const Glib::RefPtr<ItemModel>& child);
00146
00147
00148 void move_child(int old_position, int new_position);
00149
00150 void remove_child(int child_num);
00151
00152 int find_child(const Glib::RefPtr<ItemModel>& child);
00153
00154
00155 Glib::RefPtr<ItemModel> get_parent();
00156
00157 Glib::RefPtr<const ItemModel> get_parent() const;
00158
00159 void set_parent(const Glib::RefPtr<ItemModel>& parent);
00160
00161
00162 void remove();
00163
00164 bool is_container() const;
00165
00166
00167 void raise(const Glib::RefPtr<ItemModel>& above);
00168
00171 void raise();
00172
00173
00174 void lower(const Glib::RefPtr<ItemModel>& below);
00175
00178 void lower();
00179
00180
00181
00182 bool get_transform(Cairo::Matrix* transform);
00183
00184 void set_transform(const Cairo::Matrix* transform);
00185
00186 void set_simple_transform(double x, double y, double scale, double rotation);
00187
00188 void translate(double tx, double ty);
00189
00190 void scale(double sx, double sy);
00191
00192 void rotate(double degrees, double cx, double cy);
00193
00194 void skew_x(double degrees, double cx, double cy);
00195
00196 void skew_y(double degrees, double cx, double cy);
00197
00198
00199 Glib::RefPtr<Style> get_style();
00200
00201 Glib::RefPtr<const Style> get_style() const;
00202
00203 void set_style(const Glib::RefPtr<Style>& style);
00204
00205
00206 void animate(double x, double y, double scale, double degrees, bool absolute, int duration, int step_time, AnimateType animate_type);
00207
00208 void stop_animation();
00209
00210 protected:
00211
00212
00213 public:
00214
00215 public:
00216
00217 #ifdef GLIBMM_VFUNCS_ENABLED
00218 #endif //GLIBMM_VFUNCS_ENABLED
00219
00220 protected:
00221
00222 #ifdef GLIBMM_VFUNCS_ENABLED
00223 #endif //GLIBMM_VFUNCS_ENABLED
00224
00225
00226 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00227 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00228
00229
00230 };
00231
00232 }
00233
00234
00235 namespace Glib
00236 {
00245 Glib::RefPtr<Goocanvas::ItemModel> wrap(GooCanvasItemModel* object, bool take_copy = false);
00246
00247 }
00248
00249
00250 #endif
00251