#include <list>
#include <map>
#include <dali/public-api/common/stage.h>
+#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/property-map.h>
#include <dali/public-api/render-tasks/render-task.h>
+#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/json-parser.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
#include <dali-toolkit/internal/builder/builder-declarations.h>
// Warning messages usually displayed
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 );
virtual ~Builder();
private:
- // Undefined
- Builder(const Builder&);
- Builder& operator=(const Builder& rhs);
-
- void SetupTask( RenderTask& task, const Toolkit::TreeNode& node, const Replacement& replacement );
+ typedef std::vector<const char*> KeyStack;
+ typedef std::vector< TreeNode::KeyNodePair > MappingsLut;
+ typedef struct{ std::string name; Dali::LinearConstrainer linearConstrainer; } LinearConstrainerEntry;
+ typedef std::vector<LinearConstrainerEntry> LinearConstrainerLut;
+ typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
+ typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
+ typedef std::map<const std::string, Path> PathLut;
+ typedef std::map<const std::string, FrameBufferImage> ImageLut;
private:
- Toolkit::JsonParser mParser;
-
- typedef std::map<const std::string, FrameBufferImage> ImageLut;
- ImageLut mFrameBufferImageLut;
+ // Undefined
+ Builder(const Builder&);
- typedef std::map<const std::string, ShaderEffect> ShaderEffectLut;
- ShaderEffectLut mShaderEffectLut;
+ // Undefined
+ Builder& operator=(const Builder& rhs);
- typedef std::map<const std::string, Path> PathLut;
- PathLut mPathLut;
+ void LoadConstants( const TreeNode& root, Property::Map& intoMap );
- typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
- typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
- PathConstrainerLut mPathConstrainerLut;
+ Animation CreateAnimation( const std::string& animationName,
+ const Replacement& replacement,
+ Dali::Actor sourceActor );
- typedef struct{ std::string name; Dali::LinearConstrainer linearConstrainer; } LinearConstrainerEntry;
- typedef std::vector<LinearConstrainerEntry> LinearConstrainerLut;
- LinearConstrainerLut mLinearConstrainerLut;
+ BaseHandle Create( const std::string& templateName,
+ const Replacement& constant );
- SlotDelegate<Builder> mSlotDelegate;
+ BaseHandle DoCreate( const TreeNode& root,
+ const TreeNode& node,
+ Actor parent,
+ const Replacement& replacements );
- Property::Map mReplacementMap;
+ void SetupTask( RenderTask& task,
+ const Toolkit::TreeNode& node,
+ const Replacement& replacement );
- BaseHandle Create( const std::string& templateName, const Replacement& constant );
+ bool ApplyStyle( const std::string& styleName,
+ Handle& handle,
+ const Replacement& replacement);
- BaseHandle DoCreate( const TreeNode& root, const TreeNode& node, Actor parent, const Replacement& replacements );
+ void ApplyAllStyleProperties( const TreeNode& root,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& constant );
- void LoadConstants( const TreeNode& root, Property::Map& intoMap );
+ void ApplyProperties( const TreeNode& root,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& constant );
- void LoadIncludes( const std::string& data );
+ void ApplyStylesByActor( const TreeNode& root,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& constant );
- bool ApplyStyle( const std::string& styleName, Handle& handle, const Replacement& replacement);
+ void SetProperties( const TreeNode& node,
+ Handle& handle,
+ const Replacement& constant );
- Animation CreateAnimation( const std::string& animationName, const Replacement& replacement, Dali::Actor sourceActor );
+ /**
+ * 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 );
+ void SetCustomProperties( const TreeNode& node,
+ Handle& handle,
+ const Replacement& constant,
+ const std::string& childName,
+ Property::AccessMode accessMode );
- void ApplyStylesByActor( const TreeNode& root, const TreeNode& node,
- Dali::Handle& handle, const Replacement& constant );
+ /**
+ * 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 );
- void ApplyAllStyleProperties( const TreeNode& root, const TreeNode& node,
- Dali::Handle& handle, const Replacement& constant );
- void SetProperties( const TreeNode& node, Handle& handle, const Replacement& constant );
+ /**
+ * 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 );
+private:
+ Toolkit::JsonParser mParser;
+ ImageLut mFrameBufferImageLut;
+ PathLut mPathLut;
+ PathConstrainerLut mPathConstrainerLut;
+ LinearConstrainerLut mLinearConstrainerLut;
+ SlotDelegate<Builder> mSlotDelegate;
+ Property::Map mReplacementMap;
+ MappingsLut mCompleteMappings;
Toolkit::Builder::BuilderSignalType mQuitSignal;
};