-#ifndef __DALI_TOOLKIT_INTERNAL_BUILDER_H__
-#define __DALI_TOOLKIT_INTERNAL_BUILDER_H__
+#ifndef DALI_TOOLKIT_INTERNAL_BUILDER_H
+#define DALI_TOOLKIT_INTERNAL_BUILDER_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#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/devel-api/builder/json-parser.h>
#include <dali-toolkit/devel-api/builder/builder.h>
#include <dali-toolkit/internal/builder/builder-declarations.h>
+#include <dali-toolkit/internal/builder/style.h>
// Warning messages usually displayed
-#define DALI_SCRIPT_WARNING(format, args...) \
- DALI_LOG_WARNING("Script:" format, ## args)
+#define DALI_SCRIPT_WARNING(format, ...) \
+ DALI_LOG_WARNING("Script:" format, ## __VA_ARGS__)
// Info messages are usually debug build
-#define DALI_SCRIPT_INFO(format, args...) \
- DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::General, "Script:" format, ## args)
+#define DALI_SCRIPT_INFO(format, ...) \
+ DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::General, "Script:" format, ## __VA_ARGS__)
// Info Verbose need to be swiched on in gFilterScript filter constructor (by default set to General)
-#define DALI_SCRIPT_VERBOSE(format, args...) \
- DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::Verbose, "Script:" format, ## args)
+#define DALI_SCRIPT_VERBOSE(format, ...) \
+ DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::Verbose, "Script:" format, ## __VA_ARGS__)
namespace Dali
{
void AddConstant( const std::string& key, const Property::Value& value );
/**
+ * @copydoc Toolkit::Builder::GetConfigurations
+ */
+ const Property::Map& GetConfigurations() const;
+
+ /**
* @copydoc Toolkit::Builder::GetConstants
*/
const Property::Map& GetConstants() const;
bool ApplyStyle( const std::string& styleName, Handle& handle );
/**
- * @copydoc Toolkit::Builder::AddActors
+ * Lookup the stylename in builder. If it's found in the parse tree,
+ * then return true.
+ * @param[in] styleName The style name to search for
+ * @return true if the stylename exists
*/
- void AddActors( Actor toActor );
+ bool LookupStyleName( const std::string& styleName );
/**
- * @copydoc Toolkit::Builder::AddActors
+ * Lookup the stylename in the recorded Styles - if it exists,
+ * performs a shallow copy to the passed in style and returns true.
+ * Otherwise it returns false.
+
+ * @param[in] styleName The stylename to search for
+ * @return A const pointer to the style object
*/
- void AddActors( const std::string §ionName, Actor toActor );
+ const StylePtr GetStyle( const std::string& styleName );
/**
- * @copydoc Toolkit::Builder::CreateRenderTask
+ * @copydoc Toolkit::Builder::AddActors
*/
- void CreateRenderTask( const std::string &name );
+ void AddActors( Actor toActor );
/**
- * @copydoc Toolkit::Builder::GetFrameBufferImage
+ * @copydoc Toolkit::Builder::AddActors
*/
- FrameBufferImage GetFrameBufferImage( const std::string &name );
+ void AddActors( const std::string §ionName, Actor toActor );
/**
- * @copydoc Toolkit::Builder::GetFrameBufferImage
+ * @copydoc Toolkit::Builder::CreateRenderTask
*/
- FrameBufferImage GetFrameBufferImage( const std::string &name, const Replacement& constant );
+ void CreateRenderTask( const std::string &name );
/**
* @copydoc Toolkit::Builder::GetPath
*/
void EmitQuitSignal();
+
protected:
virtual ~Builder();
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:
// Undefined
void LoadConstants( const TreeNode& root, Property::Map& intoMap );
+ void LoadConfiguration( const TreeNode& root, Property::Map& intoMap );
+
Animation CreateAnimation( const std::string& animationName,
const Replacement& replacement,
Dali::Actor sourceActor );
Dali::Handle& handle,
const Replacement& constant );
+ void RecordStyles( const char* styleName,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& replacements );
+
+ void RecordStyle( StylePtr style,
+ const TreeNode& node,
+ Dali::Handle& handle,
+ const Replacement& replacements );
+
+ void RecordTransitions( const TreeNode::KeyNodePair& keyValue,
+ Property::Array& transitions,
+ const Replacement& replacements );
+
+ void RecordTransitionData( const TreeNode::KeyNodePair& keyNode,
+ Toolkit::TransitionData& transitionData,
+ const Replacement& replacements );
+
void ApplyProperties( const TreeNode& root,
const TreeNode& node,
Dali::Handle& handle,
const Replacement& constant );
+ void ApplySignals( const TreeNode& root,
+ const TreeNode& node,
+ Dali::Handle& handle );
+
void ApplyStylesByActor( const TreeNode& root,
const TreeNode& node,
Dali::Handle& handle,
Handle& handle,
const Replacement& constant );
+ bool MapToTargetProperty( Handle& propertyObject,
+ const std::string& key,
+ const TreeNode& node,
+ const Replacement& constant,
+ Property::Index& index,
+ 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),
private:
Toolkit::JsonParser mParser;
- ImageLut mFrameBufferImageLut;
PathLut mPathLut;
PathConstrainerLut mPathConstrainerLut;
LinearConstrainerLut mLinearConstrainerLut;
SlotDelegate<Builder> mSlotDelegate;
Property::Map mReplacementMap;
+ Property::Map mConfigurationMap;
MappingsLut mCompleteMappings;
+ Dictionary<StylePtr> mStyles; // State based styles
Toolkit::Builder::BuilderSignalType mQuitSignal;
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_INTERNAL_BUILDER_H__
+#endif // DALI_TOOLKIT_INTERNAL_BUILDER_H