X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Flayer.h;h=1e01f58ea999e766e34e750c0a750a4c9bddff5a;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=a3ae3b74561099424da7c966b8f98e49699c91bd;hpb=eaf12afa6f6d98b64bec9dd9d55019e9bf3553a4;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index a3ae3b7..1e01f58 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -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 @@ -77,11 +78,15 @@ #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 ¶m_name)const; + /* -- ** -- V I R T U A L F U N C T I O N S ----------------------------------- */ @@ -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: