Minor coverity issue fixes 55/282555/24
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 5 Oct 2022 14:02:09 +0000 (23:02 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Mon, 19 Dec 2022 19:25:28 +0000 (04:25 +0900)
Fix some minor coverity issues that might has meanful

1. Implement missing move operation.
2. Remove float equal checks by ==, != operator.
3. Remove useless std::move.
4. Remove const keyword for function return value.
5. Resolve some value has same name.
6. Use referenced iterator so we don't copy value.
7. Remove cyclic header include (a.k.a gltf-loader.h -> scene3d-view-impl.h -> gltf-loader.h)

Change-Id: I57ad541310b43413ee0d52b1f8c56a95df12bbd9
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
87 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-VisualUrl.cpp
dali-scene3d/internal/controls/model/model-impl.cpp
dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp
dali-scene3d/public-api/loader/dli-loader.cpp
dali-scene3d/public-api/loader/material-definition.cpp
dali-scene3d/public-api/loader/material-definition.h
dali-scene3d/public-api/loader/mesh-definition.cpp
dali-scene3d/public-api/loader/mesh-definition.h
dali-scene3d/public-api/loader/scene-definition.cpp
dali-scene3d/public-api/loader/shader-definition.cpp
dali-toolkit/devel-api/controls/bloom-view/bloom-view.cpp
dali-toolkit/devel-api/controls/bloom-view/bloom-view.h
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.cpp
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h
dali-toolkit/devel-api/controls/control-accessible.cpp
dali-toolkit/devel-api/controls/effects-view/effects-view.cpp
dali-toolkit/devel-api/controls/effects-view/effects-view.h
dali-toolkit/devel-api/controls/magnifier/magnifier.cpp
dali-toolkit/devel-api/controls/magnifier/magnifier.h
dali-toolkit/devel-api/controls/navigation-view/navigation-view.cpp
dali-toolkit/devel-api/controls/navigation-view/navigation-view.h
dali-toolkit/devel-api/controls/popup/confirmation-popup.cpp
dali-toolkit/devel-api/controls/popup/confirmation-popup.h
dali-toolkit/devel-api/controls/popup/popup.cpp
dali-toolkit/devel-api/controls/popup/popup.h
dali-toolkit/devel-api/controls/scene3d-view/scene3d-view.cpp
dali-toolkit/devel-api/controls/scene3d-view/scene3d-view.h
dali-toolkit/devel-api/controls/shadow-view/shadow-view.cpp
dali-toolkit/devel-api/controls/shadow-view/shadow-view.h
dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.cpp
dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h
dali-toolkit/devel-api/controls/text-controls/text-anchor-devel.cpp
dali-toolkit/devel-api/controls/text-controls/text-anchor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h
dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.cpp
dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h
dali-toolkit/devel-api/controls/tool-bar/tool-bar.cpp
dali-toolkit/devel-api/controls/tool-bar/tool-bar.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/tree-node-manipulator.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/model3d-view/obj-loader.h
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/scene3d-view/gltf-loader.cpp
dali-toolkit/internal/controls/scene3d-view/gltf-loader.h
dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp
dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/text-controls/common-text-utils.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/text/controller/text-controller-impl-model-updater.cpp
dali-toolkit/internal/text/controller/text-controller-relayouter.cpp
dali-toolkit/internal/text/controller/text-controller-text-updater.cpp
dali-toolkit/internal/text/controller/text-controller.cpp
dali-toolkit/internal/text/controller/text-controller.h
dali-toolkit/internal/text/input-style.h
dali-toolkit/internal/text/multi-language-support.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-backend.cpp
dali-toolkit/internal/text/rendering/text-backend.h
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/vector-based/vector-blob-atlas-share.h
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/rendering/view-model.h
dali-toolkit/internal/text/strikethrough-style-properties.h
dali-toolkit/internal/text/text-effects-style.cpp
dali-toolkit/internal/text/text-geometry.cpp
dali-toolkit/internal/text/text-model-interface.h
dali-toolkit/internal/text/text-model.cpp
dali-toolkit/internal/text/text-model.h
dali-toolkit/internal/text/text-view-interface.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/text/text-view.h
dali-toolkit/internal/text/underline-style-properties.h
dali-toolkit/internal/transition/slide-transition-impl.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-factory-cache.cpp
dali-toolkit/internal/visuals/visual-url.cpp
dali-toolkit/internal/visuals/visual-url.h
dali-toolkit/public-api/controls/control-impl.cpp

index bd5ab62..3003ae4 100644 (file)
@@ -52,7 +52,7 @@ int UtcDaliVisualUrlConstructor(void)
   DALI_TEST_EQUALS(visualUrl4.GetProtocolType(), VisualUrl::LOCAL, TEST_LOCATION);
 
   VisualUrl visualUrl5("dali://1");
-  visualUrl4 = visualUrl5;
+  visualUrl4 = std::move(visualUrl5);
   DALI_TEST_EQUALS(true, visualUrl4.IsValid(), TEST_LOCATION);
   DALI_TEST_EQUALS(visualUrl4.GetType(), VisualUrl::REGULAR_IMAGE, TEST_LOCATION);
   DALI_TEST_EQUALS(visualUrl4.GetProtocolType(), VisualUrl::TEXTURE, TEST_LOCATION);
@@ -68,6 +68,18 @@ int UtcDaliVisualUrlConstructor(void)
   DALI_TEST_EQUALS(true, visualUrl6.IsValid(), TEST_LOCATION);
   DALI_TEST_EQUALS(visualUrl6.GetType(), VisualUrl::REGULAR_IMAGE, TEST_LOCATION);
   DALI_TEST_EQUALS(visualUrl6.GetProtocolType(), VisualUrl::BUFFER, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(true, visualUrl7.IsValid(), TEST_LOCATION);
+  std::size_t hashResult = visualUrl7.GetUrlHash();
+
+  VisualUrl visualUrl8(std::move(visualUrl7));
+  DALI_TEST_EQUALS(true, visualUrl8.IsValid(), TEST_LOCATION);
+  DALI_TEST_EQUALS(visualUrl8.GetType(), VisualUrl::REGULAR_IMAGE, TEST_LOCATION);
+  DALI_TEST_EQUALS(visualUrl8.GetProtocolType(), VisualUrl::BUFFER, TEST_LOCATION);
+  DALI_TEST_EQUALS(visualUrl8.GetUrlHash(), hashResult, TEST_LOCATION);
+
+  DALI_TEST_EQUALS(false, visualUrl7.IsValid(), TEST_LOCATION);
+  DALI_TEST_EQUALS(Dali::CalculateHash(std::string("")), visualUrl7.GetUrlHash(), TEST_LOCATION);
   END_TEST;
 }
 
index 8b95f82..bdbbf3b 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
 #include <filesystem>
@@ -104,7 +105,7 @@ struct BoundingVolume
     for(uint32_t i = 0; i < 3; ++i)
     {
       // To avoid divid by zero
-      if(pointMin[i] == pointMax[i])
+      if(Dali::Equals(pointMin[i], pointMax[i]))
       {
         pivot[i] = 0.5f;
       }
@@ -529,7 +530,7 @@ void Model::LoadModel()
   mModelPivot  = AABB.CalculatePivot();
   mModelRoot.SetProperty(Dali::Actor::Property::SIZE, mNaturalSize);
   Vector3 controlSize = Self().GetProperty<Vector3>(Dali::Actor::Property::SIZE);
-  if(controlSize.x == 0.0f || controlSize.y == 0.0f)
+  if(Dali::EqualsZero(controlSize.x) || Dali::EqualsZero(controlSize.y))
   {
     Self().SetProperty(Dali::Actor::Property::SIZE, mNaturalSize);
   }
index 169cef9..940bf87 100644 (file)
@@ -31,6 +31,7 @@
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/rendering/frame-buffer-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
 #include <string_view>
@@ -552,8 +553,8 @@ void SceneView::UpdateRenderTask()
     {
       Dali::FrameBuffer currentFrameBuffer = mRenderTask.GetFrameBuffer();
       if(!currentFrameBuffer ||
-         currentFrameBuffer.GetColorTexture().GetWidth() != size.width ||
-         currentFrameBuffer.GetColorTexture().GetHeight() != size.height)
+         !Dali::Equals(currentFrameBuffer.GetColorTexture().GetWidth(), size.width) ||
+         !Dali::Equals(currentFrameBuffer.GetColorTexture().GetHeight(), size.height))
       {
         mRenderTask.ResetViewportGuideActor();
         mRenderTask.SetViewport(Dali::Viewport(Vector4::ZERO));
index 70c59d2..7eafcb7 100644 (file)
@@ -485,8 +485,7 @@ void DliLoader::Impl::ParseScene(LoadParams& params)
 
 void DliLoader::Impl::ParseSceneInternal(Index iScene, const Toolkit::TreeNode* tnScenes, const Toolkit::TreeNode* tnNodes, LoadParams& params)
 {
-  auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene)
-  {
+  auto getSceneRootIdx = [tnScenes, tnNodes](Index iScene) {
     auto tn = GetNthChild(tnScenes, iScene); // now a "scene" object
     if(!tn)
     {
@@ -569,8 +568,7 @@ void DliLoader::Impl::ParseSkeletons(const TreeNode* skeletons, SceneDefinition&
         uint32_t                   jointCount = 0;
         std::function<void(Index)> visitFn;
         auto&                      ibms = mInverseBindMatrices;
-        visitFn                         = [&](Index id)
-        {
+        visitFn                         = [&](Index id) {
           auto node = scene.GetNode(id);
           jointCount += ibms.find(id) != ibms.end();
 
@@ -589,8 +587,7 @@ void DliLoader::Impl::ParseSkeletons(const TreeNode* skeletons, SceneDefinition&
 
         skeleton.mJoints.reserve(jointCount);
 
-        visitFn = [&](Index id)
-        {
+        visitFn = [&](Index id) {
           auto iFind = ibms.find(id);
           if(iFind != ibms.end() && skeleton.mJoints.size() < Skinning::MAX_JOINTS)
           {
@@ -742,9 +739,10 @@ void DliLoader::Impl::ParseShaders(const TreeNode* shaders, ResourceBundle& reso
 
             default:
               mOnError(FormatString(
-                "shader %d: Ignoring uniform '%s': failed to infer type from %d elements.",
+                "shader %u: Ignoring uniform '%s': failed to infer type from %zu elements.",
                 iShader,
-                key.c_str()));
+                key.c_str(),
+                size));
               break;
           }
 
@@ -1080,8 +1078,7 @@ void DliLoader::Impl::ParseNodes(const TreeNode* const nodes, Index index, LoadP
 
     virtual unsigned int Resolve(Index iDli) override
     {
-      auto iFind = std::lower_bound(mIndices.begin(), mIndices.end(), iDli, [](const Entry& idx, Index iDli)
-                                    { return idx.iDli < iDli; });
+      auto iFind = std::lower_bound(mIndices.begin(), mIndices.end(), iDli, [](const Entry& idx, Index iDli) { return idx.iDli < iDli; });
       DALI_ASSERT_ALWAYS(iFind != mIndices.end());
       return iFind->iScene;
     }
@@ -1357,7 +1354,7 @@ void DliLoader::Impl::ParseNodesInternal(const TreeNode* const nodes, Index inde
     const unsigned int myIndex = output.mScene.GetNodeCount();
     if(!mapper.Map(index, myIndex))
     {
-      mOnError(FormatString("node %d: error mapping dli index %d: node has multiple parents. Ignoring subtree."));
+      mOnError(FormatString("node %d: error mapping dli index %d: node has multiple parents. Ignoring subtree.", index, myIndex));
       return;
     }
 
@@ -1428,8 +1425,7 @@ void DliLoader::Impl::ParseAnimations(const TreeNode* tnAnimations, LoadParams&
     AnimationDefinition animDef;
     ReadString(tnAnim.GetChild(NAME), animDef.mName);
 
-    auto       iFind     = std::lower_bound(definitions.begin(), definitions.end(), animDef, [](const AnimationDefinition& ad0, const AnimationDefinition& ad1)
-                                  { return ad0.mName < ad1.mName; });
+    auto       iFind     = std::lower_bound(definitions.begin(), definitions.end(), animDef, [](const AnimationDefinition& ad0, const AnimationDefinition& ad1) { return ad0.mName < ad1.mName; });
     const bool overwrite = iFind != definitions.end() && iFind->mName == animDef.mName;
     if(overwrite)
     {
@@ -1695,8 +1691,7 @@ void DliLoader::Impl::ParseAnimationGroups(const Toolkit::TreeNode* tnAnimationG
       continue;
     }
 
-    auto iFind = std::lower_bound(animGroups.begin(), animGroups.end(), groupName, [](const AnimationGroupDefinition& group, const std::string& name)
-                                  { return group.mName < name; });
+    auto iFind = std::lower_bound(animGroups.begin(), animGroups.end(), groupName, [](const AnimationGroupDefinition& group, const std::string& name) { return group.mName < name; });
     if(iFind != animGroups.end() && iFind->mName == groupName)
     {
       mOnError(FormatString("Animation group with name '%s' already exists; new entries will be merged.", groupName.c_str()));
index 7245652..6b9cffd 100644 (file)
@@ -108,6 +108,14 @@ TextureDefinition::TextureDefinition(const std::string& imageUri, SamplerFlags::
 {
 }
 
+TextureDefinition::TextureDefinition(std::string&& imageUri, SamplerFlags::Type samplerFlags, ImageDimensions minImageDimensions, SamplingMode::Type samplingMode)
+: mImageUri(std::move(imageUri)),
+  mSamplerFlags(samplerFlags),
+  mMinImageDimensions(minImageDimensions),
+  mSamplingMode(samplingMode)
+{
+}
+
 MaterialDefinition::RawData
 MaterialDefinition::LoadRaw(const std::string& imagesPath) const
 {
index e6df18e..b59c6aa 100644 (file)
@@ -120,6 +120,7 @@ struct DALI_SCENE3D_API TextureDefinition
   SamplingMode::Type mSamplingMode;
 
   TextureDefinition(const std::string& imageUri = "", SamplerFlags::Type samplerFlags = SamplerFlags::DEFAULT, ImageDimensions minImageDimensions = ImageDimensions(), SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR);
+  TextureDefinition(std::string&& imageUri, SamplerFlags::Type samplerFlags = SamplerFlags::DEFAULT, ImageDimensions minImageDimensions = ImageDimensions(), SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR);
 };
 
 /**
index 4b8f21d..5c9655a 100644 (file)
@@ -453,6 +453,13 @@ MeshDefinition::SparseBlob::SparseBlob(const Blob& indices, const Blob& values,
 {
 }
 
+MeshDefinition::SparseBlob::SparseBlob(Blob&& indices, Blob&& values, uint32_t count)
+: mIndices(std::move(indices)),
+  mValues(std::move(values)),
+  mCount{count}
+{
+}
+
 MeshDefinition::Accessor::Accessor(const MeshDefinition::Blob&       blob,
                                    const MeshDefinition::SparseBlob& sparse)
 : mBlob{blob},
@@ -460,6 +467,13 @@ MeshDefinition::Accessor::Accessor(const MeshDefinition::Blob&       blob,
 {
 }
 
+MeshDefinition::Accessor::Accessor(MeshDefinition::Blob&&       blob,
+                                   MeshDefinition::SparseBlob&& sparse)
+: mBlob{std::move(blob)},
+  mSparse{(sparse.mIndices.IsDefined() && sparse.mValues.IsDefined()) ? new SparseBlob{std::move(sparse)} : nullptr}
+{
+}
+
 void MeshDefinition::Blob::ComputeMinMax(std::vector<float>& min, std::vector<float>& max, uint32_t numComponents, uint32_t count, const float* values)
 {
   min.assign(numComponents, MAXFLOAT);
index 445fbe7..595d06e 100644 (file)
@@ -86,6 +86,12 @@ struct DALI_SCENE3D_API MeshDefinition
 
     Blob() = default;
 
+    Blob(const Blob&) = default;
+    Blob& operator=(const Blob&) = default;
+
+    Blob(Blob&&)  = default;
+    Blob& operator=(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 = {});
 
     /**
@@ -138,7 +144,14 @@ struct DALI_SCENE3D_API MeshDefinition
   {
     SparseBlob() = default;
 
+    SparseBlob(const SparseBlob&) = default;
+    SparseBlob& operator=(const SparseBlob&) = default;
+
+    SparseBlob(SparseBlob&&) = default;
+    SparseBlob& operator=(SparseBlob&&) = default;
+
     SparseBlob(const Blob& indices, const Blob& values, uint32_t count);
+    SparseBlob(Blob&& indices, Blob&& values, uint32_t count);
 
     Blob     mIndices;
     Blob     mValues;
@@ -160,6 +173,8 @@ struct DALI_SCENE3D_API MeshDefinition
 
     Accessor(const MeshDefinition::Blob&       blob,
              const MeshDefinition::SparseBlob& sparse);
+    Accessor(MeshDefinition::Blob&&       blob,
+             MeshDefinition::SparseBlob&& sparse);
 
     bool IsDefined() const
     {
index b6a2743..993fcd1 100644 (file)
@@ -957,7 +957,7 @@ void SceneDefinition::ConfigureSkeletonJoints(uint32_t iRoot, const SkeletonDefi
   }
 
   // 3, For each root, register joint matrices and constraints
-  for(auto r : rootsJoints)
+  for(const auto& r : rootsJoints)
   {
     auto node      = GetNode(r.first);
     auto rootJoint = root.FindChildByName(node->mName);
@@ -972,7 +972,7 @@ void SceneDefinition::ConfigureSkeletonJoints(uint32_t iRoot, const SkeletonDefi
     constraint.AddSource(Source(rootJoint, Actor::Property::POSITION));
     constraint.Apply();
 
-    for(auto j : r.second)
+    for(const auto j : r.second)
     {
       node       = GetNode(j);
       auto joint = rootJoint.FindChildByName(node->mName);
index ad263e4..729fa1d 100644 (file)
@@ -109,7 +109,7 @@ ShaderDefinition::LoadRaw(const std::string& shadersPath) const
 
   if(!fail)
   {
-    for(auto definevar : mDefines)
+    for(const auto& definevar : mDefines)
     {
       ApplyDefine(raw.mVertexShaderSource, definevar);
       ApplyDefine(raw.mFragmentShaderSource, definevar);
index 4c2a099..89e8c16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -33,19 +33,13 @@ BloomView::~BloomView()
 {
 }
 
-BloomView::BloomView(const BloomView& handle)
-: Control(handle)
-{
-}
+BloomView::BloomView(const BloomView& handle) = default;
 
-BloomView& BloomView::operator=(const BloomView& rhs)
-{
-  if(&rhs != this)
-  {
-    Control::operator=(rhs);
-  }
-  return *this;
-}
+BloomView& BloomView::operator=(const BloomView& rhs) = default;
+
+BloomView::BloomView(BloomView&& handle) = default;
+
+BloomView& BloomView::operator=(BloomView&& rhs) = default;
 
 BloomView BloomView::New()
 {
index 1ea7ee4..1356d28 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_BLOOM_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -98,13 +98,29 @@ public:
 
   /**
    * Copy constructor. Creates another handle that points to the same real object
+   * @param[in] handle The handle to copy from.
    */
   BloomView(const BloomView& handle);
 
   /**
    * Assignment operator. Changes this handle to point to another real object
+   * @param[in] handle The handle to copy from.
+   * @return reference to this
    */
-  BloomView& operator=(const BloomView& ZoomView);
+  BloomView& operator=(const BloomView& handle);
+
+  /**
+   * Move constructor. Creates another handle that points to the same real object
+   * @param[in] handle The handle to move from.
+   */
+  BloomView(BloomView&& handle);
+
+  /**
+   * Move assignment operator. Changes this handle to point to another real object
+   * @param[in] handle The handle to move from.
+   * @return reference to this
+   */
+  BloomView& operator=(BloomView&& handle);
 
   /**
    * @brief Destructor
index 530ff29..56568fc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -52,19 +52,13 @@ BubbleEmitter BubbleEmitter::New(const Vector2& winSize,
   return Internal::BubbleEmitter::New(winSize, shapeTexture, maximumNumberOfBubble, bubbleSizeRange);
 }
 
-BubbleEmitter::BubbleEmitter(const BubbleEmitter& handle)
-: Control(handle)
-{
-}
+BubbleEmitter::BubbleEmitter(const BubbleEmitter& handle) = default;
 
-BubbleEmitter& BubbleEmitter::operator=(const BubbleEmitter& rhs)
-{
-  if(&rhs != this)
-  {
-    Control::operator=(rhs);
-  }
-  return *this;
-}
+BubbleEmitter& BubbleEmitter::operator=(const BubbleEmitter& rhs) = default;
+
+BubbleEmitter::BubbleEmitter(BubbleEmitter&& handle) = default;
+
+BubbleEmitter& BubbleEmitter::operator=(BubbleEmitter&& rhs) = default;
 
 BubbleEmitter BubbleEmitter::DownCast(BaseHandle handle)
 {
index d4381fa..7a12d1e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_BUBBLE_EMMITER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -84,6 +84,23 @@ public:
   BubbleEmitter& operator=(const BubbleEmitter& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * Creates another handle that points to the same real object
+   * @param[in] handle The handle to move
+   */
+  BubbleEmitter(BubbleEmitter&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * Changes this handle to point to another real object
+   * @param[in] rhs The object to point at
+   * @return A reference to this
+   */
+  BubbleEmitter& operator=(BubbleEmitter&& rhs);
+
+  /**
    * @brief Downcast an Object handle to SuperBlurView.
    *
    * If handle points to a BubbleEmitter, the downcast produces valid handle.
index a24e59d..719657d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -38,14 +38,14 @@ namespace Dali::Toolkit::DevelControl
 {
 namespace
 {
-static std::string GetLocaleText(std::string string, const char *domain = "dali-toolkit")
+static std::string GetLocaleText(std::string string, const chardomain = "dali-toolkit")
 {
 #ifdef DGETTEXT_ENABLED
-    /*TODO: currently non-localized string is used as a key for translation lookup. In case the lookup key formatting is forced
+  /*TODO: currently non-localized string is used as a key for translation lookup. In case the lookup key formatting is forced
           consider calling utility function for converting non-localized string into well-formatted key before lookup. */
-    return dgettext(domain, string.c_str());
+  return dgettext(domain, string.c_str());
 #else
-    return string;
+  return string;
 #endif
 }
 
@@ -104,7 +104,7 @@ std::string ControlAccessible::GetName() const
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
-  std::string name;
+  std::string              name;
 
   if(!controlImpl.mAccessibilityGetNameSignal.Empty())
   {
@@ -142,7 +142,7 @@ std::string ControlAccessible::GetDescription() const
 
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
   Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
-  std::string description;
+  std::string              description;
 
   if(!controlImpl.mAccessibilityGetDescriptionSignal.Empty())
   {
@@ -183,7 +183,7 @@ std::string ControlAccessible::GetLocalizedRoleName() const
 bool ControlAccessible::IsShowing()
 {
   Dali::Actor self = Self();
-  if(!self.GetProperty<bool>(Actor::Property::VISIBLE) || self.GetProperty<Vector4>(Actor::Property::WORLD_COLOR).a == 0 || self.GetProperty<bool>(Dali::DevelActor::Property::CULLED))
+  if(!self.GetProperty<bool>(Actor::Property::VISIBLE) || Dali::EqualsZero(self.GetProperty<Vector4>(Actor::Property::WORLD_COLOR).a) || self.GetProperty<bool>(Dali::DevelActor::Property::CULLED))
   {
     return false;
   }
@@ -198,14 +198,14 @@ bool ControlAccessible::IsShowing()
   auto childExtent = child->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
   while(parent)
   {
-    auto control      = Dali::Toolkit::Control::DownCast(parent->Self());
+    auto control = Dali::Toolkit::Control::DownCast(parent->Self());
     if(!control.GetProperty<bool>(Actor::Property::VISIBLE))
     {
       return false;
     }
     auto clipMode     = control.GetProperty(Actor::Property::CLIPPING_MODE).Get<bool>();
     auto parentExtent = parent->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
-    if ((clipMode != ClippingMode::DISABLED) && !parentExtent.Intersects(childExtent))
+    if((clipMode != ClippingMode::DISABLED) && !parentExtent.Intersects(childExtent))
     {
       return false;
     }
@@ -219,7 +219,7 @@ Dali::Accessibility::States ControlAccessible::CalculateStates()
 {
   using Dali::Accessibility::State;
 
-  Dali::Actor self = Self();
+  Dali::Actor                 self = Self();
   Dali::Accessibility::States states;
 
   states[State::FOCUSABLE]     = self.GetProperty<bool>(Actor::Property::KEYBOARD_FOCUSABLE);
@@ -243,9 +243,9 @@ Dali::Accessibility::States ControlAccessible::GetStates()
 Dali::Accessibility::Attributes ControlAccessible::GetAttributes() const
 {
   std::unordered_map<std::string, std::string> attributeMap;
-  auto control = Dali::Toolkit::Control::DownCast(Self());
-  auto attribute = control.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
-  auto map = attribute.GetMap();
+  auto                                         control   = Dali::Toolkit::Control::DownCast(Self());
+  auto                                         attribute = control.GetProperty(Dali::Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES);
+  auto                                         map       = attribute.GetMap();
 
   if(map)
   {
@@ -291,12 +291,12 @@ bool ControlAccessible::GrabFocus()
 
 void ControlAccessible::ScrollToSelf()
 {
-  auto* child = this;
+  auto* child  = this;
   auto* parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(child->GetParent());
 
-  while (parent)
+  while(parent)
   {
-    if (parent->IsScrollable())
+    if(parent->IsScrollable())
     {
       parent->ScrollToChild(child->Self());
     }
@@ -323,8 +323,8 @@ void ControlAccessible::UnregisterPositionPropertyNotification()
 
 bool ControlAccessible::GrabHighlight()
 {
-  Dali::Actor self = Self();
-  auto oldHighlightedActor = GetCurrentlyHighlightedActor();
+  Dali::Actor self                = Self();
+  auto        oldHighlightedActor = GetCurrentlyHighlightedActor();
 
   if(!Dali::Accessibility::IsUp())
   {
index 4cad313..fa4f268 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -36,19 +36,13 @@ EffectsView::EffectsView()
 {
 }
 
-EffectsView::EffectsView(const EffectsView& handle)
-: Control(handle)
-{
-}
+EffectsView::EffectsView(const EffectsView& handle) = default;
 
-EffectsView& EffectsView::operator=(const EffectsView& rhs)
-{
-  if(&rhs != this)
-  {
-    Control::operator=(rhs);
-  }
-  return *this;
-}
+EffectsView& EffectsView::operator=(const EffectsView& handle) = default;
+
+EffectsView::EffectsView(EffectsView&& handle) = default;
+
+EffectsView& EffectsView::operator=(EffectsView&& handle) = default;
 
 EffectsView EffectsView::DownCast(BaseHandle handle)
 {
index 60df473..1b1147b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_EFFECTS_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -111,13 +111,29 @@ public:
 
   /**
    * Copy constructor.
+   * @param[in] handle to copy from
    */
   EffectsView(const EffectsView& handle);
 
   /**
    * Assignment operator.
+   * @param[in] handle to copy from
+   * @return reference to this
    */
-  EffectsView& operator=(const EffectsView& rhs);
+  EffectsView& operator=(const EffectsView& handle);
+
+  /**
+   * Move constructor.
+   * @param[in] rhs to move from
+   */
+  EffectsView(EffectsView&& rhs);
+
+  /**
+   * Move assignment operator.
+   * @param[in] rhs to move from
+   * @return reference to this
+   */
+  EffectsView& operator=(EffectsView&& rhs);
 
   /**
    * Downcast an Object handle to EffectsView. If handle points to a EffectsView the
index 8c5ec81..b9d86d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -37,19 +37,13 @@ Magnifier::Magnifier()
 {
 }
 
-Magnifier::Magnifier(const Magnifier& handle)
-: Control(handle)
-{
-}
+Magnifier::Magnifier(const Magnifier& handle) = default;
 
-Magnifier& Magnifier::operator=(const Magnifier& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+Magnifier& Magnifier::operator=(const Magnifier& handle) = default;
+
+Magnifier::Magnifier(Magnifier&& rhs) = default;
+
+Magnifier& Magnifier::operator=(Magnifier&& rhs) = default;
 
 Magnifier::Magnifier(Internal::Magnifier& implementation)
 : Control(implementation)
index bf0ca8e..15429e8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_MAGNIFIER_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -78,16 +78,31 @@ public:
 
   /**
    * Copy constructor. Creates another handle that points to the same real object
-   * @param handle to copy from
+   * @param[in] handle to copy from
    */
   Magnifier(const Magnifier& handle);
 
   /**
    * Assignment operator. Changes this handle to point to another real object
+   * @param[in] handle to copy from
+   * @return reference to this
    */
   Magnifier& operator=(const Magnifier& handle);
 
   /**
+   * Move constructor. Creates another handle that points to the same real object
+   * @param[in] rhs to move from
+   */
+  Magnifier(Magnifier&& rhs);
+
+  /**
+   * Move assignment operator. Changes this handle to point to another real object
+   * @param[in] rhs to move from
+   * @return reference to this
+   */
+  Magnifier& operator=(Magnifier&& rhs);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index 3e9b94c..96852f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -31,19 +31,13 @@ NavigationView::NavigationView()
 {
 }
 
-NavigationView::NavigationView(const NavigationView& handle)
-: Control(handle)
-{
-}
+NavigationView::NavigationView(const NavigationView& handle) = default;
 
-NavigationView& NavigationView::operator=(const NavigationView& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+NavigationView& NavigationView::operator=(const NavigationView& handle) = default;
+
+NavigationView::NavigationView(NavigationView&& handle) = default;
+
+NavigationView& NavigationView::operator=(NavigationView&& handle) = default;
 
 NavigationView::~NavigationView()
 {
index 49bc4fd..0624f6b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_NAVIGATION_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -57,13 +57,26 @@ public:
   NavigationView(const NavigationView& handle);
 
   /**
-  * @brief Assignment operator.
-  * @param handle The handle to copy from.
-  * @return reference to this
-  */
+   * @brief Assignment operator.
+   * @param[in] handle The handle to copy from.
+   * @return reference to this
+   */
   NavigationView& operator=(const NavigationView& handle);
 
   /**
+   * @brief Move Constructor.
+   * @param[in] handle Handle to move.
+   */
+  NavigationView(NavigationView&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   * @param[in] handle The handle to move from.
+   * @return reference to this
+   */
+  NavigationView& operator=(NavigationView&& handle);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index f8c2ba4..ad13686 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,19 +39,13 @@ ConfirmationPopup::ConfirmationPopup(Internal::ConfirmationPopup& implementation
 {
 }
 
-ConfirmationPopup::ConfirmationPopup(const ConfirmationPopup& confirmationPopup)
-: Popup(confirmationPopup)
-{
-}
+ConfirmationPopup::ConfirmationPopup(const ConfirmationPopup& confirmationPopup) = default;
 
-ConfirmationPopup& ConfirmationPopup::operator=(const ConfirmationPopup& confirmationPopup)
-{
-  if(&confirmationPopup != this)
-  {
-    Popup::operator=(confirmationPopup);
-  }
-  return *this;
-}
+ConfirmationPopup& ConfirmationPopup::operator=(const ConfirmationPopup& confirmationPopup) = default;
+
+ConfirmationPopup::ConfirmationPopup(ConfirmationPopup&& confirmationPopup) = default;
+
+ConfirmationPopup& ConfirmationPopup::operator=(ConfirmationPopup&& confirmationPopup) = default;
 
 ConfirmationPopup::ConfirmationPopup(Dali::Internal::CustomActor* internal)
 : Popup(internal)
index 43bdae1..ebf6a65 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CONFIRMATION_POPUP_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -88,15 +88,31 @@ public:
 
   /**
    * @brief Copy constructor.
+   * @param[in] confirmationPopup The handle to copy from.
    */
   ConfirmationPopup(const ConfirmationPopup& confirmationPopup);
 
   /**
    * @brief Assignment operator.
+   * @param[in] confirmationPopup The handle to copy from.
+   * @return reference to this
    */
   ConfirmationPopup& operator=(const ConfirmationPopup& confirmationPopup);
 
   /**
+   * @brief Move constructor.
+   * @param[in] confirmationPopup The handle to move from.
+   */
+  ConfirmationPopup(ConfirmationPopup&& confirmationPopup);
+
+  /**
+   * @brief Move assignment operator.
+   * @param[in] confirmationPopup The handle to move from.
+   * @return reference to this
+   */
+  ConfirmationPopup& operator=(ConfirmationPopup&& confirmationPopup);
+
+  /**
    * @brief Destructor.
    *
    * This is non-virtual since derived types must not contain data or virtual methods.
index 73ceaea..5cb4670 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -35,19 +35,13 @@ Popup::Popup()
 {
 }
 
-Popup::Popup(const Popup& handle)
-: Control(handle)
-{
-}
+Popup::Popup(const Popup& handle) = default;
 
-Popup& Popup::operator=(const Popup& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+Popup& Popup::operator=(const Popup& handle) = default;
+
+Popup::Popup(Popup&& handle) = default;
+
+Popup& Popup::operator=(Popup&& handle) = default;
 
 Popup::Popup(Internal::Popup& implementation)
 : Control(implementation)
index 9a81bb8..ec3b7bc 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_POPUP_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -168,6 +168,23 @@ public:
   Popup& operator=(const Popup& handle);
 
   /**
+   * @brief Move constructor.
+   *
+   * Creates another handle that points to the same real object
+   * @param[in] handle Handle to the moved object
+   */
+  Popup(Popup&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * Changes this handle to point to another real object
+   * @param[in] handle Handle to the object
+   * @return A reference to this
+   */
+  Popup& operator=(Popup&& handle);
+
+  /**
    * @brief Downcast an Object handle to Popup.
    *
    * If handle points to a Popup the
index 85e1162..3474006 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -33,16 +33,13 @@ Scene3dView::~Scene3dView()
 {
 }
 
-Scene3dView::Scene3dView(const Scene3dView& handle)
-: Control(handle)
-{
-}
+Scene3dView::Scene3dView(const Scene3dView& handle) = default;
 
-Scene3dView& Scene3dView::operator=(const Scene3dView& handle)
-{
-  BaseHandle::operator=(handle);
-  return *this;
-}
+Scene3dView& Scene3dView::operator=(const Scene3dView& handle) = default;
+
+Scene3dView::Scene3dView(Scene3dView&& rhs) = default;
+
+Scene3dView& Scene3dView::operator=(Scene3dView&& rhs) = default;
 
 Scene3dView Scene3dView::New(const std::string& filePath)
 {
index 756a7a5..573c221 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SCENE3D_VIEW_H\r
 \r
 /*\r
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -93,15 +93,31 @@ public:
 \r
   /**\r
    * @brief Copy constructor. Creates another handle that points to the same real object\r
+   * @param[in] handle to copy from\r
    */\r
   Scene3dView(const Scene3dView& handle);\r
 \r
   /**\r
    * @brief Assignment operator. Changes this handle to point to another real object\r
+   * @param[in] handle to copy from\r
+   * @return reference to this\r
    */\r
   Scene3dView& operator=(const Scene3dView& handle);\r
 \r
   /**\r
+   * @brief Move constructor. Creates another handle that points to the same real object\r
+   * @param[in] rhs to move from\r
+   */\r
+  Scene3dView(Scene3dView&& rhs);\r
+\r
+  /**\r
+   * @brief Move assignment operator. Changes this handle to point to another real object\r
+   * @param[in] rhs to move from\r
+   * @return reference to this\r
+   */\r
+  Scene3dView& operator=(Scene3dView&& rhs);\r
+\r
+  /**\r
    * @brief Destructor\r
    * This is non-virtual since derived Handle types must not contain data or virtual methods.\r
    */\r
index c568fb8..5d6b75e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -40,19 +40,13 @@ ShadowView::~ShadowView()
 {
 }
 
-ShadowView::ShadowView(const ShadowView& handle)
-: Control(handle)
-{
-}
+ShadowView::ShadowView(const ShadowView& handle) = default;
 
-ShadowView& ShadowView::operator=(const ShadowView& rhs)
-{
-  if(&rhs != this)
-  {
-    Control::operator=(rhs);
-  }
-  return *this;
-}
+ShadowView& ShadowView::operator=(const ShadowView& handle) = default;
+
+ShadowView::ShadowView(ShadowView&& rhs) = default;
+
+ShadowView& ShadowView::operator=(ShadowView&& rhs) = default;
 
 ShadowView ShadowView::New()
 {
index 9667fa9..07e5ee5 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SHADOW_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -107,13 +107,29 @@ public:
 
   /**
    * Copy constructor. Creates another handle that points to the same real object
+   * @param[in] handle to copy from
    */
   ShadowView(const ShadowView& handle);
 
   /**
    * Assignment operator. Changes this handle to point to another real object
+   * @param[in] handle to copy from
+   * @return reference to this
    */
-  ShadowView& operator=(const ShadowView& view);
+  ShadowView& operator=(const ShadowView& handle);
+
+  /**
+   * Move constructor. Creates another handle that points to the same real object
+   * @param[in] rhs to move from
+   */
+  ShadowView(ShadowView&& rhs);
+
+  /**
+   * Move assignment operator. Changes this handle to point to another real object
+   * @param[in] rhs to move from
+   * @return reference to this
+   */
+  ShadowView& operator=(ShadowView&& rhs);
 
   /**
    * @brief Destructor
index d19ff68..9e65519 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -34,19 +34,13 @@ SuperBlurView SuperBlurView::New(unsigned int blurLevels)
   return Internal::SuperBlurView::New(blurLevels);
 }
 
-SuperBlurView::SuperBlurView(const SuperBlurView& handle)
-: Control(handle)
-{
-}
+SuperBlurView::SuperBlurView(const SuperBlurView& handle) = default;
 
-SuperBlurView& SuperBlurView::operator=(const SuperBlurView& rhs)
-{
-  if(&rhs != this)
-  {
-    Control::operator=(rhs);
-  }
-  return *this;
-}
+SuperBlurView& SuperBlurView::operator=(const SuperBlurView& rhs) = default;
+
+SuperBlurView::SuperBlurView(SuperBlurView&& handle) = default;
+
+SuperBlurView& SuperBlurView::operator=(SuperBlurView&& rhs) = default;
 
 SuperBlurView::~SuperBlurView()
 {
index 67ac339..c7b29be 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SUPER_BLUR_VIEW_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -109,6 +109,23 @@ public:
   SuperBlurView& operator=(const SuperBlurView& rhs);
 
   /**
+   * @brief Move constructor.
+   *
+   * Creates another handle that points to the same real object.
+   * @param[in] handle the handle to move from
+   */
+  SuperBlurView(SuperBlurView&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * Changes this handle to point to another real object.
+   * @param[in] rhs the handle to move from
+   * @return a reference to this
+   */
+  SuperBlurView& operator=(SuperBlurView&& rhs);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index 9b72f8a..1d4ad58 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -36,19 +36,13 @@ TextAnchor::TextAnchor()
 {
 }
 
-TextAnchor::TextAnchor(const TextAnchor& handle)
-: Control(handle)
-{
-}
+TextAnchor::TextAnchor(const TextAnchor& handle) = default;
 
-TextAnchor& TextAnchor::operator=(const TextAnchor& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+TextAnchor& TextAnchor::operator=(const TextAnchor& handle) = default;
+
+TextAnchor::TextAnchor(TextAnchor&& handle) = default;
+
+TextAnchor& TextAnchor::operator=(TextAnchor&& handle) = default;
 
 TextAnchor::~TextAnchor()
 {
index 83fbc76..62b021f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_ANCHOR_DEVEL_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -99,6 +99,21 @@ public:
   TextAnchor& operator=(const TextAnchor& handle);
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] handle The handle to move from.
+   */
+  TextAnchor(TextAnchor&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @param[in] handle The handle to move from.
+   * @return A reference to this.
+   */
+  TextAnchor& operator=(TextAnchor&& handle);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index 5d953db..2f03c72 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -36,19 +36,13 @@ TextSelectionPopup::TextSelectionPopup()
 {
 }
 
-TextSelectionPopup::TextSelectionPopup(const TextSelectionPopup& handle)
-: Control(handle)
-{
-}
+TextSelectionPopup::TextSelectionPopup(const TextSelectionPopup& handle) = default;
 
-TextSelectionPopup& TextSelectionPopup::operator=(const TextSelectionPopup& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+TextSelectionPopup& TextSelectionPopup::operator=(const TextSelectionPopup& handle) = default;
+
+TextSelectionPopup::TextSelectionPopup(TextSelectionPopup&& handle) = default;
+
+TextSelectionPopup& TextSelectionPopup::operator=(TextSelectionPopup&& handle) = default;
 
 TextSelectionPopup::~TextSelectionPopup()
 {
index a4cb2a7..720b37c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_SELECTION_POPUP_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -259,6 +259,21 @@ public:
   TextSelectionPopup& operator=(const TextSelectionPopup& handle);
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] handle The handle to move from.
+   */
+  TextSelectionPopup(TextSelectionPopup&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @param[in] handle The handle to move from.
+   * @return A reference to this.
+   */
+  TextSelectionPopup& operator=(TextSelectionPopup&& handle);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index 64515fc..deb9fe3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -36,19 +36,13 @@ TextSelectionToolbar::TextSelectionToolbar()
 {
 }
 
-TextSelectionToolbar::TextSelectionToolbar(const TextSelectionToolbar& handle)
-: Control(handle)
-{
-}
+TextSelectionToolbar::TextSelectionToolbar(const TextSelectionToolbar& handle) = default;
 
-TextSelectionToolbar& TextSelectionToolbar::operator=(const TextSelectionToolbar& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+TextSelectionToolbar& TextSelectionToolbar::operator=(const TextSelectionToolbar& handle) = default;
+
+TextSelectionToolbar::TextSelectionToolbar(TextSelectionToolbar&& handle) = default;
+
+TextSelectionToolbar& TextSelectionToolbar::operator=(TextSelectionToolbar&& handle) = default;
 
 TextSelectionToolbar::~TextSelectionToolbar()
 {
index 98b4e7d..7858539 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -94,6 +94,21 @@ public:
   TextSelectionToolbar& operator=(const TextSelectionToolbar& handle);
 
   /**
+   * @brief Move constructor.
+   *
+   * @param[in] handle The handle to move from.
+   */
+  TextSelectionToolbar(TextSelectionToolbar&& handle);
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @param[in] handle The handle to move from.
+   * @return A reference to this.
+   */
+  TextSelectionToolbar& operator=(TextSelectionToolbar&& handle);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index d700652..b84b5ed 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -36,19 +36,13 @@ ToolBar::ToolBar()
 {
 }
 
-ToolBar::ToolBar(const ToolBar& handle)
-: Control(handle)
-{
-}
+ToolBar::ToolBar(const ToolBar& handle) = default;
 
-ToolBar& ToolBar::operator=(const ToolBar& handle)
-{
-  if(&handle != this)
-  {
-    Control::operator=(handle);
-  }
-  return *this;
-}
+ToolBar& ToolBar::operator=(const ToolBar& handle) = default;
+
+ToolBar::ToolBar(ToolBar&& handle) = default;
+
+ToolBar& ToolBar::operator=(ToolBar&& handle) = default;
 
 ToolBar::~ToolBar()
 {
index 36f4c34..43e6681 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TOOL_BAR_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -55,16 +55,31 @@ public:
 
   /**
    * Copy constructor. Creates another handle that points to the same real object
-   * @param handle to copy from
+   * @param[in] handle Handle to copy.
    */
   ToolBar(const ToolBar& handle);
 
   /**
    * Assignment operator. Changes this handle to point to another real object
+   * @param[in] handle The handle to copy from.
+   * @return reference to this
    */
   ToolBar& operator=(const ToolBar& handle);
 
   /**
+   * Move constructor. Creates another handle that points to the same real object
+   * @param[in] handle Handle to move.
+   */
+  ToolBar(ToolBar&& handle);
+
+  /**
+   * Move assignment operator. Changes this handle to point to another real object
+   * @param[in] handle The handle to move from.
+   * @return reference to this
+   */
+  ToolBar& operator=(ToolBar&& handle);
+
+  /**
    * @brief Destructor
    *
    * This is non-virtual since derived Handle types must not contain data or virtual methods.
index 9ddab28..517d78f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -1210,8 +1210,8 @@ void Builder::RecordStyle(StylePtr           style,
         StylePtr* stylePtr = style->subStates.Find(stateName);
         if(stylePtr)
         {
-          StylePtr style(*stylePtr);
-          RecordStyle(style, stateNode, handle, replacements);
+          StylePtr subState(*stylePtr);
+          RecordStyle(subState, stateNode, handle, replacements);
         }
         else
         {
@@ -1577,8 +1577,8 @@ bool Builder::ConvertChildValue(const TreeNode& mappingRoot, KeyStack& keyStack,
       {
         for(Property::Map::SizeType i = 0; i < map->Count(); ++i)
         {
-          Property::Value& child = map->GetValue(i);
-          ConvertChildValue(mappingRoot, keyStack, child);
+          Property::Value& currentChild = map->GetValue(i);
+          ConvertChildValue(mappingRoot, keyStack, currentChild);
         }
       }
       break;
@@ -1591,8 +1591,8 @@ bool Builder::ConvertChildValue(const TreeNode& mappingRoot, KeyStack& keyStack,
       {
         for(Property::Array::SizeType i = 0; i < array->Count(); ++i)
         {
-          Property::Value& child = array->GetElementAt(i);
-          ConvertChildValue(mappingRoot, keyStack, child);
+          Property::Value& currentChild = array->GetElementAt(i);
+          ConvertChildValue(mappingRoot, keyStack, currentChild);
         }
       }
       break;
index f7679fd..3f7e73e 100644 (file)
@@ -290,9 +290,9 @@ void TreeNodeManipulator::SetType(TreeNode::NodeType type)
   {
     if(mNode->mFirstChild != NULL)
     {
-      TreeNode::NodeType type = mNode->mFirstChild->GetType();
+      TreeNode::NodeType firstChildType = mNode->mFirstChild->GetType();
 
-      if(TreeNode::FLOAT == type || TreeNode::INTEGER == type)
+      if(TreeNode::FLOAT == firstChildType || TreeNode::INTEGER == firstChildType)
       {
         // Arrays of numbers should be replaced, not appended to.
         RemoveChildren();
index 84d44b9..23f9204 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/object-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <cstring>
@@ -580,11 +581,11 @@ void Control::Impl::CheckHighlightedObjectGeometry()
     }
     case Dali::Accessibility::ScreenRelativeMoveType::INSIDE:
     {
-      if(rect.width < 0 && accessibleRect.x != lastPosition.x)
+      if(rect.width < 0 && !Dali::Equals(accessibleRect.x, lastPosition.x))
       {
         mAccessibilityLastScreenRelativeMoveType = (accessibleRect.x < lastPosition.x) ? Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_TOP_LEFT : Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_BOTTOM_RIGHT;
       }
-      if(rect.height < 0 && accessibleRect.y != lastPosition.y)
+      if(rect.height < 0 && !Dali::Equals(accessibleRect.y, lastPosition.y))
       {
         mAccessibilityLastScreenRelativeMoveType = (accessibleRect.y < lastPosition.y) ? Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_TOP_LEFT : Dali::Accessibility::ScreenRelativeMoveType::OUTGOING_BOTTOM_RIGHT;
       }
index f769b44..1133211 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/scripting/scripting.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
@@ -344,8 +345,8 @@ void ImageView::SetTransformMapForFittingMode(Vector2 finalSize, Vector2 natural
       auto availableVisualSize = finalSize;
 
       // scale to fit the padded area
-      finalSize = naturalSize * std::min((naturalSize.width ? (availableVisualSize.width / naturalSize.width) : 0),
-                                         (naturalSize.height ? (availableVisualSize.height / naturalSize.height) : 0));
+      finalSize = naturalSize * std::min((!Dali::EqualsZero(naturalSize.width) ? (availableVisualSize.width / naturalSize.width) : 0),
+                                         (!Dali::EqualsZero(naturalSize.height) ? (availableVisualSize.height / naturalSize.height) : 0));
 
       // calculate final offset within the padded area
       finalOffset += (availableVisualSize - finalSize) * .5f;
@@ -359,8 +360,8 @@ void ImageView::SetTransformMapForFittingMode(Vector2 finalSize, Vector2 natural
     {
       mImageViewPixelAreaSetByFittingMode = true;
       auto availableVisualSize            = finalSize;
-      finalSize                           = naturalSize * std::max((naturalSize.width ? (availableVisualSize.width / naturalSize.width) : 0),
-                                         (naturalSize.height ? (availableVisualSize.height / naturalSize.height) : 0));
+      finalSize                           = naturalSize * std::max((!Dali::EqualsZero(naturalSize.width) ? (availableVisualSize.width / naturalSize.width) : 0.0f),
+                                         (!Dali::EqualsZero(naturalSize.height) ? (availableVisualSize.height / naturalSize.height) : 0.0f));
 
       auto originalOffset = finalOffset;
       finalOffset += (availableVisualSize - finalSize) * .5f;
@@ -386,8 +387,8 @@ void ImageView::SetTransformMapForFittingMode(Vector2 finalSize, Vector2 natural
       }
       else
       {
-        finalSize = naturalSize * std::min((naturalSize.width ? (availableVisualSize.width / naturalSize.width) : 0),
-                                           (naturalSize.height ? (availableVisualSize.height / naturalSize.height) : 0));
+        finalSize = naturalSize * std::min((!Dali::EqualsZero(naturalSize.width) ? (availableVisualSize.width / naturalSize.width) : 0.0f),
+                                           (!Dali::EqualsZero(naturalSize.height) ? (availableVisualSize.height / naturalSize.height) : 0.0f));
       }
 
       finalOffset += (availableVisualSize - finalSize) * .5f;
index 0f7019f..8d284ef 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_OBJ_LOADER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,8 +26,6 @@ namespace Dali
 {
 namespace Toolkit
 {
-class ObjLoader;
-
 namespace Internal
 {
 class ObjLoader
index 1606bfb..bc65701 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -987,7 +987,7 @@ void Popup::SetTailVisibility(bool visible)
   mLayoutDirty = true;
 }
 
-const bool Popup::IsTailVisible() const
+bool Popup::IsTailVisible() const
 {
   return mTailVisible;
 }
@@ -1065,7 +1065,7 @@ void Popup::SetBackingEnabled(bool enabled)
   mLayoutDirty    = true;
 }
 
-const bool Popup::IsBackingEnabled() const
+bool Popup::IsBackingEnabled() const
 {
   return mBackingEnabled;
 }
@@ -1139,7 +1139,7 @@ void Popup::SetTouchTransparent(bool enabled)
   }
 }
 
-const bool Popup::IsTouchTransparent() const
+bool Popup::IsTouchTransparent() const
 {
   return mTouchTransparent;
 }
index 8f4aef0..0efba18 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_POPUP_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -112,7 +112,7 @@ public:
   /**
    * @copydoc Toolkit::Popup::IsTailVisible
    */
-  const bool IsTailVisible() const;
+  bool IsTailVisible() const;
 
   /**
    * @copydoc Toolkit::Popup::SetTailPosition
@@ -172,7 +172,7 @@ public:
   /**
    * @copydoc Toolkit::Popup::IsBackingEnabled
    */
-  const bool IsBackingEnabled() const;
+  bool IsBackingEnabled() const;
 
   /**
    * @copydoc Toolkit::Popup::SetBackingColor
@@ -340,7 +340,7 @@ private:
    *
    * @return True if the popup is touch-transparent.
    */
-  const bool IsTouchTransparent() const;
+  bool IsTouchTransparent() const;
 
   /**
    * @brief Allows the popup entry animation to be setup from a Property::Map that could
index f98ece7..68abe9b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -261,7 +261,7 @@ void ProgressBar::SetProgressValue(float value)
 {
   // update the progress bar value (taking float precision errors into account)
   // TODO : it seems 0.0f cannot into this statement.
-  if((mProgressValue != value) &&
+  if((!Equals(mProgressValue, value)) &&
      ((value >= DEFAULT_LOWER_BOUND) || (Equals(value, DEFAULT_LOWER_BOUND))) &&
      ((value <= DEFAULT_UPPER_BOUND) || (Equals(value, DEFAULT_UPPER_BOUND))))
   {
@@ -288,7 +288,7 @@ void ProgressBar::SetSecondaryProgressValue(float value)
 {
   // update the progress bar value (taking float precision errors into account)
   // TODO : it seems 0.0f cannot into this statement.
-  if((mSecondaryProgressValue != value) &&
+  if((!Equals(mSecondaryProgressValue, value)) &&
      ((value >= DEFAULT_LOWER_BOUND) || (Equals(value, DEFAULT_LOWER_BOUND))) &&
      ((value <= DEFAULT_UPPER_BOUND) || (Equals(value, DEFAULT_UPPER_BOUND))))
   {
index 0f5f792..c25e3d0 100644 (file)
@@ -25,6 +25,9 @@
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.h>
+
 namespace Dali
 {
 namespace Toolkit
index 9672929..5793116 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_GLTF_LOADER_H\r
 \r
 /*\r
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -27,7 +27,6 @@
 \r
 // INTERNAL INCLUDES\r
 #include <dali-toolkit/devel-api/builder/json-parser.h>\r
-#include <dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.h>\r
 \r
 using namespace Dali;\r
 \r
@@ -37,6 +36,8 @@ namespace Toolkit
 {\r
 namespace Internal\r
 {\r
+class Scene3dView;\r
+\r
 namespace Gltf\r
 {\r
 enum ShaderType\r
index 6231b64..77eb533 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/internal/controls/scene3d-view/gltf-loader.h>
 
 namespace Dali
 {
@@ -131,14 +132,14 @@ bool Scene3dView::PlayAnimations()
 
 bool Scene3dView::SetLight(Toolkit::Scene3dView::LightType type, Vector3 lightVector, Vector3 lightColor)
 {
-  mLightType = type;
+  mLightType   = type;
   mLightVector = lightVector;
   mLightColor  = lightColor;
 
   for(auto&& shader : mShaderArray)
   {
     float hasLightSource = static_cast<float>(!!(GetLightType() & (Toolkit::Scene3dView::LightType::POINT_LIGHT | Toolkit::Scene3dView::LightType::DIRECTIONAL_LIGHT)));
-    float isPointLight = static_cast<float>(!!(GetLightType() & Toolkit::Scene3dView::LightType::POINT_LIGHT));
+    float isPointLight   = static_cast<float>(!!(GetLightType() & Toolkit::Scene3dView::LightType::POINT_LIGHT));
     shader.RegisterProperty("uHasLightSource", hasLightSource);
     shader.RegisterProperty("uIsPointLight", isPointLight);
     shader.RegisterProperty("uLightVector", lightVector);
@@ -230,7 +231,7 @@ void Scene3dView::SetCubeMap(const std::string& diffuseTexturePath, const std::s
   mSpecularTexture.GenerateMipmaps();
 
   mIBLScaleFactor = scaleFactor;
-  mUseIBL = true;
+  mUseIBL         = true;
 }
 
 bool Scene3dView::SetDefaultCamera(const Dali::Camera::Type type, const float nearPlane, const Vector3 cameraPosition)
index bc731d3..6aec3d4 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_SCENE3D_VIEW_H\r
 \r
 /*\r
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
 #include <dali/devel-api/adaptor-framework/image-loading.h>\r
 #include <dali/public-api/object/base-object.h>\r
 #include <dali/public-api/rendering/shader.h>\r
+#include <dali/public-api/rendering/texture.h>\r
 #include <cstring>\r
 \r
 // INTERNAL INCLUDES\r
 #include <dali-toolkit/devel-api/controls/scene3d-view/scene3d-view.h>\r
-#include <dali-toolkit/internal/controls/scene3d-view/gltf-loader.h>\r
 #include <dali-toolkit/public-api/controls/control-impl.h>\r
 \r
 namespace Dali\r
index 88fdf6b..02ca819 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +24,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/type-registry.h>
@@ -867,21 +868,21 @@ Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
 
 double ScrollBar::ScrollBarAccessible::GetMinimum() const
 {
-  auto self = Toolkit::ScrollBar::DownCast(Self());
+  auto   self             = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyMinScrollPosition) : 0.0f;
 }
 
 double ScrollBar::ScrollBarAccessible::GetCurrent() const
 {
-  auto self = Toolkit::ScrollBar::DownCast(Self());
+  auto   self             = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyScrollPosition) : 0.0f;
 }
 
 double ScrollBar::ScrollBarAccessible::GetMaximum() const
 {
-  auto self = Toolkit::ScrollBar::DownCast(Self());
+  auto   self             = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyMaxScrollPosition) : 1.0f;
 }
@@ -895,7 +896,7 @@ bool ScrollBar::ScrollBarAccessible::SetCurrent(double current)
 
   auto valueBefore = GetCurrent();
 
-  auto self = Toolkit::ScrollBar::DownCast(Self());
+  auto   self             = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   if(!scrollableHandle)
   {
@@ -906,7 +907,7 @@ bool ScrollBar::ScrollBarAccessible::SetCurrent(double current)
 
   auto valueAfter = GetCurrent();
 
-  if((current != valueBefore) && (valueBefore == valueAfter))
+  if(!Dali::Equals(current, valueBefore) && Dali::Equals(valueBefore, valueAfter))
   {
     return false;
   }
index c73a216..6ece809 100644 (file)
@@ -316,7 +316,7 @@ Accessibility::Range TextControlAccessible::GetTextAtOffset(std::size_t offset,
       break;
     }
 
-    case Dali::Accessibility::TextBoundary::SENTENCE: // Not supported by default
+    case Dali::Accessibility::TextBoundary::SENTENCE:  // Not supported by default
     case Dali::Accessibility::TextBoundary::PARAGRAPH: // Not supported by libunibreak library
     default:
     {
@@ -482,7 +482,7 @@ bool EditableTextControlAccessible::DeleteText(std::size_t startPosition, std::s
     return false;
   }
 
-  return SetTextContents(text.erase(startPosition, endPosition - startPosition));
+  return SetTextContents(std::move(text.erase(startPosition, endPosition - startPosition)));
 }
 
 bool EditableTextControlAccessible::InsertText(std::size_t startPosition, std::string newText)
@@ -494,7 +494,7 @@ bool EditableTextControlAccessible::InsertText(std::size_t startPosition, std::s
     return false;
   }
 
-  return SetTextContents(text.insert(startPosition, std::move(newText)));
+  return SetTextContents(std::move(text.insert(startPosition, newText)));
 }
 
 bool EditableTextControlAccessible::SetTextContents(std::string newContents)
index a27f45d..8b17590 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <cstring>
 #include <limits>
@@ -1237,7 +1238,7 @@ void TextEditor::UpdateScrollBar()
 void TextEditor::OnScrollIndicatorAnimationFinished(Animation& animation)
 {
   // If animation is successfully ended, then emit ScrollStateChangedSignal
-  if(animation.GetCurrentProgress() == 0.0f)
+  if(Dali::EqualsZero(animation.GetCurrentProgress()))
   {
     mScrollStarted = false;
     Dali::Toolkit::TextEditor handle(GetOwner());
index cb21ed9..280ebcd 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/bidirectional-support.h>
@@ -404,13 +405,13 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
           impl.mModel->mLogicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
 
           Vector4 backgroundColor = impl.mModel->mVisualModel->GetBackgroundColor();
-          if(backgroundColor.a == 0) // There is no text background color.
+          if(Dali::EqualsZero(backgroundColor.a)) // There is no text background color.
           {
             // Try use the control's background color.
             if(nullptr != impl.mEditableControlInterface)
             {
               impl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
-              if(backgroundColor.a == 0) // There is no control background color.
+              if(Dali::EqualsZero(backgroundColor.a)) // There is no control background color.
               {
                 // Determines black or white color according to text color.
                 // Based on W3C Recommendations (https://www.w3.org/TR/WCAG20/)
index 48df46e..a2ebc3f 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <limits>
 
 // INTERNAL INCLUDES
@@ -307,7 +308,7 @@ void Controller::Relayouter::FitPointSizeforLayout(Controller& controller, const
     }
 
     model->mElideEnabled = actualellipsis;
-    if(currentFitPointSize != bestPointSize)
+    if(!Dali::Equals(currentFitPointSize, bestPointSize))
     {
       impl.mTextFitChanged = true;
     }
@@ -843,7 +844,7 @@ void Controller::Relayouter::CalculateVerticalOffset(Controller::Impl& impl, con
 
   // Whether the text control is editable
   const bool isEditable = NULL != impl.mEventData;
-  if(isEditable && layoutSize.height != defaultFontLineHeight && impl.IsShowingPlaceholderText())
+  if(isEditable && !Dali::Equals(layoutSize.height, defaultFontLineHeight) && impl.IsShowingPlaceholderText())
   {
     // This code prevents the wrong positioning of cursor when the layout size is bigger/smaller than defaultFontLineHeight.
     // This situation occurs when the size of placeholder text is different from the default text.
index 144fe15..30355f8 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <memory.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/character-set-conversion.h>
 #include <dali-toolkit/internal/text/characters-helper-functions.h>
-#include <dali-toolkit/internal/text/emoji-helper.h>
-#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
 #include <dali-toolkit/internal/text/controller/text-controller-impl.h>
 #include <dali-toolkit/internal/text/controller/text-controller-placeholder-handler.h>
+#include <dali-toolkit/internal/text/emoji-helper.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor.h>
 #include <dali-toolkit/internal/text/text-editable-control-interface.h>
 
 namespace
@@ -323,7 +324,7 @@ void Controller::TextUpdater::InsertText(Controller& controller, const std::stri
     const bool addFontWeightRun = (style.weight != inputStyle.weight) && inputStyle.isWeightDefined;
     const bool addFontWidthRun  = (style.width != inputStyle.width) && inputStyle.isWidthDefined;
     const bool addFontSlantRun  = (style.slant != inputStyle.slant) && inputStyle.isSlantDefined;
-    const bool addFontSizeRun   = (style.size != inputStyle.size) && inputStyle.isSizeDefined;
+    const bool addFontSizeRun   = (!Dali::Equals(style.size, inputStyle.size)) && inputStyle.isSizeDefined;
 
     // Add style runs.
     if(addColorRun)
@@ -494,7 +495,7 @@ bool Controller::TextUpdater::RemoveText(
   int                  numberOfCharacters,
   UpdateInputStyleType type)
 {
-  bool removed = false;
+  bool removed   = false;
   bool removeAll = false;
 
   Controller::Impl& impl      = *controller.mImpl;
@@ -646,7 +647,7 @@ bool Controller::TextUpdater::RemoveText(
 
       DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", &controller, numberOfCharacters);
       removeAll = false;
-      removed = true;
+      removed   = true;
     }
   }
 
index 2589266..9e9b0f0 100644 (file)
@@ -1284,7 +1284,7 @@ int Controller::GetLineCount(float width)
   return mImpl->mModel->GetNumberOfLines();
 }
 
-const ModelInterface* const Controller::GetTextModel() const
+const ModelInterface* Controller::GetTextModel() const
 {
   return mImpl->mModel.Get();
 }
index 85ebfaa..0685371 100644 (file)
@@ -1598,7 +1598,7 @@ public: // Queries & retrieves.
    *
    * @return A pointer to the text's model.
    */
-  const ModelInterface* const GetTextModel() const;
+  const ModelInterface* GetTextModel() const;
 
   /**
    * @brief Used to get scrolled distance by user input
index fed87e8..1027903 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_INPUT_STYLE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/text-definitions.h>
@@ -149,8 +150,8 @@ struct InputStyle
        (weight != inputStyle.weight) ||
        (width != inputStyle.width) ||
        (slant != inputStyle.slant) ||
-       (size != inputStyle.size) ||
-       (lineSpacing != inputStyle.lineSpacing) ||
+       (!Dali::Equals(size, inputStyle.size)) ||
+       (!Dali::Equals(lineSpacing, inputStyle.lineSpacing)) ||
        (underlineProperties != inputStyle.underlineProperties) ||
        (shadowProperties != inputStyle.shadowProperties) ||
        (embossProperties != inputStyle.embossProperties) ||
@@ -187,11 +188,11 @@ struct InputStyle
     {
       mask = static_cast<Mask>(mask | INPUT_FONT_SLANT);
     }
-    if(size != inputStyle.size)
+    if(!Dali::Equals(size, inputStyle.size))
     {
       mask = static_cast<Mask>(mask | INPUT_POINT_SIZE);
     }
-    if(lineSpacing != inputStyle.lineSpacing)
+    if(!Dali::Equals(lineSpacing, inputStyle.lineSpacing))
     {
       mask = static_cast<Mask>(mask | INPUT_LINE_SPACING);
     }
index 7423820..7697a41 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_MULTI_LANGUAGE_SUPPORT_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -122,6 +122,13 @@ public:
                      CharacterIndex                          startIndex,
                      Length                                  numberOfCharacters,
                      Vector<FontRun>&                        fonts);
+
+public:
+  // Default copy and move operator
+  MultilanguageSupport(const MultilanguageSupport& rhs) = default;
+  MultilanguageSupport(MultilanguageSupport&& rhs)      = default;
+  MultilanguageSupport& operator=(const MultilanguageSupport& rhs) = default;
+  MultilanguageSupport& operator=(MultilanguageSupport&& rhs) = default;
 };
 
 } // namespace Text
index cc6f92f..f1a292b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_ATLAS_GLYPH_MANAGER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -181,6 +181,13 @@ public:
    */
   void AdjustReferenceCount(Text::FontId fontId, Text::GlyphIndex index, const GlyphStyle& style, int32_t delta);
 
+public:
+  // Default copy and move operator
+  AtlasGlyphManager(const AtlasGlyphManager& rhs) = default;
+  AtlasGlyphManager(AtlasGlyphManager&& rhs)      = default;
+  AtlasGlyphManager& operator=(const AtlasGlyphManager& rhs) = default;
+  AtlasGlyphManager& operator=(AtlasGlyphManager&& rhs) = default;
+
 private:
   explicit DALI_INTERNAL AtlasGlyphManager(Internal::AtlasGlyphManager* impl);
 };
index 91bb97e..dcbcf27 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_ATLAS_MANAGER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -269,6 +269,13 @@ public:
    */
   void SetTextures(AtlasId atlas, TextureSet& textureSet);
 
+public:
+  // Default copy and move operator
+  AtlasManager(const AtlasManager& rhs) = default;
+  AtlasManager(AtlasManager&& rhs)      = default;
+  AtlasManager& operator=(const AtlasManager& rhs) = default;
+  AtlasManager& operator=(AtlasManager&& rhs) = default;
+
 private:
   explicit DALI_INTERNAL AtlasManager(Internal::AtlasManager* impl);
 };
index 1d8731d..3dddd7c 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraints.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/public-api/rendering/renderer.h>
 #include <map>
@@ -581,7 +582,7 @@ struct AtlasRenderer::Impl
       thereAreStrikethroughGlyphs                                                 = thereAreStrikethroughGlyphs || isGlyphStrikethrough;
 
       // No operation for white space
-      if(glyph.width && glyph.height)
+      if(!Dali::EqualsZero(glyph.width) && !Dali::EqualsZero(glyph.height))
       {
         // Check and update decorative-lines informations
         if(isGlyphUnderlined || isGlyphStrikethrough)
index 1802b7b..e236c4c 100644 (file)
@@ -45,16 +45,13 @@ Backend::~Backend()
 {
 }
 
-Backend::Backend(const Backend& handle)
-: BaseHandle(handle)
-{
-}
+Backend::Backend(const Backend& handle) = default;
 
-Backend& Backend::operator=(const Backend& handle)
-{
-  BaseHandle::operator=(handle);
-  return *this;
-}
+Backend& Backend::operator=(const Backend& handle) = default;
+
+Backend::Backend(Backend&& handle) = default;
+
+Backend& Backend::operator=(Backend&& handle) = default;
 
 Backend::Backend(Internal::Backend* internal)
 : BaseHandle(internal)
index 926ecd3..733e688 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_BACKEND_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -83,6 +83,21 @@ public:
    */
   Backend& operator=(const Backend& handle);
 
+  /**
+   * @brief This move constructor is required for (smart) pointer semantics.
+   *
+   * @param[in] handle A reference to the moved handle.
+   */
+  Backend(Backend&& handle);
+
+  /**
+   * @brief This move assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] handle  A reference to the moved handle.
+   * @return A reference to this.
+   */
+  Backend& operator=(Backend&& handle);
+
 public: // Not intended for application developers
   /**
    * @brief This constructor is used by Backend::Get().
index 343f6cb..aaa3911 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 #include <memory.h>
 
 // INTERNAL INCLUDES
@@ -447,7 +448,7 @@ void DrawUnderline(
 
         for(uint32_t x = xRangeMin; x < xRangeMax; x++)
         {
-          if(dashGap == 0 && dashWidth > 0)
+          if(Dali::EqualsZero(dashGap) && dashWidth > 0)
           {
             // Note : this is same logic as bitmap[y][x] = underlineColor;
             *(bitmapBuffer + x) = packedUnderlineColor;
@@ -749,7 +750,7 @@ inline Devel::PixelBuffer CreateTransparentImageBuffer(const uint32_t bufferWidt
   if(Pixel::RGBA8888 == pixelFormat)
   {
     const uint32_t bufferSizeInt  = bufferWidth * bufferHeight;
-    const size_t bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
+    const size_t   bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
     memset(imageBuffer.GetBuffer(), 0, bufferSizeChar);
   }
   else
@@ -945,7 +946,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
   const uint32_t bufferHeight = static_cast<uint32_t>(size.height);
 
   const uint32_t bufferSizeInt  = bufferWidth * bufferHeight;
-  const size_t bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
+  const size_t   bufferSizeChar = sizeof(uint32_t) * static_cast<std::size_t>(bufferSizeInt);
 
   //Elided text in ellipsis at START could start on index greater than 0
   auto startIndexOfGlyphs = mModel->GetStartIndexOfElidedGlyphs();
index d58848a..822ea3d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VECTOR_BLOB_ATLAS_SHARE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -70,6 +70,13 @@ public:
    */
   VectorBlobAtlas* GetNewAtlas();
 
+public:
+  // Default copy and move operator
+  VectorBlobAtlasShare(const VectorBlobAtlasShare& rhs) = default;
+  VectorBlobAtlasShare(VectorBlobAtlasShare&& rhs)      = default;
+  VectorBlobAtlasShare& operator=(const VectorBlobAtlasShare& rhs) = default;
+  VectorBlobAtlasShare& operator=(VectorBlobAtlasShare&& rhs) = default;
+
 private:
   class Impl;
 
index 725f945..c37cba3 100644 (file)
@@ -93,7 +93,7 @@ Length ViewModel::GetNumberOfLines() const
   return mModel->GetNumberOfLines();
 }
 
-const LineRun* const ViewModel::GetLines() const
+const LineRun* ViewModel::GetLines() const
 {
   return mModel->GetLines();
 }
@@ -103,7 +103,7 @@ Length ViewModel::GetNumberOfScripts() const
   return mModel->GetNumberOfScripts();
 }
 
-const ScriptRun* const ViewModel::GetScriptRuns() const
+const ScriptRun* ViewModel::GetScriptRuns() const
 {
   return mModel->GetScriptRuns();
 }
@@ -162,7 +162,7 @@ GlyphIndex ViewModel::GetSecondMiddleIndexOfElidedGlyphs() const
   return mModel->GetSecondMiddleIndexOfElidedGlyphs();
 }
 
-const GlyphInfo* const ViewModel::GetGlyphs() const
+const GlyphInfo* ViewModel::GetGlyphs() const
 {
   if(mIsTextElided && mModel->IsTextElideEnabled())
   {
@@ -176,7 +176,7 @@ const GlyphInfo* const ViewModel::GetGlyphs() const
   return NULL;
 }
 
-const Vector2* const ViewModel::GetLayout() const
+const Vector2* ViewModel::GetLayout() const
 {
   if(mIsTextElided && mModel->IsTextElideEnabled())
   {
@@ -190,27 +190,27 @@ const Vector2* const ViewModel::GetLayout() const
   return NULL;
 }
 
-const Vector4* const ViewModel::GetColors() const
+const Vector4* ViewModel::GetColors() const
 {
   return mModel->GetColors();
 }
 
-const ColorIndex* const ViewModel::GetColorIndices() const
+const ColorIndex* ViewModel::GetColorIndices() const
 {
   return mModel->GetColorIndices();
 }
 
-const Vector4* const ViewModel::GetBackgroundColors() const
+const Vector4* ViewModel::GetBackgroundColors() const
 {
   return mModel->GetBackgroundColors();
 }
 
-const ColorIndex* const ViewModel::GetBackgroundColorIndices() const
+const ColorIndex* ViewModel::GetBackgroundColorIndices() const
 {
   return mModel->GetBackgroundColorIndices();
 }
 
-bool const ViewModel::IsMarkupBackgroundColorSet() const
+bool ViewModel::IsMarkupBackgroundColorSet() const
 {
   return mModel->IsMarkupBackgroundColorSet();
 }
@@ -245,7 +245,7 @@ bool ViewModel::IsUnderlineEnabled() const
   return mModel->IsUnderlineEnabled();
 }
 
-bool const ViewModel::IsMarkupUnderlineSet() const
+bool ViewModel::IsMarkupUnderlineSet() const
 {
   return mModel->IsMarkupUnderlineSet();
 }
@@ -325,7 +325,7 @@ Length ViewModel::GetHyphensCount() const
   return mModel->GetHyphensCount();
 }
 
-const float ViewModel::GetCharacterSpacing() const
+float ViewModel::GetCharacterSpacing() const
 {
   return mModel->GetCharacterSpacing();
 }
@@ -709,7 +709,7 @@ bool ViewModel::IsStrikethroughEnabled() const
   return mModel->IsStrikethroughEnabled();
 }
 
-bool const ViewModel::IsMarkupStrikethroughSet() const
+bool ViewModel::IsMarkupStrikethroughSet() const
 {
   return mModel->IsMarkupStrikethroughSet();
 }
index 0e0c64e..e68e7c6 100644 (file)
@@ -104,7 +104,7 @@ public:
   /**
    * @copydoc ModelInterface::GetLines()
    */
-  const LineRun* const GetLines() const override;
+  const LineRun* GetLines() const override;
 
   /**
    * @copydoc ModelInterface::GetNumberOfScripts()
@@ -114,7 +114,7 @@ public:
   /**
    * @copydoc ModelInterface::GetScriptRuns()
    */
-  const ScriptRun* const GetScriptRuns() const override;
+  const ScriptRun* GetScriptRuns() const override;
 
   /**
    * @copydoc ModelInterface::GetNumberOfGlyphs()
@@ -144,37 +144,37 @@ public:
   /**
    * @copydoc ModelInterface::GetGlyphs()
    */
-  const GlyphInfo* const GetGlyphs() const override;
+  const GlyphInfo* GetGlyphs() const override;
 
   /**
    * @copydoc ModelInterface::GetLayout()
    */
-  const Vector2* const GetLayout() const override;
+  const Vector2* GetLayout() const override;
 
   /**
    * @copydoc ModelInterface::GetColors()
    */
-  const Vector4* const GetColors() const override;
+  const Vector4* GetColors() const override;
 
   /**
    * @copydoc ModelInterface::GetColorIndices()
    */
-  const ColorIndex* const GetColorIndices() const override;
+  const ColorIndex* GetColorIndices() const override;
 
   /**
    * @copydoc ModelInterface::GetBackgroundColors()
    */
-  const Vector4* const GetBackgroundColors() const override;
+  const Vector4* GetBackgroundColors() const override;
 
   /**
    * @copydoc ModelInterface::GetBackgroundColorIndices()
    */
-  const ColorIndex* const GetBackgroundColorIndices() const override;
+  const ColorIndex* GetBackgroundColorIndices() const override;
 
   /**
    * @copydoc ModelInterface::IsMarkupBackgroundColorSet()
    */
-  bool const IsMarkupBackgroundColorSet() const override;
+  bool IsMarkupBackgroundColorSet() const override;
 
   /**
    * @copydoc ModelInterface::GetDefaultColor()
@@ -209,7 +209,7 @@ public:
   /**
    * @copydoc ModelInterface::IsMarkupUnderlineSet()
    */
-  bool const IsMarkupUnderlineSet() const override;
+  bool IsMarkupUnderlineSet() const override;
 
   /**
    * @copydoc ModelInterface::GetUnderlineHeight()
@@ -289,7 +289,7 @@ public:
   /**
   * @copydoc ModelInterface::GetCharacterSpacing()
   */
-  const float GetCharacterSpacing() const override;
+  float GetCharacterSpacing() const override;
 
   /**
   * @copydoc ModelInterface::GetTextBuffer()
@@ -331,7 +331,7 @@ public:
   /**
    * @copydoc ModelInterface::IsMarkupStrikethroughSet()
    */
-  bool const IsMarkupStrikethroughSet() const override;
+  bool IsMarkupStrikethroughSet() const override;
 
   /**
    * @copydoc ModelInterface::GetNumberOfStrikethroughRuns()
index 79597c9..1a68bbe 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/vector4.h>
 
 namespace Dali
@@ -63,7 +64,7 @@ struct StrikethroughStyleProperties
   {
     //The property is similar when both are not defined or when both are defined and have the same value.
     return ((!colorDefined && !other.colorDefined) || ((colorDefined && other.colorDefined) && (color == other.color))) &&
-           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height)));
+           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height))));
   }
 
   bool operator!=(const StrikethroughStyleProperties& other) const
@@ -73,7 +74,7 @@ struct StrikethroughStyleProperties
 
   bool IsHeightEqualTo(const StrikethroughStyleProperties& other) const
   {
-    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height)));
+    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height))));
   }
 
   StrikethroughStyleProperties& CopyIfNotDefined(const StrikethroughStyleProperties& other)
index c15a11d..1428b95 100644 (file)
@@ -18,6 +18,9 @@
 // FILE HEADER
 #include <dali-toolkit/internal/text/text-effects-style.h>
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/text-controls/text-style-properties-devel.h>
 #include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
@@ -610,7 +613,7 @@ bool SetShadowProperties(ControllerPtr controller, const Property::Value& value,
             update = true;
           }
 
-          if(blurRadiusDefined && (controller->GetShadowBlurRadius() != blurRadius))
+          if(blurRadiusDefined && (!Dali::Equals(controller->GetShadowBlurRadius(), blurRadius)))
           {
             controller->SetShadowBlurRadius(blurRadius);
             update = true;
index 01ba584..4bef3b3 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/cursor-helper-functions.h>
@@ -74,7 +75,7 @@ void GetTextGeometry(ModelPtr textModel, CharacterIndex startIndex, CharacterInd
   sizesList.Clear();
   positionsList.Clear();
 
-  if(charactersToGlyphBuffer == nullptr || glyphsPerCharacterBuffer  == nullptr || charactersPerGlyphBuffer  == nullptr || glyphToCharacterBuffer == nullptr )
+  if(charactersToGlyphBuffer == nullptr || glyphsPerCharacterBuffer == nullptr || charactersPerGlyphBuffer == nullptr || glyphToCharacterBuffer == nullptr)
   {
     return;
   }
@@ -244,7 +245,7 @@ void GetTextGeometry(ModelPtr textModel, CharacterIndex startIndex, CharacterInd
       blockPos  = currentPosition;
       blockSize = currentSize;
     }
-    else if((isPrevoiusRightToLeft != isCurrentRightToLeft) || (blockPos.y != currentPosition.y)) //new direction or new line
+    else if((isPrevoiusRightToLeft != isCurrentRightToLeft) || (!Dali::Equals(blockPos.y, currentPosition.y))) //new direction or new line
     {
       sizesList.PushBack(blockSize);
       positionsList.PushBack(blockPos);
@@ -277,19 +278,19 @@ float GetLineLeft(const LineRun& lineRun)
 
 float GetLineTop(const Vector<LineRun>& lines, const LineRun& lineRun)
 {
-  float lineTop = 0;
+  float     lineTop       = 0;
   const int numberOfLines = (int)lines.Count();
 
-  int currentLineIndex = 0;
-  Vector<LineRun>::ConstIterator endIt = (&lineRun);
+  int                            currentLineIndex = 0;
+  Vector<LineRun>::ConstIterator endIt            = (&lineRun);
   for(Vector<LineRun>::Iterator it = lines.Begin();
       it != endIt;
       ++it, ++currentLineIndex)
-    {
-      LineRun& line = *it;
-      bool isLastLine  = (currentLineIndex + 1) == numberOfLines;
-      lineTop         += GetLineHeight(line, isLastLine);
-    }
+  {
+    LineRun& line       = *it;
+    bool     isLastLine = (currentLineIndex + 1) == numberOfLines;
+    lineTop += GetLineHeight(line, isLastLine);
+  }
 
   return lineTop;
 }
@@ -301,7 +302,6 @@ float GetLineWidth(const LineRun& lineRun)
 
 Rect<float> GetLineBoundingRect(ModelPtr textModel, const uint32_t lineIndex)
 {
-
   if(textModel->mVisualModel == nullptr)
   {
     return {0, 0, 0, 0};
@@ -314,10 +314,10 @@ Rect<float> GetLineBoundingRect(ModelPtr textModel, const uint32_t lineIndex)
     return {0, 0, 0, 0};
   }
 
-  const Vector<LineRun>& lines   = textModel->mVisualModel->mLines;
-  const LineRun&         lineRun = lines[lineIndex];
-  bool  isFirstLine = lineIndex == 0;
-  bool  isLastLine  = (lineIndex + 1) == numberOfLines;
+  const Vector<LineRun>& lines       = textModel->mVisualModel->mLines;
+  const LineRun&         lineRun     = lines[lineIndex];
+  bool                   isFirstLine = lineIndex == 0;
+  bool                   isLastLine  = (lineIndex + 1) == numberOfLines;
 
   // Calculate the Left(lineX) = X position.
   float lineX = GetLineLeft(lineRun) + textModel->mScrollPosition.x;
@@ -376,7 +376,7 @@ Rect<> GetCharacterBoundingRect(ModelPtr textModel, const uint32_t charIndex)
   const GlyphIndex glyphIndex = visualModel->mCharactersToGlyph[charIndex]; //took its glyphs
 
   const Vector2&   characterPosition = glyphPositions[glyphIndex];
-  const GlyphInfo& glyphInfo    = glyphs[glyphIndex];
+  const GlyphInfo& glyphInfo         = glyphs[glyphIndex];
 
   // GetLineOfCharacter function returns 0 if the lines are empty
   const int      lineIndex = visualModel->GetLineOfCharacter(charIndex);
index 4859597..b663073 100644 (file)
@@ -121,7 +121,7 @@ public:
    *
    * @return A pointer to the vector with the laid-out lines.
    */
-  virtual const LineRun* const GetLines() const = 0;
+  virtual const LineRun* GetLines() const = 0;
 
   /**
    * @brief Retrieves the number of script runs.
@@ -135,7 +135,7 @@ public:
    *
    * @return A pointer to the vector with the runs of characters with the same script..
    */
-  virtual const ScriptRun* const GetScriptRuns() const = 0;
+  virtual const ScriptRun* GetScriptRuns() const = 0;
 
   /**
    * @brief Retrieves the number of laid-out glyphs.
@@ -177,49 +177,49 @@ public:
    *
    * @return A pointer to the vector with the laid-out glyphs.
    */
-  virtual const GlyphInfo* const GetGlyphs() const = 0;
+  virtual const GlyphInfo* GetGlyphs() const = 0;
 
   /**
    * @brief Retrieves the text layout.
    *
    * @return A pointer to the vector with the positions for each glyph.
    */
-  virtual const Vector2* const GetLayout() const = 0;
+  virtual const Vector2* GetLayout() const = 0;
 
   /**
    * @brief Retrieves the vector of colors.
    *
    * @return Pointer to the vector of colors.
    */
-  virtual const Vector4* const GetColors() const = 0;
+  virtual const Vector4* GetColors() const = 0;
 
   /**
    * @brief Retrieves the vector of indices to the vector of colors.
    *
    * @return Pointer to a vector which stores for each glyph the index to the vector of colors.
    */
-  virtual const ColorIndex* const GetColorIndices() const = 0;
+  virtual const ColorIndex* GetColorIndices() const = 0;
 
   /**
    * @brief Retrieves the vector of background colors.
    *
    * @return Pointer to the vector of background colors.
    */
-  virtual const Vector4* const GetBackgroundColors() const = 0;
+  virtual const Vector4* GetBackgroundColors() const = 0;
 
   /**
    * @brief Retrieves the vector of indices to the vector of background colors.
    *
    * @return Pointer to a vector which stores for each glyph the index to the vector of background colors.
    */
-  virtual const ColorIndex* const GetBackgroundColorIndices() const = 0;
+  virtual const ColorIndex* GetBackgroundColorIndices() const = 0;
 
   /**
    * @brief checks if there is background colors set using markup.
    *
    * @return boolean if there is background colors set using markup .
    */
-  virtual bool const IsMarkupBackgroundColorSet() const = 0;
+  virtual bool IsMarkupBackgroundColorSet() const = 0;
 
   /**
    * @brief Retrieves the text's default color.
@@ -268,7 +268,7 @@ public:
    *
    * @return boolean if there is underline set using markup.
    */
-  virtual bool const IsMarkupUnderlineSet() const = 0;
+  virtual bool IsMarkupUnderlineSet() const = 0;
 
   /**
    * @brief Retrieves the underline height override
@@ -398,7 +398,7 @@ public:
    *
    * @return boolean if there is strikethrough set using markup.
    */
-  virtual bool const IsMarkupStrikethroughSet() const = 0;
+  virtual bool IsMarkupStrikethroughSet() const = 0;
 
   /**
    * @brief Retrieves the strikethrough height override
@@ -458,7 +458,7 @@ public:
    *
    * @return The character spacing.
    */
-  virtual const float GetCharacterSpacing() const = 0;
+  virtual float GetCharacterSpacing() const = 0;
 
   /**
    * @brief Retrieves the text buffer.
index b1d4d02..b158459 100644 (file)
@@ -82,7 +82,7 @@ Length Model::GetNumberOfLines() const
   return mVisualModel->mLines.Count();
 }
 
-const LineRun* const Model::GetLines() const
+const LineRun* Model::GetLines() const
 {
   return mVisualModel->mLines.Begin();
 }
@@ -92,7 +92,7 @@ Length Model::GetNumberOfScripts() const
   return mLogicalModel->mScriptRuns.Count();
 }
 
-const ScriptRun* const Model::GetScriptRuns() const
+const ScriptRun* Model::GetScriptRuns() const
 {
   return mLogicalModel->mScriptRuns.Begin();
 }
@@ -122,37 +122,37 @@ GlyphIndex Model::GetSecondMiddleIndexOfElidedGlyphs() const
   return mVisualModel->GetSecondMiddleIndexOfElidedGlyphs();
 }
 
-const GlyphInfo* const Model::GetGlyphs() const
+const GlyphInfo* Model::GetGlyphs() const
 {
   return mVisualModel->mGlyphs.Begin();
 }
 
-const Vector2* const Model::GetLayout() const
+const Vector2* Model::GetLayout() const
 {
   return mVisualModel->mGlyphPositions.Begin();
 }
 
-const Vector4* const Model::GetColors() const
+const Vector4* Model::GetColors() const
 {
   return mVisualModel->mColors.Begin();
 }
 
-const ColorIndex* const Model::GetColorIndices() const
+const ColorIndex* Model::GetColorIndices() const
 {
   return mVisualModel->mColorIndices.Begin();
 }
 
-const Vector4* const Model::GetBackgroundColors() const
+const Vector4* Model::GetBackgroundColors() const
 {
   return mVisualModel->mBackgroundColors.Begin();
 }
 
-const ColorIndex* const Model::GetBackgroundColorIndices() const
+const ColorIndex* Model::GetBackgroundColorIndices() const
 {
   return mVisualModel->mBackgroundColorIndices.Begin();
 }
 
-bool const Model::IsMarkupBackgroundColorSet() const
+bool Model::IsMarkupBackgroundColorSet() const
 {
   return (mVisualModel->mBackgroundColors.Count() > 0);
 }
@@ -187,7 +187,7 @@ bool Model::IsUnderlineEnabled() const
   return mVisualModel->IsUnderlineEnabled();
 }
 
-bool const Model::IsMarkupUnderlineSet() const
+bool Model::IsMarkupUnderlineSet() const
 {
   return (mVisualModel->mUnderlineRuns.Count() > 0u);
 }
@@ -276,7 +276,7 @@ bool Model::IsStrikethroughEnabled() const
   return mVisualModel->IsStrikethroughEnabled();
 }
 
-bool const Model::IsMarkupStrikethroughSet() const
+bool Model::IsMarkupStrikethroughSet() const
 {
   return (mVisualModel->mStrikethroughRuns.Count() > 0u);
 }
@@ -316,7 +316,7 @@ const Vector<CharacterSpacingGlyphRun>& Model::GetCharacterSpacingGlyphRuns() co
   return mVisualModel->GetCharacterSpacingGlyphRuns();
 }
 
-const float Model::GetCharacterSpacing() const
+float Model::GetCharacterSpacing() const
 {
   return mVisualModel->GetCharacterSpacing();
 }
index 945d5fc..e8be2cd 100644 (file)
@@ -102,7 +102,7 @@ public:
   /**
    * @copydoc ModelInterface::GetLines()
    */
-  const LineRun* const GetLines() const override;
+  const LineRun* GetLines() const override;
 
   /**
    * @copydoc ModelInterface::GetNumberOfScripts()
@@ -112,7 +112,7 @@ public:
   /**
    * @copydoc ModelInterface::GetScriptRuns()
    */
-  const ScriptRun* const GetScriptRuns() const override;
+  const ScriptRun* GetScriptRuns() const override;
 
   /**
    * @copydoc ModelInterface::GetNumberOfGlyphs()
@@ -142,37 +142,37 @@ public:
   /**
    * @copydoc ModelInterface::GetGlyphs()
    */
-  const GlyphInfo* const GetGlyphs() const override;
+  const GlyphInfo* GetGlyphs() const override;
 
   /**
    * @copydoc ModelInterface::GetLayout()
    */
-  const Vector2* const GetLayout() const override;
+  const Vector2* GetLayout() const override;
 
   /**
    * @copydoc ModelInterface::GetColors()
    */
-  const Vector4* const GetColors() const override;
+  const Vector4* GetColors() const override;
 
   /**
    * @copydoc ModelInterface::GetColorIndices()
    */
-  const ColorIndex* const GetColorIndices() const override;
+  const ColorIndex* GetColorIndices() const override;
 
   /**
    * @copydoc ModelInterface::GetBackgroundColors()
    */
-  const Vector4* const GetBackgroundColors() const override;
+  const Vector4* GetBackgroundColors() const override;
 
   /**
    * @copydoc ModelInterface::GetBackgroundColorIndices()
    */
-  const ColorIndex* const GetBackgroundColorIndices() const override;
+  const ColorIndex* GetBackgroundColorIndices() const override;
 
   /**
    * @copydoc ModelInterface::IsMarkupBackgroundColorSet()
    */
-  bool const IsMarkupBackgroundColorSet() const override;
+  bool IsMarkupBackgroundColorSet() const override;
 
   /**
    * @copydoc ModelInterface::GetDefaultColor()
@@ -207,7 +207,7 @@ public:
   /**
    * @copydoc ModelInterface::IsMarkupUnderlineSet()
    */
-  bool const IsMarkupUnderlineSet() const override;
+  bool IsMarkupUnderlineSet() const override;
 
   /**
    * @copydoc ModelInterface::GetUnderlineHeight()
@@ -302,12 +302,12 @@ public:
   /**
    * @copydoc ModelInterface::IsMarkupStrikethroughSet()
    */
-  bool const IsMarkupStrikethroughSet() const override;
+  bool IsMarkupStrikethroughSet() const override;
 
   /**
    * @copydoc ModelInterface::GetCharacterSpacing()
    */
-  const float GetCharacterSpacing() const override;
+  float GetCharacterSpacing() const override;
 
   /**
    * @copydoc ModelInterface::GetTextBuffer()
index 2fcf548..8a23485 100644 (file)
@@ -109,35 +109,35 @@ public:
    *
    * @return Pointer to the vector of colors.
    */
-  virtual const Vector4* const GetColors() const = 0;
+  virtual const Vector4* GetColors() const = 0;
 
   /**
    * @brief Retrieves the vector of indices to the vector of colors.
    *
    * @return Pointer to a vector which stores for each glyph the index to the vector of colors.
    */
-  virtual const ColorIndex* const GetColorIndices() const = 0;
+  virtual const ColorIndex* GetColorIndices() const = 0;
 
   /**
    * @brief Retrieves the vector of background colors.
    *
    * @return Pointer to the vector of background colors.
    */
-  virtual const Vector4* const GetBackgroundColors() const = 0;
+  virtual const Vector4* GetBackgroundColors() const = 0;
 
   /**
    * @brief Retrieves the vector of indices to the vector of background colors.
    *
    * @return Pointer to a vector which stores for each glyph the index to the vector of background colors.
    */
-  virtual const ColorIndex* const GetBackgroundColorIndices() const = 0;
+  virtual const ColorIndex* GetBackgroundColorIndices() const = 0;
 
   /**
    * @brief checks if there is background colors set using markup.
    *
    * @return boolean if there is background colors set using markup .
    */
-  virtual bool const IsMarkupBackgroundColorSet() const = 0;
+  virtual bool IsMarkupBackgroundColorSet() const = 0;
 
   /**
    * @brief Retrieves the text color
@@ -179,7 +179,7 @@ public:
    *
    * @return boolean if there is underline set using markup.
    */
-  virtual bool const IsMarkupUnderlineSet() const = 0;
+  virtual bool IsMarkupUnderlineSet() const = 0;
 
   /**
    * @brief Returns the hyphens glyph info.
@@ -322,7 +322,7 @@ public:
    *
    * @return boolean if there is strikethrough set using markup.
    */
-  virtual bool const IsMarkupStrikethroughSet() const = 0;
+  virtual bool IsMarkupStrikethroughSet() const = 0;
 
   /**
    * @brief Retrieves the strikethrough height override
@@ -384,7 +384,7 @@ public:
    *
    * @return characterSpacing.
    */
-  virtual const float GetCharacterSpacing() const = 0;
+  virtual float GetCharacterSpacing() const = 0;
 
   /**
    * @brief The text buffer.
index 0b81484..e89d434 100644 (file)
@@ -575,7 +575,7 @@ Length View::GetGlyphs(GlyphInfo* glyphs,
   return numberOfLaidOutGlyphs;
 }
 
-const Vector4* const View::GetColors() const
+const Vector4* View::GetColors() const
 {
   if(mImpl->mVisualModel)
   {
@@ -585,7 +585,7 @@ const Vector4* const View::GetColors() const
   return NULL;
 }
 
-const ColorIndex* const View::GetColorIndices() const
+const ColorIndex* View::GetColorIndices() const
 {
   if(mImpl->mVisualModel)
   {
@@ -595,7 +595,7 @@ const ColorIndex* const View::GetColorIndices() const
   return NULL;
 }
 
-const Vector4* const View::GetBackgroundColors() const
+const Vector4* View::GetBackgroundColors() const
 {
   if(mImpl->mVisualModel)
   {
@@ -605,7 +605,7 @@ const Vector4* const View::GetBackgroundColors() const
   return nullptr;
 }
 
-const ColorIndex* const View::GetBackgroundColorIndices() const
+const ColorIndex* View::GetBackgroundColorIndices() const
 {
   if(mImpl->mVisualModel)
   {
@@ -615,7 +615,7 @@ const ColorIndex* const View::GetBackgroundColorIndices() const
   return nullptr;
 }
 
-bool const View::IsMarkupBackgroundColorSet() const
+bool View::IsMarkupBackgroundColorSet() const
 {
   if(mImpl->mVisualModel)
   {
@@ -670,7 +670,7 @@ bool View::IsUnderlineEnabled() const
   return false;
 }
 
-bool const View::IsMarkupUnderlineSet() const
+bool View::IsMarkupUnderlineSet() const
 {
   return (GetNumberOfUnderlineRuns() > 0u);
 }
@@ -870,7 +870,7 @@ bool View::IsStrikethroughEnabled() const
   return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false;
 }
 
-bool const View::IsMarkupStrikethroughSet() const
+bool View::IsMarkupStrikethroughSet() const
 {
   return (GetNumberOfStrikethroughRuns() > 0u);
 }
@@ -927,7 +927,7 @@ const Vector<CharacterSpacingGlyphRun>& View::GetCharacterSpacingGlyphRuns() con
   return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacingGlyphRuns() : GetEmptyCharacterSpacingGlyphRuns();
 }
 
-const float View::GetCharacterSpacing() const
+float View::GetCharacterSpacing() const
 {
   return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacing() : 0.f;
 }
index 7cccf19..893c802 100644 (file)
@@ -87,27 +87,27 @@ public:
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetColors()
    */
-  const Vector4* const GetColors() const override;
+  const Vector4* GetColors() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetColorIndices()
    */
-  const ColorIndex* const GetColorIndices() const override;
+  const ColorIndex* GetColorIndices() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColors()
    */
-  const Vector4* const GetBackgroundColors() const override;
+  const Vector4* GetBackgroundColors() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetBackgroundColorIndices()
    */
-  const ColorIndex* const GetBackgroundColorIndices() const override;
+  const ColorIndex* GetBackgroundColorIndices() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupBackgroundColorSet()
    */
-  bool const IsMarkupBackgroundColorSet() const;
+  bool IsMarkupBackgroundColorSet() const;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
@@ -137,7 +137,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupUnderlineSet()
    */
-  bool const IsMarkupUnderlineSet() const;
+  bool IsMarkupUnderlineSet() const;
 
   /**
   * @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
@@ -239,7 +239,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupStrikethroughSet()
    */
-  bool const IsMarkupStrikethroughSet() const;
+  bool IsMarkupStrikethroughSet() const;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
@@ -281,7 +281,7 @@ public:
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetCharacterSpacing()
    */
-  const float GetCharacterSpacing() const override;
+  float GetCharacterSpacing() const override;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextBuffer()
index d75f22b..c2bd9ab 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/vector4.h>
 
 // INTERNAL INCLUDES
@@ -85,9 +86,9 @@ struct UnderlineStyleProperties
     //The property is similar when both are not defined or when both are defined and have the same value.
     return ((!typeDefined && !other.typeDefined) || ((typeDefined && other.typeDefined) && (type == other.type))) &&
            ((!colorDefined && !other.colorDefined) || ((colorDefined && other.colorDefined) && (color == other.color))) &&
-           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height))) &&
-           ((!dashGapDefined && !other.dashGapDefined) || ((dashGapDefined && other.dashGapDefined) && (dashGap == other.dashGap))) &&
-           ((!dashWidthDefined && !other.dashWidthDefined) || ((dashWidthDefined && other.dashWidthDefined) && (dashWidth == other.dashWidth)));
+           ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height)))) &&
+           ((!dashGapDefined && !other.dashGapDefined) || ((dashGapDefined && other.dashGapDefined) && (Dali::Equals(dashGap, other.dashGap)))) &&
+           ((!dashWidthDefined && !other.dashWidthDefined) || ((dashWidthDefined && other.dashWidthDefined) && (Dali::Equals(dashWidth, other.dashWidth))));
   }
 
   bool operator!=(const UnderlineStyleProperties& other) const
@@ -97,7 +98,7 @@ struct UnderlineStyleProperties
 
   bool IsHeightEqualTo(const UnderlineStyleProperties& other) const
   {
-    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (height == other.height)));
+    return ((!heightDefined && !other.heightDefined) || ((heightDefined && other.heightDefined) && (Dali::Equals(height, other.height))));
   }
 
   UnderlineStyleProperties& CopyIfNotDefined(const UnderlineStyleProperties& other)
index 21b9977..71bcdc3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,6 +24,7 @@
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-registry.h>
 #include <limits>
 
@@ -105,10 +106,10 @@ void SlideTransition::OnPlay()
                           Vector2(currentPosition.x + ((mDirection.x < 0.0f) ? size.x / 2.0f : -size.x / 2.0f),
                                   currentPosition.y + ((mDirection.y < 0.0f) ? size.y / 2.0f : -size.y / 2.0f));
 
-  float xScale = (mDirection.x == 0.0f) ? std::numeric_limits<float>::max()
-                                        : ((mDirection.x < 0.0f) ? checkPosition.x : windowSize.x - checkPosition.x) / std::abs(mDirection.x);
-  float yScale = (mDirection.y == 0.0f) ? std::numeric_limits<float>::max()
-                                        : ((mDirection.y < 0.0f) ? checkPosition.y : windowSize.y - checkPosition.y) / std::abs(mDirection.y);
+  float xScale = (Dali::EqualsZero(mDirection.x)) ? std::numeric_limits<float>::max()
+                                                  : ((mDirection.x < 0.0f) ? checkPosition.x : windowSize.x - checkPosition.x) / std::abs(mDirection.x);
+  float yScale = (Dali::EqualsZero(mDirection.y)) ? std::numeric_limits<float>::max()
+                                                  : ((mDirection.y < 0.0f) ? checkPosition.y : windowSize.y - checkPosition.y) / std::abs(mDirection.y);
 
   Vector2 displacement = mDirection * std::min(xScale, yScale);
 
index ca3b93d..7244829 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/rendering/decorated-visual-renderer.h>
 
 // INTERNAL INCLUDES
@@ -697,7 +698,7 @@ void AnimatedVectorImageVisual::OnScaleNotification(PropertyNotification& source
   {
     Vector3 scale = actor.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
 
-    if((mVisualScale.width != scale.width || mVisualScale.height != scale.height) && (mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f))
+    if((!Dali::Equals(mVisualScale.width, scale.width) || !Dali::Equals(mVisualScale.height, scale.height)) && (mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f))
     {
       mVisualScale.width  = scale.width;
       mVisualScale.height = scale.height;
@@ -719,7 +720,7 @@ void AnimatedVectorImageVisual::OnSizeNotification(PropertyNotification& source)
   {
     Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE);
 
-    if(mVisualSize.width != size.width || mVisualSize.height != size.height)
+    if(!Dali::Equals(mVisualSize.width, size.width) || !Dali::Equals(mVisualSize.height, size.height))
     {
       mVisualSize.width  = size.width;
       mVisualSize.height = size.height;
index 1539bc4..b4c7fc9 100644 (file)
@@ -496,7 +496,7 @@ float Visual::Base::GetHeightForWidth(float width)
   float   aspectCorrectedHeight = 0.f;
   Vector2 naturalSize;
   GetNaturalSize(naturalSize);
-  if(naturalSize.width)
+  if(naturalSize.width > 0.0f)
   {
     aspectCorrectedHeight = naturalSize.height * width / naturalSize.width;
   }
index 6bf66cb..7e7a0b0 100644 (file)
@@ -20,6 +20,8 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/devel-api/common/hash.h>
+#include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/utility/npatch-helper.h>
@@ -29,7 +31,6 @@
 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
 #include <dali-toolkit/internal/visuals/svg/svg-visual.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
-#include <dali/integration-api/debug.h>
 
 namespace Dali
 {
@@ -436,7 +437,7 @@ int32_t VisualFactoryCache::GetProperBrokenImageIndex(const Vector2& size)
 {
   // Sets the default broken type
   int32_t returnIndex = 0;
-  if((size.width == 0 || size.height == 0) || mUseDefaultBrokenImageOnly)
+  if(Dali::EqualsZero(size.width) || Dali::EqualsZero(size.height) || mUseDefaultBrokenImageOnly)
   {
     // To do : Need to add observer about size
     return returnIndex;
index c43af6d..fc19714 100644 (file)
@@ -249,6 +249,15 @@ VisualUrl::VisualUrl(const VisualUrl& url)
 {
 }
 
+VisualUrl::VisualUrl(VisualUrl&& url) noexcept
+: mUrl(std::move(url.mUrl)),
+  mType(std::move(url.mType)),
+  mLocation(std::move(url.mLocation)),
+  mUrlHash(std::move(url.mUrlHash))
+{
+  url.mUrlHash = 0ull;
+}
+
 VisualUrl::~VisualUrl()
 {
 }
@@ -265,12 +274,26 @@ VisualUrl& VisualUrl::operator=(const VisualUrl& url)
   return *this;
 }
 
+VisualUrl& VisualUrl::operator=(VisualUrl&& url) noexcept
+{
+  if(&url != this)
+  {
+    mUrl      = std::move(url.mUrl);
+    mType     = std::move(url.mType);
+    mLocation = std::move(url.mLocation);
+    mUrlHash  = std::move(url.mUrlHash);
+
+    url.mUrlHash = 0ull;
+  }
+  return *this;
+}
+
 const std::string& VisualUrl::GetUrl() const
 {
   return mUrl;
 }
 
-const std::uint64_t& VisualUrl::GetUrlHash() const
+std::uint64_t VisualUrl::GetUrlHash() const
 {
   return DALI_UNLIKELY(mUrlHash == 0) ? (mUrlHash = Dali::CalculateHash(mUrl)) : mUrlHash;
 }
index 941d0b8..47aadd9 100644 (file)
@@ -84,6 +84,18 @@ public:
   VisualUrl& operator=(const VisualUrl& url);
 
   /**
+   * Move constructor
+   * @param[in] url The VisualUrl to move
+   */
+  VisualUrl(VisualUrl&& url) noexcept;
+
+  /**
+   * Move assignment operator
+   * @param[in] url The VisualUrl to move
+   */
+  VisualUrl& operator=(VisualUrl&& url) noexcept;
+
+  /**
    * Get the full URL
    * @return The url
    */
@@ -93,7 +105,7 @@ public:
    * Get the hash value of full URL
    * @return The hash value of url
    */
-  const std::uint64_t& GetUrlHash() const;
+  std::uint64_t GetUrlHash() const;
 
   /**
    * Get the visual type of the URL
index 6019285..2bd33ca 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraint.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/object/type-info.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
@@ -37,8 +38,8 @@
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
-#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
 #include <dali-toolkit/devel-api/visuals/color-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/visuals/color/color-visual.h>
@@ -599,7 +600,7 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper
     case DevelActor::Property::USER_INTERACTION_ENABLED:
     {
       const bool enabled = propertyValue.Get<bool>();
-      if (!enabled && Self() == Dali::Toolkit::KeyboardFocusManager::Get().GetCurrentFocusActor())
+      if(!enabled && Self() == Dali::Toolkit::KeyboardFocusManager::Get().GetCurrentFocusActor())
       {
         Dali::Toolkit::KeyboardFocusManager::Get().ClearFocus();
       }
@@ -727,8 +728,7 @@ void Control::SignalDisconnected(SlotObserver* slotObserver, CallbackBase* callb
   mImpl->SignalDisconnected(slotObserver, callback);
 }
 
-void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali::Property::Map& destinationPropertyMap,
-                                   Dali::Toolkit::Control source, Dali::Toolkit::Control destination, Dali::Property::Index visualIndex)
+void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali::Property::Map& destinationPropertyMap, Dali::Toolkit::Control source, Dali::Toolkit::Control destination, Dali::Property::Index visualIndex)
 {
   sourcePropertyMap.Clear();
   destinationPropertyMap.Clear();
@@ -747,8 +747,7 @@ void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali:
   sourceVisual.CreatePropertyMap(sourceMap);
   destinationVisual.CreatePropertyMap(destinationMap);
 
-  static auto findValueVector4 = [](const Property::Map& map, Property::Index index, const Vector4& defaultValue = Vector4()) -> Vector4
-  {
+  static auto findValueVector4 = [](const Property::Map& map, Property::Index index, const Vector4& defaultValue = Vector4()) -> Vector4 {
     Property::Value* propertyValue = map.Find(index);
     if(propertyValue)
     {
@@ -757,8 +756,7 @@ void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali:
     return defaultValue;
   };
 
-  static auto findValueFloat = [](const Property::Map& map, Property::Index index, const float& defaultValue = 0.0f) -> float
-  {
+  static auto findValueFloat = [](const Property::Map& map, Property::Index index, const float& defaultValue = 0.0f) -> float {
     Property::Value* propertyValue = map.Find(index);
     if(propertyValue)
     {
@@ -804,7 +802,7 @@ void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali:
     destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationCornerRadius);
   }
 
-  if(sourceBorderlineWidth != destinationBorderlineWidth)
+  if(!Dali::Equals(sourceBorderlineWidth, destinationBorderlineWidth))
   {
     sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, sourceBorderlineWidth);
     destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
@@ -816,7 +814,7 @@ void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali:
     destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
   }
 
-  if(sourceBorderlineOffset != destinationBorderlineOffset)
+  if(!Dali::Equals(sourceBorderlineOffset, destinationBorderlineOffset))
   {
     sourcePropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, sourceBorderlineOffset);
     destinationPropertyMap.Add(Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);