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 #include <goocanvasmm/enums.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 extern "C" { typedef union _GooCanvasPathCommand GooCanvasPathCommand; }
00035 #endif
00036
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GooCanvasItemModel GooCanvasItemModel;
00039 typedef struct _GooCanvasItemModelClass GooCanvasItemModelClass;
00040 #endif
00041
00042
00043 namespace Goocanvas
00044 { class ItemModel_Class; }
00045 namespace Goocanvas
00046 {
00047 class Canvas ;
00048 class Item ;
00049
00055 enum AnimateType
00056 {
00057 ANIMATE_FREEZE,
00058 ANIMATE_RESET,
00059 ANIMATE_RESTART,
00060 ANIMATE_BOUNCE
00061 };
00062
00063 }
00064
00065
00066 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00067 namespace Glib
00068 {
00069
00070 template <>
00071 class Value<Goocanvas::AnimateType> : public Glib::Value_Enum<Goocanvas::AnimateType>
00072 {
00073 public:
00074 static GType value_type() G_GNUC_CONST;
00075 };
00076
00077 }
00078 #endif
00079
00080
00081 namespace Goocanvas
00082 {
00083
00084
00085 class ItemModel : public Glib::Interface
00086 {
00087
00088 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00089
00090 public:
00091 typedef ItemModel CppObjectType;
00092 typedef ItemModel_Class CppClassType;
00093 typedef GooCanvasItemModel BaseObjectType;
00094 typedef GooCanvasItemModelIface BaseClassType;
00095
00096 private:
00097 friend class ItemModel_Class;
00098 static CppClassType itemmodel_class_;
00099
00100
00101 ItemModel(const ItemModel&);
00102 ItemModel& operator=(const ItemModel&);
00103
00104 protected:
00105 ItemModel();
00106
00113 explicit ItemModel(const Glib::Interface_Class& interface_class);
00114
00115 public:
00116
00117
00118
00119 explicit ItemModel(GooCanvasItemModel* castitem);
00120
00121 protected:
00122 #endif
00123
00124 public:
00125 virtual ~ItemModel();
00126
00127 static void add_interface(GType gtype_implementer);
00128
00129 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00130 static GType get_type() G_GNUC_CONST;
00131 static GType get_base_type() G_GNUC_CONST;
00132 #endif
00133
00135 GooCanvasItemModel* gobj() { return reinterpret_cast<GooCanvasItemModel*>(gobject_); }
00136
00138 const GooCanvasItemModel* gobj() const { return reinterpret_cast<GooCanvasItemModel*>(gobject_); }
00139
00140 private:
00141
00142
00143 public:
00144
00145
00149 int get_n_children() const;
00150
00156 Glib::RefPtr<ItemModel> get_child(int child_num);
00157
00163 Glib::RefPtr<const ItemModel> get_child(int child_num) const;
00164
00170 void get_child_property(const Glib::RefPtr<ItemModel>& child, const Glib::ustring& property_name, Glib::ValueBase& value) const;
00171
00177 void set_child_property(const Glib::RefPtr<ItemModel>& child, const Glib::ustring& property_name, const Glib::ValueBase& value);
00178
00179
00185 void add_child(const Glib::RefPtr<ItemModel>& child, int position);
00186 void add_child(const Glib::RefPtr<ItemModel>& child);
00187
00188
00193 void move_child(int old_position, int new_position);
00194
00198 void remove_child(int child_num);
00199
00204 int find_child(const Glib::RefPtr<ItemModel>& child);
00205
00206
00210 Glib::RefPtr<ItemModel> get_parent();
00211
00215 Glib::RefPtr<const ItemModel> get_parent() const;
00216
00228 void set_parent(const Glib::RefPtr<ItemModel>& parent);
00229
00230
00236 void remove();
00237
00241 bool is_container() const;
00242
00243
00248 void raise(const Glib::RefPtr<ItemModel>& above);
00249
00252 void raise();
00253
00254
00259 void lower(const Glib::RefPtr<ItemModel>& below);
00260
00263 void lower();
00264
00265
00266
00271 bool get_transform(Cairo::Matrix* transform);
00272
00277 void set_transform(const Cairo::Matrix* transform);
00278
00285 void set_simple_transform(double x, double y, double scale, double rotation);
00286
00298 bool get_simple_transform(double& x, double& y, double& scale, double& rotation) const;
00299
00304 void translate(double tx, double ty);
00305
00310 void scale(double sx, double sy);
00311
00318 void rotate(double degrees, double cx, double cy);
00319
00326 void skew_x(double degrees, double cx, double cy);
00327
00334 void skew_y(double degrees, double cx, double cy);
00335
00336
00341 Glib::RefPtr<Style> get_style();
00342
00347 Glib::RefPtr<const Style> get_style() const;
00348
00352 void set_style(const Glib::RefPtr<Style>& style);
00353
00354
00371 void animate(double x, double y, double scale, double degrees, bool absolute, int duration, int step_time, AnimateType animate_type);
00372
00376 void stop_animation();
00377
00378
00384 Glib::SignalProxy1< void,int > signal_child_added();
00385
00386
00392 Glib::SignalProxy1< void,int > signal_child_removed();
00393
00394
00400 Glib::SignalProxy2< void,int,int > signal_child_moved();
00401
00402
00408 Glib::SignalProxy1< void,bool > signal_changed();
00409
00410
00416 Glib::SignalProxy1< void,GParamSpec* > signal_child_notify();
00417
00418
00424 Glib::SignalProxy1< void,bool > signal_animation_finished();
00425
00426
00427 #ifdef GLIBMM_PROPERTIES_ENABLED
00428
00434 Glib::PropertyProxy< Glib::RefPtr<ItemModel> > property_parent() ;
00435 #endif //#GLIBMM_PROPERTIES_ENABLED
00436
00437 #ifdef GLIBMM_PROPERTIES_ENABLED
00438
00444 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ItemModel> > property_parent() const;
00445 #endif //#GLIBMM_PROPERTIES_ENABLED
00446
00447 #ifdef GLIBMM_PROPERTIES_ENABLED
00448
00454 Glib::PropertyProxy<bool> property_can_focus() ;
00455 #endif //#GLIBMM_PROPERTIES_ENABLED
00456
00457 #ifdef GLIBMM_PROPERTIES_ENABLED
00458
00464 Glib::PropertyProxy_ReadOnly<bool> property_can_focus() const;
00465 #endif //#GLIBMM_PROPERTIES_ENABLED
00466
00467 #ifdef GLIBMM_PROPERTIES_ENABLED
00468
00474 Glib::PropertyProxy<Cairo::Matrix*> property_transform() ;
00475 #endif //#GLIBMM_PROPERTIES_ENABLED
00476
00477 #ifdef GLIBMM_PROPERTIES_ENABLED
00478
00484 Glib::PropertyProxy_ReadOnly<Cairo::Matrix*> property_transform() const;
00485 #endif //#GLIBMM_PROPERTIES_ENABLED
00486
00487 #ifdef GLIBMM_PROPERTIES_ENABLED
00488
00494 Glib::PropertyProxy<Glib::ustring> property_title() ;
00495 #endif //#GLIBMM_PROPERTIES_ENABLED
00496
00497 #ifdef GLIBMM_PROPERTIES_ENABLED
00498
00504 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
00505 #endif //#GLIBMM_PROPERTIES_ENABLED
00506
00507 #ifdef GLIBMM_PROPERTIES_ENABLED
00508
00514 Glib::PropertyProxy<Glib::ustring> property_description() ;
00515 #endif //#GLIBMM_PROPERTIES_ENABLED
00516
00517 #ifdef GLIBMM_PROPERTIES_ENABLED
00518
00524 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_description() const;
00525 #endif //#GLIBMM_PROPERTIES_ENABLED
00526
00527 #ifdef GLIBMM_PROPERTIES_ENABLED
00528
00534 Glib::PropertyProxy<PointerEvents> property_pointer_events() ;
00535 #endif //#GLIBMM_PROPERTIES_ENABLED
00536
00537 #ifdef GLIBMM_PROPERTIES_ENABLED
00538
00544 Glib::PropertyProxy_ReadOnly<PointerEvents> property_pointer_events() const;
00545 #endif //#GLIBMM_PROPERTIES_ENABLED
00546
00547 #ifdef GLIBMM_PROPERTIES_ENABLED
00548
00554 Glib::PropertyProxy<ItemVisibility> property_visibility() ;
00555 #endif //#GLIBMM_PROPERTIES_ENABLED
00556
00557 #ifdef GLIBMM_PROPERTIES_ENABLED
00558
00564 Glib::PropertyProxy_ReadOnly<ItemVisibility> property_visibility() const;
00565 #endif //#GLIBMM_PROPERTIES_ENABLED
00566
00567 #ifdef GLIBMM_PROPERTIES_ENABLED
00568
00574 Glib::PropertyProxy<double> property_visibility_threshold() ;
00575 #endif //#GLIBMM_PROPERTIES_ENABLED
00576
00577 #ifdef GLIBMM_PROPERTIES_ENABLED
00578
00584 Glib::PropertyProxy_ReadOnly<double> property_visibility_threshold() const;
00585 #endif //#GLIBMM_PROPERTIES_ENABLED
00586
00587
00588 protected:
00589
00590
00591 #ifdef GLIBMM_VFUNCS_ENABLED
00592 virtual int get_n_children_vfunc() const;
00593 #endif //GLIBMM_VFUNCS_ENABLED
00594
00595 #ifdef GLIBMM_VFUNCS_ENABLED
00596 virtual Glib::RefPtr<ItemModel> get_child_vfunc(int child_num) const;
00597 #endif //GLIBMM_VFUNCS_ENABLED
00598
00599 #ifdef GLIBMM_VFUNCS_ENABLED
00600 virtual void add_child_vfunc(const Glib::RefPtr<ItemModel>& child, int position);
00601 #endif //GLIBMM_VFUNCS_ENABLED
00602
00603 #ifdef GLIBMM_VFUNCS_ENABLED
00604 virtual void move_child_vfunc(int old_position, int ne_position);
00605 #endif //GLIBMM_VFUNCS_ENABLED
00606
00607 #ifdef GLIBMM_VFUNCS_ENABLED
00608 virtual void remove_child_vfunc(int child_num);
00609 #endif //GLIBMM_VFUNCS_ENABLED
00610
00611 #ifdef GLIBMM_VFUNCS_ENABLED
00612 virtual void get_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, Glib::ValueBase& value, GParamSpec* pspec) const;
00613 #endif //GLIBMM_VFUNCS_ENABLED
00614
00615 #ifdef GLIBMM_VFUNCS_ENABLED
00616 virtual void set_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, const Glib::ValueBase& value, GParamSpec* pspec);
00617 #endif //GLIBMM_VFUNCS_ENABLED
00618
00619
00620 #ifdef GLIBMM_VFUNCS_ENABLED
00621 virtual Glib::RefPtr<ItemModel> get_parent_vfunc() const;
00622 #endif //GLIBMM_VFUNCS_ENABLED
00623
00624 #ifdef GLIBMM_VFUNCS_ENABLED
00625 virtual void set_parent_vfunc(const Glib::RefPtr<ItemModel>& parent);
00626 #endif //GLIBMM_VFUNCS_ENABLED
00627
00628
00629 #ifdef GLIBMM_VFUNCS_ENABLED
00630 virtual Glib::RefPtr<Item> create_item_vfunc(Canvas* canvas);
00631 #endif //GLIBMM_VFUNCS_ENABLED
00632
00633 #ifdef GLIBMM_VFUNCS_ENABLED
00634 virtual bool get_transform_vfunc(Cairo::Matrix* transform) const;
00635 #endif //GLIBMM_VFUNCS_ENABLED
00636
00637 #ifdef GLIBMM_VFUNCS_ENABLED
00638 virtual void set_transform_vfunc(const Cairo::Matrix* transform);
00639 #endif //GLIBMM_VFUNCS_ENABLED
00640
00641
00642 #ifdef GLIBMM_VFUNCS_ENABLED
00643 virtual Glib::RefPtr<Style> get_style_vfunc() const;
00644 #endif //GLIBMM_VFUNCS_ENABLED
00645
00646 #ifdef GLIBMM_VFUNCS_ENABLED
00647 virtual void set_style_vfunc(const Glib::RefPtr<Style>& style);
00648 #endif //GLIBMM_VFUNCS_ENABLED
00649
00650
00651 public:
00652
00653 public:
00654
00655 #ifdef GLIBMM_VFUNCS_ENABLED
00656 #endif //GLIBMM_VFUNCS_ENABLED
00657
00658 protected:
00659
00660 #ifdef GLIBMM_VFUNCS_ENABLED
00661 #endif //GLIBMM_VFUNCS_ENABLED
00662
00663
00664 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00665 virtual void on_child_added(int child_num);
00666 virtual void on_child_removed(int child_num);
00667 virtual void on_child_moved(int old_child_num, int new_child_num);
00668 virtual void on_changed(bool recompute_bounds);
00669 virtual void on_child_notify(GParamSpec* pspec);
00670 virtual void on_animation_finished(bool stopped);
00671 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00672
00673
00674 };
00675
00676 }
00677
00678
00679 namespace Glib
00680 {
00689 Glib::RefPtr<Goocanvas::ItemModel> wrap(GooCanvasItemModel* object, bool take_copy = false);
00690
00691 }
00692
00693
00694 #endif
00695