diff options
Diffstat (limited to 'glib/glibmm/objectbase.h')
-rw-r--r-- | glib/glibmm/objectbase.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/glib/glibmm/objectbase.h b/glib/glibmm/objectbase.h index d60ad7e3..c8adeeed 100644 --- a/glib/glibmm/objectbase.h +++ b/glib/glibmm/objectbase.h @@ -21,6 +21,8 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <glibmm/signalproxy.h> +#include <glibmm/propertyproxy.h> #include <sigc++/object.h> #include <typeinfo> #include <glibmmconfig.h> @@ -79,6 +81,22 @@ protected: void initialize(GObject* castitem); public: + + /// You probably want to use a specific property_*() accessor method instead. + void set_property_value(const Glib::ustring& property_name, const Glib::ValueBase& value); + + /// You probably want to use a specific property_*() accessor method instead. + void get_property_value(const Glib::ustring& property_name, Glib::ValueBase& value) const; + + /// You probably want to use a specific property_*() accessor method instead. + template <class PropertyType> + void set_property(const Glib::ustring& property_name, const PropertyType& value); + + /// You probably want to use a specific property_*() accessor method instead. + template <class PropertyType> + void get_property(const Glib::ustring& property_name, PropertyType& value) const; + + virtual void reference() const; // overrides SigC::ObjectBase::reference() virtual void unreference() const; // overrides SigC::ObjectBase::unreference() @@ -118,6 +136,32 @@ private: #endif }; +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +template <class PropertyType> +void ObjectBase::set_property(const Glib::ustring& property_name, const PropertyType& value) +{ + Glib::Value<PropertyType> property_value; + property_value.init(Glib::Value<PropertyType>::value_type()); + + property_value.set(value); + this->set_property_value(property_name, property_value); +} + +template <class PropertyType> +void ObjectBase::get_property(const Glib::ustring& property_name, PropertyType& value) const +{ + Glib::Value<PropertyType> property_value; + property_value.init(Glib::Value<PropertyType>::value_type()); + + this->get_property_value(property_name, property_value); + + value = property_value.get(); +} + +#endif /* DOXYGEN_SHOULD_SKIP_THIS */ + + bool _gobject_cppinstance_already_deleted(GObject* gobject); } // namespace Glib |