diff options
Diffstat (limited to 'libs/pbd/pbd/property_basics.h')
-rw-r--r-- | libs/pbd/pbd/property_basics.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/libs/pbd/pbd/property_basics.h b/libs/pbd/pbd/property_basics.h index 1baa14ac64..9661180e21 100644 --- a/libs/pbd/pbd/property_basics.h +++ b/libs/pbd/pbd/property_basics.h @@ -28,6 +28,8 @@ namespace PBD { class PropertyList; + +/** A unique identifier for a property of a Stateful object */ typedef GQuark PropertyID; template<typename T> @@ -39,6 +41,7 @@ struct PropertyDescriptor { typedef T value_type; }; +/** A list of IDs of Properties that have changed in some situation or other */ class PropertyChange : public std::set<PropertyID> { public: @@ -82,13 +85,29 @@ public: /** Forget about any old value for this state */ virtual void clear_history () = 0; - virtual void add_history_state (XMLNode*) const = 0; - virtual void diff (PropertyList&, PropertyList&) const = 0; + /** Make XML that allows us to get from some previous state to the current state + * of this property, and add it to @param history_node + */ + virtual void add_history_state (XMLNode* history_node) const = 0; + + /** Add information to two property lists: one that allows + * undo of the changes in this property's state betwen now and + * the last call to clear_history, and one that allows redo + * of those changes. + */ + virtual void diff (PropertyList& undo, PropertyList& redo) const = 0; virtual PropertyBase* maybe_clone_self_if_found_in_history_node (const XMLNode&) const { return 0; } + /** Set state from an XML node previously generated by add_history_state */ virtual bool set_state_from_owner_state (XMLNode const&) = 0; - virtual void add_state_to_owner_state (XMLNode&) const = 0; + + /** Add complete current state in XML form to an existing XML node @param node */ + virtual void add_state_to_owner_state (XMLNode& node) const = 0; + + /** @return true if this property has changed in value since construction or since + * the last call to clear_history(), whichever was more recent. + */ virtual bool changed() const = 0; /** Set the value of this property from another */ |