Updated all header files to new format 11/253111/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 4 Feb 2021 14:12:27 +0000 (14:12 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 4 Feb 2021 15:57:40 +0000 (15:57 +0000)
Change-Id: I68b3cf032fa1758fff92509f463101bdfd36cce1

260 files changed:
dali-scene-loader/internal/gltf2-asset.h
dali-scene-loader/internal/hash.h
dali-scene-loader/internal/json-reader.h
dali-scene-loader/internal/json-util.h
dali-scene-loader/public-api/alpha-function-helper.h
dali-scene-loader/public-api/animated-property.h
dali-scene-loader/public-api/animation-definition.h
dali-scene-loader/public-api/api.h
dali-scene-loader/public-api/blend-shape-details.h
dali-scene-loader/public-api/camera-parameters.h
dali-scene-loader/public-api/customization.h
dali-scene-loader/public-api/dli-loader.h
dali-scene-loader/public-api/environment-definition.h
dali-scene-loader/public-api/gltf2-loader.h
dali-scene-loader/public-api/index.h
dali-scene-loader/public-api/ktx-loader.h
dali-scene-loader/public-api/light-parameters.h
dali-scene-loader/public-api/load-result.h
dali-scene-loader/public-api/material-definition.h
dali-scene-loader/public-api/matrix-stack.h
dali-scene-loader/public-api/mesh-definition.h
dali-scene-loader/public-api/mesh-geometry.h
dali-scene-loader/public-api/node-definition.h
dali-scene-loader/public-api/parse-renderer-state.h
dali-scene-loader/public-api/renderer-state.h
dali-scene-loader/public-api/resource-bundle.h
dali-scene-loader/public-api/scene-definition.h
dali-scene-loader/public-api/shader-definition-factory.h
dali-scene-loader/public-api/shader-definition.h
dali-scene-loader/public-api/skeleton-definition.h
dali-scene-loader/public-api/skinning-details.h
dali-scene-loader/public-api/string-callback.h
dali-scene-loader/public-api/utils.h
dali-scene-loader/public-api/view-projection.h
dali-scene-loader/third-party/.clang-format [new file with mode: 0644]
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/web-view/web-back-forward-list-item.h [changed mode: 0755->0644]
dali-toolkit/devel-api/controls/web-view/web-back-forward-list.h [changed mode: 0755->0644]
dali-toolkit/devel-api/controls/web-view/web-context.h [changed mode: 0755->0644]
dali-toolkit/devel-api/controls/web-view/web-cookie-manager.h [changed mode: 0755->0644]
dali-toolkit/devel-api/controls/web-view/web-settings.h [changed mode: 0755->0644]
dali-toolkit/devel-api/controls/web-view/web-view.h [changed mode: 0755->0644]
dali-toolkit/devel-api/layouting/flex-node.h
dali-toolkit/devel-api/shader-effects/dissolve-effect.h
dali-toolkit/devel-api/shader-effects/motion-blur-effect.h
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h
dali-toolkit/devel-api/text/text-utils-devel.h [changed mode: 0755->0644]
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.h
dali-toolkit/internal/builder/builder-declarations.h
dali-toolkit/internal/builder/builder-filesystem.h [changed mode: 0755->0644]
dali-toolkit/internal/builder/builder-get-is.inl.h
dali-toolkit/internal/builder/builder-impl-debug.h
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/builder/builder-set-property.h
dali-toolkit/internal/builder/dictionary.h
dali-toolkit/internal/builder/json-parser-impl.h
dali-toolkit/internal/builder/json-parser-state.h
dali-toolkit/internal/builder/optional-value.h
dali-toolkit/internal/builder/replacement.h
dali-toolkit/internal/builder/style.h
dali-toolkit/internal/builder/tree-node-manipulator.h
dali-toolkit/internal/controls/alignment/alignment-impl.h
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/bubble-effect/bubble-effect.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/bubble-effect/bubble-renderer.h
dali-toolkit/internal/controls/bubble-effect/color-adjuster.h
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/buttons/check-box-button-impl.h
dali-toolkit/internal/controls/buttons/push-button-impl.h
dali-toolkit/internal/controls/buttons/radio-button-impl.h
dali-toolkit/internal/controls/buttons/toggle-button-impl.h
dali-toolkit/internal/controls/control/control-data-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/control/control-debug.h
dali-toolkit/internal/controls/control/control-renderers.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.h
dali-toolkit/internal/controls/flex-container/flex-container-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.h
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.h
dali-toolkit/internal/controls/model3d-view/obj-loader.h
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h
dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/popup/confirmation-popup-impl.h
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/scene3d-view/gltf-loader.h
dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h
dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/table-view/array-2d.h
dali-toolkit/internal/controls/table-view/table-view-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-editor-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-field-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h
dali-toolkit/internal/controls/tooltip/tooltip.h
dali-toolkit/internal/controls/video-view/video-view-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/controls/web-view/web-view-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/drag-drop-detector/drag-and-drop-detector-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/feedback/feedback-ids.h
dali-toolkit/internal/feedback/feedback-style.h
dali-toolkit/internal/filters/blur-two-pass-filter.h
dali-toolkit/internal/filters/emboss-filter.h
dali-toolkit/internal/filters/image-filter.h
dali-toolkit/internal/filters/spread-filter.h
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h
dali-toolkit/internal/helpers/color-conversion.h
dali-toolkit/internal/helpers/property-helper.h
dali-toolkit/internal/helpers/round-robin-container-view.h
dali-toolkit/internal/image-loader/async-image-loader-impl.h
dali-toolkit/internal/image-loader/atlas-packer.h
dali-toolkit/internal/image-loader/image-atlas-impl.h
dali-toolkit/internal/image-loader/image-load-thread.h
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/bidirectional-line-info-run.h
dali-toolkit/internal/text/bidirectional-paragraph-info-run.h
dali-toolkit/internal/text/bidirectional-support.h [changed mode: 0755->0644]
dali-toolkit/internal/text/character-run.h
dali-toolkit/internal/text/character-set-conversion.h
dali-toolkit/internal/text/color-run.h
dali-toolkit/internal/text/color-segmentation.h
dali-toolkit/internal/text/cursor-helper-functions.h
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/embedded-item.h [changed mode: 0755->0644]
dali-toolkit/internal/text/font-description-run.h
dali-toolkit/internal/text/font-run.h
dali-toolkit/internal/text/glyph-metrics-helper.h
dali-toolkit/internal/text/glyph-run.h
dali-toolkit/internal/text/hidden-text.h
dali-toolkit/internal/text/input-style.h
dali-toolkit/internal/text/layouts/layout-engine.h [changed mode: 0755->0644]
dali-toolkit/internal/text/layouts/layout-parameters.h [changed mode: 0755->0644]
dali-toolkit/internal/text/line-run.h
dali-toolkit/internal/text/logical-model-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/text/markup-processor-color.h
dali-toolkit/internal/text/markup-processor-embedded-item.h [changed mode: 0755->0644]
dali-toolkit/internal/text/markup-processor-font.h
dali-toolkit/internal/text/markup-processor-helper-functions.h [changed mode: 0755->0644]
dali-toolkit/internal/text/markup-processor.h [changed mode: 0755->0644]
dali-toolkit/internal/text/metrics.h [changed mode: 0755->0644]
dali-toolkit/internal/text/multi-language-helper-functions.h
dali-toolkit/internal/text/multi-language-support-impl.h
dali-toolkit/internal/text/multi-language-support.h
dali-toolkit/internal/text/paragraph-run.h
dali-toolkit/internal/text/property-string-parser.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager.h
dali-toolkit/internal/text/rendering/atlas/atlas-mesh-factory.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.h
dali-toolkit/internal/text/rendering/text-backend-impl.h
dali-toolkit/internal/text/rendering/text-backend.h
dali-toolkit/internal/text/rendering/text-renderer.h
dali-toolkit/internal/text/rendering/text-typesetter.h
dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-common-glsl.h
dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-sdf-glsl.h
dali-toolkit/internal/text/rendering/vector-based/glyphy-shader/glyphy-shader.h
dali-toolkit/internal/text/rendering/vector-based/vector-based-renderer.h
dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas-share.h
dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas.h
dali-toolkit/internal/text/rendering/view-model.h [changed mode: 0755->0644]
dali-toolkit/internal/text/script-run.h [changed mode: 0755->0644]
dali-toolkit/internal/text/segmentation.h
dali-toolkit/internal/text/shaper.h
dali-toolkit/internal/text/text-control-interface.h
dali-toolkit/internal/text/text-controller-event-handler.h
dali-toolkit/internal/text/text-controller-impl-event-handler.h
dali-toolkit/internal/text/text-controller-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-controller-input-font-handler.h
dali-toolkit/internal/text/text-controller-placeholder-handler.h
dali-toolkit/internal/text/text-controller-relayouter.h
dali-toolkit/internal/text/text-controller-text-updater.h
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-definitions.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-editable-control-interface.h
dali-toolkit/internal/text/text-effects-style.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-enumerations-impl.h
dali-toolkit/internal/text/text-font-style.h
dali-toolkit/internal/text/text-io.h
dali-toolkit/internal/text/text-model-interface.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-model.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-run-container.h
dali-toolkit/internal/text/text-scroller-interface.h
dali-toolkit/internal/text/text-scroller.h
dali-toolkit/internal/text/text-selectable-control-interface.h
dali-toolkit/internal/text/text-selection-handle-controller.h
dali-toolkit/internal/text/text-vertical-scroller.h
dali-toolkit/internal/text/text-view-interface.h [changed mode: 0755->0644]
dali-toolkit/internal/text/text-view.h [changed mode: 0755->0644]
dali-toolkit/internal/text/visual-model-impl.h [changed mode: 0755->0644]
dali-toolkit/internal/text/xhtml-entities.h [changed mode: 0755->0644]
dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.h
dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.h [changed mode: 0755->0644]
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h
dali-toolkit/internal/visuals/animated-image/image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-manager.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-thread.h
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h
dali-toolkit/internal/visuals/arc/arc-visual.h
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/gradient/gradient.h
dali-toolkit/internal/visuals/gradient/linear-gradient.h
dali-toolkit/internal/visuals/gradient/radial-gradient.h
dali-toolkit/internal/visuals/image-atlas-manager.h
dali-toolkit/internal/visuals/image-visual-shader-factory.h
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch-data.h
dali-toolkit/internal/visuals/npatch-loader.h
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/rendering-addon.h
dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h
dali-toolkit/internal/visuals/svg/svg-visual.h
dali-toolkit/internal/visuals/text/text-visual.h [changed mode: 0755->0644]
dali-toolkit/internal/visuals/texture-manager-impl.h
dali-toolkit/internal/visuals/texture-upload-observer.h
dali-toolkit/internal/visuals/transition-data-impl.h
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-event-observer.h
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.h
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/internal/visuals/visual-url.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
dali-toolkit/public-api/controls/control.h

index 79a72db..1ec67e2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_GLTF2_ASSET_H_
 #define DALI_SCENE_LOADER_GLTF2_ASSET_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/index.h"
 #include "dali-scene-loader/internal/json-reader.h"
+#include "dali-scene-loader/public-api/index.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/math/vector4.h"
-#include "dali/public-api/math/quaternion.h"
-#include "dali/public-api/common/vector-wrapper.h"
-#include "dali/devel-api/common/map-wrapper.h"
 #include <cstdint>
 #include <memory>
+#include "dali/devel-api/common/map-wrapper.h"
+#include "dali/public-api/common/vector-wrapper.h"
+#include "dali/public-api/math/quaternion.h"
+#include "dali/public-api/math/vector4.h"
 
 namespace gltf2
 {
-
 using Index = Dali::SceneLoader::Index;
 
-template <typename T>
+template<typename T>
 class Ref
 {
 public:
@@ -42,14 +41,18 @@ public:
   Ref(std::vector<T>& v, Index i)
   : mVector(&v),
     mIndex(i)
-  {}
+  {
+  }
 
   /**
    * @return The index of the object into the vector.
    * @note It is client code responsibility to ensure that the vector is unambiguous. It should be in
    *  a glTF document, since there's one vector for each type.
    */
-  Index GetIndex() const { return mIndex; }
+  Index GetIndex() const
+  {
+    return mIndex;
+  }
 
   /**
    * @brief There may be scenarios in which the object, whose vector we're populating, changes, e.g.
@@ -60,9 +63,18 @@ public:
     mVector = &v;
   }
 
-  operator bool() const { return mVector != nullptr; }
-  T* operator->() const { return &(*mVector)[mIndex]; }
-  T& operator*() const { return (*mVector)[mIndex]; }
+  operator bool() const
+  {
+    return mVector != nullptr;
+  }
+  T* operator->() const
+  {
+    return &(*mVector)[mIndex];
+  }
+  T& operator*() const
+  {
+    return (*mVector)[mIndex];
+  }
 
   bool operator==(const Ref<T>& other) const
   {
@@ -76,7 +88,7 @@ public:
 
 private:
   std::vector<T>* mVector = nullptr;
-  Index mIndex = Dali::SceneLoader::INVALID_INDEX;
+  Index           mIndex  = Dali::SceneLoader::INVALID_INDEX;
 };
 
 struct Asset
@@ -88,16 +100,16 @@ struct Component
 {
   enum Type
   {
-    BYTE = 5120,
-    UNSIGNED_BYTE = 5121,
-    SHORT = 5122,
+    BYTE           = 5120,
+    UNSIGNED_BYTE  = 5121,
+    SHORT          = 5122,
     UNSIGNED_SHORT = 5123,
-    UNSIGNED_INT = 5125,
-    FLOAT = 5126,
-    INVALID = -1
+    UNSIGNED_INT   = 5125,
+    FLOAT          = 5126,
+    INVALID        = -1
   };
 
-  static bool IsUnsigned(Type t);
+  static bool     IsUnsigned(Type t);
   static uint32_t Size(Type t);
 
   Component() = delete;
@@ -161,7 +173,7 @@ struct Attribute
 
 struct Buffer
 {
-  uint32_t mByteLength;
+  uint32_t         mByteLength;
   std::string_view mUri;
   //TODO: extensions
   //TODO: extras
@@ -174,7 +186,7 @@ struct BufferView
     enum Type
     {
       NONE,
-      ARRAY_BUFFER = 34962,
+      ARRAY_BUFFER         = 34962,
       ELEMENT_ARRAY_BUFFER = 34963
     };
 
@@ -182,10 +194,10 @@ struct BufferView
   };
 
   Ref<Buffer> mBuffer;
-  uint32_t mByteOffset = 0;
-  uint32_t mByteLength;
-  uint32_t mByteStride = 0;  // if 0 after reading, it needs to be calculated
-  uint32_t mTarget;
+  uint32_t    mByteOffset = 0;
+  uint32_t    mByteLength;
+  uint32_t    mByteStride = 0; // if 0 after reading, it needs to be calculated
+  uint32_t    mTarget;
   //TODO: extensions
   //TODO: extras
 };
@@ -193,7 +205,7 @@ struct BufferView
 struct BufferViewClient
 {
   Ref<BufferView> mBufferView;
-  uint32_t mByteOffset = 0;
+  uint32_t        mByteOffset = 0;
 };
 
 struct ComponentTypedBufferViewClient : BufferViewClient
@@ -215,18 +227,18 @@ struct Accessor : ComponentTypedBufferViewClient, Named
 {
   struct Sparse
   {
-    uint32_t mCount;
+    uint32_t                       mCount;
     ComponentTypedBufferViewClient mIndices;
-    BufferViewClient mValues;
+    BufferViewClient               mValues;
     //TODO: extensions
     //TODO: extras
   };
 
-  uint32_t mCount;
-  bool mNormalized = false;
-  AccessorType::Type mType = AccessorType::INVALID;
-  std::vector<float> mMin;
-  std::vector<float> mMax;
+  uint32_t                mCount;
+  bool                    mNormalized = false;
+  AccessorType::Type      mType       = AccessorType::INVALID;
+  std::vector<float>      mMin;
+  std::vector<float>      mMax;
   std::unique_ptr<Sparse> mSparse;
   //TODO: extensions
   //TODO: extras
@@ -247,11 +259,11 @@ struct Accessor : ComponentTypedBufferViewClient, Named
   }
 };
 
-struct Image: Named
+struct Image : Named
 {
   std::string_view mUri;
   std::string_view mMimeType;
-  Ref<BufferView> mBufferView;
+  Ref<BufferView>  mBufferView;
   //TODO: extensions
   //TODO: extras
 };
@@ -260,12 +272,12 @@ struct Filter
 {
   enum Type
   {
-    NEAREST = 9728,
-    LINEAR = 9729,
+    NEAREST                = 9728,
+    LINEAR                 = 9729,
     NEAREST_MIPMAP_NEAREST = 9984,
-    NEAREST_MIPMAP_LINEAR = 9985,
-    LINEAR_MIPMAP_NEAREST = 9986,
-    LINEAR_MIPMAP_LINEAR = 9987,
+    NEAREST_MIPMAP_LINEAR  = 9985,
+    LINEAR_MIPMAP_NEAREST  = 9986,
+    LINEAR_MIPMAP_LINEAR   = 9987,
   };
 
   Filter() = delete;
@@ -275,8 +287,8 @@ struct Wrap
 {
   enum Type
   {
-    REPEAT = 10497,
-    CLAMP_TO_EDGE = 33071,
+    REPEAT          = 10497,
+    CLAMP_TO_EDGE   = 33071,
     MIRRORED_REPEAT = 33648,
   };
 
@@ -287,23 +299,23 @@ struct Sampler
 {
   Filter::Type mMinFilter = Filter::LINEAR;
   Filter::Type mMagFilter = Filter::LINEAR;
-  Wrap::Type mWrapS = Wrap::CLAMP_TO_EDGE;
-  Wrap::Type mWrapT = Wrap::CLAMP_TO_EDGE;
+  Wrap::Type   mWrapS     = Wrap::CLAMP_TO_EDGE;
+  Wrap::Type   mWrapT     = Wrap::CLAMP_TO_EDGE;
   //TODO: extensions
   //TODO: extras
 };
 
 struct Texture
 {
-  Ref<Image> mSource;
+  Ref<Image>   mSource;
   Ref<Sampler> mSampler;
 };
 
 struct TextureInfo
 {
   Ref<gltf2::Texture> mTexture;
-  uint32_t mTexCoord = 0;
-  float mScale = 1.f;
+  uint32_t            mTexCoord = 0;
+  float               mScale    = 1.f;
 
   operator bool() const
   {
@@ -311,32 +323,32 @@ struct TextureInfo
   }
 };
 
-struct Material: Named
+struct Material : Named
 {
-  struct Pbr//MetallicRoughness
+  struct Pbr //MetallicRoughness
   {
     Dali::Vector4 mBaseColorFactor = Dali::Vector4::ONE;
-    TextureInfo mBaseColorTexture;
-    float mMetallicFactor = 1.f;
-    float mRoughnessFactor = 1.f;
-    TextureInfo mMetallicRoughnessTexture;
+    TextureInfo   mBaseColorTexture;
+    float         mMetallicFactor  = 1.f;
+    float         mRoughnessFactor = 1.f;
+    TextureInfo   mMetallicRoughnessTexture;
     //TODO: extensions
     //TODO: extras
   };
 
-  Pbr mPbrMetallicRoughness;
-  TextureInfo mNormalTexture;
-  TextureInfo mOcclusionTexture;
-  TextureInfo mEmissiveTexture;
-  Dali::Vector3 mEmissiveFactor;
-  AlphaMode::Type mAlphaMode = AlphaMode::OPAQUE;
-  float mAlphaCutoff = .5f;
-  bool mDoubleSided = false;
+  Pbr             mPbrMetallicRoughness;
+  TextureInfo     mNormalTexture;
+  TextureInfo     mOcclusionTexture;
+  TextureInfo     mEmissiveTexture;
+  Dali::Vector3   mEmissiveFactor;
+  AlphaMode::Type mAlphaMode   = AlphaMode::OPAQUE;
+  float           mAlphaCutoff = .5f;
+  bool            mDoubleSided = false;
   //TODO: extensions
   //TODO: extras
 };
 
-struct Mesh: Named
+struct Mesh : Named
 {
   struct Primitive
   {
@@ -352,11 +364,11 @@ struct Mesh: Named
       INVALID
     };
 
-    std::map<Attribute::Type, Ref<Accessor>> mAttributes;
+    std::map<Attribute::Type, Ref<Accessor>>              mAttributes;
     std::vector<std::map<Attribute::Type, Ref<Accessor>>> mTargets;
-    Ref<Accessor> mIndices;
-    Ref<Material> mMaterial;
-    Mode mMode = TRIANGLES;
+    Ref<Accessor>                                         mIndices;
+    Ref<Material>                                         mMaterial;
+    Mode                                                  mMode = TRIANGLES;
 
     //TODO: [morph] targets
     //TODO: extras
@@ -364,7 +376,7 @@ struct Mesh: Named
   };
 
   std::vector<Primitive> mPrimitives;
-  std::vector<float> mWeights;
+  std::vector<float>     mWeights;
   //TODO: extras
   //TODO: extensions
 };
@@ -373,14 +385,14 @@ struct Node;
 
 struct Skin : Named
 {
-  Ref<Accessor> mInverseBindMatrices;
-  Ref<Node> mSkeleton;
+  Ref<Accessor>          mInverseBindMatrices;
+  Ref<Node>              mSkeleton;
   std::vector<Ref<Node>> mJoints;
   //TODO: extras
   //TODO: extensions
 };
 
-struct Camera: Named
+struct Camera : Named
 {
   struct Perspective
   {
@@ -403,21 +415,21 @@ struct Camera: Named
   };
 
   std::string_view mType;
-  Perspective mPerspective;
-  Orthographic mOrthographic;
+  Perspective      mPerspective;
+  Orthographic     mOrthographic;
   //TODO: extras
   //TODO: extensions
 };
 
-struct Node: Named
+struct Node : Named
 {
-  Dali::Vector3 mTranslation = Dali::Vector3::ZERO;
-  Dali::Quaternion mRotation = Dali::Quaternion::IDENTITY;
-  Dali::Vector3 mScale = Dali::Vector3::ONE;
+  Dali::Vector3    mTranslation = Dali::Vector3::ZERO;
+  Dali::Quaternion mRotation    = Dali::Quaternion::IDENTITY;
+  Dali::Vector3    mScale       = Dali::Vector3::ONE;
 
-  Ref<Camera> mCamera;
+  Ref<Camera>            mCamera;
   std::vector<Ref<Node>> mChildren;
-  Ref<Mesh> mMesh;
+  Ref<Mesh>              mMesh;
 
   Ref<Skin> mSkin;
   //TODO: [morph] weights
@@ -443,8 +455,8 @@ struct Animation : Named
       static Type FromString(const char* s, size_t len);
     };
 
-    Ref<Accessor> mInput;
-    Ref<Accessor> mOutput;
+    Ref<Accessor>       mInput;
+    Ref<Accessor>       mOutput;
     Interpolation::Type mInterpolation;
 
     //TODO: extras
@@ -467,11 +479,11 @@ struct Animation : Named
       static Type FromString(const char* s, size_t len);
 
       Ref<Node> mNode;
-      Type mPath;
+      Type      mPath;
     };
 
     Ref<Sampler> mSampler;
-    Target mTarget;
+    Target       mTarget;
     //TODO: extras
     //TODO: extensions
   };
@@ -480,7 +492,7 @@ struct Animation : Named
   std::vector<Channel> mChannels;
 };
 
-struct Scene: Named
+struct Scene : Named
 {
   std::vector<Ref<Node>> mNodes;
 };
@@ -489,29 +501,29 @@ struct Document
 {
   Asset mAsset;
 
-  std::vector<Buffer> mBuffers;
+  std::vector<Buffer>     mBuffers;
   std::vector<BufferView> mBufferViews;
-  std::vector<Accessor> mAccessors;
+  std::vector<Accessor>   mAccessors;
 
-  std::vector<Image> mImages;
-  std::vector<Sampler> mSamplers;
-  std::vector<Texture> mTextures;
+  std::vector<Image>    mImages;
+  std::vector<Sampler>  mSamplers;
+  std::vector<Texture>  mTextures;
   std::vector<Material> mMaterials;
 
   std::vector<Mesh> mMeshes;
   std::vector<Skin> mSkins;
 
   std::vector<Camera> mCameras;
-  std::vector<Node> mNodes;
+  std::vector<Node>   mNodes;
 
   std::vector<Animation> mAnimations;
 
   std::vector<Scene> mScenes;
-  Ref<Scene> mScene;
+  Ref<Scene>         mScene;
 
-  Document() = default;
+  Document()                = default;
   Document(const Document&) = delete;
-  Document(Document&&) = default;
+  Document(Document&&)      = default;
 
   Document& operator=(const Document&) = delete;
   Document& operator=(Document&&) = default;
@@ -521,12 +533,12 @@ struct Document
  * @brief Provides a json::Property<T>::ReadFn for interpreting unsigned integers
  *  as a Ref<U> into a std::vector<U> data member of a type T.
  */
-template <typename T>
+template<typename T>
 struct RefReader
 {
   static T* sObject;
 
-  template <typename U, std::vector<U> T::* V>
+  template<typename U, std::vector<U> T::*V>
   static Ref<U> Read(const json_value_s& j)
   {
     uint32_t index = json::Read::Number<uint32_t>(j);
@@ -534,13 +546,13 @@ struct RefReader
   }
 };
 
-template <typename T>
+template<typename T>
 T* RefReader<T>::sObject = nullptr;
 
 /**
  * @brief Convenience method to set the object for RefReader.
  */
-template <typename T>
+template<typename T>
 void SetRefReaderObject(T& object)
 {
   RefReader<T>::sObject = &object;
@@ -551,7 +563,7 @@ void SetRefReaderObject(T& object)
  * @note The enum must: 1, be called Type, nested to T, 2, provide a FromString static method taking a const char*
  *  (string data) and a size_t (string length) and returning T::Type.
  */
-template <typename T> // T must have a nested enum called Type and a static Type FromString(const char*) method.
+template<typename T> // T must have a nested enum called Type and a static Type FromString(const char*) method.
 typename T::Type ReadStringEnum(const json_value_s& j)
 {
   auto str = json::Read::StringView(j);
@@ -564,12 +576,11 @@ typename T::Type ReadStringEnum(const json_value_s& j)
  * @note T must provide an AsFloat() member method returning the non-const array of its
  *  float components.
  */
-template <typename T>
-inline
-T ReadDaliVector(const json_value_s& j)
+template<typename T>
+inline T ReadDaliVector(const json_value_s& j)
 {
   std::vector<float> floats = json::Read::Array<float, json::Read::Number<float>>(j);
-  T result;
+  T                  result;
   std::copy(floats.begin(), std::min(floats.end(), floats.begin() + sizeof(T) / sizeof(float)), result.AsFloat());
   return result;
 }
@@ -580,6 +591,6 @@ T ReadDaliVector(const json_value_s& j)
  */
 Dali::Quaternion ReadQuaternion(const json_value_s& j);
 
-}
+} // namespace gltf2
 
 #endif //DALI_SCENE_LOADER_GLTF2_ASSET_H_
index 32c69da..22b770e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_HASH_H_
 #define DALI_SCENE_LOADER_HASH_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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 <string>
-#include <cstring>
 #include <cstdint>
+#include <cstring>
+#include <string>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Rudimentary hash generator that follows a builder pattern.
  */
@@ -94,7 +93,7 @@ public:
    * @brief Applies the bytes of an object @a value, to the hash.
    * @return Its updated self.
    */
-  template <typename T>
+  template<typename T>
   Hash& AddObjectBytes(const T& value);
 
   operator uint64_t() const;
@@ -105,13 +104,12 @@ private:
   uint64_t Concatenate(uint64_t value);
 };
 
-
 template<typename T>
-Hash& Hash::AddObjectBytes(const T & value)
+Hash& Hash::AddObjectBytes(const T& value)
 {
   auto i0 = reinterpret_cast<const uint8_t*>(&value);
   auto i1 = i0 + sizeof(T);
-  while (i0 != i1)
+  while(i0 != i1)
   {
     mValue = Concatenate(*i0);
     ++i0;
@@ -119,7 +117,7 @@ Hash& Hash::AddObjectBytes(const T & value)
   return *this;
 }
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_HASH_H_
index 2f769a7..4fb6f7a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_JSON_READER_H_
 #define DALI_SCENE_LOADER_JSON_READER_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/third-party/json.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/common/vector-wrapper.h"
 #include <algorithm>
-#include <map>
-#include <string_view>
-#include <sstream>
 #include <cstring>
+#include <map>
 #include <memory>
+#include <sstream>
+#include <string_view>
+#include "dali/public-api/common/vector-wrapper.h"
 
 namespace json
 {
-
 /**
  * @brief Helper for freeing the memory allocated by json_parse()
  */
@@ -60,9 +59,8 @@ int StrCmp(const json_string_s& js, const std::string& s);
  * @brief Convenience function to compare json_string_s and other supported string type,
  *  in swapped order.
  */
-template <typename String>
-inline
-int StrCmp(String& s, const json_string_s& js)
+template<typename String>
+inline int StrCmp(String& s, const json_string_s& js)
 {
   return -StrCmp(js, s);
 }
@@ -77,28 +75,33 @@ namespace detail
 /**
  * @brief Compile-time type-enum mapping.
  */
-template <typename T>
+template<typename T>
 struct Type2Enum
-{};
-
-#define TYPE2ENUM(x) template<> struct Type2Enum<json_## x ##_s>\
-{\
-  enum { VALUE = json_type_## x };\
+{
 };
 
+#define TYPE2ENUM(x)             \
+  template<>                     \
+  struct Type2Enum<json_##x##_s> \
+  {                              \
+    enum                         \
+    {                            \
+      VALUE = json_type_##x      \
+    };                           \
+  };
+
 TYPE2ENUM(object)
 TYPE2ENUM(array)
 TYPE2ENUM(string)
 TYPE2ENUM(number)
 #undef TYPE2ENUM
-}
+} // namespace detail
 
 /**
  * @brief Casts the payload of a json_value_s to the given type.
  */
-template <typename Out>
-inline
-const Out& Cast(const json_value_s& j)
+template<typename Out>
+inline const Out& Cast(const json_value_s& j)
 {
   Validate(j, static_cast<json_type_e>(detail::Type2Enum<typename std::decay<Out>::type>::VALUE));
   return *static_cast<const Out*>(j.payload);
@@ -108,9 +111,8 @@ const Out& Cast(const json_value_s& j)
  * @brief Casts the payload of a json_value_s to the given type.
  * @note std::runtime_error is thrown if the value is not the given type.
  */
-template <typename Out>
-inline
-Out& Cast(json_value_s& j)
+template<typename Out>
+inline Out& Cast(json_value_s& j)
 {
   Validate(j, static_cast<json_type_e>(detail::Type2Enum<typename std::decay<Out>::type>::VALUE));
   return *static_cast<Out*>(j.payload);
@@ -129,11 +131,11 @@ struct Read
 {
   static bool Boolean(const json_value_s& j)
   {
-    if (j.type == json_type_true)
+    if(j.type == json_type_true)
     {
       return true;
     }
-    else if (j.type == json_type_false)
+    else if(j.type == json_type_false)
     {
       return false;
     }
@@ -143,25 +145,25 @@ struct Read
     }
   }
 
-  template <typename T>
+  template<typename T>
   static T Number(const json_value_s& j)
   {
-    auto& jn = Cast<const json_number_s>(j);
+    auto&             jn = Cast<const json_number_s>(j);
     std::stringstream ss;
-    for (auto i0 = jn.number, i1 = i0 + jn.number_size; i0 != i1; ++i0)
+    for(auto i0 = jn.number, i1 = i0 + jn.number_size; i0 != i1; ++i0)
     {
       ss.put(*i0);
     }
 
     T result;
-    if (ss >> result)
+    if(ss >> result)
     {
       return result;
     }
     throw std::runtime_error("Failed to convert value to number");
   }
 
-  template <typename E>
+  template<typename E>
   static E Enum(const json_value_s& j)
   {
     size_t number = Number<size_t>(j);
@@ -180,14 +182,14 @@ struct Read
     return std::string(js.string, js.string_size);
   }
 
-  template <typename T, T(*readElement)(const json_value_s&)>
+  template<typename T, T (*readElement)(const json_value_s&)>
   static std::vector<T> Array(const json_value_s& j)
   {
-    auto& ja = Cast<const json_array_s>(j);
+    auto&          ja = Cast<const json_array_s>(j);
     std::vector<T> result;
     result.reserve(ja.length);
     auto i = ja.start;
-    while (i)
+    while(i)
     {
       result.push_back(std::move(readElement(*i->value)));
       i = i->next;
@@ -204,9 +206,13 @@ struct PropertyCore
 protected:
   explicit PropertyCore(const std::string& key)
   : mKey(key)
-  {}
+  {
+  }
 
-  const std::string& GetKey() const { return mKey; }
+  const std::string& GetKey() const
+  {
+    return mKey;
+  }
 
 private:
   std::string mKey;
@@ -215,17 +221,19 @@ private:
 /**
  * @brief Base class for the properties of a type T.
  */
-template <typename T>
+template<typename T>
 struct PropertyBase : PropertyCore
 {
   using PropertyCore::GetKey;
 
   explicit PropertyBase(const std::string& key)
   : PropertyCore(key)
-  {}
+  {
+  }
 
   virtual ~PropertyBase()
-  {}
+  {
+  }
 
   virtual void Read(const json_value_s& j, T& obj) = 0;
 };
@@ -233,28 +241,31 @@ struct PropertyBase : PropertyCore
 /**
  * @brief Concrete property of an object to read into from JSON with a given function.
  */
-template <class T, typename U>
+template<class T, typename U>
 struct Property : PropertyBase<T>
 {
-  using ReadFn = U(*)(const json_value_s&);
-  using MemberPtr = U T::*;
+  using ReadFn        = U (*)(const json_value_s&);
+  using MemberPtr     = U T::*;
   using SetterArgType = typename std::conditional<sizeof(U) <= sizeof(uintptr_t), U, const U&>::type;
-  using Setter = void (T::*)(SetterArgType);
+  using Setter        = void (T::*)(SetterArgType);
 
   Property(const std::string& key, ReadFn read, MemberPtr ptr)
   : PropertyBase<T>(key),
     mRead(read),
     mAccessor(new DirectAccessor(ptr))
-  {}
+  {
+  }
 
   Property(const std::string& key, ReadFn read, Setter setter)
   : PropertyBase<T>(key),
     mRead(read),
     mAccessor(new SetterAccessor(setter))
-  {}
+  {
+  }
 
   ~Property()
-  {}
+  {
+  }
 
   void Read(const json_value_s& j, T& obj) override
   {
@@ -265,7 +276,8 @@ private:
   struct AccessorBase
   {
     virtual ~AccessorBase()
-    {}
+    {
+    }
 
     virtual void Set(U value, T& obj) const = 0;
   };
@@ -274,7 +286,8 @@ private:
   {
     DirectAccessor(MemberPtr ptr)
     : mPointer(ptr)
-    {}
+    {
+    }
 
     void Set(U value, T& obj) const override
     {
@@ -288,7 +301,8 @@ private:
   {
     SetterAccessor(Setter setter)
     : mSetter(setter)
-    {}
+    {
+    }
 
     void Set(U value, T& obj) const override
     {
@@ -298,16 +312,15 @@ private:
     Setter mSetter;
   };
 
-  ReadFn mRead;
+  ReadFn                        mRead;
   std::unique_ptr<AccessorBase> mAccessor;
 };
 
 /**
  * @brief Helper function to make a Property for a member of type U, of object of type T.
  */
-template <class T, typename U>
-Property<T, U>* MakeProperty(const std::string& key, typename Property<T, U>::ReadFn readFn,
-  U T::* ptr)
+template<class T, typename U>
+Property<T, U>* MakeProperty(const std::string& key, typename Property<T, U>::ReadFn readFn, U T::*ptr)
 {
   return new Property<T, U>(key, readFn, ptr);
 }
@@ -333,7 +346,7 @@ protected:
  * @brief Object Reader template for reading into an object of a given type,
  *  with properties registered for the various members.
  */
-template <typename T>
+template<typename T>
 class Reader : protected ReaderCore
 {
 public:
@@ -347,7 +360,7 @@ public:
 
   ~Reader()
   {
-    for (auto& p : mProperties)
+    for(auto& p : mProperties)
     {
       delete Cast(p);
     }
@@ -355,9 +368,8 @@ public:
 
   Reader<T>& Register(PropertyBase<T>& prop)
   {
-    auto iInsert = std::lower_bound(mProperties.begin(), mProperties.end(), &prop,
-      SortPredicate);
-    if (iInsert == mProperties.end() || Cast(*iInsert)->GetKey() != prop.GetKey())
+    auto iInsert = std::lower_bound(mProperties.begin(), mProperties.end(), &prop, SortPredicate);
+    if(iInsert == mProperties.end() || Cast(*iInsert)->GetKey() != prop.GetKey())
     {
       mProperties.insert(iInsert, &prop);
     }
@@ -372,14 +384,13 @@ public:
   void Read(const json_object_s& jo, T& obj) const
   {
     auto i = jo.start;
-    while (i)
+    while(i)
     {
-      auto iFind = std::lower_bound(mProperties.begin(), mProperties.end(),
-        *i->name, FindPredicate);
-      if (iFind != mProperties.end())
+      auto iFind = std::lower_bound(mProperties.begin(), mProperties.end(), *i->name, FindPredicate);
+      if(iFind != mProperties.end())
       {
         auto prop = Cast(*iFind);
-        if (0 == StrCmp(*i->name, prop->GetKey()))
+        if(0 == StrCmp(*i->name, prop->GetKey()))
         {
           prop->Read(*i->value, obj);
         }
@@ -411,29 +422,29 @@ private:
  * @brief Wraps a Reader<T> in a function usable as a Property<T>::ReadFn, i.e. to facilitate
  *  deserializing structures of nested objects.
  */
-template <typename T>
+template<typename T>
 struct ObjectReader
 {
   static const Reader<T>* sReader;
 
   static T Read(const json_value_s& j)
   {
-    T result;
+    T     result;
     auto& jo = Cast<json_object_s>(j);
     sReader->Read(jo, result);
     return result;
   }
 };
 
-template <typename T>
+template<typename T>
 const Reader<T>* ObjectReader<T>::sReader = nullptr;
 
-template <typename T>
+template<typename T>
 void SetObjectReader(const Reader<T>& r)
 {
   ObjectReader<T>::sReader = &r;
 }
 
-} // json
+} // namespace json
 
 #endif //DALI_SCENE_LOADER_JSON_READER_H_
index 64a99cd..9121bcd 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_JSON_UTIL_H_
 #define DALI_SCENE_LOADER_JSON_UTIL_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/index.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/common/vector-wrapper.h"
+#include "dali-toolkit/devel-api/builder/tree-node.h"
 #include "dali/public-api/animation/time-period.h"
-#include "dali/public-api/object/property.h"
+#include "dali/public-api/common/vector-wrapper.h"
 #include "dali/public-api/math/vector4.h"
-#include "dali-toolkit/devel-api/builder/tree-node.h"
+#include "dali/public-api/object/property.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 bool ReadBool(const Toolkit::TreeNode* node, bool& num);
 
 bool ReadInt(const Toolkit::TreeNode* node, int& num);
@@ -89,7 +88,7 @@ Property::Value ReadPropertyValue(const Property::Type& propType, const Toolkit:
  */
 Property::Value ReadPropertyValue(const Toolkit::TreeNode& tn);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_JSON_UTIL_H_
index 1a6c9ad..a524b81 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
 #define DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
-#include "dali/public-api/animation/alpha-function.h"
 #include <string>
+#include "dali/public-api/animation/alpha-function.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @return Given a name, provide a AlphaFunction; if the name was not
  *  recognised, get the default one.
@@ -39,7 +38,7 @@ AlphaFunction DALI_SCENE_LOADER_API GetAlphaFunction(const std::string& name, bo
  */
 void DALI_SCENE_LOADER_API RegisterAlphaFunction(const std::string& name, AlphaFunction alphaFn) noexcept(false);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_ALPHA_FUNCTION_HELPER_H_
index 026b68a..085b977 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
 #define DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
+#include <functional>
+#include <memory>
 #include "dali/public-api/actors/actor.h"
 #include "dali/public-api/animation/animation.h"
 #include "dali/public-api/object/property.h"
-#include <memory>
-#include <functional>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Intermediate representation for a property that's given to
  *  a Animation to animate. Since there is no getting an
@@ -78,20 +77,20 @@ public: // DATA
   struct Value
   {
     Property::Value mValue;
-    bool mIsRelative;
+    bool            mIsRelative;
   };
 
   std::string mNodeName;
   std::string mPropertyName;
 
-  KeyFrames mKeyFrames;
+  KeyFrames              mKeyFrames;
   std::unique_ptr<Value> mValue;
 
   AlphaFunction mAlphaFunction = AlphaFunction::DEFAULT;
-  TimePeriod mTimePeriod = TimePeriod(0.f);
+  TimePeriod    mTimePeriod    = TimePeriod(0.f);
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_ANIMATED_PROPERTY_H
index 41de471..ea0dcb9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
 #define DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/animated-property.h"
+#include "dali-scene-loader/public-api/api.h"
 #include "dali/public-api/common/vector-wrapper.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Animation handle + name + definition of properties.
  */
@@ -66,23 +65,23 @@ public: // METHODS
 public: // DATA
   std::string mName;
 
-  float mDuration = DEFAULT_DURATION_SECONDS;
-  int mLoopCount = 1;
+  float                mDuration         = DEFAULT_DURATION_SECONDS;
+  int                  mLoopCount        = 1;
   Animation::EndAction mDisconnectAction = Animation::BAKE_FINAL;
-  Animation::EndAction mEndAction = Animation::BAKE;
-  float mSpeedFactor = 1.f;
-  Vector2 mPlayRange = Vector2{ 0.f, 1.f };
+  Animation::EndAction mEndAction        = Animation::BAKE;
+  float                mSpeedFactor      = 1.f;
+  Vector2              mPlayRange        = Vector2{0.f, 1.f};
 
   std::vector<AnimatedProperty> mProperties;
 };
 
 struct AnimationGroupDefinition
 {
-  std::string mName;
+  std::string              mName;
   std::vector<std::string> mAnimations;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_ANIMATION_DEFINITION_H
index f5ffea0..45f4a1c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_API_H
 #define DALI_SCENE_LOADER_API_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 #elif defined(WIN32)
 #ifdef BUILDING_DALI_SCENE_LOADER
-#define DALI_SCENE_LOADER_API  __declspec(dllexport)
+#define DALI_SCENE_LOADER_API __declspec(dllexport)
 #else
-#define DALI_SCENE_LOADER_API  __declspec(dllimport)
-#endif  // BUILDING_DALI_SCENE_LOADER
+#define DALI_SCENE_LOADER_API __declspec(dllimport)
+#endif // BUILDING_DALI_SCENE_LOADER
 
 #endif
 
index 67283a8..505fc5a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
 #define DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/rendering/shader.h"
-#include "dali/public-api/actors/actor.h"
 #include <string>
+#include "dali/public-api/actors/actor.h"
+#include "dali/public-api/rendering/shader.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 struct MeshDefinition;
 struct MeshGeometry;
 
@@ -47,21 +46,21 @@ struct DALI_SCENE_LOADER_API BlendShapes
     enum
     {
       POSITIONS = 0x1,
-      NORMALS = 0x2,
-      TANGENTS = 0x4
+      NORMALS   = 0x2,
+      TANGENTS  = 0x4
     };
   };
 
   // shader properties - animatable (uniforms)
-  static const std::string NUMBER_OF_BLEND_SHAPES;  ///< Integer number of blend shapes loaded.
-  static const std::string UNNORMALIZE_FACTOR;  ///< Scalar(s) for position components of blend shapes; Version 1.0: float array (1 per blend shape); Version 2.0: single float.
-  static const std::string COMPONENT_SIZE;  ///< Integer offset from one component (positions / normals / tangents) of a blend shape to the next.
+  static const std::string NUMBER_OF_BLEND_SHAPES; ///< Integer number of blend shapes loaded.
+  static const std::string UNNORMALIZE_FACTOR;     ///< Scalar(s) for position components of blend shapes; Version 1.0: float array (1 per blend shape); Version 2.0: single float.
+  static const std::string COMPONENT_SIZE;         ///< Integer offset from one component (positions / normals / tangents) of a blend shape to the next.
 
   // shader properties - read-only (not available as uniforms)
-  static const std::string COMPONENTS;  ///< Integer bitmask of the blend shape components that the shader uses; refer to the Components enum.
+  static const std::string COMPONENTS; ///< Integer bitmask of the blend shape components that the shader uses; refer to the Components enum.
 
   // actor property (instance) - animatable (uniforms)
-  static const std::string WEIGHTS_UNIFORM;  ///< The weight of each blend shape in a float array
+  static const std::string WEIGHTS_UNIFORM; ///< The weight of each blend shape in a float array
 
   /**
    * @brief Registers properties based on the mesh definition (and geometry) and identified by the above string constants,
@@ -72,7 +71,7 @@ struct DALI_SCENE_LOADER_API BlendShapes
   BlendShapes() = delete;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_BLEND_SHAPE_DETAILS_H
index 044c7f4..06370fc 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
 #define DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -17,7 +17,7 @@
  *
  */
 
- // INTERNAL INCLUDES
+// INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/view-projection.h"
 
 
 namespace Dali
 {
-
 class CameraActor;
 
 namespace SceneLoader
 {
-
 struct DALI_SCENE_LOADER_API CameraParameters
 {
-  Matrix matrix = Matrix::IDENTITY;
-  Vector4 orthographicSize = Vector4{ -1.f, 1.f, 1.f, -1.f };
-  float yFov = 60.f;
-  float zNear = 0.1f;
-  float zFar = 1000.f;
-  bool isPerspective = true;
+  Matrix  matrix           = Matrix::IDENTITY;
+  Vector4 orthographicSize = Vector4{-1.f, 1.f, 1.f, -1.f};
+  float   yFov             = 60.f;
+  float   zNear            = 0.1f;
+  float   zFar             = 1000.f;
+  bool    isPerspective    = true;
 
   /**
    * @return The view-projection matrix of the camera.
@@ -61,7 +59,7 @@ struct DALI_SCENE_LOADER_API CameraParameters
   void ConfigureCamera(CameraActor& camera) const;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_CAMERA_PARAMETERS_H
index ff29b95..cdac2fc 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_CUSTOMIZATION_STATE_H_
 #define DALI_SCENE_LOADER_CUSTOMIZATION_STATE_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  *
  */
 
- // INTERNAL INCLUDES
+// INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/common/vector-wrapper.h"
-#include <string>
 #include <memory>
+#include <string>
+#include "dali/public-api/common/vector-wrapper.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Offers a description of an aspect of the scene that can be customized:
  *     the number of options, and the name of the nodes that are registered
@@ -37,7 +36,7 @@ namespace SceneLoader
  */
 struct DALI_SCENE_LOADER_API Customization
 {
-  using Tag = std::string;
+  using Tag        = std::string;
   using OptionType = uint32_t;
 
   /**
@@ -114,11 +113,11 @@ struct DALI_SCENE_LOADER_API Customization
 
   static const OptionType NONE = OptionType(-1);
 
-  OptionType numOptions = 0;
-  std::vector<std::string> nodes;  // to apply option to.
+  OptionType               numOptions = 0;
+  std::vector<std::string> nodes; // to apply option to.
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_CUSTOMIZATION_STATE_H_
index e09d4d0..b46a7bf 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_DLI_LOADER_H
 #define DALI_SCENE_LOADER_DLI_LOADER_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  *
  */
 
- // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
+// INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/animation-definition.h"
+#include "dali-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/customization.h"
-#include "dali-scene-loader/public-api/string-callback.h"
 #include "dali-scene-loader/public-api/index.h"
+#include "dali-scene-loader/public-api/string-callback.h"
 
 // EXTERNAL INCLUDES
 #include "dali/public-api/common/vector-wrapper.h"
@@ -46,17 +46,19 @@ class SceneDefinition;
 class DALI_SCENE_LOADER_API DliLoader
 {
 public:
-  using ConvertFontCode = void(*)(const std::string& code, std::string& fontFamily, std::string& slant, std::string& weight, float& size);
-  using ConvertColorCode = Vector4(*)(const std::string& code);
+  using ConvertFontCode  = void (*)(const std::string& code, std::string& fontFamily, std::string& slant, std::string& weight, float& size);
+  using ConvertColorCode = Vector4 (*)(const std::string& code);
 
-  using CategoryProcessor = std::function<void(Property::Array&& categoryData, StringCallback onError)>;
+  using CategoryProcessor       = std::function<void(Property::Array&& categoryData, StringCallback onError)>;
   using CategoryProcessorVector = std::vector<std::pair<std::string /*name*/, CategoryProcessor>>;
 
   using NodeProcessor = std::function<void(const NodeDefinition& nodeDef,
-    Property::Map&& nodeData, StringCallback onError)>;
+                                           Property::Map&&       nodeData,
+                                           StringCallback        onError)>;
 
   using AnimationProcessor = std::function<void(const AnimationDefinition& animDef,
-    Property::Map&& animData, StringCallback onError)>;
+                                                Property::Map&&            animData,
+                                                StringCallback             onError)>;
 
   struct InputParams
   {
@@ -105,7 +107,7 @@ public:
   struct LoadParams
   {
     InputParams const& input;
-    LoadResult& output;
+    LoadResult&        output;
   };
 
   DliLoader();
@@ -133,7 +135,7 @@ private:
   const std::unique_ptr<Impl> mImpl;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_DLI_LOADER_H
index 1b1906f..066f6fa 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H
 #define DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  *
  */
 
- // INTERNAL INCLUDES
+// INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/ktx-loader.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/rendering/texture.h"
 #include "dali/public-api/math/quaternion.h"
+#include "dali/public-api/rendering/texture.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Defines an environment map with either or both of radiance
  *  and irradiance maps.
@@ -39,7 +38,7 @@ struct DALI_SCENE_LOADER_API EnvironmentDefinition
   struct Textures
   {
     Texture mDiffuse;  // irradiance
-    Texture mSpecular;  // radiance
+    Texture mSpecular; // radiance
 
     bool IsLoaded() const
     {
@@ -54,7 +53,7 @@ struct DALI_SCENE_LOADER_API EnvironmentDefinition
   };
 
   using EnvironmentData = std::pair<EnvironmentDefinition, Textures>;
-  using Vector = std::vector<EnvironmentData>;
+  using Vector          = std::vector<EnvironmentData>;
 
   EnvironmentDefinition() = default;
 
@@ -80,11 +79,11 @@ struct DALI_SCENE_LOADER_API EnvironmentDefinition
 public: // DATA
   std::string mDiffuseMapPath;
   std::string mSpecularMapPath;
-  Quaternion mCubeOrientation = Quaternion::IDENTITY;
-  float mIblIntensity = 1.0f;
+  Quaternion  mCubeOrientation = Quaternion::IDENTITY;
+  float       mIblIntensity    = 1.0f;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_ENVIRONMENT_DEFINITION_H
index ce3ec79..9871ec0 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_GLTF2_LOADER_H
 #define DALI_SCENE_LOADER_GLTF2_LOADER_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -17,7 +17,7 @@
  *
  */
 
- // INTERNAL INCLUDES
+// INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
@@ -38,7 +38,7 @@ class ShaderDefinitionFactory;
  */
 DALI_SCENE_LOADER_API void LoadGltfScene(const std::string& url, ShaderDefinitionFactory& shaderFactory, LoadResult& params);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_GLTF2_LOADER_H
index 278f19a..9ad5fc2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_INDEX_H_
 #define DALI_SCENE_LOADER_INDEX_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -27,12 +27,11 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 using Index = uint32_t;
 
 constexpr Index INVALID_INDEX = static_cast<Index>(-1);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_INDEX_H_
index 6167fef..d94f4ca 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_KTX_LOADER_H
 #define DALI_SCENE_LOADER_KTX_LOADER_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -29,13 +29,12 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Stores the pixel data objects for each face of the cube texture and their mipmaps.
  */
 struct DALI_SCENE_LOADER_API CubeData
 {
-  std::vector< std::vector<PixelData> > data;
+  std::vector<std::vector<PixelData> > data;
 
   Texture CreateTexture() const;
 };
@@ -48,7 +47,7 @@ struct DALI_SCENE_LOADER_API CubeData
  */
 DALI_SCENE_LOADER_API bool LoadCubeMapData(const std::string& path, CubeData& cubedata);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_KTX_LOADER_H
index 0d8d514..11b014b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_LIGHT_PARAMETERS_H
 #define DALI_SCENE_LOADER_LIGHT_PARAMETERS_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
+#include <stdint.h>
 #include "dali/public-api/math/matrix.h"
 #include "dali/public-api/math/vector3.h"
-#include <stdint.h>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 struct DALI_SCENE_LOADER_API LightParameters
 {
   Matrix transform;
 
-  Vector3 color;
-  float intensity;
-  float shadowIntensity;
+  Vector3  color;
+  float    intensity;
+  float    shadowIntensity;
   uint32_t shadowMapSize;
-  float orthographicSize;
+  float    orthographicSize;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_LIGHT_PARAMETERS_H
index ca05bfd..4ed3ff5 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_OUTPUT_H
 #define DALI_SCENE_LOADER_OUTPUT_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/animation-definition.h"
-#include "dali-scene-loader/public-api/light-parameters.h"
+#include "dali-scene-loader/public-api/api.h"
 #include "dali-scene-loader/public-api/camera-parameters.h"
+#include "dali-scene-loader/public-api/light-parameters.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 class ResourceBundle;
 class SceneDefinition;
 
@@ -67,7 +66,7 @@ struct DALI_SCENE_LOADER_API LoadResult
   std::vector<LightParameters>& mLightParameters;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_OUTPUT_H
index d360c88..80e93e7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_MATERIAL_DEFINITION_H
 #define DALI_SCENE_LOADER_MATERIAL_DEFINITION_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/utils.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/math/vector4.h"
-#include "dali/public-api/common/vector-wrapper.h"
 #include <cmath>
+#include "dali/public-api/common/vector-wrapper.h"
+#include "dali/public-api/math/vector4.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Helper enum for encoding and decoding sampler states.
  */
@@ -43,54 +42,53 @@ struct DALI_SCENE_LOADER_API SamplerFlags
   enum Values : Type
   {
     // Filter - 3 bits
-    FILTER_NEAREST = 0,
-    FILTER_LINEAR = NthBit(0),
+    FILTER_NEAREST        = 0,
+    FILTER_LINEAR         = NthBit(0),
     FILTER_MIPMAP_NEAREST = NthBit(1),
-    FILTER_MIPMAP_LINEAR = NthBit(2),
+    FILTER_MIPMAP_LINEAR  = NthBit(2),
 
     // Wrap - 2 bits
     WRAP_REPEAT = 0,
-    WRAP_CLAMP = NthBit(0),
+    WRAP_CLAMP  = NthBit(0),
     WRAP_MIRROR = NthBit(1),
 
     // Layout - apply shift, then mask
     FILTER_MIN_BITS = 3,
     FILTER_MIN_MASK = NthBit(FILTER_MIN_BITS) - 1,
 
-    FILTER_MAG_BITS = 1,
+    FILTER_MAG_BITS  = 1,
     FILTER_MAG_SHIFT = FILTER_MIN_BITS,
-    FILTER_MAG_MASK = NthBit(FILTER_MAG_BITS) - 1,
+    FILTER_MAG_MASK  = NthBit(FILTER_MAG_BITS) - 1,
 
-    WRAP_S_BITS = 2,
+    WRAP_S_BITS  = 2,
     WRAP_S_SHIFT = FILTER_MAG_SHIFT + FILTER_MAG_BITS,
-    WRAP_S_MASK = NthBit(WRAP_S_BITS) - 1,
+    WRAP_S_MASK  = NthBit(WRAP_S_BITS) - 1,
 
-    WRAP_T_BITS = 2,
+    WRAP_T_BITS  = 2,
     WRAP_T_SHIFT = WRAP_S_SHIFT + WRAP_S_BITS,
-    WRAP_T_MASK = NthBit(WRAP_T_BITS) - 1,
+    WRAP_T_MASK  = NthBit(WRAP_T_BITS) - 1,
 
     // Diagnostics
     MIPMAP_MASK = FILTER_MIPMAP_LINEAR | FILTER_MIPMAP_NEAREST,
 
     // Default
-    DEFAULT = FILTER_LINEAR | (FILTER_LINEAR << FILTER_MAG_SHIFT) | (WRAP_REPEAT << WRAP_S_SHIFT) | (WRAP_REPEAT << WRAP_T_SHIFT),  // LINEAR filters, REPEAT wraps
+    DEFAULT = FILTER_LINEAR | (FILTER_LINEAR << FILTER_MAG_SHIFT) | (WRAP_REPEAT << WRAP_S_SHIFT) | (WRAP_REPEAT << WRAP_T_SHIFT), // LINEAR filters, REPEAT wraps
   };
 
   /**
    * @return SamplerFlags bit pattern calculated from the given Dali Sampler settings.
    */
-  static Type Encode(FilterMode::Type minFilter, FilterMode::Type magFilter,
-    WrapMode::Type wrapS, WrapMode::Type wrapT);
+  static Type Encode(FilterMode::Type minFilter, FilterMode::Type magFilter, WrapMode::Type wrapS, WrapMode::Type wrapT);
 
   /**
    * @brief Decodes the minification filter patter of @a flags into the corresponding FilterMode.
    */
-  static FilterMode::Type  GetMinFilter(Type flags);
+  static FilterMode::Type GetMinFilter(Type flags);
 
   /**
    * @brief Decodes the magnification filter patter of @a flags into the corresponding FilterMode.
    */
-  static FilterMode::Type  GetMagFilter(Type flags);
+  static FilterMode::Type GetMagFilter(Type flags);
 
   /**
    * @brief Decodes the horizontal wrap pattern of @a flags into the corresponding WrapMode.
@@ -113,7 +111,7 @@ struct DALI_SCENE_LOADER_API SamplerFlags
  */
 struct DALI_SCENE_LOADER_API TextureDefinition
 {
-  std::string mImageUri;
+  std::string        mImageUri;
   SamplerFlags::Type mSamplerFlags;
 
   TextureDefinition(const std::string& imageUri = "", SamplerFlags::Type samplerFlags = SamplerFlags::DEFAULT);
@@ -130,22 +128,22 @@ struct DALI_SCENE_LOADER_API MaterialDefinition
   enum Flags : uint32_t
   {
     // Texture semantics
-    ALBEDO = NthBit(0),
-    METALLIC = NthBit(1),
-    ROUGHNESS = NthBit(2),
-    NORMAL = NthBit(3),
-    EMISSIVE = NthBit(4),  // TODO: support
-    OCCLUSION = NthBit(5),  // TODO: support
-    SUBSURFACE = NthBit(6),  // Note: dli-only
+    ALBEDO     = NthBit(0),
+    METALLIC   = NthBit(1),
+    ROUGHNESS  = NthBit(2),
+    NORMAL     = NthBit(3),
+    EMISSIVE   = NthBit(4), // TODO: support
+    OCCLUSION  = NthBit(5), // TODO: support
+    SUBSURFACE = NthBit(6), // Note: dli-only
 
     // Other binary options
-    TRANSPARENCY = NthBit(20),
-    GLTF_CHANNELS = NthBit(21),  // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#pbrmetallicroughnessmetallicroughnesstexture
+    TRANSPARENCY  = NthBit(20),
+    GLTF_CHANNELS = NthBit(21), // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#pbrmetallicroughnessmetallicroughnesstexture
 
     // Alpha cutoff - reserved from the 24th bit
-    ALPHA_CUTOFF_BITS = 8,
+    ALPHA_CUTOFF_BITS  = 8,
     ALPHA_CUTOFF_SHIFT = sizeof(uint32_t) * 8 - ALPHA_CUTOFF_BITS,
-    ALPHA_CUTOFF_MASK = (1 << ALPHA_CUTOFF_BITS) - 1,
+    ALPHA_CUTOFF_MASK  = (1 << ALPHA_CUTOFF_BITS) - 1,
   };
 
   /**
@@ -153,7 +151,7 @@ struct DALI_SCENE_LOADER_API MaterialDefinition
    */
   struct TextureStage
   {
-    uint32_t mSemantic;
+    uint32_t          mSemantic;
     TextureDefinition mTexture;
   };
 
@@ -163,7 +161,7 @@ struct DALI_SCENE_LOADER_API MaterialDefinition
   {
     struct TextureData
     {
-      PixelData mPixels;
+      PixelData          mPixels;
       SamplerFlags::Type mSamplerFlags;
     };
 
@@ -221,14 +219,14 @@ struct DALI_SCENE_LOADER_API MaterialDefinition
 public: // DATA
   uint32_t mFlags = 0x0;
 
-  Index mEnvironmentIdx = 0;
-  Vector4 mColor = Color::WHITE;
-  float mMetallic = 1.f;
-  float mRoughness = 1.f;
+  Index                     mEnvironmentIdx = 0;
+  Vector4                   mColor          = Color::WHITE;
+  float                     mMetallic       = 1.f;
+  float                     mRoughness      = 1.f;
   std::vector<TextureStage> mTextureStages;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_MATERIAL_DEFINITION_H
index f764da1..5c5c923 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_MATRIX_STACK_H_
 #define DALI_SCENE_LOADER_MATRIX_STACK_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/math/matrix.h"
 #include "dali/public-api/common/vector-wrapper.h"
+#include "dali/public-api/math/matrix.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief A stack of matrices whereby each newly pushed matrix is stored
  *  after being multiplied by the previous one (if any).
@@ -39,17 +38,17 @@ class DALI_SCENE_LOADER_API MatrixStack
 public:
   MatrixStack();
 
-  bool IsEmpty() const;
-  void Push(const Matrix& model);
+  bool          IsEmpty() const;
+  void          Push(const Matrix& model);
   const Matrix& Top() const;
-  void Pop();
-  void PopAll();  // clears the stack, but retains the storage.
+  void          Pop();
+  void          PopAll(); // clears the stack, but retains the storage.
 
 private:
   std::vector<Matrix> mStack;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_MATRIX_STACK_H_
index 057aad7..cd0ddc9 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_MESH_DEFINITION_H
 #define DALI_SCENE_LOADER_MESH_DEFINITION_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 // INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/api.h"
-#include "dali-scene-loader/public-api/mesh-geometry.h"
 #include "dali-scene-loader/public-api/blend-shape-details.h"
-#include "dali-scene-loader/public-api/utils.h"
 #include "dali-scene-loader/public-api/index.h"
+#include "dali-scene-loader/public-api/mesh-geometry.h"
+#include "dali-scene-loader/public-api/utils.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/common/vector-wrapper.h"
 #include <memory>
+#include "dali/public-api/common/vector-wrapper.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Defines a mesh with its attributes, the primitive type to render it as,
  *  and the file to load it from with the offset and length information for the
@@ -42,25 +41,28 @@ struct DALI_SCENE_LOADER_API MeshDefinition
 {
   using Vector = std::vector<std::pair<MeshDefinition, MeshGeometry>>;
 
-  enum : uint32_t { INVALID = std::numeric_limits<uint32_t>::max() };
+  enum : uint32_t
+  {
+    INVALID = std::numeric_limits<uint32_t>::max()
+  };
 
   enum Flags : uint16_t
   {
     FLIP_UVS_VERTICAL = NthBit(0),
-    U32_INDICES = NthBit(1),  // default is unsigned short
-    U16_JOINT_IDS = NthBit(2), // default is floats
+    U32_INDICES       = NthBit(1), // default is unsigned short
+    U16_JOINT_IDS     = NthBit(2), // default is floats
   };
 
   enum Attributes
   {
-    INDICES = NthBit(0),
-    POSITIONS = NthBit(1),
-    NORMALS = NthBit(2),
-    TEX_COORDS = NthBit(3),
-    TANGENTS = NthBit(4),
-    LEGACY_BITANGENTS = NthBit(5),  // these are ignored; we're calculating them in the (PBR) shader.
-    JOINTS_0 = NthBit(6),
-    WEIGHTS_0 = NthBit(7),
+    INDICES           = NthBit(0),
+    POSITIONS         = NthBit(1),
+    NORMALS           = NthBit(2),
+    TEX_COORDS        = NthBit(3),
+    TANGENTS          = NthBit(4),
+    LEGACY_BITANGENTS = NthBit(5), // these are ignored; we're calculating them in the (PBR) shader.
+    JOINTS_0          = NthBit(6),
+    WEIGHTS_0         = NthBit(7),
   };
 
   /**
@@ -69,10 +71,10 @@ struct DALI_SCENE_LOADER_API MeshDefinition
    */
   struct Blob
   {
-    uint32_t mOffset = INVALID;  // the default means that the blob is undefined.
-    uint32_t mLength = 0;  // if the blob is undefined, its data may still be generated. This is enabled by setting length to some non-0 value. Refer to MeshDefinition for details.
-    uint16_t mStride = 0;  // ignore if 0
-    uint16_t mElementSizeHint = 0;  // ignore if 0 or stride == 0
+    uint32_t           mOffset          = INVALID; // the default means that the blob is undefined.
+    uint32_t           mLength          = 0;       // if the blob is undefined, its data may still be generated. This is enabled by setting length to some non-0 value. Refer to MeshDefinition for details.
+    uint16_t           mStride          = 0;       // ignore if 0
+    uint16_t           mElementSizeHint = 0;       // ignore if 0 or stride == 0
     std::vector<float> mMin;
     std::vector<float> mMax;
 
@@ -80,8 +82,7 @@ struct DALI_SCENE_LOADER_API MeshDefinition
 
     Blob() = default;
 
-    Blob(uint32_t offset, uint32_t length, uint16_t stride = 0, uint16_t elementSizeHint = 0,
-      const std::vector<float>& min = {}, const std::vector<float>& max = {});
+    Blob(uint32_t offset, uint32_t length, uint16_t stride = 0, uint16_t elementSizeHint = 0, const std::vector<float>& min = {}, const std::vector<float>& max = {});
 
     /**
      * @brief Calculates the size of a tightly-packed buffer for the elements from the blob.
@@ -122,14 +123,14 @@ struct DALI_SCENE_LOADER_API MeshDefinition
 
     SparseBlob(const Blob& indices, const Blob& values, uint32_t count);
 
-    Blob mIndices;
-    Blob mValues;
+    Blob     mIndices;
+    Blob     mValues;
     uint32_t mCount = 0u;
   };
 
   struct Accessor
   {
-    Blob mBlob;
+    Blob                        mBlob;
     std::unique_ptr<SparseBlob> mSparse;
 
     Accessor() = default;
@@ -140,8 +141,8 @@ struct DALI_SCENE_LOADER_API MeshDefinition
     Accessor(Accessor&&) = default;
     Accessor& operator=(Accessor&&) = default;
 
-    Accessor(const MeshDefinition::Blob& blob,
-      const MeshDefinition::SparseBlob& sparse);
+    Accessor(const MeshDefinition::Blob&       blob,
+             const MeshDefinition::SparseBlob& sparse);
 
     bool IsDefined() const
     {
@@ -155,30 +156,30 @@ struct DALI_SCENE_LOADER_API MeshDefinition
   struct BlendShape
   {
     std::string name;
-    Accessor deltas;
-    Accessor normals;
-    Accessor tangents;
-    float weight = 0.f;
+    Accessor    deltas;
+    Accessor    normals;
+    Accessor    tangents;
+    float       weight = 0.f;
   };
 
   struct RawData
   {
     struct Attrib
     {
-      std::string mName;
-      Property::Type mType;
-      uint32_t mNumElements;
+      std::string          mName;
+      Property::Type       mType;
+      uint32_t             mNumElements;
       std::vector<uint8_t> mData;
 
       void AttachBuffer(Geometry& g) const;
     };
 
     std::vector<uint16_t> mIndices;
-    std::vector<Attrib> mAttribs;
+    std::vector<Attrib>   mAttribs;
 
-    unsigned int mBlendShapeBufferOffset;
+    unsigned int        mBlendShapeBufferOffset;
     Dali::Vector<float> mBlendShapeUnnormalizeFactor;
-    PixelData mBlendShapeData;
+    PixelData           mBlendShapeData;
   };
 
   MeshDefinition() = default;
@@ -235,25 +236,25 @@ struct DALI_SCENE_LOADER_API MeshDefinition
   MeshGeometry Load(RawData&& raw) const;
 
 public: // DATA
-  uint32_t mFlags = 0x0;
+  uint32_t       mFlags         = 0x0;
   Geometry::Type mPrimitiveType = Geometry::TRIANGLES;
-  std::string mUri;
-  Accessor mIndices;
-  Accessor mPositions;
-  Accessor mNormals;  // data can be generated based on positions
-  Accessor mTexCoords;
-  Accessor mTangents;  // data can be generated based on normals and texCoords (the latter isn't mandatory; the results will be better if available)
-  Accessor mJoints0;
-  Accessor mWeights0;
-
-  Blob mBlendShapeHeader;
+  std::string    mUri;
+  Accessor       mIndices;
+  Accessor       mPositions;
+  Accessor       mNormals; // data can be generated based on positions
+  Accessor       mTexCoords;
+  Accessor       mTangents; // data can be generated based on normals and texCoords (the latter isn't mandatory; the results will be better if available)
+  Accessor       mJoints0;
+  Accessor       mWeights0;
+
+  Blob                    mBlendShapeHeader;
   std::vector<BlendShape> mBlendShapes;
-  BlendShapes::Version mBlendShapeVersion = BlendShapes::Version::INVALID;
+  BlendShapes::Version    mBlendShapeVersion = BlendShapes::Version::INVALID;
 
   Index mSkeletonIdx = INVALID_INDEX;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_MESH_DEFINITION_H
index bf282da..026e9a7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_MESH_GEOMETRY_H
 #define DALI_SCENE_LOADER_MESH_GEOMETRY_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -28,16 +28,15 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 struct DALI_SCENE_LOADER_API MeshGeometry
 {
-  Geometry geometry;                         ///< The array of vertices.
-  Texture blendShapeGeometry;                ///< The array of vertices of the different blend shapes encoded inside a texture with power of two dimensions.
+  Geometry      geometry;                    ///< The array of vertices.
+  Texture       blendShapeGeometry;          ///< The array of vertices of the different blend shapes encoded inside a texture with power of two dimensions.
   Vector<float> blendShapeUnnormalizeFactor; ///< Factor used to unnormalize the geometry of the blend shape.
-  unsigned int blendShapeBufferOffset;             ///< Offset used to calculate the start of each blend shape.
+  unsigned int  blendShapeBufferOffset;      ///< Offset used to calculate the start of each blend shape.
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_MESH_GEOMETRY_H
index 3dec499..b496cf7 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_NODE_DEFINITION_H_
 #define DALI_SCENE_LOADER_NODE_DEFINITION_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/resource-bundle.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/math/quaternion.h"
+#include <functional>
+#include <memory>
+#include <string>
+#include "dali/public-api/actors/actor.h"
 #include "dali/public-api/math/matrix.h"
+#include "dali/public-api/math/quaternion.h"
 #include "dali/public-api/math/vector4.h"
-#include "dali/public-api/actors/actor.h"
-#include <string>
-#include <memory>
-#include <functional>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 class ViewProjection;
 
 /**
@@ -70,7 +69,7 @@ public:
 struct DALI_SCENE_LOADER_API ConstraintDefinition
 {
   std::string mProperty;  ///< name of the property to constrain.
-  Index mSourceIdx;  ///< index of the node to serve as the source of the constraint.
+  Index       mSourceIdx; ///< index of the node to serve as the source of the constraint.
 
   bool operator<(const ConstraintDefinition& other) const
   {
@@ -90,7 +89,7 @@ struct DALI_SCENE_LOADER_API ConstraintDefinition
 
 struct DALI_SCENE_LOADER_API Transforms
 {
-  MatrixStack modelStack;
+  MatrixStack           modelStack;
   const ViewProjection& viewProjection;
 };
 
@@ -100,7 +99,7 @@ struct DALI_SCENE_LOADER_API Transforms
  */
 struct DALI_SCENE_LOADER_API SkinningShaderConfigurationRequest
 {
-  Index mSkeletonIdx;
+  Index  mSkeletonIdx;
   Shader mShader;
 
   bool operator<(const SkinningShaderConfigurationRequest& other) const
@@ -115,8 +114,8 @@ struct DALI_SCENE_LOADER_API SkinningShaderConfigurationRequest
 struct DALI_SCENE_LOADER_API BlendshapeShaderConfigurationRequest
 {
   std::string mNodeName;
-  Index mMeshIdx;
-  Shader mShader;
+  Index       mMeshIdx;
+  Shader      mShader;
 
   bool operator<(const BlendshapeShaderConfigurationRequest& other) const
   {
@@ -129,8 +128,8 @@ struct DALI_SCENE_LOADER_API BlendshapeShaderConfigurationRequest
  */
 struct DALI_SCENE_LOADER_API ConstraintRequest
 {
-  const ConstraintDefinition* const mConstraint;  ///< Definition of the constraint to create.
-  Actor mTarget;  ///< Target of the constraint.
+  const ConstraintDefinition* const mConstraint; ///< Definition of the constraint to create.
+  Actor                             mTarget;     ///< Target of the constraint.
 };
 
 /**
@@ -140,18 +139,18 @@ struct DALI_SCENE_LOADER_API ConstraintRequest
  */
 struct DALI_SCENE_LOADER_API NodeDefinition
 {
-public:  // TYPES
+public: // TYPES
   using Vector = std::vector<NodeDefinition>;
 
   struct CreateParams
   {
   public: // input
     const ResourceBundle& mResources;
-    Transforms& mXforms;
+    Transforms&           mXforms;
 
   public: // output
-    std::vector<ConstraintRequest> mConstrainables;
-    std::vector<SkinningShaderConfigurationRequest> mSkinnables;
+    std::vector<ConstraintRequest>                    mConstrainables;
+    std::vector<SkinningShaderConfigurationRequest>   mSkinnables;
     std::vector<BlendshapeShaderConfigurationRequest> mBlendshapeRequests;
   };
 
@@ -176,14 +175,14 @@ public:  // TYPES
     {
       auto choice = choices.Get(mTag);
       return std::min(choice != Customization::NONE ? choice : 0,
-        static_cast<Index>(node.mChildren.size() - 1));
+                      static_cast<Index>(node.mChildren.size() - 1));
     }
   };
 
   class IVisitor
   {
   public:
-    virtual void Start(NodeDefinition& n) = 0;
+    virtual void Start(NodeDefinition& n)  = 0;
     virtual void Finish(NodeDefinition& n) = 0;
 
   protected:
@@ -193,7 +192,7 @@ public:  // TYPES
   class IConstVisitor
   {
   public:
-    virtual void Start(const NodeDefinition& n) = 0;
+    virtual void Start(const NodeDefinition& n)  = 0;
     virtual void Finish(const NodeDefinition& n) = 0;
 
   protected:
@@ -202,7 +201,7 @@ public:  // TYPES
 
   struct Extra
   {
-    std::string mKey;
+    std::string     mKey;
     Property::Value mValue;
 
     bool operator<(const Extra& other) const
@@ -211,7 +210,7 @@ public:  // TYPES
     }
   };
 
-public:  // METHODS
+public: // METHODS
   /**
    * @brief Creates a DALi Actor from this definition only.
    * @note Not recursive.
@@ -225,28 +224,28 @@ public: // DATA
 
   std::string mName;
 
-  Vector3 mPosition = Vector3::ZERO;
+  Vector3    mPosition    = Vector3::ZERO;
   Quaternion mOrientation = Quaternion::IDENTITY;
-  Vector3 mScale = Vector3::ONE;
-  Vector3 mSize = Vector3::ONE;
+  Vector3    mScale       = Vector3::ONE;
+  Vector3    mSize        = Vector3::ONE;
 
   bool mIsVisible = true;
 
-  std::unique_ptr<Renderable> mRenderable;
+  std::unique_ptr<Renderable>              mRenderable;
   std::unique_ptr<CustomizationDefinition> mCustomization;
-  std::vector<Extra> mExtras;
-  std::vector<ConstraintDefinition> mConstraints;
+  std::vector<Extra>                       mExtras;
+  std::vector<ConstraintDefinition>        mConstraints;
 
   std::vector<Index> mChildren;
-  Index mParentIdx = INVALID_INDEX;
+  Index              mParentIdx = INVALID_INDEX;
 };
 
 class DALI_SCENE_LOADER_API ModelNode : public NodeDefinition::Renderable
 {
 public: // DATA
-  Vector4 mColor = Color::WHITE;
-  Index mMeshIdx = INVALID_INDEX;
-  Index mMaterialIdx = INVALID_INDEX;
+  Vector4 mColor       = Color::WHITE;
+  Index   mMeshIdx     = INVALID_INDEX;
+  Index   mMaterialIdx = INVALID_INDEX;
 
 public: // METHODS
   void RegisterResources(IResourceReceiver& receiver) const override;
@@ -260,11 +259,11 @@ public: // METHODS
 class DALI_SCENE_LOADER_API ArcNode : public ModelNode
 {
 public: // DATA
-  bool mAntiAliasing = true;
-  int mArcCaps = 0;
+  bool  mAntiAliasing      = true;
+  int   mArcCaps           = 0;
   float mStartAngleDegrees = .0f;
-  float mEndAngleDegrees = .0f;
-  float mRadius = .0f;
+  float mEndAngleDegrees   = .0f;
+  float mRadius            = .0f;
 
 public: // METHODS
   static void GetEndVectorWithDiffAngle(float startAngle, float endAngle, Vector2& endVector);
@@ -272,7 +271,7 @@ public: // METHODS
   void OnCreate(const NodeDefinition& node, NodeDefinition::CreateParams& params, Actor& actor) const override;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_NODE_DEFINITION_H_
index 97792aa..38103d0 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_INTERPRET_RENDERER_STATE_H
 #define DALI_SCENE_LOADER_INTERPRET_RENDERER_STATE_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -26,7 +26,6 @@ namespace SceneLoader
 {
 namespace RendererState
 {
-
 /*
  * @brief Attempts to interpret a string for renderer states, which can be a combination of the following
  *  (using '|' as a delimiter, if multiple specified):<br/>
@@ -42,8 +41,8 @@ namespace RendererState
  */
 DALI_SCENE_LOADER_API Type Parse(const char* string, size_t length = 0, StringCallback onError = DefaultErrorCallback);
 
-}
-}
-}
+} // namespace RendererState
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_INTERPRET_RENDERER_STATE_H
index dc1bf63..f70100a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_RENDERER_STATE_H
 #define DALI_SCENE_LOADER_RENDERER_STATE_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -27,7 +27,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief Contains values for comparison functions used in depth and stencil testing.
  * @note Relative order of members must match DepthFunction::Type and StencilFunction::Type.
@@ -36,7 +35,7 @@ struct DALI_SCENE_LOADER_API Comparison
 {
   enum Type
   {
-    OMIT,  // not specified; will not be set.
+    OMIT, // not specified; will not be set.
     NEVER,
     ALWAYS,
     LESS,
@@ -58,13 +57,13 @@ struct DALI_SCENE_LOADER_API BlendFactor
 {
   enum Type
   {
-    OMIT,  // not specified - will not be updated
+    OMIT, // not specified - will not be updated
     ZERO,
-    ONE,  // default for source alpha
+    ONE, // default for source alpha
     SRC_COLOR,
     ONE_MINUS_SRC_COLOR,
-    SRC_ALPHA,  // default for source RGB
-    ONE_MINUS_SRC_ALPHA,  // default for destination RGB and destination alpha
+    SRC_ALPHA,           // default for source RGB
+    ONE_MINUS_SRC_ALPHA, // default for destination RGB and destination alpha
     DST_ALPHA,
     ONE_MINUS_DST_ALPHA,
     DST_COLOR,
@@ -87,12 +86,12 @@ struct DALI_SCENE_LOADER_API BufferMode
 {
   enum Type
   {
-    OMIT,  ///< not specified - will not be updated
-    NONE,  ///< Don’t write to either color or stencil buffer (But will potentially render to depth buffer).
-    AUTO,  ///< Writes are managed by the Actor Clipping API. This is DALi's default.
-    COLOR,  ///< Ignore stencil properties.  Write to the color buffer.
-    STENCIL,  ///< Use the stencil properties. Do not write to the color buffer.
-    COLOR_STENCIL  ///< Use the stencil properties AND Write to the color buffer.
+    OMIT,         ///< not specified - will not be updated
+    NONE,         ///< Don’t write to either color or stencil buffer (But will potentially render to depth buffer).
+    AUTO,         ///< Writes are managed by the Actor Clipping API. This is DALi's default.
+    COLOR,        ///< Ignore stencil properties.  Write to the color buffer.
+    STENCIL,      ///< Use the stencil properties. Do not write to the color buffer.
+    COLOR_STENCIL ///< Use the stencil properties AND Write to the color buffer.
   };
 
   BufferMode() = delete;
@@ -103,36 +102,35 @@ struct DALI_SCENE_LOADER_API BufferMode
  */
 namespace RendererState
 {
-
-using Type = uint32_t;  // 8 bits reserved for flags, 4 * 4 bit for blend factors, 4 bits for depth function
+using Type = uint32_t; // 8 bits reserved for flags, 4 * 4 bit for blend factors, 4 bits for depth function
 
 enum DALI_SCENE_LOADER_API Value : Type
 {
   NONE = 0x0,
 
   DEPTH_WRITE = 0x01,
-  DEPTH_TEST = 0x02,
+  DEPTH_TEST  = 0x02,
 
   CULL_FRONT = 0x04,
-  CULL_BACK = 0x08,
+  CULL_BACK  = 0x08,
 
   ALPHA_BLEND = 0x10,
 
   DEPTH_FUNCTION_SHIFT = 6,
-  DEPTH_FUNCTION_BITS = 4,
-  DEPTH_FUNCTION_MASK = ((1 << DEPTH_FUNCTION_BITS) - 1) << DEPTH_FUNCTION_SHIFT,
+  DEPTH_FUNCTION_BITS  = 4,
+  DEPTH_FUNCTION_MASK  = ((1 << DEPTH_FUNCTION_BITS) - 1) << DEPTH_FUNCTION_SHIFT,
 
   BLEND_FACTOR_BASE_SHIFT = DEPTH_FUNCTION_SHIFT + DEPTH_FUNCTION_BITS,
-  BLEND_FACTOR_ITEM_BITS = 4,
-  BLEND_FACTOR_ITEMS = 4,
-  BLEND_FACTOR_BITS = BLEND_FACTOR_ITEM_BITS * BLEND_FACTOR_ITEMS,
-  BLEND_FACTOR_MASK = ((1 << BLEND_FACTOR_BITS) - 1) << BLEND_FACTOR_BASE_SHIFT,
-  BLEND_FACTOR_ITEM_MASK = (1 << BLEND_FACTOR_ITEM_BITS) - 1,  // after rshifting by BLEND_FACTOR_BASE_SHIFT
+  BLEND_FACTOR_ITEM_BITS  = 4,
+  BLEND_FACTOR_ITEMS      = 4,
+  BLEND_FACTOR_BITS       = BLEND_FACTOR_ITEM_BITS * BLEND_FACTOR_ITEMS,
+  BLEND_FACTOR_MASK       = ((1 << BLEND_FACTOR_BITS) - 1) << BLEND_FACTOR_BASE_SHIFT,
+  BLEND_FACTOR_ITEM_MASK  = (1 << BLEND_FACTOR_ITEM_BITS) - 1, // after rshifting by BLEND_FACTOR_BASE_SHIFT
 
   // Buffer mode is DALi's RenderMode, just to avoid too much conflation.
-  BUFFER_MODE_BITS = 3u,
-  BUFFER_MODE_SHIFT = 32u - BUFFER_MODE_BITS,  // from end
-  BUFFER_MODE_MASK = ((1u << BUFFER_MODE_BITS) - 1u) << BUFFER_MODE_SHIFT,
+  BUFFER_MODE_BITS  = 3u,
+  BUFFER_MODE_SHIFT = 32u - BUFFER_MODE_BITS, // from end
+  BUFFER_MODE_MASK  = ((1u << BUFFER_MODE_BITS) - 1u) << BUFFER_MODE_SHIFT,
 
   DEFAULT = DEPTH_WRITE | DEPTH_TEST | CULL_BACK | (Comparison::LESS_EQUAL << DEPTH_FUNCTION_SHIFT),
 };
@@ -141,12 +139,11 @@ enum DALI_SCENE_LOADER_API Value : Type
  * @brief Encodes the given blend factors into a RenderMode value, maskable into other options,
  *  passable into ApplyRenderMode().
  */
-inline
-DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcRgb, BlendFactor::Type destRgb,
-  BlendFactor::Type srcAlpha, BlendFactor::Type destAlpha)
+inline DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcRgb, BlendFactor::Type destRgb, BlendFactor::Type srcAlpha, BlendFactor::Type destAlpha)
 {
   return (srcRgb | (destRgb << BLEND_FACTOR_ITEM_BITS) | (srcAlpha << (BLEND_FACTOR_ITEM_BITS * 2)) |
-    (destAlpha << (BLEND_FACTOR_ITEM_BITS * 3))) << BLEND_FACTOR_BASE_SHIFT;
+          (destAlpha << (BLEND_FACTOR_ITEM_BITS * 3)))
+         << BLEND_FACTOR_BASE_SHIFT;
 }
 
 /*
@@ -157,9 +154,9 @@ DALI_SCENE_LOADER_API constexpr uint32_t FromBlendFactors(BlendFactor::Type srcR
  */
 DALI_SCENE_LOADER_API void Apply(Type rendererState, Renderer& renderer);
 
-} // RendererState
+} // namespace RendererState
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_RENDERER_STATE_H
index 16860ec..b1e0936 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_RESOURCE_BUNDLE_H_
 #define DALI_SCENE_LOADER_RESOURCE_BUNDLE_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // INTERNAL
-#include "dali-scene-loader/public-api/mesh-definition.h"
-#include "dali-scene-loader/public-api/material-definition.h"
 #include "dali-scene-loader/public-api/environment-definition.h"
+#include "dali-scene-loader/public-api/material-definition.h"
+#include "dali-scene-loader/public-api/mesh-definition.h"
 #include "dali-scene-loader/public-api/shader-definition.h"
 #include "dali-scene-loader/public-api/skeleton-definition.h"
 
 // EXTERNAL
+#include <functional>
+#include <memory>
 #include "dali/public-api/common/vector-wrapper.h"
 #include "dali/public-api/rendering/shader.h"
 #include "dali/public-api/rendering/texture-set.h"
-#include <memory>
-#include <functional>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief The types of resources that .dli may define.
  */
@@ -73,9 +72,9 @@ public:
 
     enum Value : Type
     {
-      None = 0,
-      ForceReload = NthBit(0),  ///< Load resources [again] even if they were already loaded.
-      KeepUnused = NthBit(1)  ///<s Don't reset handles to resources that had a 0 reference count.
+      None        = 0,
+      ForceReload = NthBit(0), ///< Load resources [again] even if they were already loaded.
+      KeepUnused  = NthBit(1)  ///<s Don't reset handles to resources that had a 0 reference count.
     };
   };
 
@@ -111,19 +110,19 @@ public:
    *  UNLESS the KeepUnused option was specified.
    */
   void LoadResources(const ResourceRefCounts& refCounts,
-    PathProvider pathProvider,
-    Options::Type options = Options::None);
+                     PathProvider             pathProvider,
+                     Options::Type            options = Options::None);
 
 public: // DATA
   EnvironmentDefinition::Vector mEnvironmentMaps;
-  ShaderDefinition::Vector mShaders;
-  MeshDefinition::Vector mMeshes;
-  MaterialDefinition::Vector mMaterials;
+  ShaderDefinition::Vector      mShaders;
+  MeshDefinition::Vector        mMeshes;
+  MaterialDefinition::Vector    mMaterials;
 
   SkeletonDefinition::Vector mSkeletons;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_RESOURCE_BUNDLE_H_
index 66ea758..192d8d4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_SCENE_DEFINITION_H_
 #define DALI_SCENE_LOADER_SCENE_DEFINITION_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 // INTERNAL INCLUDES
 #include "dali-scene-loader/public-api/customization.h"
-#include "dali-scene-loader/public-api/utils.h"
 #include "dali-scene-loader/public-api/node-definition.h"
 #include "dali-scene-loader/public-api/string-callback.h"
+#include "dali-scene-loader/public-api/utils.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/math/quaternion.h"
+#include <memory>
+#include <string>
+#include "dali/public-api/actors/actor.h"
 #include "dali/public-api/math/matrix.h"
+#include "dali/public-api/math/quaternion.h"
 #include "dali/public-api/math/vector4.h"
-#include "dali/public-api/actors/actor.h"
-#include <string>
-#include <memory>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 class MatrixStack;
 
 /*
@@ -44,9 +43,9 @@ class MatrixStack;
  */
 class DALI_SCENE_LOADER_API SceneDefinition
 {
-public:  // TYPES
-  using NodePredicate = std::function<bool(const NodeDefinition&)>;
-  using NodeConsumer = std::function<void(NodeDefinition&)>;
+public: // TYPES
+  using NodePredicate     = std::function<bool(const NodeDefinition&)>;
+  using NodeConsumer      = std::function<void(NodeDefinition&)>;
   using ConstNodeConsumer = std::function<void(const NodeDefinition&)>;
 
 public: // METHODS
@@ -112,8 +111,7 @@ public: // METHODS
    *  from node definitions.
    * @return Handle to the root actor.
    */
-  Actor CreateNodes(Index iNode, const Customization::Choices& choices,
-    NodeDefinition::CreateParams& params) const;
+  Actor CreateNodes(Index iNode, const Customization::Choices& choices, NodeDefinition::CreateParams& params) const;
 
   /*
    * @brief Creates / update a registry of mappings from customization tags to
@@ -123,8 +121,8 @@ public: // METHODS
    *  choice of 0.
    */
   void GetCustomizationOptions(const Customization::Choices& choices,
-    Customization::Map& outCustomizationOptions,
-    Customization::Choices* outMissingChoices) const;
+                               Customization::Map&           outCustomizationOptions,
+                               Customization::Choices*       outMissingChoices) const;
 
   /*
    * @brief Attempts to add @a nodeDef to the end of nodes, and its index to the end of
@@ -198,9 +196,9 @@ public: // METHODS
   /*
    * @brief Applies constraints from the given requests.
    */
-  void ApplyConstraints(Actor& root,
-    std::vector<ConstraintRequest>&& constrainables,
-    StringCallback onError = DefaultErrorCallback) const;
+  void ApplyConstraints(Actor&                           root,
+                        std::vector<ConstraintRequest>&& constrainables,
+                        StringCallback                   onError = DefaultErrorCallback) const;
 
   /*
    * @brief Sets up joint matrix properties and constraints on actors that are involved in skeletal
@@ -239,8 +237,9 @@ public: // METHODS
    *   of separate instances need to be declared in the .dli to avoid clashing uniform
    *   definitions and constraints.
    */
-  void ConfigureSkinningShaders(const ResourceBundle& resources,
-    Actor root, std::vector<SkinningShaderConfigurationRequest>&& requests) const;
+  void ConfigureSkinningShaders(const ResourceBundle&                             resources,
+                                Actor                                             root,
+                                std::vector<SkinningShaderConfigurationRequest>&& requests) const;
 
   /*
    * @brief Ensures there is no two meshes with blend shapes sharing the same shader.
@@ -258,21 +257,22 @@ public: // METHODS
    * @param[in] resources The resources bundle. Meshes need to be accessed to configure the blend shapes.
    * @param[in] onError The error callback.
    */
-  bool ConfigureBlendshapeShaders(const ResourceBundle& resources,
-    Actor root, std::vector<BlendshapeShaderConfigurationRequest>&& requests,
-    StringCallback onError = DefaultErrorCallback) const;
+  bool ConfigureBlendshapeShaders(const ResourceBundle&                               resources,
+                                  Actor                                               root,
+                                  std::vector<BlendshapeShaderConfigurationRequest>&& requests,
+                                  StringCallback                                      onError = DefaultErrorCallback) const;
 
   SceneDefinition& operator=(SceneDefinition&& other);
 
 private: // METHODS
   bool FindNode(const std::string& name, std::unique_ptr<NodeDefinition>** result);
 
-private: // DATA
-  std::vector<std::unique_ptr<NodeDefinition>> mNodes;  // size unknown up front (may discard nodes).
-  std::vector<Index> mRootNodeIds;
+private:                                               // DATA
+  std::vector<std::unique_ptr<NodeDefinition>> mNodes; // size unknown up front (may discard nodes).
+  std::vector<Index>                           mRootNodeIds;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_SCENE_DEFINITION_H_
index 4f55bbe..387984d 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_SHADER_DEFINITION_FACTORY_H_
 #define DALI_SCENE_LOADER_SHADER_DEFINITION_FACTORY_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -18,8 +18,8 @@
  */
 
 // INTERNAL INCLUDES
-#include "dali-scene-loader/public-api/index.h"
 #include "dali-scene-loader/public-api/api.h"
+#include "dali-scene-loader/public-api/index.h"
 
 // EXTERNAL INCLUDER
 #include <memory>
@@ -28,7 +28,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 struct NodeDefinition;
 class ResourceBundle;
 
@@ -57,7 +56,7 @@ private:
   const std::unique_ptr<Impl> mImpl;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_SHADER_DEFINITION_FACTORY_H_
index 29693fb..d7f390b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_SHADER_DEFINITION_H
 #define DALI_SCENE_LOADER_SHADER_DEFINITION_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/renderer-state.h"
 
 // EXTERNAL INCLUDES
+#include <memory>
 #include "dali/public-api/common/vector-wrapper.h"
 #include "dali/public-api/rendering/shader.h"
-#include <memory>
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief Defines a shader with paths to the files which define its
  *  vertex and fragment components, and a mapping of uniform names (which are
@@ -76,15 +75,15 @@ struct DALI_SCENE_LOADER_API ShaderDefinition
 public: // DATA
   RendererState::Type mRendererState = RendererState::NONE;
 
-  std::string mVertexShaderPath;
-  std::string mFragmentShaderPath;
+  std::string              mVertexShaderPath;
+  std::string              mFragmentShaderPath;
   std::vector<std::string> mDefines;
   std::vector<std::string> mHints;
 
   Property::Map mUniforms;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_SHADER_DEFINITION_H
index a06f19b..9bd7133 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_SKELETON_H
 #define DALI_SCENE_LOADER_SKELETON_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -28,7 +28,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief A set of joints (stored as node indices), and an optional root node index.
  * @note The list of joints must not be empty and must not contain INVALID_INDEX.
@@ -39,17 +38,17 @@ struct DALI_SCENE_LOADER_API SkeletonDefinition
 {
   struct Joint
   {
-    Index mNodeIdx;
+    Index  mNodeIdx;
     Matrix mInverseBindMatrix;
   };
 
   using Vector = std::vector<SkeletonDefinition>;
 
-  Index mRootNodeIdx = INVALID_INDEX;
+  Index              mRootNodeIdx = INVALID_INDEX;
   std::vector<Joint> mJoints;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_SKELETON_H
index 415d25a..4ad1676 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_SKINNING_DETAILS_H_
 #define DALI_SCENE_LOADER_SKINNING_DETAILS_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -21,8 +21,8 @@
 #include "dali-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
-#include "dali/public-api/rendering/shader.h"
 #include <string>
+#include "dali/public-api/rendering/shader.h"
 
 namespace Dali
 {
@@ -43,7 +43,7 @@ struct DALI_SCENE_LOADER_API Skinning
   Skinning() = delete;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif // DALI_SCENE_LOADER_SKINNING_DETAILS_H_
index 9569b2d..5a1d289 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_STRING_CALLBACK_H
 #define DALI_SCENE_LOADER_STRING_CALLBACK_H
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -28,7 +28,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief A callback to post strings to.
  */
@@ -39,7 +38,7 @@ using StringCallback = std::function<void(const std::string&)>;
  */
 DALI_SCENE_LOADER_API void DefaultErrorCallback(const std::string& message);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_STRING_CALLBACK_H
index 1aace35..f9213e1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_UTILS_H_
 #define DALI_SCENE_LOADER_UTILS_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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-scene-loader/public-api/api.h"
 
 // EXTERNAL INCLUDES
+#include <cctype>
+#include <sstream>
 #include "dali/public-api/actors/actor.h"
-#include "dali/public-api/rendering/renderer.h"
 #include "dali/public-api/common/dali-common.h"
-#include <sstream>
-#include <cctype>
+#include "dali/public-api/rendering/renderer.h"
 
 namespace Dali
 {
 namespace SceneLoader
 {
-
 /*
  * @brief Fixed size backing buffer to use with std::ostreams where control over
  *  allocations (which this does not make), is required.
@@ -52,14 +51,16 @@ public:
 class DALI_SCENE_LOADER_API ExceptionFlinger
 {
 public:
-  enum { MESSAGE_BUFFER_SIZE = 512 };
+  enum
+  {
+    MESSAGE_BUFFER_SIZE = 512
+  };
 
   ExceptionFlinger(const char* location) noexcept(true);
 
-  [[noreturn]]
-  ~ExceptionFlinger() noexcept(false);
+  [[noreturn]] ~ExceptionFlinger() noexcept(false);
 
-  template <typename T>
+  template<typename T>
   ExceptionFlinger& operator<<(const T& rhs) noexcept(true)
   {
     mStream << rhs;
@@ -71,13 +72,12 @@ private:
   {
     const char* mLocation;
 
-    [[noreturn]]
-    ~Impl() noexcept(false);
+    [[noreturn]] ~Impl() noexcept(false);
   };
 
   static char* GetMessageBuffer() noexcept(true);
 
-  Impl mImpl;
+  Impl         mImpl;
   StreamBuffer mStreamBuffer;
   std::ostream mStream;
 };
@@ -90,13 +90,15 @@ DALI_SCENE_LOADER_API std::string FormatString(const char* format, ...);
 /*
  * @return The @n th bit in a bitmask.
  */
-DALI_SCENE_LOADER_API constexpr size_t NthBit(size_t n) { return 1 << n; }
+DALI_SCENE_LOADER_API constexpr size_t NthBit(size_t n)
+{
+  return 1 << n;
+}
 
 /*
  * @return Whether all of @a mask 's bits are set on @a value.
  */
-inline
-DALI_SCENE_LOADER_API bool MaskMatch(uint32_t value, uint32_t mask)
+inline DALI_SCENE_LOADER_API bool MaskMatch(uint32_t value, uint32_t mask)
 {
   return (value & mask) == mask;
 }
@@ -104,8 +106,7 @@ DALI_SCENE_LOADER_API bool MaskMatch(uint32_t value, uint32_t mask)
 /*
  * @brief Convert a four-letter(, null-terminated) string literal into a uint32_t.
  */
-inline
-DALI_SCENE_LOADER_API constexpr uint32_t FourCC(const char(&fourCC)[5])
+inline DALI_SCENE_LOADER_API constexpr uint32_t FourCC(const char (&fourCC)[5])
 {
   return (fourCC[3] << 24) | (fourCC[2] << 16) | (fourCC[1] << 8) | fourCC[0];
 }
@@ -116,11 +117,10 @@ DALI_SCENE_LOADER_API constexpr uint32_t FourCC(const char(&fourCC)[5])
  * @param[in] b, compare string
  * @return true if strings are equal
  */
-inline
-DALI_SCENE_LOADER_API bool CaseInsensitiveCharacterCompare( unsigned char a, unsigned char b )
+inline DALI_SCENE_LOADER_API bool CaseInsensitiveCharacterCompare(unsigned char a, unsigned char b)
 {
   // Converts to lower case in the current locale.
-  return std::tolower( a ) == std::tolower( b );
+  return std::tolower(a) == std::tolower(b);
 }
 
 /*
@@ -128,13 +128,12 @@ DALI_SCENE_LOADER_API bool CaseInsensitiveCharacterCompare( unsigned char a, uns
  * @param[in] a, compare string
  * @param[in] b, compare string
  */
-inline
-DALI_SCENE_LOADER_API bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b )
+inline DALI_SCENE_LOADER_API bool CaseInsensitiveStringCompare(const std::string& a, const std::string& b)
 {
   bool result = false;
-  if( a.length() == b.length() )
+  if(a.length() == b.length())
   {
-    result = std::equal( a.begin(), a.end(), b.begin(), &CaseInsensitiveCharacterCompare );
+    result = std::equal(a.begin(), a.end(), b.begin(), &CaseInsensitiveCharacterCompare);
   }
   return result;
 }
@@ -154,9 +153,8 @@ DALI_SCENE_LOADER_API std::string LoadTextFile(const char* path, bool* fail = nu
  * @note Use of a @a fn that is itself recursing in @a is also discouraged
  *  for performance and stability reasons.
  */
-template <typename Func>
-inline
-DALI_SCENE_LOADER_API void VisitActor(Actor a, Func fn)
+template<typename Func>
+inline DALI_SCENE_LOADER_API void VisitActor(Actor a, Func fn)
 {
   fn(a);
 
@@ -171,8 +169,7 @@ DALI_SCENE_LOADER_API void VisitActor(Actor a, Func fn)
  * @brief Convenience function to set the given actor @a 's anchor point
  *  and parent origin to center.
  */
-inline
-DALI_SCENE_LOADER_API void SetActorCentered(Actor a)
+inline DALI_SCENE_LOADER_API void SetActorCentered(Actor a)
 {
   a.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
   a.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
@@ -184,10 +181,10 @@ using Type = uint32_t;
 
 enum DALI_SCENE_LOADER_API Values : Type
 {
-  NONE = 0x00,
+  NONE          = 0x00,
   FLIP_VERTICAL = 0x01,
 };
-}
+} // namespace TexturedQuadOptions
 
 /*
  * @brief Makes... geometry for a textured quad.
@@ -198,9 +195,9 @@ DALI_SCENE_LOADER_API Geometry MakeTexturedQuadGeometry(TexturedQuadOptions::Typ
  * @brief Fixes the path of a file. Replaces the '\\' separator by the '/' one.
  * @param[in,out] path The path to be fixed.
  */
-DALI_SCENE_LOADER_API void ToUnixFileSeparators( std::string& path );
+DALI_SCENE_LOADER_API void ToUnixFileSeparators(std::string& path);
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif /* DALI_SCENE_LOADER_UTILS_H_ */
index 70efc4f..26ce908 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_SCENE_LOADER_VIEW_PROJECTION_H_
 #define DALI_SCENE_LOADER_VIEW_PROJECTION_H_
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -27,7 +27,6 @@ namespace Dali
 {
 namespace SceneLoader
 {
-
 /**
  * @brief Contains view and projection matrices, also caching the view-projection
  *      and inverse projection matrices.
@@ -35,18 +34,36 @@ namespace SceneLoader
 class ViewProjection
 {
 public:
-  Matrix& GetView() { return mView; }
-  Matrix& GetProjection() { return mProjection; }
+  Matrix& GetView()
+  {
+    return mView;
+  }
+  Matrix& GetProjection()
+  {
+    return mProjection;
+  }
 
   /*
    * @brief Updates the cached view projection and inverse projection matrices.
    */
   void Update();
 
-  const Matrix& GetView() const { return mView; }
-  const Matrix& GetProjection() const { return mProjection; }
-  const Matrix& GetInverseProjection() const { return mInvProjection; }
-  const Matrix& GetViewProjection() const { return mViewProjection; }
+  const Matrix& GetView() const
+  {
+    return mView;
+  }
+  const Matrix& GetProjection() const
+  {
+    return mProjection;
+  }
+  const Matrix& GetInverseProjection() const
+  {
+    return mInvProjection;
+  }
+  const Matrix& GetViewProjection() const
+  {
+    return mViewProjection;
+  }
 
 private:
   Matrix mView;
@@ -55,7 +72,7 @@ private:
   Matrix mViewProjection;
 };
 
-}
-}
+} // namespace SceneLoader
+} // namespace Dali
 
 #endif //DALI_SCENE_LOADER_VIEW_PROJECTION_H_
diff --git a/dali-scene-loader/third-party/.clang-format b/dali-scene-loader/third-party/.clang-format
new file mode 100644 (file)
index 0000000..297ddc2
--- /dev/null
@@ -0,0 +1,5 @@
+---
+Language:        Cpp
+DisableFormat: true
+SortIncludes: false
+...
index 9baeeb2..c9d13f2 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONTROL_DEVEL_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -39,31 +39,31 @@ class Base;
 namespace DevelControl
 {
 /// @brief AccessibilityActivate signal type.
-typedef Signal< void ( ) > AccessibilityActivateSignalType;
+typedef Signal<void()> AccessibilityActivateSignalType;
 
 /// @brief AccessibilityReadingSkipped signal type.
-typedef Signal< void ( ) > AccessibilityReadingSkippedSignalType;
+typedef Signal<void()> AccessibilityReadingSkippedSignalType;
 
 /// @brief AccessibilityReadingPaused signal type.
-typedef Signal< void ( ) > AccessibilityReadingPausedSignalType;
+typedef Signal<void()> AccessibilityReadingPausedSignalType;
 
 /// @brief AccessibilityReadingResumed signal type.
-typedef Signal< void ( ) > AccessibilityReadingResumedSignalType;
+typedef Signal<void()> AccessibilityReadingResumedSignalType;
 
 /// @brief AccessibilityReadingCancelled signal type.
-typedef Signal< void ( ) > AccessibilityReadingCancelledSignalType;
+typedef Signal<void()> AccessibilityReadingCancelledSignalType;
 
 /// @brief AccessibilityReadingStopped signal type.
-typedef Signal< void ( ) > AccessibilityReadingStoppedSignalType;
+typedef Signal<void()> AccessibilityReadingStoppedSignalType;
 
 /// @brief AccessibilityGetName signal type.
-typedef Signal< void ( std::string& ) > AccessibilityGetNameSignalType;
+typedef Signal<void(std::string&)> AccessibilityGetNameSignalType;
 
 /// @brief AccessibilityGetDescription signal type.
-typedef Signal< void ( std::string& ) > AccessibilityGetDescriptionSignalType;
+typedef Signal<void(std::string&)> AccessibilityGetDescriptionSignalType;
 
 /// @brief AccessibilityDoGesture signal type.
-typedef Signal< void ( std::pair<Dali::Accessibility::GestureInfo, bool>& ) > AccessibilityDoGestureSignalType;
+typedef Signal<void(std::pair<Dali::Accessibility::GestureInfo, bool>&)> AccessibilityDoGestureSignalType;
 
 enum State
 {
@@ -371,7 +371,7 @@ DALI_TOOLKIT_API Dali::Property GetVisualProperty(Control control, Dali::Propert
  * @brief The signal is emmited as a succession of "activate" signal send by accessibility client.
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityActivateSignalType &AccessibilityActivateSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityActivateSignalType& AccessibilityActivateSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emmited when text send via Dali::Accessibility::Bridge::Say
@@ -379,21 +379,21 @@ DALI_TOOLKIT_API AccessibilityActivateSignalType &AccessibilityActivateSignal( T
  *
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityReadingSkippedSignalType &AccessibilityReadingSkippedSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityReadingSkippedSignalType& AccessibilityReadingSkippedSignal(Toolkit::Control control);
 
 /**
  * @brief
  *
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityReadingPausedSignalType &AccessibilityReadingPausedSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityReadingPausedSignalType& AccessibilityReadingPausedSignal(Toolkit::Control control);
 
 /**
  * @brief
  *
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityReadingResumedSignalType &AccessibilityReadingResumedSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityReadingResumedSignalType& AccessibilityReadingResumedSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emmited when text send via Dali::Accessibility::Bridge::Say
@@ -401,7 +401,7 @@ DALI_TOOLKIT_API AccessibilityReadingResumedSignalType &AccessibilityReadingResu
  *
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityReadingCancelledSignalType &AccessibilityReadingCancelledSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityReadingCancelledSignalType& AccessibilityReadingCancelledSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emmited when text send via Dali::Accessibility::Bridge::Say
@@ -409,7 +409,7 @@ DALI_TOOLKIT_API AccessibilityReadingCancelledSignalType &AccessibilityReadingCa
  *
  * @return The signal to connect to
  */
-DALI_TOOLKIT_API AccessibilityReadingStoppedSignalType &AccessibilityReadingStoppedSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityReadingStoppedSignalType& AccessibilityReadingStoppedSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emmited when accessibility client asks for object's name.
@@ -421,7 +421,7 @@ DALI_TOOLKIT_API AccessibilityReadingStoppedSignalType &AccessibilityReadingStop
  * Priority is as above. If none is used, default implementation is provided.
  * @return [description]
  */
-DALI_TOOLKIT_API AccessibilityGetNameSignalType &AccessibilityGetNameSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityGetNameSignalType& AccessibilityGetNameSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emmited when accessibility client asks for object's description.
@@ -433,7 +433,7 @@ DALI_TOOLKIT_API AccessibilityGetNameSignalType &AccessibilityGetNameSignal( Too
  * Priority is as above. If none is used, default implementation is provided.
  * @return signal handler
  */
-DALI_TOOLKIT_API AccessibilityGetDescriptionSignalType &AccessibilityGetDescriptionSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityGetDescriptionSignalType& AccessibilityGetDescriptionSignal(Toolkit::Control control);
 
 /**
  * @brief The signal is emitted when accessibility client call "DoGesture" method via IPC mechanism.
@@ -441,7 +441,7 @@ DALI_TOOLKIT_API AccessibilityGetDescriptionSignalType &AccessibilityGetDescript
  * This signal allows developers to serve incoming gesture in specific way.
  * @return signal handler
  */
-DALI_TOOLKIT_API AccessibilityDoGestureSignalType &AccessibilityDoGestureSignal( Toolkit::Control control );
+DALI_TOOLKIT_API AccessibilityDoGestureSignalType& AccessibilityDoGestureSignal(Toolkit::Control control);
 
 /**
  * @brief The method allows connection with other actor with usage of concrete accessibility relation type.
@@ -450,7 +450,7 @@ DALI_TOOLKIT_API AccessibilityDoGestureSignalType &AccessibilityDoGestureSignal(
  * @param destination Actor object
  * @param relation    enumerated value describing relation
  */
-DALI_TOOLKIT_API void AppendAccessibilityRelation( Dali::Actor control, Actor destination, Dali::Accessibility::RelationType relation );
+DALI_TOOLKIT_API void AppendAccessibilityRelation(Dali::Actor control, Actor destination, Dali::Accessibility::RelationType relation);
 
 /**
  * @brief The method allows removing relation
@@ -459,7 +459,7 @@ DALI_TOOLKIT_API void AppendAccessibilityRelation( Dali::Actor control, Actor de
  * @param destination Actor object
  * @param relation    enumerated value describing relation
  */
-DALI_TOOLKIT_API void RemoveAccessibilityRelation( Dali::Actor control, Actor destination, Dali::Accessibility::RelationType relation );
+DALI_TOOLKIT_API void RemoveAccessibilityRelation(Dali::Actor control, Actor destination, Dali::Accessibility::RelationType relation);
 
 /**
  * @brief The method returns collection accessibility addresses representing objects connected with current object
@@ -467,14 +467,14 @@ DALI_TOOLKIT_API void RemoveAccessibilityRelation( Dali::Actor control, Actor de
  * @param control object to append attribute to
  * @return std::vector, where index is casted value of Accessibility::RelationType and value is std::vector of type Accessibility::Address
  */
-DALI_TOOLKIT_API std::vector<std::vector<Accessibility::Address>> GetAccessibilityRelations( Dali::Actor control );
+DALI_TOOLKIT_API std::vector<std::vector<Accessibility::Address>> GetAccessibilityRelations(Dali::Actor control);
 
 /**
  * @brief The method removes all previously appended relations
  *
  * @param control object to append attribute to
  */
-DALI_TOOLKIT_API void ClearAccessibilityRelations( Dali::Actor control );
+DALI_TOOLKIT_API void ClearAccessibilityRelations(Dali::Actor control);
 
 /**
  * @brief The method allows to add or modify value matched with given key.
@@ -484,21 +484,21 @@ DALI_TOOLKIT_API void ClearAccessibilityRelations( Dali::Actor control );
  * @param key   std::string value
  * @param value std::string value
  */
-DALI_TOOLKIT_API void AppendAccessibilityAttribute( Dali::Actor control, const std::string& key, const std::string value );
+DALI_TOOLKIT_API void AppendAccessibilityAttribute(Dali::Actor control, const std::string& key, const std::string value);
 
 /**
  * @brief The method erases key with its value from accessibility attributes
  * @param control object to append attribute to
  * @param key std::string value
  */
-DALI_TOOLKIT_API void RemoveAccessibilityAttribute( Dali::Actor control, const std::string& key );
+DALI_TOOLKIT_API void RemoveAccessibilityAttribute(Dali::Actor control, const std::string& key);
 
 /**
  * @brief The method clears accessibility attributes
  *
  * @param control object to append attribute to
  */
-DALI_TOOLKIT_API void ClearAccessibilityAttributes( Dali::Actor control );
+DALI_TOOLKIT_API void ClearAccessibilityAttributes(Dali::Actor control);
 
 /**
  * @brief The method inserts reading information of an accessible object into attributes
@@ -506,7 +506,7 @@ DALI_TOOLKIT_API void ClearAccessibilityAttributes( Dali::Actor control );
  * @param control object to append attribute to
  * @param types Reading information types
  */
-DALI_TOOLKIT_API void SetAccessibilityReadingInfoType( Dali::Actor control, const Dali::Accessibility::ReadingInfoTypes types );
+DALI_TOOLKIT_API void SetAccessibilityReadingInfoType(Dali::Actor control, const Dali::Accessibility::ReadingInfoTypes types);
 
 /**
  * @brief The method returns reading information of an accessible object
@@ -514,7 +514,7 @@ DALI_TOOLKIT_API void SetAccessibilityReadingInfoType( Dali::Actor control, cons
  * @param control object to append attribute to
  * @return Reading information types
  */
-DALI_TOOLKIT_API Dali::Accessibility::ReadingInfoTypes GetAccessibilityReadingInfoType( Dali::Actor control );
+DALI_TOOLKIT_API Dali::Accessibility::ReadingInfoTypes GetAccessibilityReadingInfoType(Dali::Actor control);
 
 /**
  * @brief The method erases highlight.
@@ -522,7 +522,7 @@ DALI_TOOLKIT_API Dali::Accessibility::ReadingInfoTypes GetAccessibilityReadingIn
  * @param control object to append attribute to
  * @return bool value, false when it is not possible or something went wrong, at the other way true.
  */
-DALI_TOOLKIT_API bool ClearAccessibilityHighlight( Dali::Actor control );
+DALI_TOOLKIT_API bool ClearAccessibilityHighlight(Dali::Actor control);
 
 /**
  * @brief The method grabs highlight.
@@ -530,7 +530,7 @@ DALI_TOOLKIT_API bool ClearAccessibilityHighlight( Dali::Actor control );
  * @param control object to append attribute to
  * @return bool value, false when it is not possible or something went wrong, at the other way true.
  */
-DALI_TOOLKIT_API bool GrabAccessibilityHighlight( Dali::Actor control );
+DALI_TOOLKIT_API bool GrabAccessibilityHighlight(Dali::Actor control);
 
 /**
  * @brief The metod presents bitset of control's states.
@@ -538,7 +538,7 @@ DALI_TOOLKIT_API bool GrabAccessibilityHighlight( Dali::Actor control );
  * @param control object to append attribute to
  * @return Dali::Accessibility::States is vector of enumerated State.
  */
-DALI_TOOLKIT_API Dali::Accessibility::States GetAccessibilityStates( Dali::Actor control );
+DALI_TOOLKIT_API Dali::Accessibility::States GetAccessibilityStates(Dali::Actor control);
 
 /**
  * @brief The method force sending notifications about current states to accessibility clients
@@ -547,7 +547,7 @@ DALI_TOOLKIT_API Dali::Accessibility::States GetAccessibilityStates( Dali::Actor
  * @param states      mask with states expected to broadcast
  * @param doRecursive flag pointing if notifications of children's state would be sent
  */
-DALI_TOOLKIT_API void NotifyAccessibilityStateChange( Dali::Actor control, Dali::Accessibility::States states, bool doRecursive );
+DALI_TOOLKIT_API void NotifyAccessibilityStateChange(Dali::Actor control, Dali::Accessibility::States states, bool doRecursive);
 
 /**
  * The method allows to set specific constructor for creating accessibility structure
@@ -566,14 +566,14 @@ DALI_TOOLKIT_API void NotifyAccessibilityStateChange( Dali::Actor control, Dali:
   *
   * param constructor callback creating Accessible object
   */
-DALI_TOOLKIT_API void SetAccessibilityConstructor( Dali::Actor control, std::function<std::unique_ptr<Dali::Accessibility::Accessible>(Dali::Actor)> constructor);
+DALI_TOOLKIT_API void SetAccessibilityConstructor(Dali::Actor control, std::function<std::unique_ptr<Dali::Accessibility::Accessible>(Dali::Actor)> constructor);
 
 /**
  * Returns accessibility object bound to actor, if any
  *
  * This method won't bound new accessibility object. Use Dali::Accessibility::Accessible::Get in that case.
  */
-DALI_TOOLKIT_API Dali::Accessibility::Accessible *GetBoundAccessibilityObject( Dali::Actor control );
+DALI_TOOLKIT_API Dali::Accessibility::Accessible* GetBoundAccessibilityObject(Dali::Actor control);
 
 } // namespace DevelControl
 
old mode 100755 (executable)
new mode 100644 (file)
index 44a3bc1..2ae0e35
 
 namespace Dali
 {
-
 class WebEngineBackForwardListItem;
 
 namespace Toolkit
 {
-
 /**
  * @addtogroup dali_toolkit_controls_web_view
  * @{
@@ -50,7 +48,7 @@ public:
   /**
    * @brief Creates a WebBackForwardListItem.
    */
-  WebBackForwardListItem( const Dali::WebEngineBackForwardListItem* item );
+  WebBackForwardListItem(const Dali::WebEngineBackForwardListItem* item);
 
   /**
    * @brief Destructor.
@@ -82,7 +80,6 @@ public:
   std::string GetOriginalUrl() const;
 
 private:
-
   const Dali::WebEngineBackForwardListItem* mWebEngineBackForwardListItem;
 };
 
old mode 100755 (executable)
new mode 100644 (file)
index 144c02b..9dc81fc
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_WEB_BACK_FORWARD_LIST_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -24,7 +24,6 @@
 
 namespace Dali
 {
-
 class WebEngineBackForwardList;
 
 namespace Toolkit
@@ -49,7 +48,7 @@ public:
   /**
    * @brief Creates a WebBackForwardList.
    */
-  WebBackForwardList( const Dali::WebEngineBackForwardList& list );
+  WebBackForwardList(const Dali::WebEngineBackForwardList& list);
 
   /**
    * @brief Destructor.
@@ -78,9 +77,8 @@ public:
   uint32_t GetItemCount() const;
 
 private:
-  const Dali::WebEngineBackForwardList&  mWebEngineBackForwardList;
+  const Dali::WebEngineBackForwardList& mWebEngineBackForwardList;
   Dali::Toolkit::WebBackForwardListItem mWebBackForwardListItem;
-
 };
 
 /**
old mode 100755 (executable)
new mode 100644 (file)
index 1640c70..ead4efd
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_WEB_CONTEXT_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // EXTERNAL INCLUDES
-#include <string>
 #include <dali/devel-api/adaptor-framework/web-engine-context.h>
+#include <string>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 /**
  * @addtogroup dali_toolkit_controls_web_view
  * @{
@@ -45,13 +43,12 @@ namespace Toolkit
 class DALI_TOOLKIT_API WebContext
 {
 public:
-
   /**
    * @brief Creates a WebContext.
    *
    * @param[in] context The context of web engine.
    */
-  WebContext( Dali::WebEngineContext& context );
+  WebContext(Dali::WebEngineContext& context);
 
   /**
    * @brief Destructor.
@@ -70,14 +67,14 @@ public:
    *
    * @param[in] cacheModel The cache model
    */
-  void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel );
+  void SetCacheModel(Dali::WebEngineContext::CacheModel cacheModel);
 
   /**
    * @brief Sets the given proxy URI to network backend of specific context.
    *
    * @param[in] uri The proxy URI to set
    */
-  void SetProxyUri( const std::string& uri );
+  void SetProxyUri(const std::string& uri);
 
   /**
    * Adds CA certificates to persistent NSS certificate database
@@ -89,7 +86,7 @@ public:
    *
    * @param[in] certificatePath path to a CA certificate file(s), see above for details
    */
-  void SetCertificateFilePath( const std::string& certificatePath );
+  void SetCertificateFilePath(const std::string& certificatePath);
 
   /**
    * Toggles the cache to be enabled or disabled
@@ -99,7 +96,7 @@ public:
    *
    * @param[in] cacheDisabled enable or disable cache
    */
-  void DisableCache( bool cacheDisabled );
+  void DisableCache(bool cacheDisabled);
 
   /**
    * @brief Sets a proxy auth credential to network backend of specific context.
@@ -107,7 +104,7 @@ public:
    * @param[in] username username to set
    * @param[in] password password to set
    */
-  void SetDefaultProxyAuth( const std::string& username, const std::string& password );
+  void SetDefaultProxyAuth(const std::string& username, const std::string& password);
 
   /**
    * Requests for deleting all web databases.
@@ -133,8 +130,7 @@ public:
   void ClearCache();
 
 private:
-
-  Dali::WebEngineContext&  mWebEngineContext;
+  Dali::WebEngineContext& mWebEngineContext;
 };
 
 /**
old mode 100755 (executable)
new mode 100644 (file)
index adb8481..a332e06
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_WEB_COOKIE_MANAGER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -19,8 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <string>
 #include <dali/devel-api/adaptor-framework/web-engine-cookie-manager.h>
+#include <string>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
@@ -31,7 +31,6 @@ class WebEngineCookieManager;
 
 namespace Toolkit
 {
-
 /**
  * @addtogroup dali_toolkit_controls_web_view
  * @{
@@ -47,12 +46,11 @@ namespace Toolkit
 class DALI_TOOLKIT_API WebCookieManager
 {
 public:
-
   /**
    * @brief Creates a WebCookieManager.
    * @param[in] manager A #Dali::WebEngineCookieManager
    */
-  WebCookieManager( Dali::WebEngineCookieManager& manager );
+  WebCookieManager(Dali::WebEngineCookieManager& manager);
 
   /**
    * @brief Destructor.
@@ -67,7 +65,7 @@ public:
    *
    * @param[in] policy A #Dali::WebEngineCookieManager::CookieAcceptPolicy
    */
-  void SetCookieAcceptPolicy(Dali::WebEngineCookieManager::CookieAcceptPolicy policy );
+  void SetCookieAcceptPolicy(Dali::WebEngineCookieManager::CookieAcceptPolicy policy);
 
   /**
    * @brief Gets the cookie acceptance policy. The default is Toolkit::WebCookieManager::CookieAcceptPolicy::NO_THIRD_PARTY.
@@ -93,11 +91,10 @@ public:
    * @param[in] path The path where to read/write Cookies
    * @param[in] storage The type of storage
    */
-  void SetPersistentStorage( const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage );
+  void SetPersistentStorage(const std::string& path, Dali::WebEngineCookieManager::CookiePersistentStorage storage);
 
 private:
-
-  Dali::WebEngineCookieManager&  mWebEngineCookieManager;
+  Dali::WebEngineCookieManager& mWebEngineCookieManager;
 };
 
 /**
old mode 100755 (executable)
new mode 100644 (file)
index dc46e7c..4d24b58
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_WEB_SETTINGS_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -30,7 +30,6 @@ class WebEngineSettings;
 
 namespace Toolkit
 {
-
 /**
  * @addtogroup dali_toolkit_controls_web_view
  * @{
@@ -51,7 +50,7 @@ public:
    *
    * @param[in] settings A settings of web engine.
    */
-  WebSettings( Dali::WebEngineSettings& settings );
+  WebSettings(Dali::WebEngineSettings& settings);
 
   /**
    * @brief Destructor.
@@ -64,7 +63,7 @@ public:
    * @param[in] allowed if true, allow to run mixed contents,
    *      otherwise not allow
    */
-  void AllowMixedContents( bool allowed );
+  void AllowMixedContents(bool allowed);
 
   /**
    * @brief Enable the spatial navigation or not.
@@ -72,7 +71,7 @@ public:
    * @param[in] enabled if true, use spatial navigation,
    *       otherwise to disable
    */
-  void EnableSpatialNavigation( bool enabled );
+  void EnableSpatialNavigation(bool enabled);
 
   /**
    * @brief Returns the default font size in pixel. The default value is 16.
@@ -86,7 +85,7 @@ public:
    *
    * @param[in] defaultFontSize A new default font size to set
    */
-  void SetDefaultFontSize( int defaultFontSize );
+  void SetDefaultFontSize(int defaultFontSize);
 
   /**
    * @brief Enables/disables web security.
@@ -94,7 +93,7 @@ public:
    * @param[in] enabled if true, to enable the web security
    *       otherwise to disable
    */
-  void EnableWebSecurity( bool enabled );
+  void EnableWebSecurity(bool enabled);
 
   /**
    * @brief Allow/Disallow file access from external url
@@ -102,7 +101,7 @@ public:
    * @param[in] allowed if true, to allow file access from external url
    *       otherwise to disallow
    */
-  void AllowFileAccessFromExternalUrl( bool allowed );
+  void AllowFileAccessFromExternalUrl(bool allowed);
 
   /**
    * @brief Returns whether JavaScript can be executable. The default is true.
@@ -116,7 +115,7 @@ public:
    *
    * @param[in] enabled True if JavaScript executing is enabled, false otherwise
    */
-  void EnableJavaScript( bool enabled );
+  void EnableJavaScript(bool enabled);
 
   /**
    * @brief Allow if the scripts can open new windows.
@@ -124,7 +123,7 @@ public:
    * @param[in] allowed if true, the scripts can open new windows,
    *       otherwise not
    */
-  void AllowScriptsOpenWindows( bool allowed );
+  void AllowScriptsOpenWindows(bool allowed);
 
   /**
    * @brief Returns whether images can be loaded automatically. The default is true.
@@ -138,7 +137,7 @@ public:
    *
    * @param[in] automatic True if images are loaded automatically, false otherwise
    */
-  void AllowImagesLoadAutomatically( bool automatic );
+  void AllowImagesLoadAutomatically(bool automatic);
 
   /**
    * @brief Gets the default text encoding name (e.g. UTF-8).
@@ -152,7 +151,7 @@ public:
    *
    * @param[in] defaultTextEncodingName The default text encoding name
    */
-  void SetDefaultTextEncodingName( const std::string& defaultTextEncodingName );
+  void SetDefaultTextEncodingName(const std::string& defaultTextEncodingName);
 
 private:
   Dali::WebEngineSettings& mWebEngineSettings;
old mode 100755 (executable)
new mode 100644 (file)
index 48e57ce..8c842b7
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_WEB_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -22,8 +22,8 @@
 #include <functional>
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
 #include <dali-toolkit/public-api/controls/control.h>
+#include <dali/devel-api/adaptor-framework/web-engine-plugin.h>
 
 namespace Dali
 {
@@ -56,7 +56,6 @@ class WebView;
 class DALI_TOOLKIT_API WebView : public Control
 {
 public:
-
   /**
    * @brief Enumeration for the start and end property ranges for this control.
    */
@@ -126,37 +125,37 @@ public:
    */
   enum class LoadErrorCode
   {
-    UNKNOWN = 0,            ///< Unknown.
-    CANCELED,               ///< User canceled.
-    CANT_SUPPORT_MIMETYPE,  ///< Can't show the page for this MIME type.
-    FAILED_FILE_IO,         ///< File IO error.
-    CANT_CONNECT,           ///< Cannot connect to the network.
-    CANT_LOOKUP_HOST,       ///< Fail to look up host from the DNS.
-    FAILED_TLS_HANDSHAKE,   ///< Fail to SSL/TLS handshake.
-    INVALID_CERTIFICATE,    ///< Received certificate is invalid.
-    REQUEST_TIMEOUT,        ///< Connection timeout.
-    TOO_MANY_REDIRECTS,     ///< Too many redirects.
-    TOO_MANY_REQUESTS,      ///< Too many requests during this load.
-    BAD_URL,                ///< Malformed URL.
-    UNSUPPORTED_SCHEME,     ///< Unsupported scheme.
-    AUTHENTICATION,         ///< User authentication failed on the server.
-    INTERNAL_SERVER         ///< Web server has an internal server error.
+    UNKNOWN = 0,           ///< Unknown.
+    CANCELED,              ///< User canceled.
+    CANT_SUPPORT_MIMETYPE, ///< Can't show the page for this MIME type.
+    FAILED_FILE_IO,        ///< File IO error.
+    CANT_CONNECT,          ///< Cannot connect to the network.
+    CANT_LOOKUP_HOST,      ///< Fail to look up host from the DNS.
+    FAILED_TLS_HANDSHAKE,  ///< Fail to SSL/TLS handshake.
+    INVALID_CERTIFICATE,   ///< Received certificate is invalid.
+    REQUEST_TIMEOUT,       ///< Connection timeout.
+    TOO_MANY_REDIRECTS,    ///< Too many redirects.
+    TOO_MANY_REQUESTS,     ///< Too many requests during this load.
+    BAD_URL,               ///< Malformed URL.
+    UNSUPPORTED_SCHEME,    ///< Unsupported scheme.
+    AUTHENTICATION,        ///< User authentication failed on the server.
+    INTERNAL_SERVER        ///< Web server has an internal server error.
   };
 
   /**
    * @brief WebView signal type related with page loading.
    */
-  using WebViewPageLoadSignalType = Signal< void( WebView, const std::string& ) >;
+  using WebViewPageLoadSignalType = Signal<void(WebView, const std::string&)>;
 
   /**
    * @brief WebView signal type related with page loading error.
    */
-  using WebViewPageLoadErrorSignalType = Signal< void( WebView, const std::string&, LoadErrorCode ) >;
+  using WebViewPageLoadErrorSignalType = Signal<void(WebView, const std::string&, LoadErrorCode)>;
 
   /**
    * @brief WebView signal type related with scroll edge reached.
    */
-  using WebViewScrollEdgeReachedSignalType = Signal< void( WebView, Dali::WebEnginePlugin::ScrollEdge ) >;
+  using WebViewScrollEdgeReachedSignalType = Signal<void(WebView, Dali::WebEnginePlugin::ScrollEdge)>;
 
 public:
   /**
@@ -181,7 +180,7 @@ public:
    * @param [in] argc The count of arguments of Applications
    * @param [in] argv The string array of arguments of Applications
    */
-  static WebView New( int argc, char** argv );
+  static WebView New(int argc, char** argv);
 
   /**
    * @brief Creates an uninitialized WebView.
@@ -287,7 +286,7 @@ public:
    * @param[in] deltaX The delta x of scroll
    * @param[in] deltaY The delta y of scroll
    */
-  void ScrollBy( int deltaX, int deltaY );
+  void ScrollBy(int deltaX, int deltaY);
 
   /**
    * @brief Returns whether forward is possible.
index 5a73458..d19c90b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_LAYOUTING_FLEX_NODE_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -115,7 +115,7 @@ struct SizeTuple
  * @note int, height measure specification mode
  * @note SizeTuple, return value
  */
-using MeasureCallback = void (*)(Dali::Actor, float , int , float , int, SizeTuple *);
+using MeasureCallback = void (*)(Dali::Actor, float, int, float, int, SizeTuple*);
 
 /**
  * This class provides the API for calling into the Flex layout implementation.
index 47c171f..8572a12 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <string.h>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/object/property-map.h>
+#include <string.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
@@ -44,7 +44,7 @@ namespace Toolkit
  * @param[in] displacement The direction of the central line
  * @param[in] initialProgress The normalised initial progress of the shader
  */
-DALI_TOOLKIT_API void DissolveEffectSetCentralLine( Actor& actor, const Vector2& position, const Vector2& displacement, float initialProgress );
+DALI_TOOLKIT_API void DissolveEffectSetCentralLine(Actor& actor, const Vector2& position, const Vector2& displacement, float initialProgress);
 
 /**
  * @brief Create a new Dissolve effect
@@ -58,7 +58,7 @@ DALI_TOOLKIT_API void DissolveEffectSetCentralLine( Actor& actor, const Vector2&
  *  @return The newly created Property::Map with the dissolve effect
  */
 
-DALI_TOOLKIT_API Property::Map CreateDissolveEffect( bool useHighPrecision = true);
+DALI_TOOLKIT_API Property::Map CreateDissolveEffect(bool useHighPrecision = true);
 
 } // namespace Toolkit
 
index 8201976..aed1634 100644 (file)
@@ -35,7 +35,7 @@ namespace Toolkit
  * @param[in] actor The actor that registers the uniform properties
  * @param[in] numBlurSamples Number of samples used by the shader
  */
-DALI_TOOLKIT_API void SetMotionBlurProperties( Actor& actor, unsigned int numBlurSamples = 8 );
+DALI_TOOLKIT_API void SetMotionBlurProperties(Actor& actor, unsigned int numBlurSamples = 8);
 
 /**
  * @brief Create a new MotionBlurEffect
index 5f4976d..8ad7c67 100644 (file)
@@ -32,7 +32,7 @@ namespace Toolkit
 /**
  * @brief Set the properties for the motion stretch
  */
-DALI_TOOLKIT_API void SetMotionStretchProperties( Actor& actor );
+DALI_TOOLKIT_API void SetMotionStretchProperties(Actor& actor);
 
 /**
  * @brief Creates a new MotionStretchEffect
old mode 100755 (executable)
new mode 100644 (file)
index e4bf375..87bffdd
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_UTILS_DEVEL_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -89,7 +89,7 @@ struct DALI_TOOLKIT_API RendererParameters
                                    //
   float minLineSize;               ///< The line's minimum size (in points).
 
-  Extents padding;                 ///< The padding of the boundaries where the text is going to be laid-out.
+  Extents padding; ///< The padding of the boundaries where the text is going to be laid-out.
 };
 
 /**
index b55d448..97da737 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ACCESSIBILITY_MANAGER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
 #include <string>
 #include <vector>
-#include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 class AccessibilityManager;
 
 /**
@@ -43,7 +40,6 @@ class AccessibilityManager;
 class AccessibilityManager : public Dali::BaseObject, public Dali::ConnectionTracker
 {
 public:
-
   typedef Dali::Toolkit::AccessibilityManager::AccessibilityActionSignalType       AccessibilityActionSignalType;
   typedef Dali::Toolkit::AccessibilityManager::AccessibilityActionScrollSignalType AccessibilityActionScrollSignalType;
 
@@ -173,7 +169,6 @@ public:
   Actor GetFocusIndicatorActor();
 
 public:
-
   /**
    * @copydoc Toolkit::AccessibilityManager::FocusChangedSignal()
    */
@@ -189,8 +184,7 @@ public:
    */
   Toolkit::AccessibilityManager::FocusedActorActivatedSignalType& FocusedActorActivatedSignal();
 
-public:  // Signals
-
+public: // Signals
   /**
    * @copydoc Dali::Toolkit::AccessibilityManager::StatusChangedSignal
    */
@@ -400,25 +394,22 @@ public:  // Signals
   }
 
 protected:
-
   /**
    * Destructor
    */
   virtual ~AccessibilityManager();
 
 private:
-
   // Undefined
   AccessibilityManager(const AccessibilityManager&);
 
   AccessibilityManager& operator=(const AccessibilityManager& rhs);
 
 private:
-
   std::vector<Actor> mFocusOrder;
 
-  Toolkit::AccessibilityManager::FocusChangedSignalType mFocusChangedSignal; ///< The signal to notify the focus change
-  Toolkit::AccessibilityManager::FocusOvershotSignalType mFocusOvershotSignal; ///< The signal to notify the focus overshooted
+  Toolkit::AccessibilityManager::FocusChangedSignalType          mFocusChangedSignal;          ///< The signal to notify the focus change
+  Toolkit::AccessibilityManager::FocusOvershotSignalType         mFocusOvershotSignal;         ///< The signal to notify the focus overshooted
   Toolkit::AccessibilityManager::FocusedActorActivatedSignalType mFocusedActorActivatedSignal; ///< The signal to notify the activation of focused actor
 
   // Action signals.
index 09a5fd1..963869b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_BUILDER_DECLARATIONS_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/extents.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/matrix3.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
-#include <dali/public-api/math/matrix.h>
-#include <dali/public-api/math/matrix3.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/builder/tree-node.h>
 typedef Dali::Toolkit::TreeNode TreeNode;
 typedef TreeNode::ConstIterator TreeConstIter;
 
-typedef OptionalValue<const TreeNode&> OptionalChild;
-typedef OptionalValue<std::string> OptionalString;
-typedef OptionalValue<float> OptionalFloat;
-typedef OptionalValue<int> OptionalInteger;
-typedef OptionalValue<unsigned int> OptionalUnsignedInt;
-typedef OptionalValue<bool> OptionalBoolean;
-typedef OptionalValue<Dali::Vector2> OptionalVector2;
-typedef OptionalValue<Dali::Vector3> OptionalVector3;
-typedef OptionalValue<Dali::Vector4> OptionalVector4;
-typedef OptionalValue<std::string> OptionalString;
-typedef OptionalValue<Dali::Matrix> OptionalMatrix;
-typedef OptionalValue<Dali::Matrix3> OptionalMatrix3;
+typedef OptionalValue<const TreeNode&>  OptionalChild;
+typedef OptionalValue<std::string>      OptionalString;
+typedef OptionalValue<float>            OptionalFloat;
+typedef OptionalValue<int>              OptionalInteger;
+typedef OptionalValue<unsigned int>     OptionalUnsignedInt;
+typedef OptionalValue<bool>             OptionalBoolean;
+typedef OptionalValue<Dali::Vector2>    OptionalVector2;
+typedef OptionalValue<Dali::Vector3>    OptionalVector3;
+typedef OptionalValue<Dali::Vector4>    OptionalVector4;
+typedef OptionalValue<std::string>      OptionalString;
+typedef OptionalValue<Dali::Matrix>     OptionalMatrix;
+typedef OptionalValue<Dali::Matrix3>    OptionalMatrix3;
 typedef OptionalValue<Dali::Rect<int> > OptionalRect;
-typedef OptionalValue<Dali::Extents> OptionalExtents;
+typedef OptionalValue<Dali::Extents>    OptionalExtents;
 
 #endif // DALI_TOOLKIT_BUILDER_DECLARATIONS_H
old mode 100755 (executable)
new mode 100644 (file)
index 2222d1b..5e032a0
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // EXTERNAL INCLUDES
-#include <string>
 #include <fstream>
 #include <sstream>
+#include <string>
 
 #include <stdio.h>
 
 #include <dali/devel-api/adaptor-framework/file-loader.h>
 
-inline std::string GetFileContents(const std::string &fn)
+inline std::string GetFileContents(const std::stringfn)
 {
-  std::streampos bufferSize = 0;
+  std::streampos     bufferSize = 0;
   Dali::Vector<char> fileBuffer;
-  if( !Dali::FileLoader::ReadFile( fn, bufferSize, fileBuffer, Dali::FileLoader::FileType::BINARY ) )
+  if(!Dali::FileLoader::ReadFile(fn, bufferSize, fileBuffer, Dali::FileLoader::FileType::BINARY))
   {
-      return std::string();
+    return std::string();
   }
 
-  return std::string( &fileBuffer[0], bufferSize );
+  return std::string(&fileBuffer[0], bufferSize);
 }
 
 #endif // DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H
index 01dab59..0a7f6d5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_GET_IS_INL
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 inline OptionalChild IsChild(const TreeNode* node, const std::string& childName)
 {
-  if( node )
+  if(node)
   {
     const TreeNode* c = node->GetChild(childName);
-    if( NULL != c )
+    if(NULL != c)
     {
-      return OptionalChild( *c );
+      return OptionalChild(*c);
     }
     else
     {
@@ -43,12 +43,12 @@ inline OptionalChild IsChild(const TreeNode* node, const std::string& childName)
 
 inline OptionalChild IsChildIgnoreCase(const TreeNode* node, const std::string& childName)
 {
-  if( node )
+  if(node)
   {
     const TreeNode* c = node->GetChildIgnoreCase(childName);
-    if( NULL != c )
+    if(NULL != c)
     {
-      return OptionalChild( *c );
+      return OptionalChild(*c);
     }
     else
     {
@@ -73,7 +73,7 @@ inline OptionalChild IsChildIgnoreCase(const TreeNode& node, const std::string&
 
 inline OptionalString IsString(const OptionalChild& node)
 {
-  if( node && (*node).GetType() == TreeNode::STRING )
+  if(node && (*node).GetType() == TreeNode::STRING)
   {
     return OptionalString((*node).GetString());
   }
@@ -87,36 +87,36 @@ inline OptionalFloat IsFloat(const OptionalChild& node)
 {
   OptionalFloat ret;
 
-  if( node )
+  if(node)
   {
-    if( (*node).GetType() == TreeNode::FLOAT )
+    if((*node).GetType() == TreeNode::FLOAT)
     {
       ret = (*node).GetFloat();
     }
-    else if( (*node).GetType() == TreeNode::INTEGER )
+    else if((*node).GetType() == TreeNode::INTEGER)
     {
       // JSON has number not float/int but JsonParser discriminates.
       // Here we don't care so we allow coercion
-      ret = static_cast<float>( (*node).GetInteger() );
+      ret = static_cast<float>((*node).GetInteger());
     }
   }
 
   return ret;
 }
 
-inline OptionalInteger IsInteger(const OptionalChild &node)
+inline OptionalInteger IsInteger(const OptionalChildnode)
 {
   OptionalInteger ret;
 
-  if( node )
+  if(node)
   {
-    if( (*node).GetType() == TreeNode::INTEGER )
+    if((*node).GetType() == TreeNode::INTEGER)
     {
       ret = (*node).GetInteger();
     }
-    else if( (*node).GetType() == TreeNode::FLOAT )
+    else if((*node).GetType() == TreeNode::FLOAT)
     {
-      ret = static_cast<int>(  (*node).GetFloat() );
+      ret = static_cast<int>((*node).GetFloat());
     }
   }
 
@@ -125,7 +125,7 @@ inline OptionalInteger IsInteger(const OptionalChild &node)
 
 inline OptionalBoolean IsBoolean(const OptionalChild& node)
 {
-  if( node && (*node).GetType() == TreeNode::BOOLEAN )
+  if(node && (*node).GetType() == TreeNode::BOOLEAN)
   {
     return OptionalBoolean(1 == (*node).GetInteger());
   }
@@ -135,18 +135,17 @@ inline OptionalBoolean IsBoolean(const OptionalChild& node)
   }
 }
 
-
 // copy N Numbers
-template <typename T>
+template<typename T>
 inline bool CopyNumbers(TreeNode::ConstIterator iter, int N, T& vector)
 {
   for(int i = 0; i < N; ++i)
   {
-    if( (*iter).second.GetType() == TreeNode::FLOAT)
+    if((*iter).second.GetType() == TreeNode::FLOAT)
     {
       vector[i] = (*iter).second.GetFloat();
     }
-    else if( (*iter).second.GetType() == TreeNode::INTEGER )
+    else if((*iter).second.GetType() == TreeNode::INTEGER)
     {
       vector[i] = static_cast<float>((*iter).second.GetInteger());
     }
@@ -164,10 +163,10 @@ inline OptionalVector4 IsVector4(const OptionalChild& node)
 {
   OptionalVector4 ret;
 
-  if( node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 4 )
+  if(node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 4)
   {
     Dali::Vector4 v;
-    if( CopyNumbers((*node).CBegin(), 4, v) )
+    if(CopyNumbers((*node).CBegin(), 4, v))
     {
       ret = OptionalVector4(v);
     }
@@ -180,10 +179,10 @@ inline OptionalVector3 IsVector3(const OptionalChild& node)
 {
   OptionalVector3 ret;
 
-  if( node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 3 )
+  if(node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 3)
   {
     Dali::Vector3 v;
-    if( CopyNumbers((*node).CBegin(), 3, v) )
+    if(CopyNumbers((*node).CBegin(), 3, v))
     {
       ret = OptionalVector3(v);
     }
@@ -196,10 +195,10 @@ inline OptionalVector2 IsVector2(const OptionalChild& node)
 {
   OptionalVector2 ret;
 
-  if( node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 2 )
+  if(node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 2)
   {
     Dali::Vector2 v;
-    if( CopyNumbers((*node).CBegin(), 2, v) )
+    if(CopyNumbers((*node).CBegin(), 2, v))
     {
       ret = OptionalVector2(v);
     }
@@ -208,14 +207,14 @@ inline OptionalVector2 IsVector2(const OptionalChild& node)
   return ret;
 }
 
-inline OptionalMatrix IsMatrix(const OptionalChild &node)
+inline OptionalMatrix IsMatrix(const OptionalChildnode)
 {
   OptionalMatrix ret;
 
-  if( node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 16 )
+  if(node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 16)
   {
     float v[16];
-    if( CopyNumbers((*node).CBegin(), 16, v) )
+    if(CopyNumbers((*node).CBegin(), 16, v))
     {
       ret = OptionalMatrix(Dali::Matrix(v));
     }
@@ -228,14 +227,12 @@ inline OptionalMatrix3 IsMatrix3(const OptionalChild& node)
 {
   OptionalMatrix3 ret;
 
-  if( node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 9 )
+  if(node && (TreeNode::ARRAY == (*node).GetType()) && (*node).Size() >= 9)
   {
     float v[9];
-    if( CopyNumbers((*node).CBegin(), 9, v) )
+    if(CopyNumbers((*node).CBegin(), 9, v))
     {
-      ret = OptionalMatrix3(Dali::Matrix3(v[0], v[1], v[2],
-                                          v[3], v[4], v[5],
-                                          v[6], v[7], v[8] ));
+      ret = OptionalMatrix3(Dali::Matrix3(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]));
     }
   }
 
@@ -250,8 +247,8 @@ inline OptionalRect IsRect(const OptionalChild& node)
     if((*node).Size() >= 4)
     {
       TreeNode::ConstIterator iter((*node).CBegin());
-      int v[4];
-      if( CopyNumbers((*node).CBegin(), 4, v) )
+      int                     v[4];
+      if(CopyNumbers((*node).CBegin(), 4, v))
       {
         ret = OptionalRect(Dali::Rect<int>(v[0], v[1], v[2], v[3]));
       }
@@ -268,8 +265,8 @@ inline OptionalExtents IsExtents(const OptionalChild& node)
     if((*node).Size() >= 4)
     {
       TreeNode::ConstIterator iter((*node).CBegin());
-      int v[4];
-      if( CopyNumbers((*node).CBegin(), 4, v) )
+      int                     v[4];
+      if(CopyNumbers((*node).CBegin(), 4, v))
       {
         extents = OptionalExtents(Dali::Extents(v[0], v[1], v[2], v[3]));
       }
@@ -281,164 +278,162 @@ inline OptionalExtents IsExtents(const OptionalChild& node)
 //
 //
 //
-inline OptionalString IsString( const TreeNode& parent, const std::string& childName)
+inline OptionalString IsString(const TreeNode& parent, const std::string& childName)
 {
-  return IsString( IsChild(&parent, childName) );
+  return IsString(IsChild(&parent, childName));
 }
 
-inline OptionalFloat IsFloat( const TreeNode& parent, const std::string& childName)
+inline OptionalFloat IsFloat(const TreeNode& parent, const std::string& childName)
 {
-  return IsFloat( IsChild(&parent, childName) );
+  return IsFloat(IsChild(&parent, childName));
 }
 
-inline OptionalInteger IsInteger( const TreeNode& parent, const std::string& childName)
+inline OptionalInteger IsInteger(const TreeNode& parent, const std::string& childName)
 {
-  return IsInteger( IsChild(&parent, childName) );
+  return IsInteger(IsChild(&parent, childName));
 }
 
-inline OptionalBoolean IsBoolean( const TreeNode& parent, const std::string& childName)
+inline OptionalBoolean IsBoolean(const TreeNode& parent, const std::string& childName)
 {
-  return IsBoolean( IsChild(parent, childName) );
+  return IsBoolean(IsChild(parent, childName));
 }
 
-inline OptionalVector4 IsVector4(const TreeNode &parent, const std::string& childName)
+inline OptionalVector4 IsVector4(const TreeNodeparent, const std::string& childName)
 {
-  return IsVector4( IsChild(parent, childName) );
+  return IsVector4(IsChild(parent, childName));
 }
 
-inline OptionalVector3 IsVector3(const TreeNode &parent, const std::string& childName)
+inline OptionalVector3 IsVector3(const TreeNodeparent, const std::string& childName)
 {
-  return IsVector3( IsChild(parent, childName) );
+  return IsVector3(IsChild(parent, childName));
 }
 
-inline OptionalVector2 IsVector2(const TreeNode &parent, const std::string& childName)
+inline OptionalVector2 IsVector2(const TreeNodeparent, const std::string& childName)
 {
-  return IsVector2( IsChild(parent, childName) );
+  return IsVector2(IsChild(parent, childName));
 }
 
-inline OptionalMatrix IsMatrix(const TreeNode &parent, const std::string& childName)
+inline OptionalMatrix IsMatrix(const TreeNodeparent, const std::string& childName)
 {
-  return IsMatrix( IsChild(parent, childName) );
+  return IsMatrix(IsChild(parent, childName));
 }
 
-inline OptionalMatrix3 IsMatrix3(const TreeNode &parent, const std::string& childName)
+inline OptionalMatrix3 IsMatrix3(const TreeNodeparent, const std::string& childName)
 {
-  return IsMatrix3( IsChild(&parent, childName) );
+  return IsMatrix3(IsChild(&parent, childName));
 }
 
-inline OptionalRect IsRect(const TreeNode &parent, const std::string& childName)
+inline OptionalRect IsRect(const TreeNodeparent, const std::string& childName)
 {
-  return IsRect( IsChild(&parent, childName) );
+  return IsRect(IsChild(&parent, childName));
 }
 
-inline OptionalExtents IsExtents(const TreeNode &parent, const std::string& childName)
+inline OptionalExtents IsExtents(const TreeNodeparent, const std::string& childName)
 {
-  return IsExtents( IsChild(&parent, childName) );
+  return IsExtents(IsChild(&parent, childName));
 }
 
 //
 //
 //
-inline OptionalString IsString( const TreeNode& node )
+inline OptionalString IsString(const TreeNode& node)
 {
-  return IsString( OptionalChild( node ) );
+  return IsString(OptionalChild(node));
 }
 
-inline OptionalFloat IsFloat( const TreeNode& node )
+inline OptionalFloat IsFloat(const TreeNode& node)
 {
-  return IsFloat( OptionalChild( node ) );
+  return IsFloat(OptionalChild(node));
 }
 
-inline OptionalInteger IsInteger( const TreeNode& node )
+inline OptionalInteger IsInteger(const TreeNode& node)
 {
-  return IsInteger( OptionalChild( node ) );
+  return IsInteger(OptionalChild(node));
 }
 
-inline OptionalBoolean IsBoolean( const TreeNode& node )
+inline OptionalBoolean IsBoolean(const TreeNode& node)
 {
-  return IsBoolean( OptionalChild( node ) );
+  return IsBoolean(OptionalChild(node));
 }
 
-inline OptionalVector4 IsVector4(const TreeNode &node )
+inline OptionalVector4 IsVector4(const TreeNode& node)
 {
-  return IsVector4( OptionalChild( node ) );
+  return IsVector4(OptionalChild(node));
 }
 
-inline OptionalVector3 IsVector3(const TreeNode &node )
+inline OptionalVector3 IsVector3(const TreeNode& node)
 {
-  return IsVector3( OptionalChild( node ) );
+  return IsVector3(OptionalChild(node));
 }
 
-inline OptionalVector2 IsVector2(const TreeNode &node )
+inline OptionalVector2 IsVector2(const TreeNode& node)
 {
-  return IsVector2( OptionalChild( node ) );
+  return IsVector2(OptionalChild(node));
 }
 
-inline OptionalMatrix IsMatrix(const TreeNode &node )
+inline OptionalMatrix IsMatrix(const TreeNode& node)
 {
-  return IsMatrix( OptionalChild( node ) );
+  return IsMatrix(OptionalChild(node));
 }
 
-inline OptionalMatrix3 IsMatrix3(const TreeNode &node )
+inline OptionalMatrix3 IsMatrix3(const TreeNode& node)
 {
-  return IsMatrix3( OptionalChild( node ) );
+  return IsMatrix3(OptionalChild(node));
 }
 
-inline OptionalRect IsRect(const TreeNode &node )
+inline OptionalRect IsRect(const TreeNode& node)
 {
-  return IsRect( OptionalChild( node ) );
+  return IsRect(OptionalChild(node));
 }
 
-inline OptionalExtents IsExtents(const TreeNode &node )
+inline OptionalExtents IsExtents(const TreeNode& node)
 {
-  return IsExtents( OptionalChild( node ) );
+  return IsExtents(OptionalChild(node));
 }
 
 //
 //
 //
-inline Dali::Vector4 GetVector4(const TreeNode &child)
+inline Dali::Vector4 GetVector4(const TreeNodechild)
 {
-  OptionalVector4 v( IsVector4( OptionalChild( child ) ) );
+  OptionalVector4 v(IsVector4(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-inline Dali::Vector3 GetVector3(const TreeNode &child)
+inline Dali::Vector3 GetVector3(const TreeNodechild)
 {
-  OptionalVector3 v( IsVector3( OptionalChild( child ) ) );
+  OptionalVector3 v(IsVector3(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-inline Dali::Vector2 GetVector2(const TreeNode &child)
+inline Dali::Vector2 GetVector2(const TreeNodechild)
 {
-  OptionalVector2 v( IsVector2( OptionalChild( child ) ) );
+  OptionalVector2 v(IsVector2(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-inline float GetFloat(const TreeNode &child)
+inline float GetFloat(const TreeNodechild)
 {
-  OptionalFloat v( IsFloat( OptionalChild( child ) ) );
+  OptionalFloat v(IsFloat(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-inline bool GetBoolean(const TreeNode &child)
+inline bool GetBoolean(const TreeNodechild)
 {
-  OptionalBoolean v( IsBoolean( OptionalChild( child ) ) );
+  OptionalBoolean v(IsBoolean(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-inline int GetInteger(const TreeNode &child)
+inline int GetInteger(const TreeNodechild)
 {
-  OptionalInteger v( IsInteger( OptionalChild( child ) ) );
+  OptionalInteger v(IsInteger(OptionalChild(child)));
   DALI_ASSERT_ALWAYS(v);
   return *v;
 }
 
-
-
 #endif // DALI_TOOLKIT_INTERNAL_BUILDER_GET_IS_INL
index 8d30929..14c1c17 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_IMPL_DEBUG_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  * limitations under the License.
  */
 
-#include <dali/integration-api/debug.h>
 #include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali/integration-api/debug.h>
 
-#if defined( DEBUG_ENABLED )
+#if defined(DEBUG_ENABLED)
 
 namespace Dali
 {
@@ -28,36 +28,33 @@ namespace Toolkit
 {
 namespace Internal
 {
-
-#define DUMP_PARSE_TREE(parser)  LogTree(parser)
-#define DUMP_TEST_MAPPINGS(parser)                                      \
-  OptionalChild mappings = IsChild( parser.GetRoot(), KEYNAME_MAPPINGS ); \
-  if( mappings )                                                        \
-  {                                                                     \
-    std::ostringstream oss;                                             \
-    oss << "Mappings: {" << std::endl;                                  \
-    for( TreeNode::ConstIterator iter = (*mappings).CBegin(); iter != (*mappings).CEnd(); ++iter ) \
-    {                                                                   \
-      Property::Value value;                                            \
-      bool converted = GetPropertyMap(*mappings, (*iter).first, Property::NONE, value ); \
-      if( converted )                                                   \
-      {                                                                 \
-        oss << "  " << (*iter).first << ":" << value << std::endl;      \
-      }                                                                 \
-    }                                                                   \
-    oss << "}" << std::endl;                                            \
-    DALI_LOG_INFO( gFilterScript, Debug::Verbose, oss.str().c_str() );  \
+#define DUMP_PARSE_TREE(parser) LogTree(parser)
+#define DUMP_TEST_MAPPINGS(parser)                                                                 \
+  OptionalChild mappings = IsChild(parser.GetRoot(), KEYNAME_MAPPINGS);                            \
+  if(mappings)                                                                                     \
+  {                                                                                                \
+    std::ostringstream oss;                                                                        \
+    oss << "Mappings: {" << std::endl;                                                             \
+    for(TreeNode::ConstIterator iter = (*mappings).CBegin(); iter != (*mappings).CEnd(); ++iter)   \
+    {                                                                                              \
+      Property::Value value;                                                                       \
+      bool            converted = GetPropertyMap(*mappings, (*iter).first, Property::NONE, value); \
+      if(converted)                                                                                \
+      {                                                                                            \
+        oss << "  " << (*iter).first << ":" << value << std::endl;                                 \
+      }                                                                                            \
+    }                                                                                              \
+    oss << "}" << std::endl;                                                                       \
+    DALI_LOG_INFO(gFilterScript, Debug::Verbose, oss.str().c_str());                               \
   }
 
+void LogTree(const Toolkit::JsonParser& mParser);
 
-void LogTree( const Toolkit::JsonParser& mParser );
-
-std::string PropertyValueToString( const Property::Value& value );
-
+std::string PropertyValueToString(const Property::Value& value);
 
-} // Internal
-} // Toolkit
-} // Dali
+} // namespace Internal
+} // namespace Toolkit
+} // namespace Dali
 
 #else
 
index 049b3ce..59ff5de 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // EXTERNAL INCLUDES
-#include <string>
-#include <list>
-#include <map>
-#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/integration-api/debug.h>
 #include <dali/public-api/actors/actor.h>
+#include <dali/public-api/common/vector-wrapper.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/integration-api/debug.h>
+#include <list>
+#include <map>
+#include <string>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/builder/json-parser.h>
 #include <dali-toolkit/devel-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/json-parser.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, ...) \
-  DALI_LOG_WARNING("Script:" format, ## __VA_ARGS__)
+  DALI_LOG_WARNING("Script:" format, ##__VA_ARGS__)
 
 // Info messages are usually debug build
 #define DALI_SCRIPT_INFO(format, ...) \
-  DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::General, "Script:" format, ## __VA_ARGS__)
+  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, ...) \
-  DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::Verbose, "Script:" format, ## __VA_ARGS__)
+  DALI_LOG_INFO(Dali::Toolkit::Internal::gFilterScript, Debug::Verbose, "Script:" format, ##__VA_ARGS__)
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-  class TreeNode;
+class TreeNode;
 }
 
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 #if defined(DEBUG_ENABLED)
 extern Dali::Integration::Log::Filter* gFilterScript;
 #endif
@@ -74,24 +71,23 @@ class Replacement;
 class Builder : public Dali::BaseObject
 {
 public:
-
   Builder();
 
   /**
    * @copydoc Toolkit::Builder::LoadFromString
    */
-  void LoadFromString( const std::string &data,
-                       Dali::Toolkit::Builder::UIFormat rep = Dali::Toolkit::Builder::JSON );
+  void LoadFromString(const std::string&               data,
+                      Dali::Toolkit::Builder::UIFormat rep = Dali::Toolkit::Builder::JSON);
 
   /**
    * @copydoc Toolkit::Builder::AddConstants
    */
-  void AddConstants( const Property::Map& map );
+  void AddConstants(const Property::Map& map);
 
   /**
    * @copydoc Toolkit::Builder::AddConstant
    */
-  void AddConstant( const std::string& key, const Property::Value& value );
+  void AddConstant(const std::string& key, const Property::Value& value);
 
   /**
    * @copydoc Toolkit::Builder::GetConfigurations
@@ -106,52 +102,52 @@ public:
   /**
    * @copydoc Toolkit::Builder::GetConstant
    */
-  const Property::Value& GetConstant( const std::string& key ) const;
+  const Property::Value& GetConstant(const std::string& key) const;
 
   /**
    * @copydoc Toolkit::Builder::CreateAnimation( const std::string& animationName );
    */
-  Animation CreateAnimation( const std::string& animationName );
+  Animation CreateAnimation(const std::string& animationName);
 
   /**
    * @copydoc Toolkit::Builder::CreateAnimation( const std::string& animationName, const Property::Map& map );
    */
-  Animation CreateAnimation( const std::string& animationName, const Property::Map& map );
+  Animation CreateAnimation(const std::string& animationName, const Property::Map& map);
 
   /**
    * @copydoc Toolkit::Builder::CreateAnimation( const std::string&,Dali::Actor);
    */
-  Animation CreateAnimation( const std::string& animationName, Dali::Actor sourceActor );
+  Animation CreateAnimation(const std::string& animationName, Dali::Actor sourceActor);
 
   /**
    * @copydoc Toolkit::Builder::CreateAnimation( const std::string&,const Property::Map&, Dali::Actor);
    */
-  Animation CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor );
+  Animation CreateAnimation(const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor);
 
   /**
    * @copydoc Toolkit::Builder::Create( const std::string& templateName );
    */
-  BaseHandle Create( const std::string& templateName );
+  BaseHandle Create(const std::string& templateName);
 
   /**
    * @copydoc Toolkit::Builder::Create( const std::string& templateName, const Property::Map& map );
    */
-  BaseHandle Create( const std::string& templateName, const Property::Map& map );
+  BaseHandle Create(const std::string& templateName, const Property::Map& map);
 
   /**
    * @copydoc Toolkit::Builder::CreateFromJson( const std::string& json );
    */
-  BaseHandle CreateFromJson( const std::string& json );
+  BaseHandle CreateFromJson(const std::string& json);
 
   /**
    * @copydoc Toolkit::Builder::ApplyFromJson( Handle& handle, const std::string& json );
    */
-  bool ApplyFromJson(  Handle& handle, const std::string& json );
+  bool ApplyFromJson(Handle& handle, const std::string& json);
 
   /**
    * @copydoc Toolkit::Builder::ApplyStyle
    */
-  bool ApplyStyle( const std::string& styleName, Handle& handle );
+  bool ApplyStyle(const std::string& styleName, Handle& handle);
 
   /**
    * Lookup the stylename in builder. If it's found in the parse tree,
@@ -159,7 +155,7 @@ public:
    * @param[in] styleName The style name to search for
    * @return true if the stylename exists
    */
-  bool LookupStyleName( const std::string& styleName );
+  bool LookupStyleName(const std::string& styleName);
 
   /**
    * Lookup the stylename in the recorded Styles - if it exists,
@@ -169,32 +165,32 @@ public:
    * @param[in] styleName The stylename to search for
    * @return A const pointer to the style object
    */
-  const StylePtr GetStyle( const std::string& styleName );
+  const StylePtr GetStyle(const std::string& styleName);
 
   /**
    * @copydoc Toolkit::Builder::AddActors
    */
-  void AddActors( Actor toActor );
+  void AddActors(Actor toActor);
 
   /**
    * @copydoc Toolkit::Builder::AddActors
    */
-  void AddActors( const std::string &sectionName, Actor toActor );
+  void AddActors(const std::string& sectionName, Actor toActor);
 
   /**
    * @copydoc Toolkit::Builder::CreateRenderTask
    */
-  void CreateRenderTask( const std::string &name );
+  void CreateRenderTask(const std::string& name);
 
   /**
    * @copydoc Toolkit::Builder::GetPath
    */
-  Path GetPath( const std::string &name );
+  Path GetPath(const std::string& name);
 
   /**
    * @copydoc Toolkit::Builder::GetPathConstrainer
    */
-  Dali::PathConstrainer GetPathConstrainer( const std::string& name );
+  Dali::PathConstrainer GetPathConstrainer(const std::string& name);
 
   /*
    * Check if a given constrainer is of type PathConstrainer
@@ -202,12 +198,12 @@ public:
    * @return True if constainer is of type PathConstrainer, False otherwise
    *
    */
-  bool IsPathConstrainer( const std::string& name );
+  bool IsPathConstrainer(const std::string& name);
 
   /**
    * @copydoc Toolkit::Builder::GetLinearConstrainer
    */
-  Dali::LinearConstrainer GetLinearConstrainer( const std::string& name );
+  Dali::LinearConstrainer GetLinearConstrainer(const std::string& name);
 
   /*
    * Check if a given constrainer is of type LinearConstrainer
@@ -215,7 +211,7 @@ public:
    * @return True if constainer is of type LinearConstrainer, False otherwise
    *
    */
-  bool IsLinearConstrainer( const std::string& name );
+  bool IsLinearConstrainer(const std::string& name);
 
   /**
    * @copydoc Toolkit::Builder::QuitSignal
@@ -227,17 +223,23 @@ public:
    */
   void EmitQuitSignal();
 
-
 protected:
-
   ~Builder() override;
 
 private:
-  typedef std::vector<const char*> KeyStack;
-  typedef std::vector< TreeNode::KeyNodePair > MappingsLut;
-  typedef struct{ std::string name; Dali::LinearConstrainer linearConstrainer; } LinearConstrainerEntry;
+  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 struct
+  {
+    std::string           name;
+    Dali::PathConstrainer pathConstrainer;
+  } PathConstrainerEntry;
   typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
   typedef std::map<const std::string, Path> PathLut;
 
@@ -248,77 +250,77 @@ private:
   // Undefined
   Builder& operator=(const Builder& rhs);
 
-  void LoadConstants( const TreeNode& root, Property::Map& intoMap );
-
-  void LoadConfiguration( const TreeNode& root, Property::Map& intoMap );
+  void LoadConstants(const TreeNode& root, Property::Map& intoMap);
 
-  Animation CreateAnimation( const std::string& animationName,
-                             const Replacement& replacement,
-                             Dali::Actor        sourceActor );
+  void LoadConfiguration(const TreeNode& root, Property::Map& intoMap);
 
-  BaseHandle Create( const std::string& templateName,
-                     const Replacement& constant );
+  Animation CreateAnimation(const std::string& animationName,
+                            const Replacement& replacement,
+                            Dali::Actor        sourceActor);
 
-  BaseHandle DoCreate( const TreeNode&    root,
-                       const TreeNode&    node,
-                       Actor              parent,
-                       const Replacement& replacements );
+  BaseHandle Create(const std::string& templateName,
+                    const Replacement& constant);
 
-  void SetupTask( RenderTask&              task,
-                  const Toolkit::TreeNode& node,
-                  const Replacement&       replacement );
+  BaseHandle DoCreate(const TreeNode&    root,
+                      const TreeNode&    node,
+                      Actor              parent,
+                      const Replacement& replacements);
 
-  bool ApplyStyle( const std::string& styleName,
-                   Handle&            handle,
-                   const Replacement& replacement);
+  void SetupTask(RenderTask&              task,
+                 const Toolkit::TreeNode& node,
+                 const Replacement&       replacement);
 
-  void ApplyAllStyleProperties( const TreeNode&    root,
-                                const TreeNode&    node,
-                                Dali::Handle&      handle,
-                                const Replacement& constant );
+  bool ApplyStyle(const std::string& styleName,
+                  Handle&            handle,
+                  const Replacement& replacement);
 
-  void RecordStyles( const char*        styleName,
-                     const TreeNode&    node,
-                     Dali::Handle&      handle,
-                     const Replacement& replacements );
+  void ApplyAllStyleProperties(const TreeNode&    root,
+                               const TreeNode&    node,
+                               Dali::Handle&      handle,
+                               const Replacement& constant);
 
-  void RecordStyle( StylePtr           style,
+  void RecordStyles(const char*        styleName,
                     const TreeNode&    node,
                     Dali::Handle&      handle,
-                    const Replacement& replacements );
+                    const Replacement& replacements);
 
-  void RecordTransitions( const TreeNode::KeyNodePair& keyValue,
-                          Property::Array& transitions,
-                          const Replacement& replacements );
+  void RecordStyle(StylePtr           style,
+                   const TreeNode&    node,
+                   Dali::Handle&      handle,
+                   const Replacement& replacements);
 
-  void RecordTransitionData( const TreeNode::KeyNodePair& keyNode,
-                             Toolkit::TransitionData& transitionData,
-                             const Replacement& replacements );
+  void RecordTransitions(const TreeNode::KeyNodePair& keyValue,
+                         Property::Array&             transitions,
+                         const Replacement&           replacements);
 
-  void ApplyProperties( const TreeNode&    root,
-                        const TreeNode&    node,
-                        Dali::Handle&      handle,
-                        const Replacement& constant );
+  void RecordTransitionData(const TreeNode::KeyNodePair& keyNode,
+                            Toolkit::TransitionData&     transitionData,
+                            const Replacement&           replacements);
 
-  void ApplySignals( const TreeNode& root,
-                     const TreeNode& node,
-                     Dali::Handle& handle );
+  void ApplyProperties(const TreeNode&    root,
+                       const TreeNode&    node,
+                       Dali::Handle&      handle,
+                       const Replacement& constant);
 
-  void ApplyStylesByActor( const TreeNode&    root,
-                           const TreeNode&    node,
-                           Dali::Handle&      handle,
-                           const Replacement& constant );
+  void ApplySignals(const TreeNode& root,
+                    const TreeNode& node,
+                    Dali::Handle&   handle);
 
-  void SetProperties( const TreeNode&    node,
-                      Handle&            handle,
-                      const Replacement& constant );
+  void ApplyStylesByActor(const TreeNode&    root,
+                          const TreeNode&    node,
+                          Dali::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 );
+  void SetProperties(const TreeNode&    node,
+                     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
@@ -330,16 +332,16 @@ private:
    * @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 );
+  bool GetPropertyMap(const TreeNode&  mappingRoot,
+                      const char*      theKey,
+                      Property::Type   propertyType,
+                      Property::Value& value);
 
-  void SetCustomProperties( const TreeNode&      node,
-                            Handle&              handle,
-                            const Replacement&   constant,
-                            const std::string&   childName,
-                            Property::AccessMode accessMode );
+  void SetCustomProperties(const TreeNode&      node,
+                           Handle&              handle,
+                           const Replacement&   constant,
+                           const std::string&   childName,
+                           Property::AccessMode accessMode);
 
   /**
    * Find the key in the mapping table, if it's present, then generate
@@ -352,12 +354,11 @@ private:
    * @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 );
-
+  bool RecursePropertyMap(const TreeNode&  mappingRoot,
+                          KeyStack&        keyStack,
+                          const char*      theKey,
+                          Property::Type   propertyType,
+                          Property::Value& value);
 
   /**
    * Tests if the value is a string delimited by <>. If it is, then it attempts to
@@ -367,9 +368,9 @@ private:
    * @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 );
+  bool ConvertChildValue(const TreeNode&  mappingRoot,
+                         KeyStack&        keyStack,
+                         Property::Value& value);
 
 private:
   Toolkit::JsonParser                 mParser;
index a9ae431..b5f523a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -23,7 +23,6 @@ namespace Toolkit
 {
 namespace Internal
 {
-
 /**
  * Set a property value from a tree node.
  * This function determines the type of the property from the format of the string in the node.
@@ -31,8 +30,8 @@ namespace Internal
  * @param node  The node string to convert from
  * @param value The property value to set
  */
-void DeterminePropertyFromNode( const TreeNode&  node,
-                                Property::Value& value );
+void DeterminePropertyFromNode(const TreeNode&  node,
+                               Property::Value& value);
 
 /**
  * Set a property value from a tree node as DeterminePropertyFromNode() above
@@ -42,9 +41,9 @@ void DeterminePropertyFromNode( const TreeNode&  node,
  * @param value The property value to set
  * @param replacement The overriding replacement map (if any)
  */
-void DeterminePropertyFromNode( const TreeNode&    node,
-                                Property::Value&   value,
-                                const Replacement& replacement );
+void DeterminePropertyFromNode(const TreeNode&    node,
+                               Property::Value&   value,
+                               const Replacement& replacement);
 
 /**
  * Set a property value as the given type from a tree node.
@@ -53,9 +52,9 @@ void DeterminePropertyFromNode( const TreeNode&    node,
  * @param value The property value to set
  * @return true if the string could be converted to the correct type.
  */
-bool DeterminePropertyFromNode( const TreeNode&  node,
-                                Property::Type   type,
-                                Property::Value& value );
+bool DeterminePropertyFromNode(const TreeNode&  node,
+                               Property::Type   type,
+                               Property::Value& value);
 
 /**
  * Set a property value as the given type from a tree node as DeterminePropertyFromNode() above
@@ -65,14 +64,13 @@ bool DeterminePropertyFromNode( const TreeNode&  node,
  * @param replacement The overriding replacement map (if any)
  * @return true if the string could be converted to the correct type.
  */
-bool DeterminePropertyFromNode( const TreeNode&    node,
-                                Property::Type     type,
-                                Property::Value&   value,
-                                const Replacement& replacement );
-
+bool DeterminePropertyFromNode(const TreeNode&    node,
+                               Property::Type     type,
+                               Property::Value&   value,
+                               const Replacement& replacement);
 
-} // Internal namespace
-} // Toolkit namespace
-} // Dali namespace
+} // namespace Internal
+} // namespace Toolkit
+} // namespace Dali
 
 #endif //DALI_TOOLKIT_INTERNAL_BUILDER_SET_PROPERTY_H
index a3036d9..b570c04 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
@@ -30,7 +30,6 @@ namespace Toolkit
 {
 namespace Internal
 {
-
 /**
  * The Dictionary template class enables a means of storing key-value
  * pairs where the keys are strings and the value can be a complex
@@ -41,7 +40,7 @@ namespace Internal
 
 using DictionaryKeys = std::vector<std::string>;
 
-inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict )
+inline void Merge(DictionaryKeys& toDict, const DictionaryKeys& fromDict)
 {
   for(const auto& element : fromDict)
   {
@@ -53,7 +52,6 @@ inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict )
   }
 }
 
-
 template<typename EntryType>
 class Dictionary
 {
@@ -64,7 +62,7 @@ private:
   struct Element
   {
     std::string key;
-    EntryType entry;
+    EntryType   entry;
     Element(std::string name, EntryType entry)
     : key(std::move(name)),
       entry(std::move(entry))
@@ -82,9 +80,9 @@ private:
 
   auto FindElement(std::string_view key)
   {
-    return std::find_if(container.begin(), container.end(), [key](auto& e){
-        return bool(key == e.key);
-      });
+    return std::find_if(container.begin(), container.end(), [key](auto& e) {
+      return bool(key == e.key);
+    });
   }
 
 public:
@@ -138,12 +136,12 @@ public:
 
       if(iter != End())
       {
-        container.erase( iter );
+        container.erase(iter);
       }
     }
   }
 
-  void Merge( const Dictionary<EntryType>& dictionary )
+  void Merge(const Dictionary<EntryType>& dictionary)
   {
     for(const auto& element : dictionary.container)
     {
@@ -166,7 +164,7 @@ public:
    */
   const EntryType* FindConst(std::string_view key) const
   {
-    if( ! key.empty() )
+    if(!key.empty())
     {
       auto iter = FindElementCaseInsensitive(key);
 
@@ -184,7 +182,7 @@ public:
    */
   EntryType* Find(std::string_view key) const
   {
-    if( ! key.empty() )
+    if(!key.empty())
     {
       auto iter = FindElementCaseInsensitive(key);
 
@@ -209,7 +207,7 @@ public:
     return container.cend();
   }
 
-  void GetKeys( DictionaryKeys& keys ) const
+  void GetKeys(DictionaryKeys& keys) const
   {
     keys.clear();
     for(const auto& element : container)
@@ -224,10 +222,8 @@ public:
   }
 };
 
-
-
-}//Internal
-}//Toolkit
-}//Dali
+} // namespace Internal
+} // namespace Toolkit
+} // namespace Dali
 
 #endif // DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H
index f635a82..58c2ce0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_JSON_PARSER_IMPL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  */
 
 // EXTERNAL INCLUDES
-#include <string>
-#include <list>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
+#include <list>
+#include <string>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/builder/json-parser.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 /*
  * Parses JSON
  */
@@ -105,45 +102,42 @@ public:
   void Write(std::ostream& output, int indent) const;
 
 private:
-  typedef std::vector<char> VectorChar;
+  typedef std::vector<char>    VectorChar;
   typedef VectorChar::iterator VectorCharIter;
 
-  typedef std::list<VectorChar> SourceContainer;
+  typedef std::list<VectorChar>           SourceContainer;
   typedef std::list<VectorChar>::iterator SourceContainerIter;
 
-  JsonParser(JsonParser &);
+  JsonParser(JsonParser&);
   JsonParser& operator=(const JsonParser&);
 
-  SourceContainer mSources;         ///< List of strings from Parse() merge operations
-
-  TreeNode* mRoot;                  ///< Tree root
+  SourceContainer mSources; ///< List of strings from Parse() merge operations
 
-  const char *mErrorDescription;    ///< Last parse error description
-  int mErrorPosition;               ///< Last parse error position
-  int mErrorLine;                   ///< Last parse error line
-  int mErrorColumn;                 ///< Last parse error column
+  TreeNode* mRoot; ///< Tree root
 
-  int mNumberOfChars;               ///< The size of string data for all nodes
-  int mNumberOfNodes;               ///< Node count
+  const char* mErrorDescription; ///< Last parse error description
+  int         mErrorPosition;    ///< Last parse error position
+  int         mErrorLine;        ///< Last parse error line
+  int         mErrorColumn;      ///< Last parse error column
 
+  int mNumberOfChars; ///< The size of string data for all nodes
+  int mNumberOfNodes; ///< Node count
 };
 
 } // namespace Internal
 
-
 inline const Internal::JsonParser& GetImplementation(const Toolkit::JsonParser& parser)
 {
-  DALI_ASSERT_ALWAYS( parser && "JsonParser handle is empty" );
+  DALI_ASSERT_ALWAYS(parser && "JsonParser handle is empty");
 
   const BaseObject& handle = parser.GetBaseObject();
 
   return static_cast<const Internal::JsonParser&>(handle);
 }
 
-
 inline Internal::JsonParser& GetImplementation(Toolkit::JsonParser& parser)
 {
-  DALI_ASSERT_ALWAYS( parser && "JsonParser handle is empty" );
+  DALI_ASSERT_ALWAYS(parser && "JsonParser handle is empty");
 
   BaseObject& handle = parser.GetBaseObject();
 
@@ -154,5 +148,4 @@ inline Internal::JsonParser& GetImplementation(Toolkit::JsonParser& parser)
 
 } // namespace Dali
 
-
 #endif // DALI_JSON_PARSER_IMPL_H
index 4d7e7a4..d6eb0e9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_JSON_PARSE_STATE_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 /**
  * A safer std::advance()
  */
-template <typename IteratorType,typename EndIteratorType>
+template<typename IteratorType, typename EndIteratorType>
 inline int AdvanceIter(IteratorType& iter, EndIteratorType& end, int n)
 {
-  for(int i =0; i < n; ++i)
+  for(int i = 0; i < n; ++i)
   {
     if(iter == end)
     {
@@ -85,51 +82,69 @@ public:
    * Get the error description of the last parse
    * @return The error description or NULL if no error
    */
-  const char* GetErrorDescription() { return mErrorDescription; }
+  const char* GetErrorDescription()
+  {
+    return mErrorDescription;
+  }
 
   /**
    * Get the error line number
    * @return The line number of the error
    */
-  int GetErrorLineNumber() { return mErrorNewLine; }
+  int GetErrorLineNumber()
+  {
+    return mErrorNewLine;
+  }
 
   /**
    * Get the error column
    * @return The error column
    */
-  int GetErrorColumn() { return mErrorColumn; }
+  int GetErrorColumn()
+  {
+    return mErrorColumn;
+  }
 
   /**
    * Get the error position
    * @return The error position
    */
-  int GetErrorPosition() { return mErrorPosition; }
+  int GetErrorPosition()
+  {
+    return mErrorPosition;
+  }
 
   /**
    * Get the size of the string data that has been parsed
    * @return The size of string data
    */
-  int GetParsedStringSize() { return mNumberOfParsedChars; };
+  int GetParsedStringSize()
+  {
+    return mNumberOfParsedChars;
+  };
 
   /**
    * Get the number of nodes created
    * @return The number of nodes
    */
-  int GetCreatedNodeCount() { return mNumberOfCreatedNodes; };
+  int GetCreatedNodeCount()
+  {
+    return mNumberOfCreatedNodes;
+  };
 
 private:
-  VectorCharIter mIter;                ///< Current position
-  VectorCharIter mStart;               ///< Start position
-  VectorCharIter mEnd;                 ///< End of buffer being parsed
-  TreeNode* mRoot;                     ///< Root node created
-  TreeNodeManipulator mCurrent;        ///< The Current modifiable node
-  const char* mErrorDescription;       ///< The error description if set
-  int mErrorNewLine;                   ///< The error line number
-  int mErrorColumn;                    ///< The error column
-  int mErrorPosition;                  ///< The error position
-  int mNumberOfParsedChars;            ///< The size of string data
-  int mNumberOfCreatedNodes;           ///< The number of nodes created
-  bool mFirstParse;                    ///< Flag if first parse
+  VectorCharIter      mIter;                 ///< Current position
+  VectorCharIter      mStart;                ///< Start position
+  VectorCharIter      mEnd;                  ///< End of buffer being parsed
+  TreeNode*           mRoot;                 ///< Root node created
+  TreeNodeManipulator mCurrent;              ///< The Current modifiable node
+  const char*         mErrorDescription;     ///< The error description if set
+  int                 mErrorNewLine;         ///< The error line number
+  int                 mErrorColumn;          ///< The error column
+  int                 mErrorPosition;        ///< The error position
+  int                 mNumberOfParsedChars;  ///< The size of string data
+  int                 mNumberOfCreatedNodes; ///< The number of nodes created
+  bool                mFirstParse;           ///< Flag if first parse
 
   /**
    * The current parse state
@@ -231,7 +246,7 @@ private:
     {
       return Error("Attempt to walk up above root");
     }
-    mCurrent = TreeNodeManipulator( mCurrent.GetParent() );
+    mCurrent = TreeNodeManipulator(mCurrent.GetParent());
     return true;
   }
 
@@ -269,7 +284,7 @@ private:
   {
     int c = AdvanceIter(mIter, mEnd, n);
     mErrorPosition += c;
-    mErrorColumn   += c;
+    mErrorColumn += c;
   }
 
   /**
@@ -279,7 +294,7 @@ private:
   {
     int c = AdvanceIter(mIter, mEnd, n);
     mErrorPosition += c;
-    mErrorColumn   += c;
+    mErrorColumn += c;
     return mEnd == mIter;
   }
 
@@ -290,8 +305,8 @@ private:
   {
     int c = AdvanceIter(mIter, mEnd, n);
     mErrorPosition += c;
-    mErrorColumn   += c;
-    static_cast<void>( ParseWhiteSpace() );
+    mErrorColumn += c;
+    static_cast<void>(ParseWhiteSpace());
   }
 
   /**
@@ -421,7 +436,6 @@ private:
   bool HandleCharacterComma(const char* name);
 };
 
-
 } // namespace Internal
 
 } // namespace Toolkit
index 666dd30..7251ad2 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_OPTIONAL_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
  *
  */
 
-template <typename T>
+template<typename T>
 struct OptionalTypes
 {
-  typedef T ValueType;
-  typedef const T& ReturnType;
-  static ReturnType Get(const ValueType& v) { return v; }
-  static ValueType Set(const ReturnType v) { return v; }
-  static bool Ok(const ValueType& v) { return true; }
+  typedef T         ValueType;
+  typedef const T&  ReturnType;
+  static ReturnType Get(const ValueType& v)
+  {
+    return v;
+  }
+  static ValueType Set(const ReturnType v)
+  {
+    return v;
+  }
+  static bool Ok(const ValueType& v)
+  {
+    return true;
+  }
 };
 
-template <typename T>
+template<typename T>
 struct OptionalTypes<T*>
 {
-  typedef T* ValueType;
-  typedef const T* ReturnType;
-  static ReturnType Get(const ValueType v) { return v; }
-  static ValueType Set(const ReturnType v) { return v; }
-  static bool Ok(const ReturnType v) { return NULL != v; }
+  typedef T*        ValueType;
+  typedef const T*  ReturnType;
+  static ReturnType Get(const ValueType v)
+  {
+    return v;
+  }
+  static ValueType Set(const ReturnType v)
+  {
+    return v;
+  }
+  static bool Ok(const ReturnType v)
+  {
+    return NULL != v;
+  }
 };
 
-template <typename T>
+template<typename T>
 struct OptionalTypes<T&>
 {
-  typedef T* ValueType;
-  typedef const T& ReturnType;
-  static ReturnType Get(const ValueType v) { return *v; }
-  static ValueType Set(const ReturnType v) { return &v; }
-  static bool Ok(const ReturnType v) { return true; }
+  typedef T*        ValueType;
+  typedef const T&  ReturnType;
+  static ReturnType Get(const ValueType v)
+  {
+    return *v;
+  }
+  static ValueType Set(const ReturnType v)
+  {
+    return &v;
+  }
+  static bool Ok(const ReturnType v)
+  {
+    return true;
+  }
 };
 
-template <typename T>
+template<typename T>
 class OptionalValue
 {
 public:
-  typedef void ( OptionalValue::*bool_type )() const;
+  typedef void (OptionalValue::*bool_type)() const;
   typedef typename OptionalTypes<T>::ReturnType ReturnType;
-  typedef typename OptionalTypes<T>::ValueType ValueType;
+  typedef typename OptionalTypes<T>::ValueType  ValueType;
 
-  OptionalValue(): mOk(false), mValue() {}
-  OptionalValue( T value ): mOk(OptionalTypes<T>::Ok(value)), mValue(OptionalTypes<T>::Set(value)) {}
-  OptionalValue( bool b, T value ): mOk(b), mValue(OptionalTypes<T>::Set(value)) {}
+  OptionalValue()
+  : mOk(false),
+    mValue()
+  {
+  }
+  OptionalValue(T value)
+  : mOk(OptionalTypes<T>::Ok(value)),
+    mValue(OptionalTypes<T>::Set(value))
+  {
+  }
+  OptionalValue(bool b, T value)
+  : mOk(b),
+    mValue(OptionalTypes<T>::Set(value))
+  {
+  }
 
-  ReturnType operator *() const { return OptionalTypes<T>::Get(mValue); }
+  ReturnType operator*() const
+  {
+    return OptionalTypes<T>::Get(mValue);
+  }
 
   // safe bool idiom
-  operator bool_type() const {
+  operator bool_type() const
+  {
     return mOk == true ? &OptionalValue::this_type_does_not_support_comparisons : 0;
   }
 
 private:
-  bool mOk;
+  bool      mOk;
   ValueType mValue;
-  void this_type_does_not_support_comparisons() const {}
+  void      this_type_does_not_support_comparisons() const
+  {
+  }
 };
 
-template <typename T, typename U>
-bool operator==( const OptionalValue<T>& lhs, const OptionalValue<U>& rhs )
+template<typename T, typename U>
+bool operator==(const OptionalValue<T>& lhs, const OptionalValue<U>& rhs)
 {
   lhs.this_type_does_not_support_comparisons();
   return false;
 }
 
-template <typename T, typename U>
-bool operator!=( const OptionalValue<T>& lhs, const OptionalValue<U>& rhs )
+template<typename T, typename U>
+bool operator!=(const OptionalValue<T>& lhs, const OptionalValue<U>& rhs)
 {
   lhs.this_type_does_not_support_comparisons();
   return false;
index 24260de..7780ec6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUILDER_REPLACEMENT_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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.
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-  class TreeNode;
+class TreeNode;
 }
 
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 /*
  * Supports template replacement functionality
  *
@@ -46,7 +43,6 @@ namespace Internal
 class Replacement
 {
 public:
-
   /*
    * Constructor
    */
@@ -59,7 +55,7 @@ public:
    * @param overrideMap The user overriding map
    * @param defaultMap The default map to use
    */
-  Replacement( const Property::Map& overrideMap, const Property::Map& defaultMap );
+  Replacement(const Property::Map& overrideMap, const Property::Map& defaultMap);
 
   /*
    * Constructor with default map
@@ -67,175 +63,175 @@ public:
    * Make a deep copy of the tree.
    * @param overrideMap The user overriding map
    */
-  Replacement( const Property::Map& defaultMap );
+  Replacement(const Property::Map& defaultMap);
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalString IsString( const TreeNode& node ) const;
+  OptionalString IsString(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalBoolean IsBoolean( const TreeNode & node ) const;
+  OptionalBoolean IsBoolean(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalFloat IsFloat( const TreeNode & node ) const;
+  OptionalFloat IsFloat(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalInteger IsInteger( const TreeNode & node ) const;
+  OptionalInteger IsInteger(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalVector2 IsVector2( const TreeNode & node ) const;
+  OptionalVector2 IsVector2(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalVector3 IsVector3( const TreeNode & node ) const;
+  OptionalVector3 IsVector3(const TreeNode& node) const;
 
   /* @brief Check node for a type
    *
    * @param node The TreeNode to check
    * @return Optional value
    */
-  OptionalVector4 IsVector4( const TreeNode & node ) const;
+  OptionalVector4 I