itemmodel.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _GOOCANVASMM_ITEMMODEL_H
00004 #define _GOOCANVASMM_ITEMMODEL_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 
00010 /* Copyright (C) 1998-2006 The gtkmm Development Team
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU Lesser General Public
00023  * License along with this library; if not, write to the Free
00024  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* DOXYGEN_SHOULD_SKIP_THIS */
00036 
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GooCanvasItemModel GooCanvasItemModel;
00039 typedef struct _GooCanvasItemModelClass GooCanvasItemModelClass;
00040 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00041 
00042 
00043 namespace Goocanvas
00044 { class ItemModel_Class; } // namespace Goocanvas
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 } // namespace Goocanvas
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 } // namespace Glib
00078 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
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   // noncopyable
00101   ItemModel(const ItemModel&);
00102   ItemModel& operator=(const ItemModel&);
00103 
00104 protected:
00105   ItemModel(); // you must derive from this class
00106 
00113   explicit ItemModel(const Glib::Interface_Class& interface_class);
00114 
00115 public:
00116   // This is public so that C++ wrapper instances can be
00117   // created for C instances of unwrapped types.
00118   // For instance, if an unexpected C type implements the C interface. 
00119   explicit ItemModel(GooCanvasItemModel* castitem);
00120 
00121 protected:
00122 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
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   //TODO: Use Cairo::RefPtr?
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   //These properties are not really in GooCanvasItemModel, but they are actually 
00589   //implemented in all derived GooCanvasItemModel classes individually. 
00590   //That is a GooCanvas design error, but the patch to fix it has 
00591   //not yet been accepted: http://bugzilla.gnome.org/show_bug.cgi?id=555097 
00592   #ifdef GLIBMM_PROPERTIES_ENABLED
00593 
00599   Glib::PropertyProxy<double> property_x() ;
00600 #endif //#GLIBMM_PROPERTIES_ENABLED
00601 
00602 #ifdef GLIBMM_PROPERTIES_ENABLED
00603 
00609   Glib::PropertyProxy_ReadOnly<double> property_x() const;
00610 #endif //#GLIBMM_PROPERTIES_ENABLED
00611 
00612   #ifdef GLIBMM_PROPERTIES_ENABLED
00613 
00619   Glib::PropertyProxy<double> property_y() ;
00620 #endif //#GLIBMM_PROPERTIES_ENABLED
00621 
00622 #ifdef GLIBMM_PROPERTIES_ENABLED
00623 
00629   Glib::PropertyProxy_ReadOnly<double> property_y() const;
00630 #endif //#GLIBMM_PROPERTIES_ENABLED
00631 
00632   #ifdef GLIBMM_PROPERTIES_ENABLED
00633 
00639   Glib::PropertyProxy<double> property_width() ;
00640 #endif //#GLIBMM_PROPERTIES_ENABLED
00641 
00642 #ifdef GLIBMM_PROPERTIES_ENABLED
00643 
00649   Glib::PropertyProxy_ReadOnly<double> property_width() const;
00650 #endif //#GLIBMM_PROPERTIES_ENABLED
00651 
00652   #ifdef GLIBMM_PROPERTIES_ENABLED
00653 
00659   Glib::PropertyProxy<double> property_height() ;
00660 #endif //#GLIBMM_PROPERTIES_ENABLED
00661 
00662 #ifdef GLIBMM_PROPERTIES_ENABLED
00663 
00669   Glib::PropertyProxy_ReadOnly<double> property_height() const;
00670 #endif //#GLIBMM_PROPERTIES_ENABLED
00671 
00672 
00673 protected:
00674  
00675 
00676   #ifdef GLIBMM_VFUNCS_ENABLED
00677   virtual int get_n_children_vfunc() const;
00678 #endif //GLIBMM_VFUNCS_ENABLED
00679 
00680   #ifdef GLIBMM_VFUNCS_ENABLED
00681   virtual Glib::RefPtr<ItemModel> get_child_vfunc(int child_num) const;
00682 #endif //GLIBMM_VFUNCS_ENABLED
00683 
00684   #ifdef GLIBMM_VFUNCS_ENABLED
00685   virtual void add_child_vfunc(const Glib::RefPtr<ItemModel>& child, int position);
00686 #endif //GLIBMM_VFUNCS_ENABLED
00687 
00688   #ifdef GLIBMM_VFUNCS_ENABLED
00689   virtual void move_child_vfunc(int old_position, int ne_position);
00690 #endif //GLIBMM_VFUNCS_ENABLED
00691 
00692   #ifdef GLIBMM_VFUNCS_ENABLED
00693   virtual void remove_child_vfunc(int child_num);
00694 #endif //GLIBMM_VFUNCS_ENABLED
00695 
00696   #ifdef GLIBMM_VFUNCS_ENABLED
00697   virtual void get_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, Glib::ValueBase& value, GParamSpec* pspec) const;
00698 #endif //GLIBMM_VFUNCS_ENABLED
00699 
00700   #ifdef GLIBMM_VFUNCS_ENABLED
00701   virtual void set_child_property_vfunc(const Glib::RefPtr<ItemModel>& child, guint property_id, const Glib::ValueBase& value, GParamSpec* pspec);
00702 #endif //GLIBMM_VFUNCS_ENABLED
00703 
00704 
00705   #ifdef GLIBMM_VFUNCS_ENABLED
00706   virtual Glib::RefPtr<ItemModel> get_parent_vfunc() const;
00707 #endif //GLIBMM_VFUNCS_ENABLED
00708 
00709   #ifdef GLIBMM_VFUNCS_ENABLED
00710   virtual void set_parent_vfunc(const Glib::RefPtr<ItemModel>& parent);
00711 #endif //GLIBMM_VFUNCS_ENABLED
00712 
00713 
00714   #ifdef GLIBMM_VFUNCS_ENABLED
00715   virtual Glib::RefPtr<Item> create_item_vfunc(Canvas* canvas);
00716 #endif //GLIBMM_VFUNCS_ENABLED
00717 
00718   #ifdef GLIBMM_VFUNCS_ENABLED
00719   virtual bool get_transform_vfunc(Cairo::Matrix* transform) const;
00720 #endif //GLIBMM_VFUNCS_ENABLED
00721 
00722   #ifdef GLIBMM_VFUNCS_ENABLED
00723   virtual void set_transform_vfunc(const Cairo::Matrix* transform);
00724 #endif //GLIBMM_VFUNCS_ENABLED
00725 
00726 
00727   #ifdef GLIBMM_VFUNCS_ENABLED
00728   virtual Glib::RefPtr<Style> get_style_vfunc() const;
00729 #endif //GLIBMM_VFUNCS_ENABLED
00730 
00731   #ifdef GLIBMM_VFUNCS_ENABLED
00732   virtual void set_style_vfunc(const Glib::RefPtr<Style>& style);
00733 #endif //GLIBMM_VFUNCS_ENABLED
00734 
00735 
00736 public:
00737 
00738 public:
00739   //C++ methods used to invoke GTK+ virtual functions:
00740 #ifdef GLIBMM_VFUNCS_ENABLED
00741 #endif //GLIBMM_VFUNCS_ENABLED
00742 
00743 protected:
00744   //GTK+ Virtual Functions (override these to change behaviour):
00745 #ifdef GLIBMM_VFUNCS_ENABLED
00746 #endif //GLIBMM_VFUNCS_ENABLED
00747 
00748   //Default Signal Handlers::
00749 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00750   virtual void on_child_added(int child_num);
00751   virtual void on_child_removed(int child_num);
00752   virtual void on_child_moved(int old_child_num, int new_child_num);
00753   virtual void on_changed(bool recompute_bounds);
00754   virtual void on_child_notify(GParamSpec* pspec);
00755   virtual void on_animation_finished(bool stopped);
00756 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00757 
00758 
00759 };
00760 
00761 }
00762 
00763 
00764 namespace Glib
00765 {
00774   Glib::RefPtr<Goocanvas::ItemModel> wrap(GooCanvasItemModel* object, bool take_copy = false);
00775 
00776 } // namespace Glib
00777 
00778 
00779 #endif /* _GOOCANVASMM_ITEMMODEL_H */
00780 

Generated on Wed Jul 8 05:00:06 2009 for goocanvasmm by  doxygen 1.5.8