projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make link_name(), link_local_name, and get_link_index_from_name non pure virtual...
[synfig.git]
/
synfig-core
/
src
/
synfig
/
valuenode.h
diff --git
a/synfig-core/src/synfig/valuenode.h
b/synfig-core/src/synfig/valuenode.h
index
c681b5d
..
8a1552e
100644
(file)
--- a/
synfig-core/src/synfig/valuenode.h
+++ b/
synfig-core/src/synfig/valuenode.h
@@
-39,6
+39,7
@@
#include <sigc++/signal.h>
#include "guid.h"
#include <ETL/angle>
#include <sigc++/signal.h>
#include "guid.h"
#include <ETL/angle>
+#include "paramdesc.h"
#include "node.h"
#include "node.h"
@@
-77,6
+78,7
@@
namespace synfig {
class Canvas;
class LinkableValueNode;
class Layer;
class Canvas;
class LinkableValueNode;
class Layer;
+class ParamVocab;
/*! \class ValueNode
** \brief Base class for all Value Nodes
/*! \class ValueNode
** \brief Base class for all Value Nodes
@@
-110,9
+112,15
@@
public:
*/
private:
*/
private:
+ //! The type of the Value Node
+ //! \see ValueBase
ValueBase::Type type;
ValueBase::Type type;
+ //! The name of the Value Node. This is the string that is used in the
+ //! sif file to define the value type: i.e. <param name="amount">
String name;
String name;
+ //! The canvas this Value Node belongs to
etl::loose_handle<Canvas> canvas_;
etl::loose_handle<Canvas> canvas_;
+ //! The root canvas this Value Node belongs to
etl::loose_handle<Canvas> root_canvas_;
/*
etl::loose_handle<Canvas> root_canvas_;
/*
@@
-242,7
+250,12
@@
protected:
}; // END of class ValueNode
/*! \class PlaceholderValueNode
}; // END of class ValueNode
/*! \class PlaceholderValueNode
-** \todo writeme
+** Seems to be a Place to hold a Value Node temporarly.
+*
+* Doesn't seem to implement any functionality. Seems to be used when the
+* value node cannot be created using the Const, Animated or Linkable
+* Value Nodes.
+*
*/
class PlaceholderValueNode : public ValueNode
{
*/
class PlaceholderValueNode : public ValueNode
{
@@
-324,10
+337,20
@@
public:
*/
typedef std::map<String,BookEntry> Book;
*/
typedef std::map<String,BookEntry> Book;
+ //! The vocabulary of the children
+ /*! \see synfig::Paramdesc
+ */
+ typedef ParamVocab Vocab;
+
static Book& book();
static Book& book();
+ //! Creates a Linkable Value Node based on the name and the returned
+ //! value type. Returns a valid Handle if both (name and type) match
static Handle create(const String &name, const ValueBase& x);
static Handle create(const String &name, const ValueBase& x);
+ //! Each derived Linkable Value Node has to implement this fucntion and
+ //! should return true only if the type matches. \name is the name of
+ //! the linked value node and \x is the returned value type
static bool check_type(const String &name, ValueBase::Type x);
public:
static bool check_type(const String &name, ValueBase::Type x);
public:
@@
-335,8
+358,13
@@
public:
ValueNode(type) { }
protected:
ValueNode(type) { }
protected:
+ //! Stores the Value Node \x in the sub parameter i after check if the
+ //! type is the same.
+ //! It has to be defined by the derived class.
virtual bool set_link_vfunc(int i,ValueNode::Handle x)=0;
virtual bool set_link_vfunc(int i,ValueNode::Handle x)=0;
+ //! Frees all the subparameters of the Linkable Value Node.
+ //! Used by the derived classed destructors.
void unlink_all();
public:
void unlink_all();
public:
@@
-345,13
+373,13
@@
public:
virtual int link_count()const=0;
//! Returns the local name of the 'i' linked Value Node
virtual int link_count()const=0;
//! Returns the local name of the 'i' linked Value Node
- virtual String link_local_name(int i)const
=0
;
+ virtual String link_local_name(int i)const;
//! Returns the name of the 'i' linked Value Node
//! Returns the name of the 'i' linked Value Node
- virtual String link_name(int i)const
=0
;
+ virtual String link_name(int i)const;
//! Returns the child index Value Node based on the name
//! Returns the child index Value Node based on the name
- virtual int get_link_index_from_name(const String &name)const
=0
;
+ virtual int get_link_index_from_name(const String &name)const;
//! Clones a Value Node
virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
//! Clones a Value Node
virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
@@
-368,6
+396,9
@@
public:
//! Return a full description of the linked ValueNode given by the index
String get_description(int index = -1, bool show_exported_name = true)const;
//! Return a full description of the linked ValueNode given by the index
String get_description(int index = -1, bool show_exported_name = true)const;
+ //! Gets the parameter vocabulary for linkable value nodes
+ virtual Vocab get_param_vocab()const=0;
+
protected:
//! Sets the type of the ValueNode
void set_type(ValueBase::Type t) { ValueNode::set_type(t); }
protected:
//! Sets the type of the ValueNode
void set_type(ValueBase::Type t) { ValueNode::set_type(t); }