END_TEST;
}
+int UtcDaliModelColorMode(void)
+{
+ ToolkitTestApplication application;
+
+ Scene3D::Model model = Scene3D::Model::New(TEST_GLTF_FILE_NAME);
+ model.SetProperty(Dali::Actor::Property::SIZE, Vector2(50, 50));
+ model.SetProperty(Dali::Actor::Property::COLOR, Color::RED);
+
+ application.GetScene().Add(model);
+
+ application.SendNotification();
+ application.Render();
+
+ Actor actor = model.FindChildByName("AnimatedCube");
+ Vector4 childColor = actor[Dali::Actor::Property::COLOR];
+ Vector4 childWorldColor = actor[Dali::Actor::Property::WORLD_COLOR];
+
+ DALI_TEST_EQUALS(childColor, Color::WHITE, TEST_LOCATION);
+ DALI_TEST_EQUALS(childWorldColor, Color::RED, TEST_LOCATION);
+
+ END_TEST;
+}
+
// For ResourceReady
namespace
{
END_TEST;
}
+
+int UtcDaliSceneViewColorMode(void)
+{
+ ToolkitTestApplication application;
+
+ Scene3D::SceneView view = Scene3D::SceneView::New();
+ application.GetScene().Add(view);
+
+ DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
+
+ view.UseFramebuffer(true);
+
+ DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_COLOR), TEST_LOCATION);
+
+ view.UseFramebuffer(false);
+
+ DALI_TEST_EQUALS(view.GetChildAt(0u).GetProperty<int>(Dali::Actor::Property::COLOR_MODE), static_cast<int>(ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA), TEST_LOCATION);
+
+ END_TEST;
+}
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-spannable.h>
#include <dali-toolkit/devel-api/text/spannable-string.h>
+#include <dali-toolkit/devel-api/text/spans/background-color-span.h>
+#include <dali-toolkit/devel-api/text/spans/bold-span.h>
+#include <dali-toolkit/devel-api/text/spans/character-spacing-span.h>
#include <dali-toolkit/devel-api/text/spans/font-span.h>
#include <dali-toolkit/devel-api/text/spans/foreground-color-span.h>
+#include <dali-toolkit/devel-api/text/spans/italic-span.h>
+#include <dali-toolkit/devel-api/text/spans/strikethrough-span.h>
#include <dali-toolkit/devel-api/text/spans/underline-span.h>
#include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
#include <dali-toolkit/internal/text/text-view.h>
#include <dali-toolkit/public-api/text/text-enumerations.h>
#include <toolkit-text-utils.h>
-#include <dali-toolkit/devel-api/text/spans/character-spacing-span.h>
-
using namespace Dali;
using namespace Toolkit;
const float PIXEL_FORMAT_64_FACTOR = 64.f; ///< 64.f is used to convert from point size to 26.6 pixel format.
} // namespace
+Text::SpannableString CreateSpannableStringForStrikethroughSpan()
+{
+ Text::SpannableString spannableString = Text::SpannableString::New("Hello World");
+ DALI_TEST_CHECK(spannableString);
+
+ auto isAddedStrikethroughSpan = spannableString.AttachSpan(
+ Text::StrikethroughSpan::New(Color::GREEN, 5.0f),
+ Text::Range::New(5u, 7u));
+ DALI_TEST_CHECK(isAddedStrikethroughSpan);
+
+ return spannableString;
+}
+
Text::SpannableString CreateSpannableStringForForegroundColorSpan()
{
Text::SpannableString spannableString = Text::SpannableString::New("Hello مرØبا");
DALI_TEST_CHECK(spannableString);
auto isCharacterSpacingSpan = spannableString.AttachSpan(
- Text::CharacterSpacingSpan::New(5.2f),
- Text::Range::New(5u, 7u));
+ Text::CharacterSpacingSpan::New(5.2f),
+ Text::Range::New(5u, 7u));
DALI_TEST_CHECK(isCharacterSpacingSpan);
return spannableString;
}
+Text::SpannableString CreateSpannableStringForBoldSpan()
+{
+ Text::SpannableString spannableString = Text::SpannableString::New("Hello");
+ DALI_TEST_CHECK(spannableString);
+
+ auto boldspan = Dali::Toolkit::Text::BoldSpan::New();
+ auto isBoldSpan = spannableString.AttachSpan(boldspan, Dali::Toolkit::Text::Range::New(0u, 3u));
+ DALI_TEST_CHECK(isBoldSpan);
+
+ return spannableString;
+}
+
+Text::SpannableString CreateSpannableStringForItalicSpan()
+{
+ Text::SpannableString spannableString = Text::SpannableString::New("Hello");
+ DALI_TEST_CHECK(spannableString);
+
+ auto isAddedItalic = spannableString.AttachSpan(
+ Text::ItalicSpan::New(),
+ Text::Range::New(0u, 3u));
+ DALI_TEST_CHECK(isAddedItalic);
+
+ return spannableString;
+}
+
+Text::SpannableString CreateSpannableStringForBackgroundColorSpan()
+{
+ Text::SpannableString spannableString = Text::SpannableString::New("Hello مرØبا");
+
+ DALI_TEST_CHECK(spannableString);
+
+ auto isAddedGreen = spannableString.AttachSpan(
+ Text::BackgroundColorSpan::New(Color::GREEN),
+ Text::Range::New(5u, 7u));
+ DALI_TEST_CHECK(isAddedGreen);
+
+ return spannableString;
+}
+
void CheckColorIndices(const Text::ColorIndex* const colorIndicesBuffer,
uint32_t numberOfIndices,
std::vector<uint32_t> indicesToCheck,
application.SendNotification();
application.Render();
- Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
const Vector<Dali::Toolkit::Text::CharacterSpacingGlyphRun> characterSpacing = labelImpl.GetTextController()->GetTextModel()->GetCharacterSpacingGlyphRuns();
DALI_TEST_EQUALS(1, characterSpacing.Count(), TEST_LOCATION);
END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetSpannedText_BoldSpan(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_BoldSpan");
+
+ TextLabel textLabel = TextLabel::New();
+
+ DALI_TEST_CHECK(textLabel);
+
+ application.GetScene().Add(textLabel);
+
+ Text::SpannableString spannableString = CreateSpannableStringForBoldSpan();
+ Text::SetSpannedText(textLabel, spannableString);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
+
+ const Vector<Text::FontRun>& validFonts = labelImpl.GetTextController()->GetTextModel()->GetFontRuns();
+
+ DALI_TEST_EQUALS(validFonts.Count(), 2, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFonts[0].characterRun.characterIndex, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFonts[0].characterRun.GetEndCharacterIndex(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFonts[0].isBoldRequired, true, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetSpannedText_ItalicSpan(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_ItalicSpan");
+
+ TextLabel textLabel = TextLabel::New();
+ DALI_TEST_CHECK(textLabel);
+
+ application.GetScene().Add(textLabel);
+
+ Text::SpannableString spannableString = CreateSpannableStringForItalicSpan();
+
+ Text::SetSpannedText(textLabel, spannableString);
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
+ const Vector<Text::FontRun>& validFontsItalic = labelImpl.GetTextController()->GetTextModel()->GetFontRuns();
+
+ DALI_TEST_EQUALS(validFontsItalic.Count(), 2, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFontsItalic[0].characterRun.characterIndex, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFontsItalic[0].characterRun.GetEndCharacterIndex(), 3, TEST_LOCATION);
+ DALI_TEST_EQUALS(validFontsItalic[0].isItalicRequired, true, TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetSpannedText_BackgroundColorSpan(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextLabelSetSpannedText_BackgroundColorSpan");
+
+ TextLabel textLabel = TextLabel::New();
+ DALI_TEST_CHECK(textLabel);
+
+ application.GetScene().Add(textLabel);
+
+ Text::SpannableString spannableString = CreateSpannableStringForBackgroundColorSpan();
+ Text::SetSpannedText(textLabel, spannableString);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
+ const Text::ColorIndex* const backgroundColorIndicesBuffer = labelImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
+
+ CheckColorIndices(backgroundColorIndicesBuffer, 4u, {0u, 5u, 7u, 10u}, {0u, 1u, 1u, 0u});
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetSpannedText_StrikethroughSpan(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextLabelSetSpannedText_StrikethroughSpan ");
+
+ Dali::Toolkit::Text::StrikethroughStyleProperties expectedProperties = {
+ Color::GREEN,
+ 5u,
+ true,
+ true};
+
+ TextLabel textLabel = TextLabel::New();
+
+ DALI_TEST_CHECK(textLabel);
+
+ application.GetScene().Add(textLabel);
+
+ Text::SpannableString spannableString = CreateSpannableStringForStrikethroughSpan();
+ Text::SetSpannedText(textLabel, spannableString);
+
+ application.SendNotification();
+ application.Render();
+
+ Toolkit::Internal::TextLabel& labelImpl = GetImpl(textLabel);
+
+ const Text::Length numberOfStrikethroughRuns = labelImpl.GetTextController()->GetTextModel()->GetNumberOfStrikethroughRuns();
+
+ DALI_TEST_EQUALS(numberOfStrikethroughRuns, 1u, TEST_LOCATION);
+
+ Vector<Dali::Toolkit::Text::StrikethroughGlyphRun> strikethroughRuns;
+ strikethroughRuns.Resize(numberOfStrikethroughRuns);
+
+ labelImpl.GetTextController()->GetTextModel()->GetStrikethroughRuns(strikethroughRuns.Begin(), 0u, numberOfStrikethroughRuns);
+
+ DALI_TEST_EQUALS(strikethroughRuns[0].glyphRun.glyphIndex, 5u, TEST_LOCATION);
+ DALI_TEST_EQUALS(strikethroughRuns[0].glyphRun.numberOfGlyphs, 3u, TEST_LOCATION);
+ DALI_TEST_CHECK(strikethroughRuns[0].properties == expectedProperties);
+
+ END_TEST;
}
\ No newline at end of file
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;
}
utc-Dali-Text-ForegroundColorSpan.cpp
utc-Dali-Text-CharacterSpacingSpan.cpp
utc-Dali-Text-FontSpan.cpp
+ utc-Dali-Text-BoldSpan.cpp
+ utc-Dali-Text-ItalicSpan.cpp
+ utc-Dali-Text-BackgroundColorSpan.cpp
utc-Dali-Text-Range.cpp
utc-Dali-Text-SpannableString.cpp
utc-Dali-Text-UnderlineSpan.cpp
+ utc-Dali-Text-StrikethroughSpan.cpp
utc-Dali-TextEditor.cpp
utc-Dali-TextField.cpp
utc-Dali-TextGeometry.cpp
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <iostream>
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/text/spans/background-color-span.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+int UtcDaliToolkitTextBackgroundColorSpanNew(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextBackgroundColorSpanNew");
+
+ auto greenSpan = Text::BackgroundColorSpan::New(Color::GREEN);
+ DALI_TEST_CHECK(greenSpan);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextGetBackgroundColor(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextGetBackgroundColor");
+
+ auto greenSpan = Text::BackgroundColorSpan::New(Color::GREEN);
+ DALI_TEST_CHECK(greenSpan);
+ DALI_TEST_EQUALS(Color::GREEN, greenSpan.GetBackgroundColor(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextIsBackgroundColorDefined(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextIsBackgroundColorDefined");
+
+ auto greenSpan = Text::BackgroundColorSpan::New(Color::GREEN);
+ DALI_TEST_CHECK(greenSpan);
+ DALI_TEST_EQUALS(true, greenSpan.IsBackgroundColorDefined(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextBackgroundColorSpanDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextBackgroundColorSpanDownCast");
+
+ Text::BaseSpan baseSpan = Text::BackgroundColorSpan::New(Color::GREEN);
+ DALI_TEST_CHECK(baseSpan);
+
+ Text::BackgroundColorSpan greenSpan = Text::BackgroundColorSpan::DownCast(baseSpan);
+ DALI_TEST_CHECK(greenSpan);
+
+ END_TEST;
+}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/text/spans/bold-span.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+int UtcDaliToolkitTextBoldSpanNew(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextBoldSpanNew");
+
+ auto boldSpan = Text::BoldSpan::New();
+
+ DALI_TEST_CHECK(boldSpan);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextBoldSpanDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextBoldSpanDownCast");
+
+ Text::BaseSpan baseSpan = Text::BoldSpan::New();
+ DALI_TEST_CHECK(baseSpan);
+
+ Text::BoldSpan boldSpan = Text::BoldSpan::DownCast(baseSpan);
+ DALI_TEST_CHECK(boldSpan);
+
+ END_TEST;
+}
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/text/spans/italic-span.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+int UtcDaliToolkitTextItalicSpanNew(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextItalicSpanNew");
+
+ auto italicSpan = Text::ItalicSpan::New();
+ DALI_TEST_CHECK(italicSpan);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextItalicSpanDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliToolkitTextItalicSpanDownCast");
+
+ Text::BaseSpan baseSpan = Text::ItalicSpan::New();
+
+ DALI_TEST_CHECK(baseSpan);
+ Text::ItalicSpan italicSpan = Text::ItalicSpan::DownCast(baseSpan);
+
+ DALI_TEST_CHECK(italicSpan);
+ END_TEST;
+}
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/text/spans/strikethrough-span.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <iostream>
+
+using namespace Dali;
+using namespace Toolkit;
+
+int UtcDaliToolkitTextStrikethroughSpanNew(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanNew");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New();
+ DALI_TEST_CHECK(strikethroughSpan);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanNewColorHeight(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanNewColorHeight");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New(Color::GREEN, 5.0f);
+ DALI_TEST_CHECK(strikethroughSpan);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanGetColor(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanGetColor");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New(Color::GREEN, 5.0f);
+
+ DALI_TEST_CHECK(strikethroughSpan);
+ DALI_TEST_EQUALS(Color::GREEN, strikethroughSpan.GetColor(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanIsColorDefined(void)
+
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanIsColorDefined");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New(Color::GREEN, 5.0f);
+
+ DALI_TEST_CHECK(strikethroughSpan);
+ DALI_TEST_EQUALS(true, strikethroughSpan.IsColorDefined(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanGetHeight(void)
+
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanGetHeight");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New(Color::GREEN, 5.0f);
+
+ DALI_TEST_CHECK(strikethroughSpan);
+ DALI_TEST_EQUALS(5.0f, strikethroughSpan.GetHeight(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanIsHeightDefined(void)
+
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanIsHeightDefined");
+
+ auto strikethroughSpan = Text::StrikethroughSpan::New(Color::GREEN, 5.0f);
+
+ DALI_TEST_CHECK(strikethroughSpan);
+ DALI_TEST_EQUALS(true, strikethroughSpan.IsHeightDefined(), TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliToolkitTextStrikethroughSpanStrikethroughSpanDownCast(void)
+{
+ ToolkitTestApplication application;
+
+ tet_infoline(" UtcDaliToolkitTextStrikethroughSpanStrikethroughSpanDownCast");
+
+ Text::BaseSpan baseSpan = Text::StrikethroughSpan::New();
+ DALI_TEST_CHECK(baseSpan);
+
+ Text::StrikethroughSpan strikethroughSpan = Text::StrikethroughSpan::DownCast(baseSpan);
+ DALI_TEST_CHECK(strikethroughSpan);
+
+ END_TEST;
+}
\ No newline at end of file
#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;
}
Dali::Scene3D::Loader::Customization::Choices choices;
mModelRoot = Actor::New();
+ mModelRoot.SetProperty(Actor::Property::COLOR_MODE, ColorMode::USE_OWN_MULTIPLY_PARENT_COLOR);
BoundingVolume AABB;
for(auto iRoot : scene.GetRoots())
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))
{
+ mRootLayer.SetProperty(Dali::Actor::Property::COLOR_MODE, ColorMode::USE_OWN_COLOR);
mRenderTask.ResetViewportGuideActor();
mRenderTask.SetViewport(Dali::Viewport(Vector4::ZERO));
mRenderTask.SetViewportGuideActor(Self());
if(mRenderTask.GetFrameBuffer())
{
+ mRootLayer.SetProperty(Dali::Actor::Property::COLOR_MODE, ColorMode::USE_OWN_MULTIPLY_PARENT_ALPHA);
FrameBuffer framebuffer;
mRenderTask.SetFrameBuffer(framebuffer);
mRenderTask.SetClearEnabled(false);
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
{
actor.RegisterProperty(ORIGINAL_MATRIX_PROPERTY_NAME, GetLocalSpace(), Property::AccessMode::READ_ONLY);
+ actor.SetProperty(Actor::Property::COLOR_MODE, ColorMode::USE_OWN_MULTIPLY_PARENT_COLOR);
+
for(auto& renderable : mRenderables)
{
renderable->OnCreate(*this, params, actor);
}
// 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.
${devel_api_src_dir}/text/spans/base-span.cpp
${devel_api_src_dir}/text/spans/foreground-color-span.cpp
${devel_api_src_dir}/text/spans/character-spacing-span.cpp
+ ${devel_api_src_dir}/text/spans/strikethrough-span.cpp
${devel_api_src_dir}/text/spans/font-span.cpp
${devel_api_src_dir}/text/spans/underline-span.cpp
+ ${devel_api_src_dir}/text/spans/bold-span.cpp
+ ${devel_api_src_dir}/text/spans/italic-span.cpp
+ ${devel_api_src_dir}/text/spans/background-color-span.cpp
${devel_api_src_dir}/transition-effects/cube-transition-cross-effect.cpp
${devel_api_src_dir}/transition-effects/cube-transition-effect.cpp
${devel_api_src_dir}/transition-effects/cube-transition-fold-effect.cpp
${devel_api_src_dir}/text/spans/base-span.h
${devel_api_src_dir}/text/spans/foreground-color-span.h
${devel_api_src_dir}/text/spans/character-spacing-span.h
+ ${devel_api_src_dir}/text/spans/strikethrough-span.h
${devel_api_src_dir}/text/spans/font-span.h
${devel_api_src_dir}/text/spans/underline-span.h
+ ${devel_api_src_dir}/text/spans/bold-span.h
+ ${devel_api_src_dir}/text/spans/italic-span.h
+ ${devel_api_src_dir}/text/spans/background-color-span.h
)
SET( devel_api_tool_bar_header_files
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/text/spans/background-color-span.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/spannable/spans/background-color-span-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+BackgroundColorSpan BackgroundColorSpan::New(const Vector4 &color)
+{
+ return Internal::BackgroundColorSpan::New(color);
+}
+
+BackgroundColorSpan::BackgroundColorSpan(Internal::BackgroundColorSpan* internal)
+: BaseSpan(internal)
+{
+}
+
+BackgroundColorSpan::BackgroundColorSpan() = default;
+
+BackgroundColorSpan::BackgroundColorSpan(const BackgroundColorSpan& rhs) = default;
+
+BackgroundColorSpan::BackgroundColorSpan(BackgroundColorSpan&& rhs) = default;
+
+BackgroundColorSpan& BackgroundColorSpan::operator=(const BackgroundColorSpan& rhs) = default;
+
+BackgroundColorSpan& BackgroundColorSpan::operator=(BackgroundColorSpan&& rhs) = default;
+
+BackgroundColorSpan::~BackgroundColorSpan() = default;
+
+//Methods
+const Vector4 BackgroundColorSpan::GetBackgroundColor() const
+{
+ return GetImplementation(*this).GetBackgroundColor();
+}
+
+bool BackgroundColorSpan::IsBackgroundColorDefined() const
+{
+ return GetImplementation(*this).IsBackgroundColorDefined();
+}
+
+BackgroundColorSpan BackgroundColorSpan::DownCast(BaseHandle handle)
+{
+ return BackgroundColorSpan(dynamic_cast<Dali::Toolkit::Text::Internal::BackgroundColorSpan*>(handle.GetObjectPtr()));
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_SPAN_H
+#define DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_SPAN_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/base-span.h>
+#include <dali/public-api/math/vector4.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal DALI_INTERNAL
+{
+class BackgroundColorSpan;
+}
+
+/**
+ * @brief BackgroundColorSpan is a handle to an object that specifies the background-color for range of characters.
+ */
+class DALI_TOOLKIT_API BackgroundColorSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Create an initialized BackgroundColorSpan.
+ *
+ * @param[in] color The background color.
+ *
+ * @return A handle to a newly allocated Dali resource
+ */
+ static BackgroundColorSpan New(const Vector4 &color);
+
+ /**
+ * @brief Creates an uninitialized BackgroundColorSpan handle.
+ *
+ * Calling member functions with an uninitialized BackgroundColorSpan handle is not allowed.
+ */
+ BackgroundColorSpan();
+
+ /**
+ * @brief Copy constructor.
+ * @param[in] rhs A reference to the copied handle
+ */
+ BackgroundColorSpan(const BackgroundColorSpan& rhs);
+
+ /**
+ * @brief Move constructor.
+ * @param[in] rhs A reference to the handle to move
+ */
+ BackgroundColorSpan(BackgroundColorSpan&& rhs);
+
+ /**
+ * @brief Assignment operator.
+ * @param[in] rhs A reference to the copied handle
+ * @return A reference to this
+ */
+ BackgroundColorSpan& operator=(const BackgroundColorSpan& rhs);
+
+ /**
+ * @brief Move assignment operator.
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ BackgroundColorSpan& operator=(BackgroundColorSpan&& rhs);
+
+ /**
+ * @brief Non virtual destructor.
+ */
+ ~BackgroundColorSpan();
+
+ /**
+ * @brief Downcasts to a BackgroundColorSpan handle.
+ * If handle is not a BackgroundColorSpan, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object
+ * @return BackgroundColorSpan handle or an uninitialized handle
+ */
+ static BackgroundColorSpan DownCast(BaseHandle handle);
+
+public: //Methods
+ /**
+ * @brief Retrive the background-color.
+ *
+ * @return A background-color value.
+ */
+ const Vector4 GetBackgroundColor() const;
+
+ /**
+ * @brief Retrieve whether the background-color is defined.
+ *
+ * @return The return is true if background-color is defined, otherwise false.
+ */
+ bool IsBackgroundColorDefined() const;
+
+public: // Not intended for application developers
+ /// @cond internal
+ /**
+ * @brief This constructor is used internally to Create an initialized BackgroundColorSpan handle.
+ *
+ * @param[in] colorSpan Pointer to internal BackgroundColorSpan
+ */
+ explicit DALI_INTERNAL BackgroundColorSpan(Internal::BackgroundColorSpan* colorSpan);
+ /// @endcond
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_BACKGROUND_COLOR_SPAN_H
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+// CLASS HEADER
+#include <dali-toolkit/devel-api/text/spans/bold-span.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/spannable/spans/bold-span-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+
+BoldSpan BoldSpan::New()
+{
+ return Internal::BoldSpan::New();
+}
+
+BoldSpan::BoldSpan() = default;
+
+BoldSpan::BoldSpan(const BoldSpan& rhs) = default;
+
+BoldSpan::BoldSpan(BoldSpan&& rhs) = default;
+
+BoldSpan& BoldSpan::operator=(const BoldSpan& rhs) = default;
+
+BoldSpan& BoldSpan::operator=(BoldSpan&& rhs) = default;
+
+BoldSpan::~BoldSpan() = default;
+
+BoldSpan::BoldSpan(Internal::BoldSpan* internal)
+: BaseSpan(internal)
+{
+}
+
+BoldSpan BoldSpan::DownCast(BaseHandle handle)
+{
+ return BoldSpan(dynamic_cast<Dali::Toolkit::Text::Internal::BoldSpan*>(handle.GetObjectPtr()));
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_BOLD_SPAN_H
+#define DALI_TOOLKIT_TEXT_BOLD_SPAN_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/base-span.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal DALI_INTERNAL
+{
+class BoldSpan;
+}
+
+/**
+ * @brief BoldSpan is a handle to an object that specifies the Bold for range of characters.
+ */
+class DALI_TOOLKIT_API BoldSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Create an initialized BoldSpan.
+ *
+ * @return A handle to newly allocated Dali resource.
+ */
+ static BoldSpan New();
+
+ /**
+ * @brief Creates an uninitialized BoldSpan handle.
+ *
+ * Calling member functions with an uninitialized BoldSpan handle is not allowed.
+ */
+ BoldSpan();
+
+ /**
+ * @brief Copy constructor.
+ * @param[in] rhs A refrence to the copied handle.
+ */
+ BoldSpan(const BoldSpan& rhs);
+
+ /**
+ * @brief Move constructor.
+ *
+ * @param[in] rhs A refrence to the move handle.
+ */
+ BoldSpan(BoldSpan&& rhs);
+
+ /**
+ * @brief Assignment operator.
+ * @param[in] rhs A reference to the copied handle.
+ * @return A refrence to this.
+ */
+ BoldSpan& operator=(const BoldSpan& rhs);
+
+ /**
+ * @brief Assignment operator.
+ * @param[in] rhs rhs A reference to the move handle.
+ * @return A refrence to this.
+ */
+ BoldSpan& operator=(BoldSpan&& rhs);
+
+ /**
+ * @brief Non virtual destructor.
+ *
+ */
+ ~BoldSpan();
+
+ /**
+ * @brief Downcasts to a BoldSpan handle.
+ * If handle is not a BoldSpan, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object.
+ * @return BoldSpan handle or an uninitialized handle
+ */
+ static BoldSpan DownCast(BaseHandle handle);
+
+ // Not intended for application developers
+ /**
+ * @brief This constructor is used internally to create an initialized BoldSpan handle.
+ * @param[in] boldSpan Pointer to internal BoldSpan.
+ */
+ explicit DALI_INTERNAL BoldSpan(Internal::BoldSpan* boldSpan);
+};
+
+}// namespace Text
+
+}// namespace Toolkit
+
+}// namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_BOLDSPAN_H
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/text/spans/italic-span.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/spannable/spans/italic-span-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+ItalicSpan ItalicSpan::New()
+{
+ return Internal::ItalicSpan::New();
+}
+
+ItalicSpan::ItalicSpan() = default;
+
+ItalicSpan::ItalicSpan(const ItalicSpan& rhs) = default;
+
+ItalicSpan::ItalicSpan(ItalicSpan&& rhs) = default;
+
+ItalicSpan& ItalicSpan::operator=(const ItalicSpan& rhs) = default;
+
+ItalicSpan& ItalicSpan::operator=(ItalicSpan&& rhs) = default;
+
+ItalicSpan::~ItalicSpan() = default;
+
+
+ItalicSpan ItalicSpan::DownCast(BaseHandle handle)
+{
+ return ItalicSpan(dynamic_cast<Dali::Toolkit::Text::Internal::ItalicSpan*>(handle.GetObjectPtr()));
+}
+
+ItalicSpan::ItalicSpan(Internal::ItalicSpan* internal)
+: BaseSpan(internal)
+{
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_ITALICSPAN_H
+#define DALI_TOOLKIT_TEXT_ITALICSPAN_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/base-span.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal DALI_INTERNAL
+{
+class ItalicSpan;
+}
+
+/**
+ * @brief ItalicSpan is a handle to an object that specifies the Italic font for range of characters.
+ */
+class DALI_TOOLKIT_API ItalicSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Create an Initialized ItalicSpan.
+ *
+ * @return A handle to a newly allocated Dali resource.
+ */
+ static ItalicSpan New();
+
+ /**
+ * @brief Creates an uninitialized ItalicSpan handle.
+ *
+ * Calling member functions with an uninitialized ItalicSpan handle is not allowed.
+ */
+ ItalicSpan();
+
+ /**
+ * @brief Copy constructor.
+ * @param[in] rhs A reference to the copied handle.
+ */
+ ItalicSpan(const ItalicSpan& rhs);
+
+ /**
+ * @brief Move constructor.
+ * @param rhs A reference to the handle to move.
+ */
+ ItalicSpan(ItalicSpan&& rhs);
+
+ /**
+ * @brief Assignment operator.
+ * @param[in] rhs A reference to the copied handle
+ * @return A reference to this
+ */
+ ItalicSpan& operator=(const ItalicSpan& rhs);
+
+ /**
+ * @brief Move assignment operator.
+ * @param[in] rhs A reference to the moved handle.
+ * @return A reference to this.
+ */
+ ItalicSpan& operator=(ItalicSpan&& rhs);
+
+ /**
+ * @brief Non virtual destructor.
+ */
+ ~ItalicSpan();
+
+ /**
+ * @brief Downcasts to a ItalicSpan handle.
+ * If handle is not a ItalicSpan, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object.
+ * @return ItalicSpan handle or an uninitialized handle.
+ */
+ static ItalicSpan DownCast(BaseHandle handle);
+
+ // Not intended for application developers.
+ /**
+ * @brief This constructor is used internally to Create an initialized ItalicSpan handle.
+ *
+ * @param[in] italicSpan Pointer to internal ItalicSpan.
+ */
+ explicit DALI_INTERNAL ItalicSpan(Internal::ItalicSpan* italicSpan);
+
+};
+
+}// namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif //DALI_TOOLKIT_TEXT_ITALICSPAN_H
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/text/spans/strikethrough-span.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/spannable/spans/strikethrough-span-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+StrikethroughSpan StrikethroughSpan::New()
+{
+ return Internal::StrikethroughSpan::New();
+}
+
+StrikethroughSpan StrikethroughSpan::New(Vector4 color, float height)
+{
+ return Internal::StrikethroughSpan::New(color, height);
+}
+
+StrikethroughSpan::StrikethroughSpan(Internal::StrikethroughSpan* internal)
+: BaseSpan(internal)
+{
+}
+
+StrikethroughSpan::StrikethroughSpan() = default;
+StrikethroughSpan::StrikethroughSpan(const StrikethroughSpan& rhs) = default;
+StrikethroughSpan::StrikethroughSpan(StrikethroughSpan&& rhs) = default;
+StrikethroughSpan& StrikethroughSpan::operator=(const StrikethroughSpan& rhs) = default;
+StrikethroughSpan& StrikethroughSpan::operator=(StrikethroughSpan&& rhs) = default;
+StrikethroughSpan::~StrikethroughSpan() = default;
+
+//Methods
+const Vector4 StrikethroughSpan::GetColor() const
+{
+ return GetImplementation(*this).GetColor();
+}
+
+bool StrikethroughSpan::IsColorDefined() const
+{
+ return GetImplementation(*this).IsColorDefined();
+}
+
+const float StrikethroughSpan::GetHeight() const
+{
+ return GetImplementation(*this).GetHeight();
+}
+
+bool StrikethroughSpan::IsHeightDefined() const
+{
+ return GetImplementation(*this).IsHeightDefined();
+}
+
+StrikethroughSpan StrikethroughSpan::DownCast(BaseHandle handle)
+{
+ return StrikethroughSpan(dynamic_cast<Dali::Toolkit::Text::Internal::StrikethroughSpan*>(handle.GetObjectPtr()));
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_TOOLKIT_TEXT_STRIKETHROUGH_SPAN_H
+#define DALI_TOOLKIT_TEXT_STRIKETHROUGH_SPAN_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+
+#include <dali-toolkit/devel-api/text/spans/base-span.h>
+#include <dali-toolkit/public-api/text/text-enumerations.h>
+#include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/vector4.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal DALI_INTERNAL
+{
+class StrikethroughSpan;
+}
+
+/**
+ * @brief StrikethroughSpan is a handle to an object that specifies the strikethrough properties for range of characters.
+ */
+
+class DALI_TOOLKIT_API StrikethroughSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Create an initialized StrikethroughSpan.
+ *
+ * @return A handle to a newly allocated Dali resource
+ */
+
+ static StrikethroughSpan New();
+ /**
+ * @brief Create an initialized StrikethroughSpan.
+ *
+ * @param[in] color The color of line.
+ * @param[in] height The height of line.
+ *
+ * @return A handle to a newly allocated Dali resource
+ */
+ static StrikethroughSpan New(Vector4 color, float height);
+
+ /**
+ * @brief Creates an uninitialized StrikethroughSpan handle.
+ *
+ * Calling member functions with an uninitialized StrikethroughSpan handle is not allowed.
+ */
+ StrikethroughSpan();
+
+ /**
+ * @brief Copy constructor.
+ * @param[in] rhs A reference to the copied handle
+ */
+ StrikethroughSpan(const StrikethroughSpan& rhs);
+
+ /**
+ * @brief Move constructor.
+ * @param[in] rhs A reference to the handle to move
+ */
+ StrikethroughSpan(StrikethroughSpan&& rhs);
+
+ /**
+ * @brief Assignment operator.
+ * @param[in] rhs A reference to the copied handle
+ * @return A reference to this
+ */
+ StrikethroughSpan& operator=(const StrikethroughSpan& rhs);
+
+ /**
+ * @brief Move assignment operator.
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ StrikethroughSpan& operator=(StrikethroughSpan&& rhs);
+
+ /**
+ * @brief Non virtual destructor.
+ */
+ ~StrikethroughSpan();
+
+ /**
+ * @brief Downcasts to a StrikethroughSpan handle.
+ * If handle is not a StrikethroughSpan, the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object
+ * @return StrikethroughSpan handle or an uninitialized handle
+ */
+ static StrikethroughSpan DownCast(BaseHandle handle);
+
+public: //Methods
+ /**
+ * @brief Retrive the color of line.
+ *
+ * @return A color value.
+ */
+ const Vector4 GetColor() const;
+
+ /**
+ * @brief Retrieve whether the color is defined.
+ *
+ * @return The return is true if color is defined, otherwise false.
+ */
+ bool IsColorDefined() const;
+
+ /**
+ * @brief Retrive the height of line.
+ *
+ * @return A height value.
+ */
+ const float GetHeight() const;
+
+ /**
+ * @brief Retrieve whether the height is defined.
+ *
+ * @return The return is true if height is defined, otherwise false.
+ */
+ bool IsHeightDefined() const;
+
+public: // Not intended for application developers
+ /// @cond internal
+
+ /**
+ * @brief This constructor is used internally to Create an initialized StrikethroughSpan handle.
+ *
+ * @param[in] strikethroughSpan Pointer to internal StrikethroughSpan
+ */
+ explicit DALI_INTERNAL StrikethroughSpan(Internal::StrikethroughSpan* strikethroughSpan);
+
+ /// @endcond
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_TEXT_STRIKETHROUGH_SPAN_H
\ No newline at end of file
/*
- * 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());
${toolkit_src_dir}/text/spannable/spans/base-span-impl.cpp
${toolkit_src_dir}/text/spannable/spans/foreground-color-span-impl.cpp
${toolkit_src_dir}/text/spannable/spans/character-spacing-span-impl.cpp
+ ${toolkit_src_dir}/text/spannable/spans/strikethrough-span-impl.cpp
${toolkit_src_dir}/text/spannable/spans/font-span-impl.cpp
${toolkit_src_dir}/text/spannable/spans/underline-span-impl.cpp
+ ${toolkit_src_dir}/text/spannable/spans/bold-span-impl.cpp
+ ${toolkit_src_dir}/text/spannable/spans/italic-span-impl.cpp
+ ${toolkit_src_dir}/text/spannable/spans/background-color-span-impl.cpp
${toolkit_src_dir}/text/spannable/span-ranges-container-impl.cpp
${toolkit_src_dir}/text/hyphenator.cpp
${toolkit_src_dir}/text/text-enumerations-impl.cpp
// 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/)
//Mark-up processor case
if(impl.mModel->mVisualModel->IsMarkupProcessorEnabled() ||
impl.mModel->mLogicalModel->mUnderlineRunsUpdated ||
- impl.mModel->mLogicalModel->mCharacterSpacingRunsUpdated)
+ impl.mModel->mLogicalModel->mCharacterSpacingRunsUpdated ||
+ impl.mModel->mLogicalModel->mStrikethroughRunsUpdated)
{
impl.CopyUnderlinedFromLogicalToVisualModels(true);
impl.CopyStrikethroughFromLogicalToVisualModels();
mModel->mVisualModel->mStrikethroughRuns.PushBack(strikethroughGlyphRun);
}
+
+ // Reset flag. The updates have been applied from logical to visual.
+ mModel->mLogicalModel->mStrikethroughRunsUpdated = false;
}
void Controller::Impl::CopyCharacterSpacingFromLogicalToVisualModels()
// 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);
}
: mBidirectionalLineIndex(0u),
mSpannedTextPlaced(false),
mUnderlineRunsUpdated(false),
- mCharacterSpacingRunsUpdated(false)
+ mCharacterSpacingRunsUpdated(false),
+ mStrikethroughRunsUpdated(false)
{
}
BidirectionalLineRunIndex mBidirectionalLineIndex; ///< The last fetched bidirectional line info.
bool mSpannedTextPlaced : 1; ///< Whether the spanned-text is placed.
- bool mUnderlineRunsUpdated : 1; /// Whether the UnderlinedCharacterRuns is updated. (Added for SpannedText)
+ bool mUnderlineRunsUpdated : 1; /// Whether the UnderlinedCharacterRuns is updated. (Added for SpannedText)
bool mCharacterSpacingRunsUpdated : 1; // Flag for updating character-spacing.
+ bool mStrikethroughRunsUpdated : 1; /// Whether the StrikethroughCharacterRuns is updated. (Added for SpannedText)
};
} // namespace Text
#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()
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/spannable/spans/background-color-span-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/color-run.h>
+#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+struct BackgroundColorSpan::Impl
+{
+ Vector4 mBackgroundColor; ///< The color of the characters.
+ bool mBackgroundColorDefined : 1; ///< Whether the background color is defined.
+};
+
+BackgroundColorSpan::BackgroundColorSpan()
+: BaseSpan()
+{
+ mImpl = std::make_unique<Impl>();
+}
+
+BackgroundColorSpan ::~BackgroundColorSpan()
+{
+}
+
+Dali::Toolkit::Text::BackgroundColorSpan BackgroundColorSpan::New(const Vector4 &color)
+{
+ BackgroundColorSpanPtr object = new BackgroundColorSpan();
+ object->SetBackgroundColor(color);
+ Dali::Toolkit::Text::BackgroundColorSpan handle = Dali::Toolkit::Text::BackgroundColorSpan(object.Get());
+
+ return handle;
+}
+
+//Methods
+const Vector4 BackgroundColorSpan::GetBackgroundColor() const
+{
+ return mImpl->mBackgroundColor;
+}
+
+bool BackgroundColorSpan::IsBackgroundColorDefined() const
+{
+ return mImpl->mBackgroundColorDefined;
+}
+
+void BackgroundColorSpan::SetBackgroundColor(const Vector4 &color)
+{
+ mImpl->mBackgroundColor = color;
+ mImpl->mBackgroundColorDefined = true;
+}
+
+void BackgroundColorSpan::CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const
+{
+ ColorRun backgroundColorRun;
+ backgroundColorRun.characterRun.characterIndex = range.GetStartIndex();
+ backgroundColorRun.characterRun.numberOfCharacters = range.GetNumberOfIndices();
+ backgroundColorRun.color = mImpl->mBackgroundColor;
+ logicalModel->mBackgroundColorRuns.PushBack(backgroundColorRun);
+}
+
+} // namespace Internal
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_BACKGROUND_COLOR_SPAN_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_BACKGROUND_COLOR_SPAN_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/background-color-span.h>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/logical-model-impl.h>
+#include <dali-toolkit/internal/text/spannable/spans/base-span-impl.h>
+#include <dali/public-api/math/vector4.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+class BackgroundColorSpan;
+using BackgroundColorSpanPtr = IntrusivePtr<BackgroundColorSpan>;
+
+/**
+ * @copydoc Dali::Toolkit::Text::BackgroundColorSpan
+ */
+class BackgroundColorSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Creates a new BackgroundColorSpan object.
+ */
+ static Dali::Toolkit::Text::BackgroundColorSpan New(const Vector4 &color);
+
+ /**
+ * Default Constructor
+ */
+ BackgroundColorSpan();
+
+ ///< Deleted copy constructor
+ BackgroundColorSpan(const BackgroundColorSpan&) = delete;
+
+ ///< Deleted move constructor
+ BackgroundColorSpan(BackgroundColorSpan&&) = delete;
+
+ ///< Deleted copy assignment operator
+ BackgroundColorSpan& operator=(const BackgroundColorSpan&) = delete;
+
+ ///< Deleted move assignment operator
+ BackgroundColorSpan& operator=(BackgroundColorSpan&&) = delete;
+
+ /**
+ * @brief Destructor
+ *
+ * A reference counted object may only be deleted by calling Unreference()
+ */
+ ~BackgroundColorSpan() override;
+
+public: //Methods
+ /**
+ * @copydoc Dali::Toolkit::Text::BackgroundColorSpan::GetBackgroundColor()
+ */
+ const Vector4 GetBackgroundColor() const;
+
+ /**
+ * @copydoc Dali::Toolkit::Text::BackgroundColorSpan::IsBackgroundColorDefined()
+ */
+ bool IsBackgroundColorDefined() const;
+
+public: //Methods. Not intended for application developers
+ /**
+ * @brief Set the background-color.
+ *
+ * @param[in] color The background-color.
+ */
+ void SetBackgroundColor(const Vector4 &color);
+
+public: //Methods for internal only
+ /**
+ * @copydoc Dali::Toolkit::Text::BaseSpan::CreateStyleCharacterRun
+ */
+ void CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const override;
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> mImpl{nullptr};
+
+}; // class BackgroundColorSpan
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::BackgroundColorSpan& GetImplementation(Dali::Toolkit::Text::BackgroundColorSpan& BackgroundColorSpan)
+{
+ DALI_ASSERT_ALWAYS(BackgroundColorSpan && "BackgroundColorSpan handle is empty");
+
+ BaseObject& object = BackgroundColorSpan.GetBaseObject();
+
+ return static_cast<Internal::BackgroundColorSpan&>(object);
+}
+
+inline const Internal::BackgroundColorSpan& GetImplementation(const Dali::Toolkit::Text::BackgroundColorSpan& BackgroundColorSpan)
+{
+ DALI_ASSERT_ALWAYS(BackgroundColorSpan && "BackgroundColorSpan handle is empty");
+
+ const BaseObject& object = BackgroundColorSpan.GetBaseObject();
+
+ return static_cast<const Internal::BackgroundColorSpan&>(object);
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_BACKGROUND_COLOR_SPAN_IMPL_H
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/spannable/spans/bold-span-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/font-description-run.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+BoldSpan::BoldSpan()
+: BaseSpan()
+{
+}
+
+BoldSpan::~BoldSpan()
+{
+}
+
+Dali::Toolkit::Text::BoldSpan BoldSpan::New()
+{
+ BoldSpanPtr object = new BoldSpan();
+ Dali::Toolkit::Text::BoldSpan handle = Dali::Toolkit::Text::BoldSpan(object.Get());
+ return handle;
+}
+
+void BoldSpan::CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const
+{
+ FontDescriptionRun fontRun;
+ fontRun.weight = TextAbstraction::FontWeight::BOLD;
+ fontRun.weightDefined = true;
+ fontRun.characterRun.characterIndex = range.GetStartIndex();
+ fontRun.characterRun.numberOfCharacters = range.GetNumberOfIndices();
+ logicalModel->mFontDescriptionRuns.PushBack(fontRun);
+}
+
+} // namespace Internal
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_BOLDSPAN_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_BOLDSPAN_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/bold-span.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/spannable/spans/base-span-impl.h>
+#include <dali-toolkit/internal/text/logical-model-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+class BoldSpan;
+using BoldSpanPtr = IntrusivePtr<BoldSpan>;
+
+/**
+ * @copydoc Dali::Toolkit::Text::BoldSpan
+ */
+class BoldSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Creates a new BoldSpan object.
+ *
+ * @return Dali::Toolkit::Text::BoldSpan
+ */
+ static Dali::Toolkit::Text::BoldSpan New();
+
+ /**
+ * @brief Construct a new Bold Span object
+ *
+ */
+ BoldSpan();
+
+ ///< Deleted copy constructor
+ BoldSpan(const BoldSpan& rhs) = delete;
+
+ ///< Deleted move constructor
+ BoldSpan(BoldSpan&& rhs) = delete;
+
+ ///< Deleted copy assignment operator
+ BoldSpan& operator=(const BoldSpan& rhs) = delete;
+
+ ///< Deleted move assignment operator
+ BoldSpan& operator=(BoldSpan&& rhs) = delete;
+
+ /**
+ * @brief Destructor
+ * A reference counted object may only be deleted by calling Unreference().
+ */
+ ~BoldSpan() override;
+
+ /**
+ * @copydoc Dali::Toolkit::Text::BaseSpan::CreateStyleCharacterRun
+ */
+ void CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const override;
+
+}; // class BoldSpan
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::BoldSpan& GetImplementation(Dali::Toolkit::Text::BoldSpan& boldSpan)
+{
+ DALI_ASSERT_ALWAYS(boldSpan && "boldSpan handle is empty");
+
+ BaseObject& object = boldSpan.GetBaseObject();
+
+ return static_cast<Internal::BoldSpan&>(object);
+}
+
+inline const Internal::BoldSpan& GetImplementation(const Dali::Toolkit::Text::BoldSpan& boldSpan)
+{
+ DALI_ASSERT_ALWAYS(boldSpan && "boldSpan handle is empty");
+
+ const BaseObject& object = boldSpan.GetBaseObject();
+
+ return static_cast<const Internal::BoldSpan&>(object);
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif //DALI_TOOLKIT_INTERNAL_TEXT_BOLDSPAN_IMPL_H
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/spannable/spans/italic-span-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/font-description-run.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+ItalicSpan::ItalicSpan():BaseSpan()
+{
+}
+
+ItalicSpan::~ItalicSpan()
+{
+}
+
+Dali::Toolkit::Text::ItalicSpan ItalicSpan::New()
+{
+ ItalicSpanPtr object = new ItalicSpan();
+ Dali::Toolkit::Text::ItalicSpan handle = Dali::Toolkit::Text::ItalicSpan(object.Get());
+ return handle;
+}
+void ItalicSpan::CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const
+{
+ FontDescriptionRun fontRun;
+ fontRun.slant = TextAbstraction::FontSlant::ITALIC;
+ fontRun.slantDefined = true;
+ fontRun.characterRun.characterIndex = range.GetStartIndex();
+ fontRun.characterRun.numberOfCharacters = range.GetNumberOfIndices();
+ logicalModel->mFontDescriptionRuns.PushBack(fontRun);
+}
+
+} // namespace Internal
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/italic-span.h>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/logical-model-impl.h>
+#include <dali-toolkit/internal/text/spannable/spans/base-span-impl.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+class ItalicSpan;
+using ItalicSpanPtr = IntrusivePtr<ItalicSpan>;
+
+/**
+ * @copydoc Dali::Toolkit::Text::ItalicSpan
+ */
+class ItalicSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Creates a new ItalicSpan object.
+ */
+ static Dali::Toolkit::Text::ItalicSpan New();
+
+ /**
+ * Default Constructor
+ */
+ ItalicSpan();
+
+ ///< Deleted copy constructor
+ ItalicSpan(const ItalicSpan&) = delete;
+
+ ///< Deleted move constructor
+ ItalicSpan(ItalicSpan&&) = delete;
+
+ ///< Deleted copy assignment operator
+ ItalicSpan& operator=(const ItalicSpan&) = delete;
+
+ ///< Deleted move assignment operator
+ ItalicSpan& operator=(ItalicSpan&&) = delete;
+
+ /**
+ * @brief Destructor.
+ *
+ * A reference counted object may only be deleted by calling Unreference().
+ */
+ ~ItalicSpan() override;
+
+ //Methods for internal only
+ /**
+ * @copydoc Dali::Toolkit::Text::BaseSpan::CreateStyleCharacterRun
+ */
+ void CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const override;
+
+}; // class ItalicSpan
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::ItalicSpan& GetImplementation(Dali::Toolkit::Text::ItalicSpan& italicSpan)
+{
+ DALI_ASSERT_ALWAYS(italicSpan && "italicSpan handle is empty");
+
+ BaseObject& object = italicSpan.GetBaseObject();
+
+ return static_cast<Internal::ItalicSpan&>(object);
+}
+
+inline const Internal::ItalicSpan& GetImplementation(const Dali::Toolkit::Text::ItalicSpan& italicSpan)
+{
+ DALI_ASSERT_ALWAYS(italicSpan && "italicSpan handle is empty");
+
+ const BaseObject& object = italicSpan.GetBaseObject();
+
+ return static_cast<const Internal::ItalicSpan&>(object);
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_ITALIC_SPAN_IMPL_H
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/internal/text/spannable/spans/strikethrough-span-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/color-run.h>
+#include <dali-toolkit/internal/text/markup-tags-and-attributes.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+struct StrikethroughSpan::Impl
+{
+ StrikethroughStyleProperties mStrikethroughProperties; ///< The properties of strikethrough style.
+};
+
+StrikethroughSpan::StrikethroughSpan()
+: BaseSpan()
+{
+ mImpl = std::make_unique<Impl>();
+}
+
+StrikethroughSpan ::~StrikethroughSpan()
+{
+}
+
+Dali::Toolkit::Text::StrikethroughSpan StrikethroughSpan::New()
+{
+ StrikethroughSpanPtr object = new StrikethroughSpan();
+ Dali::Toolkit::Text::StrikethroughSpan handle = Dali::Toolkit::Text::StrikethroughSpan(object.Get());
+ return handle;
+}
+
+Dali::Toolkit::Text::StrikethroughSpan StrikethroughSpan::New(Vector4 color, float height)
+{
+ StrikethroughSpanPtr object = new StrikethroughSpan();
+ object->SetColor(color);
+ object->SetHeight(height);
+ Dali::Toolkit::Text::StrikethroughSpan handle = Dali::Toolkit::Text::StrikethroughSpan(object.Get());
+
+ return handle;
+}
+
+//Methods
+const Vector4 StrikethroughSpan::GetColor() const
+{
+ return mImpl->mStrikethroughProperties.color;
+}
+
+bool StrikethroughSpan::IsColorDefined() const
+{
+ return mImpl->mStrikethroughProperties.colorDefined;
+}
+
+void StrikethroughSpan::SetColor(const Vector4& color)
+{
+ mImpl->mStrikethroughProperties.color = color;
+ mImpl->mStrikethroughProperties.colorDefined = true;
+}
+
+const float StrikethroughSpan::GetHeight() const
+{
+ return mImpl->mStrikethroughProperties.height;
+}
+
+bool StrikethroughSpan::IsHeightDefined() const
+{
+ return mImpl->mStrikethroughProperties.heightDefined;
+}
+
+void StrikethroughSpan::SetHeight(const float& height)
+{
+ mImpl->mStrikethroughProperties.height = height;
+ mImpl->mStrikethroughProperties.heightDefined = true;
+}
+
+void StrikethroughSpan::CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const
+
+{
+ StrikethroughCharacterRun strikethroughCharacterRun;
+ strikethroughCharacterRun.characterRun.characterIndex = range.GetStartIndex();
+ strikethroughCharacterRun.characterRun.numberOfCharacters = range.GetNumberOfIndices();
+ strikethroughCharacterRun.properties = mImpl->mStrikethroughProperties;
+ logicalModel->mStrikethroughCharacterRuns.PushBack(strikethroughCharacterRun);
+ logicalModel->mStrikethroughRunsUpdated = true;
+}
+
+} // namespace Internal
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
\ No newline at end of file
--- /dev/null
+#ifndef DALI_TOOLKIT_INTERNAL_TEXT_STRIKETHROUGH_SPAN_IMPL_H
+#define DALI_TOOLKIT_INTERNAL_TEXT_STRIKETHROUGH_SPAN_IMPL_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/text/spans/strikethrough-span.h>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/logical-model-impl.h>
+#include <dali-toolkit/internal/text/spannable/spans/base-span-impl.h>
+#include <dali/public-api/math/vector4.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Text
+{
+namespace Internal
+{
+class StrikethroughSpan;
+
+using StrikethroughSpanPtr = IntrusivePtr<StrikethroughSpan>;
+
+/**
+ * @copydoc Dali::Toolkit::Text::StrikethroughSpan
+ */
+
+class StrikethroughSpan : public BaseSpan
+{
+public:
+ /**
+ * @brief Creates a new StrikethroughSpan object.
+ *
+ * @return A new StrikethroughSpan object.
+ */
+ static Dali::Toolkit::Text::StrikethroughSpan New();
+
+ /**
+ * @brief Creates a new StrikethroughSpan object.
+ *
+ * @param[in] color The color of line.
+ * @param[in] height The height of line.
+ *
+ * @return A new StrikethroughSpan object.
+ */
+ static Dali::Toolkit::Text::StrikethroughSpan New(Vector4 color, float height);
+
+ /**
+ * Default Constructor
+ */
+ StrikethroughSpan();
+ StrikethroughSpan(const StrikethroughSpan&) = delete; ///< Deleted copy constructor
+ StrikethroughSpan(StrikethroughSpan&&) = delete; ///< Deleted move constructor
+ StrikethroughSpan& operator=(const StrikethroughSpan&) = delete; ///< Deleted copy assignment operator
+ StrikethroughSpan& operator=(StrikethroughSpan&&) = delete; ///< Deleted move assignment operator
+
+ /**
+ * @brief Destructor
+ *
+ * A reference counted object may only be deleted by calling Unreference()
+ */
+ ~StrikethroughSpan() override;
+
+public: //Methods
+ /**
+ * @copydoc Dali::Toolkit::Text::StrikethroughSpan::GetColor()
+ */
+ const Vector4 GetColor() const;
+
+ /**
+ * @copydoc Dali::Toolkit::Text::StrikethroughSpan::IsColorDefined()
+ */
+ bool IsColorDefined() const;
+
+ /**
+ * @copydoc Dali::Toolkit::Text::StrikethroughSpan::GetHeight()
+ */
+ const float GetHeight() const;
+
+ /**
+ * @copydoc Dali::Toolkit::Text::StrikethroughSpan::IsHeightDefined()
+ */
+ bool IsHeightDefined() const;
+
+public: //Methods. Not intended for application developers
+ /**
+ * @brief Set the color of underline.
+ *
+ * @param[in] color The color of line.
+ */
+ void SetColor(const Vector4& color);
+
+ /**
+ * @brief Set the height of underline.
+ *
+ * @param[in] height The height of line.
+ */
+ void SetHeight(const float& height);
+
+public: //Methods for internal only
+ /**
+ * @copydoc Dali::Toolkit::Text::BaseSpan::CreateStyleCharacterRun
+ */
+ void CreateStyleCharacterRun(IntrusivePtr<LogicalModel>& logicalModel, const Dali::Toolkit::Text::Range& range) const override;
+
+private:
+ struct Impl;
+
+ std::unique_ptr<Impl> mImpl{nullptr};
+
+}; // class StrikethroughSpan
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::StrikethroughSpan& GetImplementation(Dali::Toolkit::Text::StrikethroughSpan& foregroundColorSpan)
+{
+ DALI_ASSERT_ALWAYS(foregroundColorSpan && "foregroundColorSpan handle is empty");
+ BaseObject& object = foregroundColorSpan.GetBaseObject();
+ return static_cast<Internal::StrikethroughSpan&>(object);
+}
+
+inline const Internal::StrikethroughSpan& GetImplementation(const Dali::Toolkit::Text::StrikethroughSpan& foregroundColorSpan)
+{
+ DALI_ASSERT_ALWAYS(foregroundColorSpan && "foregroundColorSpan handle is empty");
+ const BaseObject& object = foregroundColorSpan.GetBaseObject();
+ return static_cast<const Internal::StrikethroughSpan&>(object);
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_TEXT_STRIKETHROUGH_SPAN_IMPL_H
\ No newline at end of file
*/
// 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;
const bool markupStrikethroughEnabled = markupOrSpannedText && mController->GetTextModel()->IsMarkupStrikethroughSet();
const bool underlineEnabled = mController->GetTextModel()->IsUnderlineEnabled() || markupUnderlineEnabled;
const bool strikethroughEnabled = mController->GetTextModel()->IsStrikethroughEnabled() || markupStrikethroughEnabled;
- const bool styleEnabled = (shadowEnabled || outlineEnabled || backgroundEnabled || markupOrSpannedText);
+ const bool backgroundMarkupSet = mController->GetTextModel()->IsMarkupBackgroundColorSet();
+ const bool styleEnabled = (shadowEnabled || outlineEnabled || backgroundEnabled || markupOrSpannedText || backgroundMarkupSet);
const bool isOverlayStyle = underlineEnabled || strikethroughEnabled;
AddRenderer(control, relayoutSize, hasMultipleTextColors, containsColorGlyph, styleEnabled, isOverlayStyle);
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);