Added copyright lines for files I've edited this year.
[synfig.git] / synfig-core / trunk / src / synfig / layer.h
index 4f2fb10..1e01f58 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
 #define EXPORT(x)                                      EXPORT_AS(x,#x)
 
 //! \writeme
-#define EXPORT_NAME()  if(param=="Name" || param=="name" || param=="name__") { return name__; } if(param=="local_name__") { return local_name__; }
+#define EXPORT_NAME()  if(param=="Name" || param=="name" || param=="name__") { return name__; } if(param=="local_name__") { return dgettext("synfig",local_name__); }
 
 //! \writeme
 #define EXPORT_VERSION()       if(param=="Version" || param=="version" || param=="version__") { return version__; }
 
+//! This is used as the category for layer book entries which represent aliases of layers.
+//! It prevents these layers showing up in the menu.
+#define CATEGORY_DO_NOT_USE "Do Not Use"
+
 /* === T Y P E D E F S ===================================================== */
 
 /* === C L A S S E S & S T R U C T S ======================================= */
@@ -318,6 +323,12 @@ public:
        //! \writeme
        void set_description(const String& x);
 
+       //! Returns the layer's description if it's not empty, else its local name
+       const String get_non_empty_description()const { return get_description().empty() ? get_local_name() : get_description(); }
+
+       //! Returns the localised version of the given layer parameter
+       const String get_param_local_name(const String &param_name)const;
+
        /*
  --    ** -- V I R T U A L   F U N C T I O N S -----------------------------------
        */
@@ -333,7 +344,7 @@ public:
        //! Returns a string containing the localized name of the Layer
        virtual String get_local_name()const;
 
-       //! Gets the paramater vocabulary
+       //! Gets the parameter vocabulary
        virtual Vocab get_param_vocab()const;
 
        //! Gets the version string for this layer
@@ -376,14 +387,14 @@ public:
        virtual ParamList get_param_list()const;
 
        //! Sets the \a time for the selected Layer and those under it
-       /*!     \param context          Context iterator refering to next Layer.
+       /*!     \param context          Context iterator referring to next Layer.
        **      \param time                     writeme
        **      \see Handle::set_time()
        */
        virtual void set_time(Context context, Time time)const;
 
        //! Sets the \a time for the selected Layer and those under it for a specific \a point
-       /*!     \param context          Context iterator refering to next Layer.
+       /*!     \param context          Context iterator referring to next Layer.
        **      \param time                     writeme
        **      \param point            writeme
        **      \see Handle::set_time()
@@ -391,14 +402,14 @@ public:
        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 refering to next Layer.
+       /*!     \param context          Context iterator referring to next Layer.
        **      \param pos              Point which indicates where the Color should come from
        **      \see Handle::get_color()
        */
        virtual Color get_color(Context context, const Point &pos)const;
 
        //! Renders the Canvas to the given Surface in an accelerated manner
-       /*!     \param context          Context iterator refering to next Layer.
+       /*!     \param context          Context iterator referring to next Layer.
        **      \param surface          Pointer to Surface to render to.
        **      \param quality          The requested quality-level to render at.
        **      \param renddesc         The associated RendDesc.
@@ -409,7 +420,7 @@ public:
        virtual bool accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const;
 
        //! Checks to see if a part of the layer is directly under \a point
-       /*!     \param context          Context iterator refering to next Layer.
+       /*!     \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. */
@@ -418,8 +429,18 @@ public:
        //! Duplicates the Layer
        virtual Handle clone(const GUID& deriv_guid=GUID())const;
 
+       //! Returns true if the layer needs to be able to examine its context.
+       /*! context to render itself, other than for simple blending.  For
+       **  example, the blur layer will return true - it can't do its job
+       **  if it can't see its context, and the circle layer will return
+       **  false - rendering a circle doesn't depend on the underlying
+       **  context until the final blend operation. */
+       virtual bool reads_context()const;
+
+#ifdef THIS_CODE_IS_NOT_USED
        //! Duplicates the Layer without duplicating the value nodes
        virtual Layer *simple_clone()const;
+#endif /* THIS_CODE_IS_NOT_USED */
 
 protected: