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 CANVAS_ANIMATE_FREEZE,
00058 CANVAS_ANIMATE_RESET,
00059 CANVAS_ANIMATE_RESTART,
00060 CANVAS_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
00419 #ifdef GLIBMM_PROPERTIES_ENABLED
00420
00426 Glib::PropertyProxy< Glib::RefPtr<ItemModel> > property_parent() ;
00427 #endif //#GLIBMM_PROPERTIES_ENABLED
00428
00429 #ifdef GLIBMM_PROPERTIES_ENABLED
00430
00436 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ItemModel> > property_parent() const;
00437 #endif //#GLIBMM_PROPERTIES_ENABLED
00438
00439 #ifdef GLIBMM_PROPERTIES_ENABLED
00440
00446 Glib::PropertyProxy<bool> property_can_focus() ;
00447 #endif //#GLIBMM_PROPERTIES_ENABLED
00448
00449 #ifdef GLIBMM_PROPERTIES_ENABLED
00450
00456 Glib::PropertyProxy_ReadOnly<bool> property_can_focus() const;
00457 #endif //#GLIBMM_PROPERTIES_ENABLED
00458
00459 #ifdef GLIBMM_PROPERTIES_ENABLED
00460
00466 Glib::PropertyProxy<Cairo::Matrix*> property_transform() ;
00467 #endif //#GLIBMM_PROPERTIES_ENABLED
00468
00469 #ifdef GLIBMM_PROPERTIES_ENABLED
00470
00476 Glib::PropertyProxy_ReadOnly<Cairo::Matrix*> property_transform() const;
00477 #endif //#GLIBMM_PROPERTIES_ENABLED
00478
00479 #ifdef GLIBMM_PROPERTIES_ENABLED
00480
00486 Glib::PropertyProxy<Glib::ustring> property_title() ;
00487 #endif //#GLIBMM_PROPERTIES_ENABLED
00488
00489 #ifdef GLIBMM_PROPERTIES_ENABLED
00490
00496 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_title() const;
00497 #endif //#GLIBMM_PROPERTIES_ENABLED
00498
00499 #ifdef GLIBMM_PROPERTIES_ENABLED
00500
00506 Glib::PropertyProxy<Glib::ustring> property_description() ;
00507 #endif //#GLIBMM_PROPERTIES_ENABLED
00508
00509 #ifdef GLIBMM_PROPERTIES_ENABLED
00510
00516 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_description() const;
00517 #endif //#GLIBMM_PROPERTIES_ENABLED
00518
00519 #ifdef GLIBMM_PROPERTIES_ENABLED
00520
00526 Glib::PropertyProxy<PointerEvents> property_pointer_events() ;
00527 #endif //#GLIBMM_PROPERTIES_ENABLED
00528
00529 #ifdef GLIBMM_PROPERTIES_ENABLED
00530
00536 Glib::PropertyProxy_ReadOnly<PointerEvents> property_pointer_events() const;
00537 #endif //#GLIBMM_PROPERTIES_ENABLED
00538
00539 #ifdef GLIBMM_PROPERTIES_ENABLED
00540
00546 Glib::PropertyProxy<ItemVisibility> property_visibility() ;
00547 #endif //#GLIBMM_PROPERTIES_ENABLED
00548
00549 #ifdef GLIBMM_PROPERTIES_ENABLED
00550
00556 Glib::PropertyProxy_ReadOnly<ItemVisibility> property_visibility() const;
00557 #endif //#GLIBMM_PROPERTIES_ENABLED
00558
00559 #ifdef GLIBMM_PROPERTIES_ENABLED
00560
00566 Glib::PropertyProxy<double> property_visibility_threshold() ;
00567 #endif //#GLIBMM_PROPERTIES_ENABLED
00568
00569 #ifdef GLIBMM_PROPERTIES_ENABLED
00570
00576 Glib::PropertyProxy_ReadOnly<double> property_visibility_threshold() const;
00577 #endif //#GLIBMM_PROPERTIES_ENABLED
00578
00579
00580 protected:
00581
00582
00583 #ifdef GLIBMM_VFUNCS_ENABLED
00584 virtual int get_n_children_vfunc() const;
00585 #endif //GLIBMM_VFUNCS_ENABLED
00586
00587 #ifdef GLIBMM_VFUNCS_ENABLED
00588 virtual Glib::RefPtr<ItemModel> get_child_vfunc(int child_num) const;
00589 #endif //GLIBMM_VFUNCS_ENABLED
00590
00591 #ifdef GLIBMM_VFUNCS_ENABLED
00592 virtual void add_child_vfunc(const Glib::RefPtr<ItemModel>& child, int position);
00593 #endif //GLIBMM_VFUNCS_ENABLED
00594
00595 #ifdef GLIBMM_VFUNCS_ENABLED
00596 virtual void move_child_vfunc(int old_position, int ne_position);
00597 #endif //GLIBMM_VFUNCS_ENABLED
00598
00599 #ifdef GLIBMM_VFUNCS_ENABLED
00600 virtual void remove_child_vfunc(int child_num);
00601 #endif //GLIBMM_VFUNCS_ENABLED
00602
00603 #ifdef GLIBMM_VFUNCS_ENABLED
00604 virtual void get_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, Glib::ValueBase& value, GParamSpec* pspec) const;
00605 #endif //GLIBMM_VFUNCS_ENABLED
00606
00607 #ifdef GLIBMM_VFUNCS_ENABLED
00608 virtual void set_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, const Glib::ValueBase& value, GParamSpec* pspec);
00609 #endif //GLIBMM_VFUNCS_ENABLED
00610
00611
00612 #ifdef GLIBMM_VFUNCS_ENABLED
00613 virtual Glib::RefPtr<ItemModel> get_parent_vfunc() const;
00614 #endif //GLIBMM_VFUNCS_ENABLED
00615
00616 #ifdef GLIBMM_VFUNCS_ENABLED
00617 virtual void set_parent_vfunc(const Glib::RefPtr<ItemModel>& parent);
00618 #endif //GLIBMM_VFUNCS_ENABLED
00619
00620
00621 #ifdef GLIBMM_VFUNCS_ENABLED
00622 virtual Glib::RefPtr<Item> create_item_vfunc(Canvas* canvas);
00623 #endif //GLIBMM_VFUNCS_ENABLED
00624
00625 #ifdef GLIBMM_VFUNCS_ENABLED
00626 virtual bool get_transform_vfunc(Cairo::Matrix* transform) const;
00627 #endif //GLIBMM_VFUNCS_ENABLED
00628
00629 #ifdef GLIBMM_VFUNCS_ENABLED
00630 virtual void set_transform_vfunc(const Cairo::Matrix* transform);
00631 #endif //GLIBMM_VFUNCS_ENABLED
00632
00633
00634 #ifdef GLIBMM_VFUNCS_ENABLED
00635 virtual Glib::RefPtr<Style> get_style_vfunc() const;
00636 #endif //GLIBMM_VFUNCS_ENABLED
00637
00638 #ifdef GLIBMM_VFUNCS_ENABLED
00639 virtual void set_style_vfunc(const Glib::RefPtr<Style>& style);
00640 #endif //GLIBMM_VFUNCS_ENABLED
00641
00642
00643 public:
00644
00645 public:
00646
00647 #ifdef GLIBMM_VFUNCS_ENABLED
00648 #endif //GLIBMM_VFUNCS_ENABLED
00649
00650 protected:
00651
00652 #ifdef GLIBMM_VFUNCS_ENABLED
00653 #endif //GLIBMM_VFUNCS_ENABLED
00654
00655
00656 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00657 virtual void on_child_added(int child_num);
00658 virtual void on_child_removed(int child_num);
00659 virtual void on_child_moved(int old_child_num, int new_child_num);
00660 virtual void on_changed(bool recompute_bounds);
00661 virtual void on_child_notify(GParamSpec* pspec);
00662 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00663
00664
00665 };
00666
00667 }
00668
00669
00670 namespace Glib
00671 {
00680 Glib::RefPtr<Goocanvas::ItemModel> wrap(GooCanvasItemModel* object, bool take_copy = false);
00681
00682 }
00683
00684
00685 #endif
00686