Module: synfig
Branch: eldruin_master
Commit: 5dcab4f32891574b830e5919a71e72b80a506641
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=5dcab4f32891574b830e5919a71e72b80a506641

Author: Diego Barrios Romero <eldr...@gmail.com>
Date:   Tue Dec 22 00:49:21 2009 +0100

Added documentation for Factory and Book typedefs.

---

 synfig-core/src/synfig/layer.h     |   11 ++++++++++-
 synfig-core/src/synfig/target.cpp  |    1 +
 synfig-core/src/synfig/target.h    |    9 ++++++++-
 synfig-core/src/synfig/valuenode.h |   10 ++++++++++
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/synfig-core/src/synfig/layer.h b/synfig-core/src/synfig/layer.h
index f729c40..1e321b0 100644
--- a/synfig-core/src/synfig/layer.h
+++ b/synfig-core/src/synfig/layer.h
@@ -162,7 +162,9 @@ class Layer : public Node
 
 public:
 
-       //! Type that represents a pointer to a layer's constructor
+       //! Type that represents a pointer to a Layer's constructor.
+       /*! As a pointer to the constructor, it represents a "factory" of 
layers.
+       */
        typedef Layer* (*Factory)();
 
        struct BookEntry
@@ -188,6 +190,13 @@ public:
                        version(version) { }
        };
 
+       //! Book of types of layers indexed by layer type name.
+       /*! While the sifz file is read, each time a new layer entry is found,
+       **  the factory constructor that the "factory" pointer member of the 
+       **  "BookEntry" struct points to, is called, and a new layer of that 
type
+       **  is created.
+       **  \sa Layer::Factory
+       */
        typedef std::map<String,BookEntry> Book;
 
        static void register_in_book(const BookEntry &);
diff --git a/synfig-core/src/synfig/target.cpp 
b/synfig-core/src/synfig/target.cpp
index 6a73822..92153b4 100644
--- a/synfig-core/src/synfig/target.cpp
+++ b/synfig-core/src/synfig/target.cpp
@@ -54,6 +54,7 @@ Target::subsys_init()
        default_gamma_=new synfig::Gamma(1.0/2.2);
        //default_gamma_->set_black_level(0.05); // Default to 5% black level.
 
+       // At least one target must be available.
        
book()["null"]=std::pair<synfig::Target::Factory,String>(Target_Null::create,"null");
        ext_book()["null"]="null";
        
book()["null-tile"]=std::pair<synfig::Target::Factory,String>(Target_Null_Tile::create,"null-tile");
diff --git a/synfig-core/src/synfig/target.h b/synfig-core/src/synfig/target.h
index 9f6e304..2f3c038 100644
--- a/synfig-core/src/synfig/target.h
+++ b/synfig-core/src/synfig/target.h
@@ -102,9 +102,16 @@ public:
        */
 
 public:
+       //! Type that represents a pointer to a Target's constructor.
+       /*! As a pointer to the constructor, it represents a "factory" of 
targets.
+       **  Receives the output filename (including path).
+       */
        typedef Target* (*Factory)(const char *filename);
 
-       //! A type for a map of targets, indexed by the name of the Target
+       //! Book of types of targets indexed by the name of the Target.
+       /*! Each entry contains the Target constructor pointer and the output 
+       **  filename string (including path).
+       */
        typedef std::map<String,std::pair<Factory,String> > Book;
 
        typedef std::map<String,String> ExtBook;
diff --git a/synfig-core/src/synfig/valuenode.h 
b/synfig-core/src/synfig/valuenode.h
index 38e5c56..9b838b7 100644
--- a/synfig-core/src/synfig/valuenode.h
+++ b/synfig-core/src/synfig/valuenode.h
@@ -305,6 +305,9 @@ public:
 
 
        //! Type that represents a pointer to a ValueNode's constructor
+       /*! As a pointer to the constructor, it represents a "factory" of 
+       **  objects of this class.
+       */
        typedef LinkableValueNode* (*Factory)(const ValueBase&);
 
        typedef bool (*CheckType)(ValueBase::Type);
@@ -317,6 +320,13 @@ public:
                ReleaseVersion release_version; // which version of synfig 
introduced this valuenode type
        };
 
+       //! Book of types of linkable value nodes indexed by type name.
+       /*! While the sifz file is read, each time a new LinkableValueNode 
entry 
+       **  is found, the factory constructor that the "factory" pointer member 
+       **  of the "BookEntry" struct points to, is called, and a new object of 
+       **  that type is created.
+       **  \sa LinkableValueNode::Factory
+       */
        typedef std::map<String,BookEntry> Book;
 
        static Book& book();


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to