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);
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;
}
#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>
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;
}
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);
}
#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>
{
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));
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)
{
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();
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)
{
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;
}
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;
}
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;
}
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)
{
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()));
{
}
+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
{
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);
};
/**
{
}
+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},
{
}
+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);
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 = {});
/**
{
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;
Accessor(const MeshDefinition::Blob& blob,
const MeshDefinition::SparseBlob& sparse);
+ Accessor(MeshDefinition::Blob&& blob,
+ MeshDefinition::SparseBlob&& sparse);
bool IsDefined() const
{
}
// 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);
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);
if(!fail)
{
- for(auto definevar : mDefines)
+ for(const auto& definevar : mDefines)
{
ApplyDefine(raw.mVertexShaderSource, definevar);
ApplyDefine(raw.mFragmentShaderSource, definevar);
/*
- * 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.
{
}
-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()
{
#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.
/**
* 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
/*
- * 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.
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)
{
#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.
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.
/*
- * 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.
{
namespace
{
-static std::string GetLocaleText(std::string string, const char *domain = "dali-toolkit")
+static std::string GetLocaleText(std::string string, const char* domain = "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
}
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())
{
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())
{
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;
}
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;
}
{
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);
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)
{
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());
}
bool ControlAccessible::GrabHighlight()
{
- Dali::Actor self = Self();
- auto oldHighlightedActor = GetCurrentlyHighlightedActor();
+ Dali::Actor self = Self();
+ auto oldHighlightedActor = GetCurrentlyHighlightedActor();
if(!Dali::Accessibility::IsUp())
{
/*
- * 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.
{
}
-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)
{
#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.
/**
* 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
/*
- * 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.
{
}
-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)
#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.
/**
* 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.
/*
- * 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.
{
}
-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()
{
#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.
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.
/*
- * 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.
{
}
-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)
#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.
/**
* @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.
/*
- * 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.
{
}
-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)
#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.
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
/*
- * 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.
{
}
-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)
{
#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
\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
/*
- * 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.
{
}
-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()
{
#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.
/**
* 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
/*
- * 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.
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()
{
#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.
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.
/*
- * 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.
{
}
-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()
{
#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.
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.
/*
- * 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.
{
}
-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()
{
#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.
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.
/*
- * 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.
{
}
-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()
{
#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.
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.
/*
- * 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.
{
}
-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()
{
#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.
/**
* 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.
/*
- * 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.
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
{
{
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;
{
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;
{
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();
#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>
}
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;
}
// 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>
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;
{
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;
}
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;
#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.
{
namespace Toolkit
{
-class ObjLoader;
-
namespace Internal
{
class ObjLoader
/*
- * 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.
mLayoutDirty = true;
}
-const bool Popup::IsTailVisible() const
+bool Popup::IsTailVisible() const
{
return mTailVisible;
}
mLayoutDirty = true;
}
-const bool Popup::IsBackingEnabled() const
+bool Popup::IsBackingEnabled() const
{
return mBackingEnabled;
}
}
}
-const bool Popup::IsTouchTransparent() const
+bool Popup::IsTouchTransparent() const
{
return mTouchTransparent;
}
#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.
/**
* @copydoc Toolkit::Popup::IsTailVisible
*/
- const bool IsTailVisible() const;
+ bool IsTailVisible() const;
/**
* @copydoc Toolkit::Popup::SetTailPosition
/**
* @copydoc Toolkit::Popup::IsBackingEnabled
*/
- const bool IsBackingEnabled() const;
+ bool IsBackingEnabled() const;
/**
* @copydoc Toolkit::Popup::SetBackingColor
*
* @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
/*
- * 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.
{
// 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))))
{
{
// 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))))
{
#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
#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
\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
{\r
namespace Internal\r
{\r
+class Scene3dView;\r
+\r
namespace Gltf\r
{\r
enum ShaderType\r
/*
- * 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.
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
+#include <dali-toolkit/internal/controls/scene3d-view/gltf-loader.h>
namespace Dali
{
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);
mSpecularTexture.GenerateMipmaps();
mIBLScaleFactor = scaleFactor;
- mUseIBL = true;
+ mUseIBL = true;
}
bool Scene3dView::SetDefaultCamera(const Dali::Camera::Type type, const float nearPlane, const Vector3 cameraPosition)
#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
/*
- * 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.
#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>
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;
}
auto valueBefore = GetCurrent();
- auto self = Toolkit::ScrollBar::DownCast(Self());
+ auto self = Toolkit::ScrollBar::DownCast(Self());
Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
if(!scrollableHandle)
{
auto valueAfter = GetCurrent();
- if((current != valueBefore) && (valueBefore == valueAfter))
+ if(!Dali::Equals(current, valueBefore) && Dali::Equals(valueBefore, valueAfter))
{
return false;
}
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:
{
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)
return false;
}
- return SetTextContents(text.insert(startPosition, std::move(newText)));
+ return SetTextContents(std::move(text.insert(startPosition, newText)));
}
bool EditableTextControlAccessible::SetTextContents(std::string newContents)
#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>
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());
// 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>
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/)
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/math/math-utils.h>
#include <limits>
// INTERNAL INCLUDES
}
model->mElideEnabled = actualellipsis;
- if(currentFitPointSize != bestPointSize)
+ if(!Dali::Equals(currentFitPointSize, bestPointSize))
{
impl.mTextFitChanged = true;
}
// 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.
// 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
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)
int numberOfCharacters,
UpdateInputStyleType type)
{
- bool removed = false;
+ bool removed = false;
bool removeAll = false;
Controller::Impl& impl = *controller.mImpl;
DALI_LOG_INFO(gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", &controller, numberOfCharacters);
removeAll = false;
- removed = true;
+ removed = true;
}
}
return mImpl->mModel->GetNumberOfLines();
}
-const ModelInterface* const Controller::GetTextModel() const
+const ModelInterface* Controller::GetTextModel() const
{
return mImpl->mModel.Get();
}
*
* @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
#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.
// 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>
(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) ||
{
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);
}
#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.
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
#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.
*/
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);
};
#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.
*/
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);
};
#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>
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)
{
}
-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)
#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.
*/
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().
// 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
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;
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
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();
#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.
*/
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;
return mModel->GetNumberOfLines();
}
-const LineRun* const ViewModel::GetLines() const
+const LineRun* ViewModel::GetLines() const
{
return mModel->GetLines();
}
return mModel->GetNumberOfScripts();
}
-const ScriptRun* const ViewModel::GetScriptRuns() const
+const ScriptRun* ViewModel::GetScriptRuns() const
{
return mModel->GetScriptRuns();
}
return mModel->GetSecondMiddleIndexOfElidedGlyphs();
}
-const GlyphInfo* const ViewModel::GetGlyphs() const
+const GlyphInfo* ViewModel::GetGlyphs() const
{
if(mIsTextElided && mModel->IsTextElideEnabled())
{
return NULL;
}
-const Vector2* const ViewModel::GetLayout() const
+const Vector2* ViewModel::GetLayout() const
{
if(mIsTextElided && mModel->IsTextElideEnabled())
{
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();
}
return mModel->IsUnderlineEnabled();
}
-bool const ViewModel::IsMarkupUnderlineSet() const
+bool ViewModel::IsMarkupUnderlineSet() const
{
return mModel->IsMarkupUnderlineSet();
}
return mModel->GetHyphensCount();
}
-const float ViewModel::GetCharacterSpacing() const
+float ViewModel::GetCharacterSpacing() const
{
return mModel->GetCharacterSpacing();
}
return mModel->IsStrikethroughEnabled();
}
-bool const ViewModel::IsMarkupStrikethroughSet() const
+bool ViewModel::IsMarkupStrikethroughSet() const
{
return mModel->IsMarkupStrikethroughSet();
}
/**
* @copydoc ModelInterface::GetLines()
*/
- const LineRun* const GetLines() const override;
+ const LineRun* GetLines() const override;
/**
* @copydoc ModelInterface::GetNumberOfScripts()
/**
* @copydoc ModelInterface::GetScriptRuns()
*/
- const ScriptRun* const GetScriptRuns() const override;
+ const ScriptRun* GetScriptRuns() const override;
/**
* @copydoc ModelInterface::GetNumberOfGlyphs()
/**
* @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()
/**
* @copydoc ModelInterface::IsMarkupUnderlineSet()
*/
- bool const IsMarkupUnderlineSet() const override;
+ bool IsMarkupUnderlineSet() const override;
/**
* @copydoc ModelInterface::GetUnderlineHeight()
/**
* @copydoc ModelInterface::GetCharacterSpacing()
*/
- const float GetCharacterSpacing() const override;
+ float GetCharacterSpacing() const override;
/**
* @copydoc ModelInterface::GetTextBuffer()
/**
* @copydoc ModelInterface::IsMarkupStrikethroughSet()
*/
- bool const IsMarkupStrikethroughSet() const override;
+ bool IsMarkupStrikethroughSet() const override;
/**
* @copydoc ModelInterface::GetNumberOfStrikethroughRuns()
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
#include <dali/public-api/math/vector4.h>
namespace Dali
{
//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
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)
// 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>
update = true;
}
- if(blurRadiusDefined && (controller->GetShadowBlurRadius() != blurRadius))
+ if(blurRadiusDefined && (!Dali::Equals(controller->GetShadowBlurRadius(), blurRadius)))
{
controller->SetShadowBlurRadius(blurRadius);
update = true;
// 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>
sizesList.Clear();
positionsList.Clear();
- if(charactersToGlyphBuffer == nullptr || glyphsPerCharacterBuffer == nullptr || charactersPerGlyphBuffer == nullptr || glyphToCharacterBuffer == nullptr )
+ if(charactersToGlyphBuffer == nullptr || glyphsPerCharacterBuffer == nullptr || charactersPerGlyphBuffer == nullptr || glyphToCharacterBuffer == nullptr)
{
return;
}
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);
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;
}
Rect<float> GetLineBoundingRect(ModelPtr textModel, const uint32_t lineIndex)
{
-
if(textModel->mVisualModel == nullptr)
{
return {0, 0, 0, 0};
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;
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);
*
* @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.
*
* @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.
*
* @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.
*
* @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
*
* @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
*
* @return The character spacing.
*/
- virtual const float GetCharacterSpacing() const = 0;
+ virtual float GetCharacterSpacing() const = 0;
/**
* @brief Retrieves the text buffer.
return mVisualModel->mLines.Count();
}
-const LineRun* const Model::GetLines() const
+const LineRun* Model::GetLines() const
{
return mVisualModel->mLines.Begin();
}
return mLogicalModel->mScriptRuns.Count();
}
-const ScriptRun* const Model::GetScriptRuns() const
+const ScriptRun* Model::GetScriptRuns() const
{
return mLogicalModel->mScriptRuns.Begin();
}
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);
}
return mVisualModel->IsUnderlineEnabled();
}
-bool const Model::IsMarkupUnderlineSet() const
+bool Model::IsMarkupUnderlineSet() const
{
return (mVisualModel->mUnderlineRuns.Count() > 0u);
}
return mVisualModel->IsStrikethroughEnabled();
}
-bool const Model::IsMarkupStrikethroughSet() const
+bool Model::IsMarkupStrikethroughSet() const
{
return (mVisualModel->mStrikethroughRuns.Count() > 0u);
}
return mVisualModel->GetCharacterSpacingGlyphRuns();
}
-const float Model::GetCharacterSpacing() const
+float Model::GetCharacterSpacing() const
{
return mVisualModel->GetCharacterSpacing();
}
/**
* @copydoc ModelInterface::GetLines()
*/
- const LineRun* const GetLines() const override;
+ const LineRun* GetLines() const override;
/**
* @copydoc ModelInterface::GetNumberOfScripts()
/**
* @copydoc ModelInterface::GetScriptRuns()
*/
- const ScriptRun* const GetScriptRuns() const override;
+ const ScriptRun* GetScriptRuns() const override;
/**
* @copydoc ModelInterface::GetNumberOfGlyphs()
/**
* @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()
/**
* @copydoc ModelInterface::IsMarkupUnderlineSet()
*/
- bool const IsMarkupUnderlineSet() const override;
+ bool IsMarkupUnderlineSet() const override;
/**
* @copydoc ModelInterface::GetUnderlineHeight()
/**
* @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()
*
* @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
*
* @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.
*
* @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
*
* @return characterSpacing.
*/
- virtual const float GetCharacterSpacing() const = 0;
+ virtual float GetCharacterSpacing() const = 0;
/**
* @brief The text buffer.
return numberOfLaidOutGlyphs;
}
-const Vector4* const View::GetColors() const
+const Vector4* View::GetColors() const
{
if(mImpl->mVisualModel)
{
return NULL;
}
-const ColorIndex* const View::GetColorIndices() const
+const ColorIndex* View::GetColorIndices() const
{
if(mImpl->mVisualModel)
{
return NULL;
}
-const Vector4* const View::GetBackgroundColors() const
+const Vector4* View::GetBackgroundColors() const
{
if(mImpl->mVisualModel)
{
return nullptr;
}
-const ColorIndex* const View::GetBackgroundColorIndices() const
+const ColorIndex* View::GetBackgroundColorIndices() const
{
if(mImpl->mVisualModel)
{
return nullptr;
}
-bool const View::IsMarkupBackgroundColorSet() const
+bool View::IsMarkupBackgroundColorSet() const
{
if(mImpl->mVisualModel)
{
return false;
}
-bool const View::IsMarkupUnderlineSet() const
+bool View::IsMarkupUnderlineSet() const
{
return (GetNumberOfUnderlineRuns() > 0u);
}
return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false;
}
-bool const View::IsMarkupStrikethroughSet() const
+bool View::IsMarkupStrikethroughSet() const
{
return (GetNumberOfStrikethroughRuns() > 0u);
}
return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacingGlyphRuns() : GetEmptyCharacterSpacingGlyphRuns();
}
-const float View::GetCharacterSpacing() const
+float View::GetCharacterSpacing() const
{
return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacing() : 0.f;
}
/**
* @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()
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupUnderlineSet()
*/
- bool const IsMarkupUnderlineSet() const;
+ bool IsMarkupUnderlineSet() const;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetHyphens()
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::IsMarkupStrikethroughSet()
*/
- bool const IsMarkupStrikethroughSet() const;
+ bool IsMarkupStrikethroughSet() const;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetCharacterSpacing()
*/
- const float GetCharacterSpacing() const override;
+ float GetCharacterSpacing() const override;
/**
* @copydoc Dali::Toolkit::Text::ViewInterface::GetTextBuffer()
// 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
//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
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)
/*
- * 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.
#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>
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);
#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
{
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;
{
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;
float aspectCorrectedHeight = 0.f;
Vector2 naturalSize;
GetNaturalSize(naturalSize);
- if(naturalSize.width)
+ if(naturalSize.width > 0.0f)
{
aspectCorrectedHeight = naturalSize.height * width / naturalSize.width;
}
// 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>
#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
{
{
// 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;
{
}
+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()
{
}
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;
}
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
*/
* 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
#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>
#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>
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();
}
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();
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)
{
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)
{
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);
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);