Merge branch 'master' into genete_core_review
authorCarlos Lopez <genetita@gmail.com>
Wed, 30 Jun 2010 16:46:13 +0000 (18:46 +0200)
committerCarlos Lopez <genetita@gmail.com>
Wed, 30 Jun 2010 16:46:13 +0000 (18:46 +0200)
40 files changed:
synfig-core/src/modules/lyr_std/stretch.cpp
synfig-core/src/modules/mod_bmp/main.cpp
synfig-core/src/modules/mod_bmp/mptr_bmp.cpp
synfig-core/src/modules/mod_bmp/trgt_bmp.cpp
synfig-core/src/modules/mod_dv/trgt_dv.cpp
synfig-core/src/modules/mod_ffmpeg/trgt_ffmpeg.cpp
synfig-core/src/modules/mod_gif/trgt_gif.cpp
synfig-core/src/modules/mod_imagemagick/trgt_imagemagick.cpp
synfig-core/src/modules/mod_jpeg/trgt_jpeg.cpp
synfig-core/src/modules/mod_libavcodec/main.cpp
synfig-core/src/modules/mod_libavcodec/mptr.cpp
synfig-core/src/modules/mod_libavcodec/trgt_av.cpp
synfig-core/src/modules/mod_magickpp/trgt_magickpp.cpp
synfig-core/src/modules/mod_mng/trgt_mng.cpp
synfig-core/src/modules/mod_openexr/trgt_openexr.cpp
synfig-core/src/modules/mod_png/trgt_png.cpp
synfig-core/src/modules/mod_ppm/trgt_mpg.cpp
synfig-core/src/modules/mod_ppm/trgt_ppm.cpp
synfig-core/src/modules/mod_svg/main.cpp
synfig-core/src/modules/mod_yuv420p/trgt_yuv.cpp
synfig-core/src/synfig/Makefile.am
synfig-core/src/synfig/canvas.cpp
synfig-core/src/synfig/color.h
synfig-core/src/synfig/importer.cpp
synfig-core/src/synfig/importer.h
synfig-core/src/synfig/layer.cpp
synfig-core/src/synfig/layer.h
synfig-core/src/synfig/layer_bitmap.cpp
synfig-core/src/synfig/main.cpp
synfig-core/src/synfig/module.cpp
synfig-core/src/synfig/module.h
synfig-core/src/synfig/node.cpp
synfig-core/src/synfig/node.h
synfig-core/src/synfig/render.cpp
synfig-core/src/synfig/surface.cpp
synfig-core/src/synfig/target.cpp
synfig-core/src/synfig/types.h
synfig-core/src/synfig/value.h
synfig-core/src/synfig/valuenode.cpp
synfig-core/src/synfig/valuenode.h

index de0de94..0f1c37d 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 88fbbbd..dbf86b1 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 9151cfe..d8c07b7 100644 (file)
@@ -24,8 +24,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index fe2d433..5a126ff 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 6174af0..896ae6c 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index d1b9219..528166d 100644 (file)
@@ -26,8 +26,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index a520ff3..5c8b49a 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index dc024ae..c23ef14 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index b0def32..890b533 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 70fa9c5..30aa3c5 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 667968b..4c9bfb8 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index f329081..5f481f6 100644 (file)
@@ -24,8 +24,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 875f2b5..0570685 100644 (file)
@@ -24,8 +24,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 3540490..23d6e81 100644 (file)
@@ -27,8 +27,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 2ad34f5..fd29524 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index a0a58b1..c4d4df4 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index c90ebfd..ecdecba 100644 (file)
@@ -24,8 +24,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 0859d84..0012c54 100644 (file)
@@ -25,8 +25,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 1f5be67..1906b70 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index a6d3455..df1e8e2 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_TARGET
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index ac0ddca..055b720 100644 (file)
@@ -11,7 +11,8 @@ INCLUDES = \
 EXTRA_DIST = \
        surfacenew.cpp \
        pch.h \
-       synfig.nsh
+       synfig.nsh \
+       synfig.h
 
 
 LAYERHEADERS = \
@@ -194,7 +195,6 @@ SYNFIGHEADERS = \
        string.h \
        string_decl.h \
        surfacenew.h \
-       synfig.h \
        types.h \
        vector.h \
        version.h \
index 2bbb743..eeecdb0 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index d54b0e9..ee5f501 100644 (file)
 /* === H E A D E R S ======================================================= */
 
 
-//#include <cmath>
 #include <math.h>
 #include <cassert>
 #include "gamma.h"
 #include <synfig/string.h>
+# include "angle.h"
 
 #ifdef USE_HALF_TYPE
 #include <OpenEXR/half.h>
 #endif
 
-#ifndef SYNFIG_NO_ANGLE
-# include "angle.h"
-#endif
-
 /* === M A C R O S ========================================================= */
 
 #define use_colorspace_gamma() App::use_colorspace_gamma
@@ -386,7 +382,6 @@ public:
        static Color YUV(const float& y, const float& u, const float& v, const value_type& a=1)
                { return Color().set_yuv(y,u,v).set_a(a); }
 
-#ifndef SYNFIG_NO_ANGLE
        //! Returns the hue of the chromanance
        /*!     This is the angle of the U and V components.
        **      \see set_hue() */
@@ -443,7 +438,6 @@ public:
        static Color YUV(const float& y, const float& s, const Angle& theta, const value_type& a=1)
                { return Color().set_yuv(y,s,theta).set_a(a); }
 
-#endif
 
        //! Clamps a color so that its values are in range. Ignores attempting to visualize negative colors.
        Color clamped()const;
index e271110..1784d3a 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file importer.cpp
-**     \brief writeme
+**     \brief It is the base class for all the importers.
 **
 **     $Id$
 **
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 4391c4e..ce89da5 100644 (file)
@@ -1,7 +1,6 @@
-#include <cstdio>
 /* === S Y N F I G ========================================================= */
 /*!    \file importer.h
-**     \brief writeme
+**     \brief It is the base class for all the importers.
 **
 **     $Id$
 **
 
 /* === H E A D E R S ======================================================= */
 
+#include <cstdio>
 #include <map>
-//#include <cmath>
 #include <ETL/handle>
 #include "string.h"
-//#include "surface.h"
-//#include "general.h"
-//#include "vector.h"
 #include "time.h"
 #include "gamma.h"
 
 /* === M A C R O S ========================================================= */
 
-//! \writeme
+//! Defines various variables and the create method, common for all importers.
+//! To be used in the private part of the importer class definition.
 #define SYNFIG_IMPORTER_MODULE_EXT public: static const char name__[], version__[], ext__[],cvs_id__[]; static Importer *create(const char *filename);
 
-//! Sets the name of the importer
+//! Sets the name of the importer.
 #define SYNFIG_IMPORTER_SET_NAME(class,x) const char class::name__[]=x
 
-//! \writeme
+//! Sets the primary file extension of the importer.
 #define SYNFIG_IMPORTER_SET_EXT(class,x) const char class::ext__[]=x
 
-//! Sets the version of the importer
+//! Sets the version of the importer.
 #define SYNFIG_IMPORTER_SET_VERSION(class,x) const char class::version__[]=x
 
-//! Sets the CVS ID of the importer
+//! Sets the CVS ID of the importer.
 #define SYNFIG_IMPORTER_SET_CVS_ID(class,x) const char class::cvs_id__[]=x
 
-//! \writeme
+//! Defines de implementation of the create method for the importer
+//! \param filename The file name to be imported by the importer.
 #define SYNFIG_IMPORTER_INIT(class) synfig::Importer* class::create(const char *filename) { return new class(filename); }
 
 /* === T Y P E D E F S ===================================================== */
@@ -68,19 +66,33 @@ class Surface;
 class ProgressCallback;
 
 /*!    \class Importer
-**     \brief Used for importing bitmaps of various formats, including animations
-**     \todo Write more detailed description
+**     \brief Used for importing bitmaps of various formats, including animations.
+*
+*      It is the base class for all the importers. It defines the has a static Book
+*      pointer class that is a map for the importers factory creators and the strings
+*      of the extension that the importer can understand. It allows to create the a
+*      pointer to a particular importer just by using the extension of the name of file
+*      to import. Also it creates a virtual member get_frame that must be declared in
+*      the inherited classes.
+*      \see module.h
+**     \
 */
 class Importer : public etl::shared_object
 {
 public:
+       //! Type that represents a pointer to a Importer's constructor.
+       //! As a pointer to the constructor, it represents a "factory" of importers.
        typedef Importer* (*Factory)(const char *filename);
        typedef std::map<String,Factory> Book;
        static Book* book_;
 
        static Book& book();
 
+       //! Initializes the Import module by creating a book of importers names
+       //! and its creators and the list of open importers
        static bool subsys_init();
+       //! Stops the Import module by deleting the book and the list of open
+       //! importers
        static bool subsys_stop();
 
        typedef etl::handle<Importer> Handle;
@@ -88,6 +100,8 @@ public:
        typedef etl::handle<const Importer> ConstHandle;
 
 private:
+       //! Gamma of the importer.
+       //! \todo Do not hardcode the gamma to 2.2
        Gamma gamma_;
 
 protected:
@@ -111,9 +125,12 @@ public:
        virtual bool get_frame(Surface &surface,Time time, ProgressCallback *callback=NULL)=0;
        virtual bool get_frame(Surface &surface,Time time,
                                                   bool &trimmed __attribute__ ((unused)),
-                                                  unsigned int &width __attribute__ ((unused)), unsigned int &height __attribute__ ((unused)),
-                                                  unsigned int &top __attribute__ ((unused)), unsigned int &left __attribute__ ((unused)),
-                                                  ProgressCallback *callback=NULL) {
+                                                  unsigned int &width __attribute__ ((unused)),
+                                                  unsigned int &height __attribute__ ((unused)),
+                                                  unsigned int &top __attribute__ ((unused)),
+                                                  unsigned int &left __attribute__ ((unused)),
+                                                  ProgressCallback *callback=NULL)
+       {
                return get_frame(surface,time,callback);
        }
 
index 8fcbfbf..9d1adf3 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 1e321b0..80e50f1 100644 (file)
@@ -41,7 +41,8 @@
 
 /* === M A C R O S ========================================================= */
 
-//! \writeme
+//! Defines various variables and the create method, common for all importers.
+//! To be used in the private part of the importer class definition.
 #define SYNFIG_LAYER_MODULE_EXT                                                                                                                        \
        public:                                                                                                                                                         \
        static const char name__[], version__[], cvs_id__[], local_name__[], category__[];      \
 #define SYNFIG_LAYER_SET_CVS_ID(class,x)                                                                                               \
        const char class::cvs_id__[]=x
 
-//! \writeme
+//! Defines de implementation of the create method for the importer
 #define SYNFIG_LAYER_INIT(class)                                                                                                               \
        synfig::Layer* class::create()                                                                                                          \
        {                                                                                                                                                                       \
                return new class();                                                                                                                             \
        }
 
-//! \writeme
+//! Imports a parameter 'x' and perform an action based usually based on
+//! some condition 'y'
 #define IMPORT_PLUS(x,y)                                                                                                                               \
        if (param==#x && value.same_type_as(x))                                                                                         \
        {                                                                                                                                                                       \
@@ -85,7 +87,7 @@
                return true;                                                                                                                                    \
        }
 
-//! \writeme
+//! Imports a parameter 'y' if it has the same type than 'x'
 #define IMPORT_AS(x,y)                                                                                                                                 \
        if (param==y && value.same_type_as(x))                                                                                          \
        {                                                                                                                                                                       \
                return true;                                                                                                                                    \
        }
 
-//! \writeme
+//! Imports a parameter if it is of the same type as param
 #define IMPORT(x)                                                                                                                                              \
        IMPORT_AS(x,#x)
 
-//! \writeme
+//! Exports a parameter 'x' if param is same type as given 'y'
 #define EXPORT_AS(x,y)                                                                                                                                 \
        if (param==y)                                                                                                                                           \
                return ValueBase(x);
 
-//! \writeme
+//! Exports a parameter if it is the same type as value
 #define EXPORT(x)                                                                                                                                              \
        EXPORT_AS(x,#x)
 
-//! \writeme
+//! Exports the name or the local name of the layer
 #define EXPORT_NAME()                                                                                                                                  \
        if (param=="Name" || param=="name" || param=="name__")                                                          \
                return name__;                                                                                                                                  \
        else if (param=="local_name__")                                                                                                         \
                return dgettext("synfig",local_name__);
 
-//! \writeme
+//! Exports the version of the layer
 #define EXPORT_VERSION()                                                                                                                               \
        if (param=="Version" || param=="version" || param=="version__")                                         \
                return version__;
@@ -192,7 +194,7 @@ public:
 
        //! 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 
+       **  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
@@ -203,10 +205,16 @@ public:
 
        static Book& book();
 
+       //! Inits the book of layers and inserts in it the basic layers that
+       //! doesn't depend on modules
+       /*! \todo motionblur should be in the mod_filter module
+       */
        static bool subsys_init();
 
+       //! Stops the layer system by deleting the book of registered layers
        static bool subsys_stop();
 
+       //! Map of Value Base parameters indexed by name
        typedef std::map<String,ValueBase> ParamList;
 
        typedef etl::handle<Layer> Handle;
@@ -215,6 +223,7 @@ public:
 
        typedef etl::handle<const Layer> ConstHandle;
 
+       //! Map of parameters that are animated Value Nodes indexed by the param name
        typedef std::map<String,etl::rhandle<ValueNode> > DynamicParamList;
 
        //! A list type which describes all the parameters that a layer has.
@@ -235,12 +244,13 @@ private:
        //! Handle to the canvas to which this layer belongs
        etl::loose_handle<Canvas> canvas_;
 
+       //! Map of parameter with animated value nodes
        DynamicParamList dynamic_param_list_;
 
        //! A description of what this layer does
        String description_;
 
-       //! \writeme
+       //! The depth parameter of the layer in the layer stack
        float z_depth_;
 
        //! \writeme
@@ -249,7 +259,10 @@ private:
        //! Contains the name of the group that this layer belongs to
        String group_;
 
-       //! \writeme
+       //! Signal to connect to the signal_deleted canvas's member
+       //! Used to do let a layer with a canvas parent that doesn't exists
+       //! Instead of that it connects to a zero canvas
+       //! \see Layer::set_canvas()
        sigc::connection parent_death_connect_;
 
        /*
@@ -327,13 +340,14 @@ public:
        //! Gets the name of the group that this layer belongs to
        String get_group()const;
 
-       //! writeme
-       //DynamicParamList &dynamic_param_list() { return dynamic_param_list_; }
-
-       //! \todo writeme
+       //! Retrieves the dynamic param list member
+       //! \see DynamicParamList
        const DynamicParamList &dynamic_param_list()const { return dynamic_param_list_; }
 
+       //! Connects the parameter to another Value Node
        bool connect_dynamic_param(const String& param, etl::loose_handle<ValueNode>);
+
+       //! Disconnects the parameter from any Value Node
        bool disconnect_dynamic_param(const String& param);
 
        //! Enables the layer for rendering (Making it \em active)
@@ -356,13 +370,13 @@ public:
        /*! Returns negative on error */
        int get_depth()const;
 
-       //! \writeme
+       //! Gets the non animated z depth of the layer
        float get_z_depth()const { return z_depth_; }
 
-       //! \writeme
+       //! Gets the z depth of the layer at a time t
        float get_z_depth(const synfig::Time& t)const;
 
-       //! \writeme
+       //! Sets the z depth of the layer (non animated)
        void set_z_depth(float x) { z_depth_=x; }
 
        //! Sets the Canvas that this Layer is a part of
@@ -371,10 +385,10 @@ public:
        //! Returns a handle to the Canvas to which this Layer belongs
        etl::loose_handle<Canvas> get_canvas()const;
 
-       //! \writeme
+       //! Returns the description of the layer
        const String& get_description()const { return description_; }
 
-       //! \writeme
+       //! Sets the description of the layer
        void set_description(const String& x);
 
        //! Returns the layer's description if it's not empty, else its local name
@@ -388,8 +402,12 @@ public:
        */
 
 public:
+       //! Returns the rectangle that includes the layer
+       //! \see synfig::Rect
        virtual Rect get_bounding_rect()const;
 
+       //!Returns the rectangle that includes the context of the layer
+       //!\see synfig::Rect synfig::Context
        virtual Rect get_full_bounding_rect(Context context)const;
 
        //! Returns a string containing the name of the Layer
@@ -404,7 +422,8 @@ public:
        //! Gets the version string for this layer
        virtual String get_version()const;
 
-       //! \writeme
+       //! Returns a handle to the Transform class of the layer
+       //! \see synfig::Transform
        virtual etl::handle<Transform> get_transform()const;
 
        //! Sets the virtual version to use for backwards-compatibility
@@ -443,7 +462,7 @@ public:
        //! Sets the \a time for the selected Layer and those under it
        /*!     \param context          Context iterator referring to next Layer.
        **      \param time                     writeme
-       **      \see Handle::set_time()
+       **      \see Context::set_time()
        */
        virtual void set_time(Context context, Time time)const;
 
@@ -451,14 +470,14 @@ public:
        /*!     \param context          Context iterator referring to next Layer.
        **      \param time                     writeme
        **      \param point            writeme
-       **      \see Handle::set_time()
+       **      \see Context::set_time()
        **      \todo \a point should be of the type <tt>const Point \&</tt> */
        virtual void set_time(Context context, Time time, const Point &point)const;
 
        //! Gets the color of the Canvas at \a pos
        /*!     \param context          Context iterator referring to next Layer.
        **      \param pos              Point which indicates where the Color should come from
-       **      \see Handle::get_color()
+       **      \see Context::get_color()
        */
        virtual Color get_color(Context context, const Point &pos)const;
 
@@ -469,7 +488,7 @@ public:
        **      \param renddesc         The associated RendDesc.
        **      \param cb                       Pointer to callback object. May be NULL if there is no callback.
        **      \return \c true on success, \c false on failure
-       **      \see Handle::accelerated_render()
+       **      \see Context::accelerated_render()
        */
        virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
 
@@ -477,7 +496,9 @@ public:
        /*!     \param context          Context iterator referring to next Layer.
        **      \param point            The point to check
        **      \return         The handle of the layer under \a point. If there is not
-       **                              a layer under \a point, then returns an empty handle. */
+       **                              a layer under \a point, then returns an empty handle.
+       **      \see Context::hit_check
+       */
        virtual Handle hit_check(Context context, const Point &point)const;
 
        //! Duplicates the Layer
index cda5d09..8443429 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 9e0a56a..31c9afe 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-//#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 5d64003..13523b0 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 29455e3..19f0c3c 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file synfig/module.h
-**     \brief writeme
+**     \brief Base class for all libraries modules
 **
 **     $Id$
 **
 #define BEGIN_LAYERS {
 
 //! DEPRECATED - use #INCLUDE_LAYER(class)
+// Really? ^^ The INCLUDE_LAYER(class) macro is defined in a cpp file and
+// is undefined a few lines later. In fact the INCLUDE_LAYER is only
+// used in the layer.cpp file and the functionality is the same. Even
+// more, I think that we should use register_in_book call because maybe
+// the Layer class would like to do something else when register the class.
+//! Register a Layer class in the book of layers
 #define LAYER(class)                                                                                                                                                   \
        synfig::Layer::register_in_book(                                                                                                                        \
                synfig::Layer::BookEntry(class::create,                                                                                                 \
                                                                 class::cvs_id__,                                                                                               \
                                                                 class::version__));
 
+//! Register a Layer class in the book of layers with an alias
 #define LAYER_ALIAS(class,alias)                                                                                                                               \
        synfig::Layer::register_in_book(                                                                                                                        \
                synfig::Layer::BookEntry(class::create,                                                                                                 \
 //! Marks the start of the importers in the module's inventory
 #define BEGIN_IMPORTERS {
 
+//! Register an Importer class in the book of importers by the default extension
 #define IMPORTER(x) synfig::Importer::book()[synfig::String(x::ext__)]=x::create;
 
+//!Register an Importer class in the book of importers by one file extension string
 #define IMPORTER_EXT(x,y) synfig::Importer::book()[synfig::String(y)]=x::create;
 
 //! Marks the end of the importers in the module's inventory
 //! Marks the start of the valuenodes in the module's inventory
 #define BEGIN_VALUENODES { synfig::LinkableValueNode::Book &book(synfig::LinkableValueNode::book());
 
+//! Registers a valuenode that is defined in the module's inventory
 #define VALUENODE(class,name,local,version)                                                                                                            \
        book[name].factory=reinterpret_cast<synfig::LinkableValueNode::Factory>(&class::create);        \
        book[name].check_type=&class::check_type;                                                                                                       \
@@ -176,21 +186,30 @@ public:
        typedef etl::handle<const Module> ConstHandle;
 
 public:
-       typedef Module*(*constructor_type)(ProgressCallback *);
+       //! Type that represents a pointer to a Module's constructor by name.
+       //! As a pointer to the member, it represents a constructor of the module.
+       typedef Module* (*constructor_type)(ProgressCallback *);
        typedef std::map<String, Handle > Book;
 private:
        static Book* book_;
 public:
        static Book& book();
 
+       //! Inits the book of importers and add the paths to search for the
+       //! ltdl library utilities.
        static bool subsys_init(const String &prefix);
        static bool subsys_stop();
+       //! Register not optional modules
        static void register_default_modules(ProgressCallback *cb=NULL);
 
+       //! Register Module by handle
        static void Register(Handle mod);
+       //! Register Module by name
        static bool Register(const String &module_name, ProgressCallback *cb=NULL);
+       //!Register Module by instance pointer
        static inline void Register(Module *mod) { Register(Handle(mod)); }
 
+       //! Virtual Modules properties wrappers. Must be defined in the modules classes
        virtual const char * Name() { return " "; }
        virtual const char * Desc() { return " "; }
        virtual const char * Author() { return " "; }
index 6524109..182483c 100644 (file)
@@ -62,21 +62,21 @@ using namespace synfig;
 #define BE_FRUGAL_WITH_GUIDS 1
 
 #ifndef __sys_clock
-#ifndef _WIN32
-# include <time.h>
-# define __sys_clock   ::clock
-#else
-# ifdef __GNUG__
-#  include <time.h>
-#  define __sys_clock  ::clock
-# else
-typedef int clock_t;
-extern clock_t _clock();
-#  define CLOCKS_PER_SEC 1000
-#  define __sys_clock  _clock
-# endif
-#endif
-#endif
+       #ifndef _WIN32
+               # include <time.h>
+               # define __sys_clock    ::clock
+       #else
+               # ifdef __GNUG__
+                       #  include <time.h>
+                       #  define __sys_clock   ::clock
+               # else
+                       typedef int clock_t;
+                       extern clock_t _clock();
+                       #  define CLOCKS_PER_SEC 1000
+                       #  define __sys_clock   _clock
+               # endif // __GNUG__
+       #endif // _WIN_32
+#endif // __sys_clock
 
 /* === G L O B A L S ======================================================= */
 
@@ -86,6 +86,7 @@ typedef HASH_MAP_CLASS<synfig::GUID,Node*,GUIDHash> GlobalNodeMap;
 typedef map<synfig::GUID,Node*> GlobalNodeMap;
 #endif
 
+//! A map to store all the GUIDs with a pointer to the Node.
 static GlobalNodeMap* global_node_map_;
 
 static GlobalNodeMap& global_node_map()
@@ -127,15 +128,20 @@ TimePoint::c_str()const
 void
 TimePoint::absorb(const TimePoint& x)
 {
+       //! If the Time Point to absorb is itself then bail out
        if(get_guid()==x.get_guid())
                return;
+       //! Creates a new GUID with the old and the new one using XOR operator
        set_guid(get_guid()^x.get_guid());
-
+       //! If the current before/after interpolation is NIL use the interpolation
+       //! provided by the TimePoint to absorb
        if(get_after()==INTERPOLATION_NIL)
                set_after(x.get_after());
        if(get_before()==INTERPOLATION_NIL)
                set_before(x.get_before());
-
+       //! If the interpolation of the Time Point to absorb is not the same
+       //! than the interpolation from the Time Point to absorb then
+       //! use UNDEFINED interpolation
        if(get_after()!=x.get_after() && x.get_after()!=INTERPOLATION_NIL)
                set_after(INTERPOLATION_UNDEFINED);
        if(get_before()!=x.get_before() && x.get_before()!=INTERPOLATION_NIL)
@@ -145,29 +151,21 @@ TimePoint::absorb(const TimePoint& x)
 TimePointSet::iterator
 TimePointSet::insert(const TimePoint& x)
 {
+       //! finds a iterator to a Time Point with the same time
+       //! \see inline bool operator==(const TimePoint& lhs,const TimePoint& rhs)
        iterator iter(find(x));
+       //! If iter is not a the end of the set (we found one Time Point)
        if(iter!=end())
        {
+               //! Absorb the time point
                const_cast<TimePoint&>(*iter).absorb(x);
                return iter;
        }
+       //! Else, insert it at the first of the set
        return std::set<TimePoint>::insert(x).first;
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 Node::Node():
        guid_(0),
        bchanged(true),
index ca5af34..fd91cf2 100644 (file)
@@ -1,6 +1,9 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file node.h
-**     \brief Template Header
+**     \brief Base class for Layers and Value Nodes.
+**     It defines the base members for the parent - child relationship,
+**     the times where the node is modified and the handling of
+**     the GUID on deletion and changing.
 **
 **     $Id$
 **
 
 namespace synfig {
 
+//!\brief TimePoint class: holds the time and the before and after interpolation mode
+/**
+ * It includes a GUID, to make it unique
+ * \see guid.h interpolation.h
+**/
 class TimePoint
 {
        GUID guid;
@@ -78,6 +86,9 @@ public:
        void set_before(Interpolation x) { before=x; }
        void set_after(Interpolation x) { after=x; }
 
+       //! Modify the TimePoint based on the values of \x "merging"
+       //! the interpolations. Used to insert a Time Point in a Time Points Set
+       //! \see TimePointSet::iterator TimePointSet::insert(const TimePoint& x)
        void absorb(const TimePoint& x);
 }; // END of class TimePoint
 
@@ -129,7 +140,7 @@ public:
 
 private:
 
-       //! \writeme
+       //! \ The GUID of the node
        GUID guid_;
 
        //! cached time values for all the children
@@ -138,17 +149,20 @@ private:
        //! \writeme
        mutable bool            bchanged;
 
-       //! \writeme
+       //! The last time the node was modified since the program started
+       //! \see __sys_clock
        mutable int time_last_changed_;
 
        //! \writeme
+       //! \see mutex.h
        mutable RWLock rw_lock_;
 
-       //! \writeme
+       //! Variable used to remember that a signal_deleted has been thrown
        bool deleting_;
 
 public:
 
+       //! A set of pointers to parent nodes
        //! \todo This should really be private
        std::set<Node*>         parent_set;
 
@@ -158,13 +172,14 @@ public:
 
 private:
 
+       //! Node changed signal
        sigc::signal<void> signal_changed_;
 
-       //!     GUID Changed
+       //!     GUID changed signal
        /*! \note The second parameter is the *OLD* guid! */
        sigc::signal<void,GUID> signal_guid_changed_;
 
-       //!     Deleted
+       //!     Node deleted signal
        sigc::signal<void> signal_deleted_;
 
        /*
@@ -204,22 +219,28 @@ public:
 
        void changed();
 
-       //! Gets the GUID for this value node
+       //! Gets the GUID for this Node
        const GUID& get_guid()const;
 
-       //! Sets the GUID for this value node
+       //! Sets the GUID for this Node
        void set_guid(const GUID& x);
 
+       //! Gets the time when the Node was changed
        int get_time_last_changed()const;
 
+       //! Adds the parameter \x as the child of the current Node
        void add_child(Node*x);
 
+       //! Removes the parameter \x as a child of the current Node
        void remove_child(Node*x);
 
+       //!Returns how many parenst has the current Node
        int parent_count()const;
 
+       //! Returns the cached times values for all the children
        const time_set &get_times() const;
 
+       //! Writeme!
        RWLock& get_rw_lock()const { return rw_lock_; }
 
 protected:
@@ -231,17 +252,26 @@ protected:
        */
 
 protected:
+       //! Used when the node has changed. Makes changed the parent too.
+       //! To be overloaded by the derivative classes. Emits a signal where the
+       //! the GUI can be connected to.
        virtual void on_changed();
 
+       //! Used when the node's GUID has changed.
+       //! To be overloaded by the derivative classes. Emits a signal where the
+       //! the GUI can be connected to.
        virtual void on_guid_changed(GUID guid);
 
-       /*!     Function to be overloaded that fills
-       */
+       //!     Function to be overloaded that fills the Time Point Set with
+       //! all the children Time Points.
        virtual void get_times_vfunc(time_set &set) const = 0;
-};
+}; // End of Node class
 
+//! Finds a node by its GUID.
+//! \see global_node_map()
 synfig::Node* find_node(const synfig::GUID& guid);
 
+//! Returns a Handle to the Node by its GUID
 template<typename T> etl::handle<T>
 guid_cast(const synfig::GUID& guid)
 {
index af58a0e..fffdd6f 100644 (file)
@@ -22,8 +22,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index 91e1663..471b85a 100644 (file)
@@ -24,8 +24,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
index b6aa1c4..a74d374 100644 (file)
@@ -23,8 +23,6 @@
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
index 6c3b7ea..866e388 100644 (file)
 /* === H E A D E R S ======================================================= */
 
 #include <cmath>
-
-#ifndef SYNFIG_NO_ANGLE
 #include "angle.h"
-#endif
-
 #include "time.h"
 #include "vector.h"
 
index 7079dba..eff65bb 100644 (file)
 
 /* === H E A D E R S ======================================================= */
 
-//#include "vector.h"
-//#include "time.h"
+#include "angle.h"
 #include "segment.h"
-//#include "color.h"
 #include "string.h"
 #include <list>
 #include <vector>
 #include <ETL/trivial>
 #include <ETL/handle>
 #include "general.h"
-//#include "gradient.h"
 #include "blinepoint.h"
 #include "exception.h"
 
@@ -46,9 +43,6 @@
 #include <OpenEXR/half.h>
 #endif
 
-#ifndef SYNFIG_NO_ANGLE
-#include "angle.h"
-#endif
 
 #include <ETL/ref_count>
 
@@ -349,10 +343,8 @@ public:
        operator half()const { return get(Real()); }
 #endif
 
-#ifndef SYNFIG_NO_ANGLE
        operator const Angle&()const { return get(Angle()); }
        static Type get_type(const Angle&) { return TYPE_ANGLE; }
-#endif
 
        template <class T>
        operator std::list<T>()const
index cae9692..8f3cc9a 100644 (file)
 
 /* === H E A D E R S ======================================================= */
 
-#define SYNFIG_NO_ANGLE
-
-//#define HAS_HASH_MAP 1
-
 #ifdef USING_PCH
 #      include "pch.h"
 #else
@@ -202,35 +198,6 @@ bool
 ValueNode::subsys_stop()
 {
        delete book_;
-/*     if(global_value_node_map.size() || value_node_count)
-       {
-               if(value_node_count)
-                       synfig::error("%d ValueNodes haven't been destroyed yet!",value_node_count);
-
-               if(global_value_node_map.size()!=value_node_count)
-                       synfig::error("value node count mismatch! map.size()!=value_node_count (%d!=%d)",global_value_node_map.size(),value_node_count);
-
-               GlobalValueNodeMap::iterator iter;
-               for(iter=global_value_node_map.begin();iter!=global_value_node_map.end();++iter)
-               {
-                       if(!iter->second->is_exported())
-                               synfig::info(_("%s: count:%d name:%s type:%s"),
-                                       iter->first.get_string().c_str(),
-                                       iter->second->count(),
-                                       iter->second->get_name().c_str(),
-                                       ValueBase::type_local_name(iter->second->get_type()).c_str()
-                               );
-                       else
-                               synfig::info(_("%s: id:%s count:%d name:%s type:%s"),
-                                       iter->first.get_string().c_str(),
-                                       iter->second->get_id().c_str(),
-                                       iter->second->count(),
-                                       iter->second->get_name().c_str(),
-                                       ValueBase::type_local_name(iter->second->get_type()).c_str()
-                               );
-               }
-       }
-*/
        return true;
 }
 
index a7a8f30..c681b5d 100644 (file)
 #include <map>
 #include <sigc++/signal.h>
 #include "guid.h"
-
-#ifndef SYNFIG_NO_ANGLE
 #include <ETL/angle>
-#endif
 
 #include "node.h"
 
@@ -82,7 +79,7 @@ class LinkableValueNode;
 class Layer;
 
 /*!    \class ValueNode
-**     \todo writeme
+**     \brief Base class for all Value Nodes
 */
 class ValueNode : public synfig::Node
 {
@@ -103,9 +100,9 @@ public:
 
        typedef etl::rhandle<ValueNode> RHandle;
 
-
+       //!Instantiates the book of ValaueNodes and register all the valid valuenodes on it
        static bool subsys_init();
-
+       //!Deletes the book of ValueNodes
        static bool subsys_stop();
 
        /*
@@ -206,10 +203,10 @@ public:
        virtual String get_description(bool show_exported_name = true)const;
 
 
-       //! \writeme
+       //! Clones a Value Node
        virtual ValueNode* clone(const GUID& deriv_guid=GUID())const=0;
 
-       //! \writeme
+       //! Returns \true if the Value Node has an ID (has been exported)
        bool is_exported()const { return !get_id().empty(); }
 
        //! Returns the type of the ValueNode
@@ -221,15 +218,20 @@ public:
        //! Returns a handle to the parent canvas, if it has one.
        etl::loose_handle<Canvas> get_root_canvas()const { return root_canvas_; }
 
-       //! \writeme
+       //! Sets the parent canvas for the Value Node
        void set_parent_canvas(etl::loose_handle<Canvas> x);
 
-       //! \writeme
+       //! Sets the root canvas parent for the Value Node
        void set_root_canvas(etl::loose_handle<Canvas> x);
 
-       //! \writeme
+       //! Returns the relative ID of a Node when accessed form the \x Canvas
        String get_relative_id(etl::loose_handle<const Canvas> x)const;
 
+       //! Replaces the Value Node with a given one. It look up all its parents
+       //! remove it self from them and adds the given Value Node
+       //! Notice that it is called twice and the second time it uses
+       //! a replaceable handle to the Node
+       //! \see etl::rhandle
        int replace(etl::handle<ValueNode> x);
 
 protected:
@@ -272,7 +274,12 @@ protected:
 
 
 /*!    \class LinkableValueNode
-**     \todo writeme
+**     \brief Specialized Class of Value Nodes that has links to other
+** Value Nodes
+*
+*      This Value Node is calculated based on a math calculation or a time
+*      evaluation of the linked Value Nodes. It is commonly known as
+*      Converted Value Nodes. The derived clases defines the behavior.
 */
 class LinkableValueNode : public ValueNode
 {
@@ -289,11 +296,15 @@ public:
 
 
        //! Type that represents a pointer to a ValueNode's constructor
-       /*! As a pointer to the constructor, it represents a "factory" of 
+       /*! As a pointer to the constructor, it represents a "factory" of
        **  objects of this class.
        */
        typedef LinkableValueNode* (*Factory)(const ValueBase&);
 
+       //! This represents a pointer to a Type check member fucntion
+       /*! As a pointer to the member, it represents a fucntion that checks
+       **  the type of the provided ValueBase
+       */
        typedef bool (*CheckType)(ValueBase::Type);
 
        struct BookEntry
@@ -305,9 +316,9 @@ public:
        };
 
        //! 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 
+       /*! 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
        */
@@ -330,41 +341,52 @@ protected:
 
 public:
 
+       //! Returns the number of linked Value Nodes
        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;
 
+       //! Returns the name of the 'i' linked Value Node
        virtual String link_name(int i)const=0;
 
+       //! Returns the child index Value Node based on the name
        virtual int get_link_index_from_name(const String &name)const=0;
 
+       //! Clones a Value Node
        virtual ValueNode* clone(const GUID& deriv_guid=GUID())const;
 
+       //! Sets a new Value Node link by its index
        bool set_link(int i,ValueNode::Handle x);
+       //! Sets a new Value Node link by its name
        bool set_link(const String &name,ValueNode::Handle x) { return set_link(get_link_index_from_name(name),x);      }
 
+       //! Returns a Loose Handle to the Value Node based on the link's index
        ValueNode::LooseHandle get_link(int i)const;
+       //! Returns a Loose Handle to the Value Node based on the link's name
        ValueNode::LooseHandle get_link(const String &name)const { return get_link(get_link_index_from_name(name)); }
-
-       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;
 
 protected:
        //! Sets the type of the ValueNode
        void set_type(ValueBase::Type t) { ValueNode::set_type(t); }
 
+       //! Virtual member to get the linked Value Node Handle
        virtual ValueNode::LooseHandle get_link_vfunc(int i)const=0;
 
-       // Wrapper for new operator, used by clone()
+       //! Wrapper for new operator, used by clone()
        virtual LinkableValueNode* create_new()const=0;
 
+       //! Returns the cached times values for all the children (linked Value Nodes)
        virtual void get_times_vfunc(Node::time_set &set) const;
 }; // END of class LinkableValueNode
 
 /*!    \class ValueNodeList
 **     \brief A searchable value_node list container
 **     \warning Do not confuse with ValueNode_DynamicList!
-**     \todo writeme
+*
+*  Used by Canvas class to access to the exported value nodes.
 */
 class ValueNodeList : public std::list<ValueNode::RHandle>
 {