Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / builder / builder-impl.h
old mode 100644 (file)
new mode 100755 (executable)
index 3051917..2eb4a2b
@@ -1,8 +1,8 @@
-#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
 {
@@ -95,6 +95,11 @@ public:
   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;
@@ -150,6 +155,24 @@ public:
   bool ApplyStyle( const std::string& styleName, Handle& handle );
 
   /**
+   * 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
+   */
+  bool LookupStyleName( const std::string& styleName );
+
+  /**
+   * 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
+   */
+  const StylePtr GetStyle( const std::string& styleName );
+
+  /**
    * @copydoc Toolkit::Builder::AddActors
    */
   void AddActors( Actor toActor );
@@ -215,6 +238,7 @@ public:
    */
   void EmitQuitSignal();
 
+
 protected:
 
   virtual ~Builder();
@@ -238,6 +262,8 @@ private:
 
   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 );
@@ -263,11 +289,33 @@ private:
                                 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,
@@ -277,6 +325,13 @@ private:
                       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),
@@ -336,7 +391,9 @@ private:
   LinearConstrainerLut                mLinearConstrainerLut;
   SlotDelegate<Builder>               mSlotDelegate;
   Property::Map                       mReplacementMap;
+  Property::Map                       mConfigurationMap;
   MappingsLut                         mCompleteMappings;
+  Dictionary<StylePtr>                mStyles; // State based styles
   Toolkit::Builder::BuilderSignalType mQuitSignal;
 };
 
@@ -364,4 +421,4 @@ inline const Internal::Builder& GetImpl(const Dali::Toolkit::Builder& obj)
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_BUILDER_H__
+#endif // DALI_TOOLKIT_INTERNAL_BUILDER_H