diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 00:00:00 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 00:00:00 +0000 |
commit | db8b575c30845bafc34b87bacd52129c95d1c478 (patch) | |
tree | 7a521b7795cc6cc4e41d717a0feabd1aefb83e1f /libs/pbd/pbd/stateful.h | |
parent | 3540594dc53137eb9e857f9e3c1309382a6d7bef (diff) |
the mega-properties/SequenceProperty patch. split is broken at present (right hand starts has start-in-source of zero)
git-svn-id: svn://localhost/ardour2/branches/3.0@6718 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd/stateful.h')
-rw-r--r-- | libs/pbd/pbd/stateful.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h index bc32d7fd9b..78b9eb7b3b 100644 --- a/libs/pbd/pbd/stateful.h +++ b/libs/pbd/pbd/stateful.h @@ -26,7 +26,7 @@ #include "pbd/id.h" #include "pbd/xml++.h" -#include "pbd/properties.h" +#include "pbd/property_basics.h" #include "pbd/signals.h" class XMLNode; @@ -37,6 +37,9 @@ namespace sys { class path; } +class PropertyList; +class OwnedPropertyList; + /** Base class for objects with saveable and undoable state */ class Stateful { public: @@ -51,10 +54,9 @@ class Stateful { virtual bool set_property (const PropertyBase&) { return false; } PropertyChange set_properties (const PropertyList&); + const OwnedPropertyList& properties() const { return *_properties; } - void add_property (PropertyBase& s) { - _properties.add (s); - } + void add_property (PropertyBase& s); /* Extra XML node: so that 3rd parties can attach state to the XMLNode representing the state of this object. @@ -65,9 +67,13 @@ class Stateful { const PBD::ID& id() const { return _id; } + /* history management */ + void clear_history (); - std::pair<XMLNode *, XMLNode*> diff () const; - void changed (PropertyChange&) const; + void diff (PropertyList&, PropertyList&) const; + /* create a property list from an XMLNode + */ + virtual PropertyList* property_factory(const XMLNode&) const { return 0; } /* How stateful's notify of changes to their properties */ @@ -85,7 +91,6 @@ class Stateful { to get basic property setting done. */ PropertyChange set_properties (XMLNode const &); - /* derived classes can implement this to do cross-checking of property values after either a PropertyList or XML @@ -98,7 +103,7 @@ class Stateful { PBD::ID _id; std::string _xml_node_name; ///< name of node to use for this object in XML - OwnedPropertyList _properties; + OwnedPropertyList* _properties; }; } // namespace PBD |