X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-impl.h;h=4c018aafb85f3344e17460f69e4257b9e5cc7e1c;hp=af1c85c107374b9b90b114526e3dfa2d72172a3c;hb=29d3264d67c7dac9c3e7059140fa7eef3592a823;hpb=4fe712193160250278a31e485ceab7d108974524 diff --git a/dali-toolkit/internal/builder/builder-impl.h b/dali-toolkit/internal/builder/builder-impl.h index af1c85c..4c018aa 100644 --- a/dali-toolkit/internal/builder/builder-impl.h +++ b/dali-toolkit/internal/builder/builder-impl.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -30,8 +31,8 @@ #include // INTERNAL INCLUDES -#include -#include +#include +#include #include // Warning messages usually displayed @@ -163,16 +164,6 @@ public: void CreateRenderTask( const std::string &name ); /** - * @copydoc Toolkit::Builder::GetShaderEffect - */ - ShaderEffect GetShaderEffect( const std::string &name ); - - /** - * @copydoc Toolkit::Builder::GetShaderEffect - */ - ShaderEffect GetShaderEffect( const std::string &name, const Replacement& constant ); - - /** * @copydoc Toolkit::Builder::GetFrameBufferImage */ FrameBufferImage GetFrameBufferImage( const std::string &name ); @@ -234,15 +225,14 @@ private: void SetupTask( RenderTask& task, const Toolkit::TreeNode& node, const Replacement& replacement ); + void SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant, const std::string& childName, Property::AccessMode accessMode ); + private: Toolkit::JsonParser mParser; typedef std::map ImageLut; ImageLut mFrameBufferImageLut; - typedef std::map ShaderEffectLut; - ShaderEffectLut mShaderEffectLut; - typedef std::map PathLut; PathLut mPathLut; @@ -258,6 +248,9 @@ private: Property::Map mReplacementMap; + typedef std::vector< TreeNode::KeyNodePair > MappingsLut; + MappingsLut mCompleteMappings; + BaseHandle Create( const std::string& templateName, const Replacement& constant ); BaseHandle DoCreate( const TreeNode& root, const TreeNode& node, Actor parent, const Replacement& replacements ); @@ -270,6 +263,39 @@ private: Animation CreateAnimation( const std::string& animationName, const Replacement& replacement, Dali::Actor sourceActor ); + typedef std::vector KeyStack; + + /** + * Tests if the value is a string delimited by <>. If it is, then it attempts to + * change the value to the mapping from a matching key in the mappings table. + * @param[in] mappingRoot The JSON node containing the mappings + * @param[in,out] keyStack the stack of visited keys + * @param[in,out] value The string value to test and write back to. + * @return true if the value was converted, false otherwise. + */ + bool ConvertChildValue( const TreeNode& mappingRoot, KeyStack& keyStack, Property::Value& value ); + + /** + * Find the key in the mapping table, if it's present, then generate a property value for it (of the given type if available), recursing as necessary, and stopping if any cycles + * are detected. + * @param[in] mappingRoot The JSON node containing the mappings + * @param[in] theKey The key to search for + * @param[in,out] keyStack the stack of visited keys + * @param[in] propertyType The property type if known, or NONE + * @param[in,out] value The string value to test and write back to. + */ + bool RecursePropertyMap( const TreeNode& mappingRoot, KeyStack& keyStack, const char* theKey, Property::Type propertyType, Property::Value& value ); + + /** + * Find the key in the mapping table, if it's present, then generate a property value for it (of the given type if available), recursing as necessary, and stopping if any cycles + * are detected. + * @param[in] mappingRoot The JSON node containing the mappings + * @param[in] theKey The key to search for + * @param[in] propertyType The property type if known, or NONE + * @param[in,out] value The string value to test and write back to. + */ + bool GetPropertyMap( const TreeNode& mappingRoot, const char* theKey, Property::Type propertyType, Property::Value& value ); + void ApplyProperties( const TreeNode& root, const TreeNode& node, Dali::Handle& handle, const Replacement& constant );