Merge "Add a callback for navigation policy in web view." into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 11 Jan 2022 06:45:21 +0000 (06:45 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 11 Jan 2022 06:45:21 +0000 (06:45 +0000)
107 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Accessible.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls-BridgeUp.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp [changed mode: 0755->0644]
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/controls/control-accessible.cpp [moved from dali-toolkit/devel-api/controls/accessible-impl.cpp with 74% similarity]
dali-toolkit/devel-api/controls/control-accessible.h [moved from dali-toolkit/devel-api/controls/accessible-impl.h with 64% similarity]
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/controls/text-controls/text-style-properties-devel.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/utility/npatch-helper.cpp [new file with mode: 0644]
dali-toolkit/devel-api/utility/npatch-helper.h [new file with mode: 0644]
dali-toolkit/devel-api/visuals/text-visual-properties-devel.h
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/controls/buttons/toggle-button-impl.h
dali-toolkit/internal/controls/canvas-view/canvas-view-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/flex-container/flex-container-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/navigation-view/navigation-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-anchor-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-property-handler.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-field-property-handler.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/video-view/video-view-impl.cpp
dali-toolkit/internal/controls/web-view/web-view-impl.cpp
dali-toolkit/internal/graphics/shaders/text-visual-multi-color-text-with-style-shader.frag
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-and-emoji-shader.frag
dali-toolkit/internal/graphics/shaders/text-visual-single-color-text-with-style-shader.frag
dali-toolkit/internal/text/cursor-helper-functions.cpp
dali-toolkit/internal/text/input-style.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/text-typesetter.h
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/rendering/view-model.h
dali-toolkit/internal/text/text-controller-impl-model-updater.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller-input-font-handler.cpp
dali-toolkit/internal/text/text-controller-text-updater.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-effects-style.cpp
dali-toolkit/internal/text/text-effects-style.h
dali-toolkit/internal/text/text-model-interface.h
dali-toolkit/internal/text/text-model.cpp
dali-toolkit/internal/text/text-model.h
dali-toolkit/internal/text/text-view-interface.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/text/text-view.h
dali-toolkit/internal/text/visual-model-impl.cpp
dali-toolkit/internal/text/visual-model-impl.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.h
dali-toolkit/internal/visuals/visual-factory-cache.cpp
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/internal/visuals/visual-string-constants.cpp
dali-toolkit/internal/visuals/visual-string-constants.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/text-controls/text-editor.h
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/controls/text-controls/text-label.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/text-visual-properties.h
packaging/dali-toolkit.spec

index 6d2e281..643b552 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 #include <dali/devel-api/adaptor-framework/accessibility.h>
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
@@ -142,3 +143,24 @@ int UtcDaliAccessibilityCheckShowingState(void)
 
   END_TEST;
 }
+
+int utcDaliAccessibilityHidden(void)
+{
+  ToolkitTestApplication application;
+
+  auto  control    = Toolkit::Control::New();
+  auto* accessible = Dali::Accessibility::Accessible::Get(control);
+
+  // Check not hidden
+  DALI_TEST_CHECK(accessible);
+  DALI_TEST_CHECK(!accessible->IsHidden());
+  DALI_TEST_CHECK(!control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+  control.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, true);
+
+  // Check hidden
+  DALI_TEST_CHECK(accessible->IsHidden());
+  DALI_TEST_CHECK(control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+  END_TEST;
+}
index 684d70d..1ed53dc 100644 (file)
@@ -613,7 +613,7 @@ int UtcDaliAccessibilityParentChildren(void)
     child_1_accessible -> GetIndexInParent();
     DALI_ABORT("Object has parent, test abort");
   }
-  catch (Dali::DaliException &){}
+  catch (const std::domain_error&){}
 
   parent.Add(child_1);
   parent.Add(child_2);
@@ -1077,11 +1077,11 @@ int UtcDaliAccessibilityScrollToChildScrollView(void)
 
   Wait(application);
 
-  auto* accessibleParent = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(scrollView));
+  auto* accessibleParent = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(scrollView));
   DALI_TEST_CHECK(accessibleParent);
-  auto* accessibleA = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(actorA));
+  auto* accessibleA = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(actorA));
   DALI_TEST_CHECK(accessibleA);
-  auto* accessibleB = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(actorB));
+  auto* accessibleB = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(actorB));
   DALI_TEST_CHECK(accessibleB);
 
   accessibleA->GrabHighlight(); // == scrollView.ScrollTo(actorA)
@@ -1132,11 +1132,11 @@ int UtcDaliAccessibilityScrollToChildItemView(void)
 
   Wait(application);
 
-  auto* accessibleParent = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view));
+  auto* accessibleParent = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view));
   DALI_TEST_CHECK(accessibleParent);
-  auto* accessibleA = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view.GetItem(0)));
+  auto* accessibleA = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view.GetItem(0)));
   DALI_TEST_CHECK(accessibleA);
-  auto* accessibleB = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(view.GetItem(1)));
+  auto* accessibleB = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(view.GetItem(1)));
   DALI_TEST_CHECK(accessibleB);
 
   accessibleA->GrabHighlight(); // == view.ScrollToItem(view.GetItemId(actorA))
@@ -1155,12 +1155,12 @@ int UtcDaliAccessibilityScrollToChildNonScrollable(void)
 
   TextLabel label = TextLabel::New("123");
 
-  auto* accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(label));
+  auto* accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(label));
   DALI_TEST_CHECK(accessible);
 
   DALI_TEST_EQUALS(accessible->IsScrollable(), false, TEST_LOCATION);
   DALI_TEST_EQUALS(accessible->ScrollToChild({}), false, TEST_LOCATION);
-  DALI_TEST_EQUALS(accessible->GetInternalActor(), Dali::Actor{}, TEST_LOCATION);
+  DALI_TEST_EQUALS(accessible->GetInternalActor(), label, TEST_LOCATION);
 
   Dali::Accessibility::TestEnableSC( false );
   END_TEST;
@@ -1197,7 +1197,7 @@ int UtcDaliAccessibilityCheckHighlight(void)
   Wait(application);
 
   // Set highlight to first child (A) to enable movement tracking
-  auto* accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
+  auto* accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonA));
   DALI_TEST_CHECK(accessible);
   accessible->GrabHighlight();
   Wait(application);
@@ -1223,7 +1223,7 @@ int UtcDaliAccessibilityCheckHighlight(void)
   Dali::Accessibility::TestResetMoveOutedCalled();
 
   // Set highlight to second child (B) to enable movement tracking
-  accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonB));
+  accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonB));
   DALI_TEST_CHECK(accessible);
   accessible->GrabHighlight();
   Wait(application);
@@ -1261,7 +1261,7 @@ int UtcDaliAccessibilityCheckHighlight(void)
   Dali::Accessibility::TestResetMoveOutedCalled();
 
   // Disable movement tracking on B by giving highlight to A
-  accessible = dynamic_cast<DevelControl::AccessibleImpl*>(Dali::Accessibility::Accessible::Get(buttonA));
+  accessible = dynamic_cast<DevelControl::ControlAccessible*>(Dali::Accessibility::Accessible::Get(buttonA));
   DALI_TEST_CHECK(accessible);
   accessible->GrabHighlight();
   Wait(application);
index 8184dd7..2887613 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -257,6 +257,57 @@ int UtcDaliDebugRenderingGetVisual2(void)
   END_TEST;
 }
 
+
+int UtcDaliDebugRenderingGetVisual3(void)
+{
+  EnvironmentVariable::SetTestingEnvironmentVariable( true );
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliDebugRenderingGetVisual3: Request visual with various parameters" );
+
+  VisualFactory factory = VisualFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  // Test that image visual is replaced with debug visual
+  Dali::Property::Map map;
+  map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
+  map[ ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME;
+  Visual::Base imageVisual = factory.CreateVisual( map );
+  DALI_TEST_CHECK( imageVisual );
+  TestDebugVisual( application.GetScene(),  imageVisual, Visual::IMAGE, Vector2(64.0f, 64.0f /* Broken Image Size */ ));
+
+  // Test that image visual with null string don't make visual
+  map.Clear();
+  map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
+  map[ ImageVisual::Property::URL ] = "";
+  Visual::Base emptyVisual = factory.CreateVisual( map );
+  DALI_TEST_CHECK( emptyVisual );
+  TestDebugVisual( application.GetScene(), emptyVisual, Visual::WIREFRAME, Vector2::ZERO);
+
+  tet_infoline( "Check that GetVisualObject returns the actual WireframeVisual" );
+  Toolkit::Internal::Visual::Base& visualImpl = GetImplementation( emptyVisual ).GetVisualObject();
+  DALI_TEST_CHECK( dynamic_cast< Toolkit::Internal::WireframeVisual* >( &visualImpl ) );
+
+  tet_infoline( "Compare the returned emptyVisual with the visual implementation, should be the same" );
+  DALI_TEST_CHECK( emptyVisual.GetObjectPtr() == &visualImpl );
+
+  // Test that image view with empty property map don't make visual even DebugRendering is enabled.
+  map.Clear();
+  ImageView imageView = ImageView::New();
+  imageView.SetProperty(Control::Property::BACKGROUND, map);
+  imageView.SetProperty(ImageView::Property::IMAGE, map);
+
+  application.GetScene().Add(imageView);
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( imageView.GetRendererCount(), 0u, TEST_LOCATION );
+
+  EnvironmentVariable::SetTestingEnvironmentVariable(false);
+  END_TEST;
+}
+
+
 int UtcDaliDebugRenderingGetVisualObject01(void)
 {
   EnvironmentVariable::SetTestingEnvironmentVariable( true );
@@ -281,6 +332,7 @@ int UtcDaliDebugRenderingGetVisualObject01(void)
   tet_infoline( "Compare the returned TextVisual with the visual implementation, should differ" );
   DALI_TEST_CHECK( textVisual.GetObjectPtr() != &visualImpl );
 
+  EnvironmentVariable::SetTestingEnvironmentVariable( false );
   END_TEST;
 }
 
@@ -352,4 +404,4 @@ int UtcDaliDebugRenderingRenderText(void)
   }
 
   END_TEST;
-}
+}
\ No newline at end of file
old mode 100755 (executable)
new mode 100644 (file)
index 0b18d11..e588998
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-#include <iostream>
 #include <stdlib.h>
+#include <iostream>
 
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 
-#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
 #include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
-#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
 #include <dali-toolkit/internal/text/text-controller-impl.h>
+#include <dali-toolkit/internal/text/text-controller.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -33,20 +33,20 @@ using namespace Text;
 int UtcDaliTextEditorSelectText(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliTextEditorSelectText" );
+  tet_infoline("UtcDaliTextEditorSelectText");
 
   // Create a text editor
   TextEditor textEditor = TextEditor::New();
-  textEditor.SetProperty( Actor::Property::SIZE, Vector2( 400.f, 60.f ) );
-  textEditor.SetProperty( TextEditor::Property::TEXT, "Hello World" );
+  textEditor.SetProperty(Actor::Property::SIZE, Vector2(400.f, 60.f));
+  textEditor.SetProperty(TextEditor::Property::TEXT, "Hello World");
 
   // Add the text editor to the stage
-  application.GetScene().Add( textEditor );
+  application.GetScene().Add(textEditor);
 
   application.SendNotification();
   application.Render();
 
-  Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor );
+  Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor);
 
   application.SendNotification();
   application.Render();
@@ -58,7 +58,7 @@ int UtcDaliTextEditorSelectText(void)
   application.Render();
 
   std::string selectedText = textEditorImpl.GetSelectedText();
-  DALI_TEST_CHECK( selectedText == "Hello World" );
+  DALI_TEST_CHECK(selectedText == "Hello World");
 
   // Select None
   textEditorImpl.SelectNone();
@@ -67,7 +67,7 @@ int UtcDaliTextEditorSelectText(void)
   application.Render();
 
   selectedText = textEditorImpl.GetSelectedText();
-  DALI_TEST_CHECK( selectedText == "" );
+  DALI_TEST_CHECK(selectedText == "");
 
   END_TEST;
 }
@@ -79,33 +79,33 @@ int UtcDaliTextEditorMarkupUnderline(void)
 
   TextEditor textEditor = TextEditor::New();
 
-  application.GetScene().Add( textEditor );
+  application.GetScene().Add(textEditor);
 
-  textEditor.SetProperty( TextEditor::Property::TEXT, "<u>ABC</u>EF<u>GH</u>" );
-  textEditor.SetProperty( TextEditor ::Property::ENABLE_MARKUP,  true );
+  textEditor.SetProperty(TextEditor::Property::TEXT, "<u>ABC</u>EF<u>GH</u>");
+  textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
 
   application.SendNotification();
   application.Render();
 
   uint32_t expectedNumberOfUnderlinedGlyphs = 5u;
 
-  Toolkit::Internal::TextEditor& textEditorImpl = GetImpl( textEditor );
-  const Text::Length numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns();
+  Toolkit::Internal::TextEditor& textEditorImpl        = GetImpl(textEditor);
+  const Text::Length             numberOfUnderlineRuns = textEditorImpl.GetTextController()->GetTextModel()->GetNumberOfUnderlineRuns();
 
-  DALI_TEST_EQUALS( numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION );
+  DALI_TEST_EQUALS(numberOfUnderlineRuns, expectedNumberOfUnderlinedGlyphs, TEST_LOCATION);
 
   Vector<GlyphRun> underlineRuns;
   underlineRuns.Resize(numberOfUnderlineRuns);
   textEditorImpl.GetTextController()->GetTextModel()->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns);
 
   //ABC are underlined
-  DALI_TEST_EQUALS( underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION);
-  DALI_TEST_EQUALS( underlineRuns[1u].glyphIndex, 1u, TEST_LOCATION);
-  DALI_TEST_EQUALS( underlineRuns[2u].glyphIndex, 2u, TEST_LOCATION);
+  DALI_TEST_EQUALS(underlineRuns[0u].glyphIndex, 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(underlineRuns[1u].glyphIndex, 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(underlineRuns[2u].glyphIndex, 2u, TEST_LOCATION);
 
   //GH are underlined
-  DALI_TEST_EQUALS( underlineRuns[3u].glyphIndex, 5u, TEST_LOCATION);
-  DALI_TEST_EQUALS( underlineRuns[4u].glyphIndex, 6u, TEST_LOCATION);
+  DALI_TEST_EQUALS(underlineRuns[3u].glyphIndex, 5u, TEST_LOCATION);
+  DALI_TEST_EQUALS(underlineRuns[4u].glyphIndex, 6u, TEST_LOCATION);
 
   END_TEST;
 }
@@ -118,27 +118,26 @@ int UtcDaliTextEditorFontPointSizeLargerThanAtlas(void)
   // Create a text editor
   TextEditor textEditor = TextEditor::New();
   //Set size to avoid automatic eliding
-  textEditor.SetProperty( Actor::Property::SIZE, Vector2(1025, 1025));
+  textEditor.SetProperty(Actor::Property::SIZE, Vector2(1025, 1025));
   //Set very large font-size using point-size
-  textEditor.SetProperty( TextEditor::Property::POINT_SIZE, 1000);
+  textEditor.SetProperty(TextEditor::Property::POINT_SIZE, 1000);
   //Specify font-family
-  textEditor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+  textEditor.SetProperty(TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
   //Set text to check if appear or not
   textEditor.SetProperty(TextEditor::Property::TEXT, "A");
 
-  application.GetScene().Add( textEditor );
+  application.GetScene().Add(textEditor);
 
   application.SendNotification();
   application.Render();
 
   //Check if Glyph is added to AtlasGlyphManger or not
   int countAtlas = AtlasGlyphManager::Get().GetMetrics().mAtlasMetrics.mAtlasCount;
-  DALI_TEST_EQUALS( countAtlas, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS(countAtlas, 1, TEST_LOCATION);
 
   END_TEST;
 }
 
-
 int UtcDaliTextEditorFontPointSizeLargerThanAtlasPlaceholderCase(void)
 {
   ToolkitTestApplication application;
@@ -146,25 +145,25 @@ int UtcDaliTextEditorFontPointSizeLargerThanAtlasPlaceholderCase(void)
 
   //Set Map of placeholder: text, font-family and point-size
   Property::Map placeholderMapSet;
-  placeholderMapSet["text"] = "A";
+  placeholderMapSet["text"]       = "A";
   placeholderMapSet["fontFamily"] = "DejaVu Sans";
-  placeholderMapSet["pixelSize"] = 1000.0f;
+  placeholderMapSet["pixelSize"]  = 1000.0f;
 
   // Create a text editor
   TextEditor textEditor = TextEditor::New();
   //Set size to avoid automatic eliding
-  textEditor.SetProperty( Actor::Property::SIZE, Vector2(1025, 1025));
+  textEditor.SetProperty(Actor::Property::SIZE, Vector2(1025, 1025));
   //Set placeholder
-  textEditor.SetProperty( TextEditor::Property::PLACEHOLDER, placeholderMapSet) ;
+  textEditor.SetProperty(TextEditor::Property::PLACEHOLDER, placeholderMapSet);
 
-  application.GetScene().Add( textEditor );
+  application.GetScene().Add(textEditor);
 
   application.SendNotification();
   application.Render();
 
   //Check if Glyph is added to AtlasGlyphManger or not
   int countAtlas = AtlasGlyphManager::Get().GetMetrics().mAtlasMetrics.mAtlasCount;
-  DALI_TEST_EQUALS( countAtlas, 1, TEST_LOCATION );
+  DALI_TEST_EQUALS(countAtlas, 1, TEST_LOCATION);
 
   END_TEST;
 }
@@ -175,27 +174,27 @@ int UtcDaliTextEditorBackgroundTag(void)
   tet_infoline("UtcDaliTextEditorBackgroundTag\n");
 
   TextEditor editor = TextEditor::New();
-  DALI_TEST_CHECK( editor );
+  DALI_TEST_CHECK(editor);
 
-  editor.SetProperty( TextEditor ::Property::ENABLE_MARKUP,  true );
-  editor.SetProperty( TextEditor::Property::TEXT, "H<background color='red'>e</background> Worl<background color='yellow'>d</background>" );
-  application.GetScene().Add( editor );
+  editor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+  editor.SetProperty(TextEditor::Property::TEXT, "H<background color='red'>e</background> Worl<background color='yellow'>d</background>");
+  application.GetScene().Add(editor);
   application.SendNotification();
   application.Render();
 
-  Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor );
-  const ColorIndex* const backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
+  Toolkit::Internal::TextEditor& editorImpl                   = GetImpl(editor);
+  const ColorIndex* const        backgroundColorIndicesBuffer = editorImpl.GetTextController()->GetTextModel()->GetBackgroundColorIndices();
 
-  DALI_TEST_CHECK( backgroundColorIndicesBuffer );
+  DALI_TEST_CHECK(backgroundColorIndicesBuffer);
 
   //default color
-  DALI_TEST_EQUALS( backgroundColorIndicesBuffer[0], 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(backgroundColorIndicesBuffer[0], 0u, TEST_LOCATION);
 
   //red color
-  DALI_TEST_EQUALS( backgroundColorIndicesBuffer[1], 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(backgroundColorIndicesBuffer[1], 1u, TEST_LOCATION);
 
   //yellow color
-  DALI_TEST_EQUALS( backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION);
+  DALI_TEST_EQUALS(backgroundColorIndicesBuffer[7], 2u, TEST_LOCATION);
 
   END_TEST;
 }
@@ -206,17 +205,17 @@ int UtcDaliTextEditorTextWithSpan(void)
   tet_infoline("UtcDaliTextEditorTextWithSpan\n");
 
   TextEditor editor = TextEditor::New();
-  DALI_TEST_CHECK( editor );
+  DALI_TEST_CHECK(editor);
 
-  editor.SetProperty( TextEditor ::Property::ENABLE_MARKUP,  true );
-  editor.SetProperty( TextEditor::Property::TEXT, "Hello Span" );
-  application.GetScene().Add( editor );
+  editor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+  editor.SetProperty(TextEditor::Property::TEXT, "Hello Span");
+  application.GetScene().Add(editor);
 
   application.SendNotification();
   application.Render();
 
   Vector3 originalSize = editor.GetNaturalSize();
-  editor.SetProperty( TextEditor::Property::TEXT, "H<span font-size='45' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red'>ello</span> Span" );
+  editor.SetProperty(TextEditor::Property::TEXT, "H<span font-size='45' font-family='DejaVu Sans' font-width='condensed' font-slant='italic' text-color='red'>ello</span> Span");
 
   application.SendNotification();
   application.Render();
@@ -225,41 +224,40 @@ int UtcDaliTextEditorTextWithSpan(void)
 
   DALI_TEST_GREATER(spanSize.width, originalSize.width, TEST_LOCATION);
 
-  Toolkit::Internal::TextEditor& editorImpl = GetImpl( editor );
-  const ColorIndex* const colorIndicesBuffer1 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
+  Toolkit::Internal::TextEditor& editorImpl          = GetImpl(editor);
+  const ColorIndex* const        colorIndicesBuffer1 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
 
-  DALI_TEST_CHECK( colorIndicesBuffer1 );
+  DALI_TEST_CHECK(colorIndicesBuffer1);
 
   //default color
-  DALI_TEST_EQUALS( colorIndicesBuffer1[0], 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer1[0], 0u, TEST_LOCATION);
 
   //span color
-  DALI_TEST_EQUALS( colorIndicesBuffer1[1], 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer1[1], 1u, TEST_LOCATION);
 
   //default color
-  DALI_TEST_EQUALS( colorIndicesBuffer1[6], 0u, TEST_LOCATION);
-
+  DALI_TEST_EQUALS(colorIndicesBuffer1[6], 0u, TEST_LOCATION);
 
-  editor.SetProperty( TextEditor::Property::TEXT, "<span font-size='45'>H</span>ello <span text-color='red'>S</span>pan" );
+  editor.SetProperty(TextEditor::Property::TEXT, "<span font-size='45'>H</span>ello <span text-color='red'>S</span>pan");
 
   application.SendNotification();
   application.Render();
 
   const ColorIndex* const colorIndicesBuffer2 = editorImpl.GetTextController()->GetTextModel()->GetColorIndices();
 
-  DALI_TEST_CHECK( colorIndicesBuffer2 );
+  DALI_TEST_CHECK(colorIndicesBuffer2);
 
   //default color
-  DALI_TEST_EQUALS( colorIndicesBuffer2[0], 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer2[0], 0u, TEST_LOCATION);
 
   //default color
-  DALI_TEST_EQUALS( colorIndicesBuffer2[1], 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer2[1], 0u, TEST_LOCATION);
 
   //span color
-  DALI_TEST_EQUALS( colorIndicesBuffer2[6], 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer2[6], 1u, TEST_LOCATION);
 
   //default color
-  DALI_TEST_EQUALS( colorIndicesBuffer2[7], 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS(colorIndicesBuffer2[7], 0u, TEST_LOCATION);
 
   END_TEST;
 }
@@ -279,9 +277,9 @@ int UtcDaliTextEditorControlBackgroundColor(void)
   application.SendNotification();
   application.Render();
 
-  Toolkit::Internal::TextEditor& editorImpl = GetImpl(editor);
-  ControllerPtr controller = editorImpl.GetTextController();
-  Controller::Impl& controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
+  Toolkit::Internal::TextEditor& editorImpl     = GetImpl(editor);
+  ControllerPtr                  controller     = editorImpl.GetTextController();
+  Controller::Impl&              controllerImpl = Controller::Impl::GetImplementation(*controller.Get());
 
   // Default color is transparent
   controllerImpl.mEditableControlInterface->GetControlBackgroundColor(backgroundColor);
@@ -298,3 +296,44 @@ int UtcDaliTextEditorControlBackgroundColor(void)
 
   END_TEST;
 }
+
+int UtcDaliTextEditorTextPositionWithMinLineAndBigFont(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliTextEditorTextPositionWithMinLine ");
+
+  TextEditor textEditor = TextEditor::New();
+
+  textEditor.SetProperty(TextEditor::Property::TEXT, "<span font-size='45'>H</span>\ni");
+  textEditor.SetProperty(DevelTextEditor::Property::MIN_LINE_SIZE, 50);
+  textEditor.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true);
+
+  application.GetScene().Add(textEditor);
+
+  application.SendNotification();
+  application.Render();
+
+  Toolkit::Internal::TextEditor& textEditorImpl = GetImpl(textEditor);
+  Text::ViewInterface&           view           = textEditorImpl.GetTextController()->GetView();
+
+  Length numberOfGlyphs = view.GetNumberOfGlyphs();
+
+  DALI_TEST_EQUALS(numberOfGlyphs, 3u, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+  Vector<GlyphInfo> glyphs;
+  glyphs.Resize(numberOfGlyphs);
+
+  Vector<Vector2> positions;
+  positions.Resize(numberOfGlyphs);
+
+  float alignmentOffset = 0u;
+  numberOfGlyphs        = view.GetGlyphs(glyphs.Begin(),
+                                  positions.Begin(),
+                                  alignmentOffset,
+                                  0u,
+                                  numberOfGlyphs);
+
+  DALI_TEST_EQUALS(positions[2].y, 165.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION);
+
+  END_TEST;
+}
\ No newline at end of file
index 96f4536..e81bb5f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1170,6 +1170,35 @@ int UtcDaliImageViewSetImageTypeChangesP(void)
   DALI_TEST_CHECK( value.Get( map ) );   // Value should NOT be empty
   DALI_TEST_CHECK( ! visual );           // Visual should be invalid
 
+  // Set a URL in property map again
+  propertyMap[ImageVisual::Property::URL] = gImage_34_RGBA;
+  imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+
+  application.SendNotification();
+  application.Render( 16 );
+
+  value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+  visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+
+  DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+  DALI_TEST_CHECK( value.Get( map ) );   // Value should NOT be empty
+  DALI_TEST_CHECK( visual );             // Visual should be valid
+
+  // Set an empty property map
+  propertyMap.Clear();
+  imageView.SetProperty( ImageView::Property::IMAGE, propertyMap );
+
+  application.SendNotification();
+  application.Render( 16 );
+
+  value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+  visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
+
+  DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
+  DALI_TEST_CHECK( value.Get( map ) );   // Value should NOT be empty
+  DALI_TEST_CHECK( map.Empty() );        // But PropertyMap should be empty
+  DALI_TEST_CHECK( ! visual );           // Visual should be invalid
+
   END_TEST;
 }
 
@@ -3001,6 +3030,59 @@ int UtcDaliImageViewImageLoadFailure03(void)
   END_TEST;
 }
 
+int UtcDaliImageViewImageLoadFailure04(void)
+{
+  ToolkitTestApplication application;
+
+  ImageView imageView = ImageView::New("invalidUrl.png");
+  imageView.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+  application.GetScene().Add( imageView );
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+
+  Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
+  DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL, TEST_BROKEN_IMAGE_S);
+  DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL, "invalidBroken.png");
+  DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE, TEST_BROKEN_IMAGE_L);
+
+  ImageView imageView2 = ImageView::New("invalidUrl.png");
+  imageView2.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+  application.GetScene().Add( imageView2 );
+
+  std::string brokenUrl;
+  brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::SMALL);
+  DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_S, brokenUrl, TEST_LOCATION);
+
+  brokenUrl = DevelStyleManager::GetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::LARGE);
+  DALI_TEST_EQUALS( TEST_BROKEN_IMAGE_L, brokenUrl, TEST_LOCATION);
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+
+  DevelStyleManager::SetBrokenImageUrl(styleManager, DevelStyleManager::BrokenImageType::NORMAL, "invalidBroken.9.png");
+
+  ImageView imageView3 = ImageView::New("invalidUrl.png");
+  imageView3.SetProperty( Actor::Property::SIZE, Vector2( 100.f, 100.f ) );
+  application.GetScene().Add( imageView3 );
+
+  application.SendNotification();
+  application.Render(16);
+
+  // loading started, this waits for the loader thread
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
 namespace
 {
 
index 4e9890c..2099139 100644 (file)
@@ -88,6 +88,8 @@ const char* const PROPERTY_NAME_EMBOSS                               = "emboss";
 const char* const PROPERTY_NAME_INPUT_EMBOSS                         = "inputEmboss";
 const char* const PROPERTY_NAME_OUTLINE                              = "outline";
 const char* const PROPERTY_NAME_INPUT_OUTLINE                        = "inputOutline";
+const char* const PROPERTY_NAME_STRIKETHROUGH                        = "strikethrough";
+const char* const PROPERTY_NAME_INPUT_STRIKETHROUGH                  = "inputStrikethrough";
 
 const char* const PROPERTY_NAME_SMOOTH_SCROLL                        = "smoothScroll";
 const char* const PROPERTY_NAME_SMOOTH_SCROLL_DURATION               = "smoothScrollDuration";
@@ -105,6 +107,7 @@ const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE                   = "enableGr
 const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION      = "matchSystemLanguageDirection";
 const char* const PROPERTY_NAME_MAX_LENGTH                           = "maxLength";
 const char* const PROPERTY_NAME_FONT_SIZE_SCALE                      = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE               = "enableFontSizeScale";
 const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR                    = "grabHandleColor";
 const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP             = "enableGrabHandlePopup";
 const char* const PROPERTY_NAME_INPUT_METHOD_SETTINGS                = "inputMethodSettings";
@@ -544,6 +547,8 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_EMBOSS ) == TextEditor::Property::INPUT_EMBOSS );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextEditor::Property::OUTLINE );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_OUTLINE ) == TextEditor::Property::INPUT_OUTLINE );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextEditor::Property::STRIKETHROUGH );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextEditor::Property::INPUT_STRIKETHROUGH );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL ) == TextEditor::Property::SMOOTH_SCROLL );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SMOOTH_SCROLL_DURATION ) == TextEditor::Property::SMOOTH_SCROLL_DURATION );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SCROLL_BAR ) == TextEditor::Property::ENABLE_SCROLL_BAR );
@@ -554,6 +559,7 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SELECTION ) == TextEditor::Property::ENABLE_SELECTION );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextEditor::Property::PLACEHOLDER );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextEditor::Property::FONT_SIZE_SCALE );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextEditor::Property::ENABLE_SHIFT_SELECTION );
@@ -564,6 +570,8 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP ) == DevelTextEditor::Property::ENABLE_GRAB_HANDLE_POPUP );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_METHOD_SETTINGS ) == DevelTextEditor::Property::INPUT_METHOD_SETTINGS );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextEditor::Property::INPUT_FILTER );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextEditor::Property::STRIKETHROUGH );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextEditor::Property::INPUT_STRIKETHROUGH );
 
   END_TEST;
 }
@@ -633,6 +641,10 @@ int UtcDaliTextEditorSetPropertyP(void)
   DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   editor.SetProperty( DevelTextEditor::Property::FONT_SIZE_SCALE, 1.0f );
 
+  editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, false );
+  DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+  editor.SetProperty( DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE, true );
+
   // Reset font style.
   fontStyleMapSet.Clear();
   fontStyleMapSet.Insert( "weight", "normal" );
@@ -1033,6 +1045,36 @@ int UtcDaliTextEditorSetPropertyP(void)
   inputFilterMapSet.Clear();
   editor.SetProperty(DevelTextEditor::Property::INPUT_FILTER, inputFilterMapSet);
 
+  // Check the strikethrough property
+
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  application.SendNotification();
+  application.Render();
+
+  // Check the input strikethrough property
+
+  strikethroughMapSet.Clear();
+  strikethroughMapGet.Clear();
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::BLUE );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapSet, strikethroughMapGet ), true,  TEST_LOCATION );
+
+  // Check the input strikethrough property
+  editor.SetProperty( DevelTextEditor::Property::INPUT_STRIKETHROUGH, "Strikethrough input properties" );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::INPUT_STRIKETHROUGH ), std::string("Strikethrough input properties"), TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -1618,6 +1660,7 @@ int utcDaliTextEditorInputStyleChanged02(void)
   editor.SetProperty( TextEditor::Property::INPUT_SHADOW, "shadow" );
   editor.SetProperty( TextEditor::Property::INPUT_EMBOSS, "emboss" );
   editor.SetProperty( TextEditor::Property::INPUT_OUTLINE, "outline" );
+  editor.SetProperty( DevelTextEditor::Property::INPUT_STRIKETHROUGH, "strikethrough" );
 
   application.ProcessEvent( GenerateKey( "a", "", "a", KEY_A_CODE, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE ) );
 
@@ -2850,6 +2893,50 @@ int utcDaliTextEditorUnderPropertyStringP(void)
   END_TEST;
 }
 
+int utcDaliTextEditorStrikethroughPropertyStringP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorStrikethroughPropertyStringP");
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+  std::string strikethroughSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"2\"}" );
+
+  application.GetScene().Add( editor );
+
+  editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettings1 );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::STRIKETHROUGH ), strikethroughSettings1, TEST_LOCATION );
+
+  tet_infoline("Set strikethrough settings with a map");
+  // Check the input strikethrough property
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::BLUE );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+  strikethroughMapGet = editor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapSet, strikethroughMapGet ), true,  TEST_LOCATION );
+
+  tet_infoline("Set strikethrough settings with a string");
+  editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettings1 );
+  Property::Value value = editor.GetProperty( DevelTextEditor::Property::STRIKETHROUGH );
+  std::string result;
+  value.Get(result);
+  DALI_TEST_EQUALS( result , strikethroughSettings1, TEST_LOCATION  );
+
+  tet_infoline("Trying to set invalid strikethrough settings, should not update and stay at previous settings");
+  std::string strikethroughSettingsVoid( "{\"enable\":\"true\",\"coooolor\":\"blue\",\"height\":\"2\"}" );
+  editor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughSettingsVoid );
+  value = editor.GetProperty( TextEditor::Property::UNDERLINE );
+  value.Get(result);
+  DALI_TEST_EQUALS( result , strikethroughSettings1, TEST_LOCATION  );
+
+  END_TEST;
+}
+
 int utcDaliTextEditorShadowPropertyStringP(void)
 {
   ToolkitTestApplication application;
@@ -5022,6 +5109,44 @@ int utcDaliTextEditorSelectionChangedSignal(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextEditorStrikethroughGeneration(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextEditorStrikethroughGeneration");
+
+  TextEditor textEditor = TextEditor::New();
+  textEditor.SetProperty( TextEditor::Property::TEXT, "Test" );
+  textEditor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+  textEditor.SetProperty( TextEditor::Property::POINT_SIZE, 10) ;
+  textEditor.SetProperty( TextEditor::Property::FONT_FAMILY, "DejaVu Sans");
+
+  application.GetScene().Add( textEditor );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  // Check the strikethrough property
+  textEditor.SetProperty( DevelTextEditor::Property::STRIKETHROUGH, strikethroughMapSet );
+  strikethroughMapGet = textEditor.GetProperty<Property::Map>( DevelTextEditor::Property::STRIKETHROUGH );
+  textEditor.SetProperty( TextEditor::Property::TEXT, "Test1" );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapSet.Clear();
+  strikethroughMapGet.Clear();
+
+  END_TEST;
+}
 
 int utcDaliTextEditorInsertCharacterAfterInitWithResizePolicyNaturalSize(void)
 {
@@ -5228,4 +5353,4 @@ int utcDaliTextEditorDoubleEnterAfterInitWithResizePolicyNaturalSize(void)
   application.Render();
 
   END_TEST;
-}
\ No newline at end of file
+}
index a6e2668..0332589 100644 (file)
@@ -95,6 +95,8 @@ const char* const PROPERTY_NAME_EMBOSS                               = "emboss";
 const char* const PROPERTY_NAME_INPUT_EMBOSS                         = "inputEmboss";
 const char* const PROPERTY_NAME_OUTLINE                              = "outline";
 const char* const PROPERTY_NAME_INPUT_OUTLINE                        = "inputOutline";
+const char* const PROPERTY_NAME_STRIKETHROUGH                        = "strikethrough";
+const char* const PROPERTY_NAME_INPUT_STRIKETHROUGH                  = "inputStrikethrough";
 
 const char* const PROPERTY_NAME_HIDDEN_INPUT_SETTINGS                = "hiddenInputSettings";
 const char* const PROPERTY_NAME_PIXEL_SIZE                           = "pixelSize";
@@ -107,6 +109,7 @@ const char* const PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION      = "matchSys
 const char* const PROPERTY_NAME_ENABLE_GRAB_HANDLE_POPUP             = "enableGrabHandlePopup";
 const char* const PROPERTY_NAME_BACKGROUND                           = "textBackground";
 const char* const PROPERTY_NAME_FONT_SIZE_SCALE                      = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE               = "enableFontSizeScale";
 const char* const PROPERTY_NAME_GRAB_HANDLE_COLOR                    = "grabHandleColor";
 const char* const PROPERTY_NAME_INPUT_FILTER                         = "inputFilter";
 
@@ -570,6 +573,7 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER ) == TextField::Property::PLACEHOLDER );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextField::Property::ELLIPSIS );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextField::Property::FONT_SIZE_SCALE );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextField::Property::ENABLE_FONT_SIZE_SCALE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_SHIFT_SELECTION ) == DevelTextField::Property::ENABLE_SHIFT_SELECTION );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_GRAB_HANDLE ) == DevelTextField::Property::ENABLE_GRAB_HANDLE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_MATCH_SYSTEM_LANGUAGE_DIRECTION ) == DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION );
@@ -577,6 +581,8 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextField::Property::BACKGROUND );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_GRAB_HANDLE_COLOR ) == DevelTextField::Property::GRAB_HANDLE_COLOR );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_FILTER ) == DevelTextField::Property::INPUT_FILTER );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextField::Property::STRIKETHROUGH );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_INPUT_STRIKETHROUGH ) == DevelTextField::Property::INPUT_STRIKETHROUGH );
 
   END_TEST;
 }
@@ -652,6 +658,10 @@ int UtcDaliTextFieldSetPropertyP(void)
   DALI_TEST_EQUALS( field.GetProperty<float>( DevelTextField::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   field.SetProperty( DevelTextField::Property::FONT_SIZE_SCALE, 1.0f );
 
+  field.SetProperty( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE, false );
+  DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+  field.SetProperty( DevelTextField::Property::ENABLE_FONT_SIZE_SCALE, true );
+
   // Reset font style.
   fontStyleMapSet.Clear();
   fontStyleMapSet.Insert( "weight", "normal" );
@@ -848,6 +858,24 @@ int UtcDaliTextFieldSetPropertyP(void)
   DALI_TEST_EQUALS( fontStyleMapGet.Count(), fontStyleMapSet.Count(), TEST_LOCATION );
   DALI_TEST_EQUALS( DaliTestCheckMaps( fontStyleMapGet, fontStyleMapSet ), true, TEST_LOCATION );
 
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  // Check the strikethrough property
+  field.SetProperty( DevelTextField::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  strikethroughMapGet = field.GetProperty<Property::Map>( DevelTextField::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+  // Check the input strikethrough property
+  field.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, "Strikethrough input properties" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( DevelTextField::Property::INPUT_STRIKETHROUGH ), std::string("Strikethrough input properties"), TEST_LOCATION );
+
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
@@ -2114,6 +2142,7 @@ int utcDaliTextFieldInputStyleChanged02(void)
   field.SetProperty( TextField::Property::INPUT_SHADOW, "shadow" );
   field.SetProperty( TextField::Property::INPUT_EMBOSS, "emboss" );
   field.SetProperty( TextField::Property::INPUT_OUTLINE, "outline" );
+  field.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, "strikethrough" );
 
   // Render and notify
   application.SendNotification();
@@ -4840,4 +4869,72 @@ int utcDaliTextFieldSelectionChangedSignal(void)
   DALI_TEST_EQUALS(oldSelectionEnd, 23, TEST_LOCATION);
 
   END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliToolkitTextFieldStrikethroughGeneration(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldStrikethroughGeneration");
+
+  TextField textField = TextField::New();
+  textField.SetProperty( TextField::Property::TEXT, "Test" );
+  textField.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+  textField.SetProperty( TextField::Property::POINT_SIZE, 10) ;
+  textField.SetProperty( TextField::Property::FONT_FAMILY, "DejaVu Sans");
+
+  application.GetScene().Add( textField );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  // Check the strikethrough property
+  textField.SetProperty( DevelTextField::Property::STRIKETHROUGH, strikethroughMapSet );
+  strikethroughMapGet = textField.GetProperty<Property::Map>( DevelTextField::Property::STRIKETHROUGH );
+  textField.SetProperty( TextField::Property::TEXT, "Test1" );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapSet.Clear();
+  strikethroughMapGet.Clear();
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextFieldInputStrikethroughGeneration(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldInputStrikethroughGeneration");
+
+  TextField textField = TextField::New();
+  textField.SetProperty( TextField::Property::TEXT, "Test" );
+  textField.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+  textField.SetProperty( TextField::Property::POINT_SIZE, 10) ;
+  textField.SetProperty( TextField::Property::FONT_FAMILY, "DejaVu Sans");
+
+  application.GetScene().Add( textField );
+  application.SendNotification();
+  application.Render();
+
+  std::string strikethroughSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"2\"}" );
+
+  // Check the strikethrough property
+  textField.SetProperty( DevelTextField::Property::INPUT_STRIKETHROUGH, strikethroughSettings1 );
+  textField.SetProperty( TextField::Property::TEXT, "Test1" );
+  DALI_TEST_EQUALS( textField.GetProperty<std::string>( DevelTextField::Property::INPUT_STRIKETHROUGH ), strikethroughSettings1, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  END_TEST;
+}
index c060743..bee836e 100644 (file)
@@ -69,11 +69,13 @@ const char* const PROPERTY_NAME_SHADOW = "shadow";
 const char* const PROPERTY_NAME_EMBOSS = "emboss";
 const char* const PROPERTY_NAME_OUTLINE = "outline";
 const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
+const char* const PROPERTY_NAME_STRIKETHROUGH = "strikethrough";
 
 const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
 const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
 const char* const PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY = "autoScrollLoopDelay";
 const char* const PROPERTY_NAME_FONT_SIZE_SCALE = "fontSizeScale";
+const char* const PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE = "enableFontSizeScale";
 
 const char* const PROPERTY_NAME_ELLIPSIS_POSITION = "ellipsisPosition";
 
@@ -352,7 +354,9 @@ int UtcDaliToolkitTextLabelGetPropertyP(void)
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_FONT_SIZE_SCALE ) == DevelTextLabel::Property::FONT_SIZE_SCALE );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_FONT_SIZE_SCALE ) == DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS_POSITION ) == DevelTextLabel::Property::ELLIPSIS_POSITION );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_STRIKETHROUGH ) == DevelTextLabel::Property::STRIKETHROUGH );
 
   END_TEST;
 }
@@ -408,6 +412,10 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   DALI_TEST_EQUALS( label.GetProperty<float>( DevelTextLabel::Property::FONT_SIZE_SCALE ), 2.5f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
   label.SetProperty( DevelTextLabel::Property::FONT_SIZE_SCALE, 1.0f );
 
+  label.SetProperty( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE, false );
+  DALI_TEST_EQUALS( label.GetProperty<bool>( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE ), false, TEST_LOCATION );
+  label.SetProperty( DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE, true );
+
   // Reset font style.
   fontStyleMapSet.Clear();
   fontStyleMapSet.Insert( "weight", "normal" );
@@ -457,6 +465,19 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
 
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  strikethroughMapSet.Insert( "enable", false );
+  strikethroughMapSet.Insert( "color", Color::BLUE );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
@@ -561,6 +582,52 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   label.SetProperty( TextLabel::Property::LINE_SPACING, 10.f );
   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 10.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
+  // Check the strikethrough property
+  strikethroughMapSet.Clear();
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+  strikethroughMapSet.Clear();
+  strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::ENABLE, true );
+  strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::COLOR, Color::RED );
+  strikethroughMapSet.Insert( Toolkit::DevelText::Strikethrough::Property::HEIGHT, 2.0f );
+
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  std::vector<std::string> strikethroughIndicesConversionTable = { "enable", "color","height"};
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet, strikethroughIndicesConversionTable ), true, TEST_LOCATION );
+
+  strikethroughMapSet.Clear();
+
+  Property::Map strikethroughDisabledMapGet;
+  strikethroughDisabledMapGet.Insert( "enable", false );
+  strikethroughDisabledMapGet.Insert( "color", Color::RED );
+  strikethroughDisabledMapGet.Insert( "height", 2.0f );
+
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughDisabledMapGet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughDisabledMapGet ), true, TEST_LOCATION );
+
   // Check the underline property
   underlineMapSet.Clear();
   underlineMapSet.Insert( "enable", true );
@@ -758,6 +825,12 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void)
   shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) );
   label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
 
+  Property::Map strikethroughMap;
+  strikethroughMap.Insert( "enable", true );
+  strikethroughMap.Insert( "color", Color::GREEN );
+  strikethroughMap.Insert( "height", 2.0f );
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMap );
+
   try
   {
     // Render some text with the shared atlas backend
@@ -1749,6 +1822,14 @@ int UtcDaliToolkitTextlabelMaxTextureSet(void)
   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
   label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
 
+  Property::Map strikethroughMapSet;
+  strikethroughMapSet.Clear();
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+  label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+
   application.GetScene().Add( label );
 
   application.SendNotification();
@@ -1764,6 +1845,68 @@ int UtcDaliToolkitTextlabelMaxTextureSet(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextlabelStrikethroughExceedsWidthAndHeight(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextlabelStrikethroughExceedsWidthAndHeight");
+
+  TextLabel label = TextLabel::New();
+  label.SetProperty( TextLabel::Property::TEXT, "Test" );
+  label.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+  //Exeeding BufferWidth
+  label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 400.0f));
+  label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::RIGHT);
+  label.SetProperty(TextLabel::Property::POINT_SIZE, 200.f);
+
+  application.GetScene().Add( label );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map strikethroughMapSet;
+  strikethroughMapSet.Clear();
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::BLUE);
+  strikethroughMapSet.Insert( "height", 2.0f);
+  label.SetProperty( TextLabel::Property::TEXT, "Test1" );
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+  label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+  application.GetScene().Add( label );
+  application.SendNotification();
+  application.Render();
+  // Check if the number of renderers is 1.
+  DALI_TEST_EQUALS( 1, label.GetRendererCount(), TEST_LOCATION);
+
+
+  label = TextLabel::New();
+  label.SetProperty( TextLabel::Property::TEXT, "Test" );
+  label.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+  //Exeeding BufferHeight
+  label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f));
+  label.SetProperty(TextLabel::Property::HORIZONTAL_ALIGNMENT, HorizontalAlignment::RIGHT);
+  label.SetProperty(TextLabel::Property::POINT_SIZE, 200.f);
+
+  application.GetScene().Add( label );
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapSet.Clear();
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::BLUE);
+  strikethroughMapSet.Insert( "height", 2.0f);
+  label.SetProperty( TextLabel::Property::TEXT, "Test2" );
+  label.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+  label.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLUE );
+  application.GetScene().Add( label );
+  application.SendNotification();
+  application.Render();
+  // Check if the number of renderers is 1.
+  DALI_TEST_EQUALS( 1, label.GetRendererCount(), TEST_LOCATION);
+
+  END_TEST;
+}
+
 int UtcDaliToolkitTextlabelLastCharacterIndex(void)
 {
   ToolkitTestApplication application;
@@ -1974,7 +2117,6 @@ int UtcDaliTextLabelHyphenWrapMode(void)
   END_TEST;
 }
 
-
 int utcDaliTextLabelGetHeightForWidthChangeLineCountWhenTextChanged(void)
 {
   ToolkitTestApplication application;
@@ -2178,3 +2320,42 @@ int UtcDaliToolkitTextlabelEllipsisPositionProperty(void)
 
   END_TEST;
 }
+
+int UtcDaliToolkitTextLabelStrikethroughGeneration(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelStrikethroughGeneration");
+
+  TextLabel textLabel = TextLabel::New();
+  textLabel.SetProperty( TextLabel::Property::TEXT, "Test" );
+  textLabel.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 100.f ) );
+  textLabel.SetProperty( TextLabel::Property::POINT_SIZE, 10) ;
+  textLabel.SetProperty( TextLabel::Property::FONT_FAMILY, "DejaVu Sans");
+
+  application.GetScene().Add( textLabel );
+  application.SendNotification();
+  application.Render();
+
+  Property::Map strikethroughMapSet;
+  Property::Map strikethroughMapGet;
+
+  strikethroughMapSet.Insert( "enable", true );
+  strikethroughMapSet.Insert( "color", Color::RED );
+  strikethroughMapSet.Insert( "height", 2.0f );
+
+  // Check the strikethrough property
+  textLabel.SetProperty( DevelTextLabel::Property::STRIKETHROUGH, strikethroughMapSet );
+  strikethroughMapGet = textLabel.GetProperty<Property::Map>( DevelTextLabel::Property::STRIKETHROUGH );
+  textLabel.SetProperty( TextLabel::Property::TEXT, "Test1" );
+  DALI_TEST_EQUALS( strikethroughMapGet.Count(), strikethroughMapSet.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( DaliTestCheckMaps( strikethroughMapGet, strikethroughMapSet ), true, TEST_LOCATION );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  strikethroughMapSet.Clear();
+  strikethroughMapGet.Clear();
+
+  END_TEST;
+}
\ No newline at end of file
index 387275d..d54a00b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -890,7 +890,7 @@ int UtcDaliVisualGetPropertyMap5(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK(  value->Get<int>() == WrapMode::MIRRORED_REPEAT);
 
-  value = resultMap.Find( "synchronousLoading",   Property::BOOLEAN );
+  value = resultMap.Find( ImageVisual::Property::SYNCHRONOUS_LOADING, Property::BOOLEAN );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<bool>() == true );
 
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include "accessible-impl.h"
+#include "control-accessible.h"
 
 // EXTERNAL INCLUDES
 #ifdef DGETTEXT_ENABLED
@@ -66,8 +66,8 @@ static Dali::Actor CreateHighlightIndicatorActor()
 }
 } // unnamed namespace
 
-AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
-: mSelf(self),
+ControlAccessible::ControlAccessible(Dali::Actor self, Dali::Accessibility::Role role, bool modal)
+: ActorAccessible(self),
   mIsModal(modal)
 {
   auto control = Dali::Toolkit::Control::DownCast(Self());
@@ -103,7 +103,7 @@ AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role,
   });
 }
 
-std::string AccessibleImpl::GetName()
+std::string ControlAccessible::GetName() const
 {
   auto control = Dali::Toolkit::Control::DownCast(Self());
 
@@ -136,12 +136,12 @@ std::string AccessibleImpl::GetName()
   return GetLocaleText(name);
 }
 
-std::string AccessibleImpl::GetNameRaw()
+std::string ControlAccessible::GetNameRaw() const
 {
   return {};
 }
 
-std::string AccessibleImpl::GetDescription()
+std::string ControlAccessible::GetDescription() const
 {
   auto control = Dali::Toolkit::Control::DownCast(Self());
 
@@ -169,56 +169,22 @@ std::string AccessibleImpl::GetDescription()
   return GetLocaleText(description);
 }
 
-std::string AccessibleImpl::GetDescriptionRaw()
+std::string ControlAccessible::GetDescriptionRaw() const
 {
   return {};
 }
 
-Dali::Accessibility::Accessible* AccessibleImpl::GetParent()
-{
-  return Dali::Accessibility::Accessible::Get(Self().GetParent());
-}
-
-size_t AccessibleImpl::GetChildCount()
-{
-  return Self().GetChildCount();
-}
-
-Dali::Accessibility::Accessible* AccessibleImpl::GetChildAtIndex(size_t index)
-{
-  return Dali::Accessibility::Accessible::Get(Self().GetChildAt(static_cast<unsigned int>(index)));
-}
-
-size_t AccessibleImpl::GetIndexInParent()
-{
-  auto self = Self();
-  auto parent = self.GetParent();
-  DALI_ASSERT_ALWAYS(parent && "can't call GetIndexInParent on object without parent");
-
-  auto count = parent.GetChildCount();
-  for(auto i = 0u; i < count; ++i)
-  {
-    auto child = parent.GetChildAt(i);
-    if(child == self)
-    {
-      return i;
-    }
-  }
-  DALI_ASSERT_ALWAYS(false && "object isn't child of it's parent");
-  return static_cast<size_t>(-1);
-}
-
-Dali::Accessibility::Role AccessibleImpl::GetRole()
+Dali::Accessibility::Role ControlAccessible::GetRole() const
 {
   return Self().GetProperty<Dali::Accessibility::Role>(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE);
 }
 
-std::string AccessibleImpl::GetLocalizedRoleName()
+std::string ControlAccessible::GetLocalizedRoleName() const
 {
   return GetLocaleText(GetRoleName());
 }
 
-bool AccessibleImpl::IsShowing()
+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))
@@ -227,7 +193,7 @@ bool AccessibleImpl::IsShowing()
   }
 
   auto* child  = this;
-  auto* parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(child->GetParent());
+  auto* parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(child->GetParent());
   if(!parent)
   {
     return true;
@@ -247,13 +213,13 @@ bool AccessibleImpl::IsShowing()
     {
       return false;
     }
-    parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+    parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
   }
 
   return true;
 }
 
-Dali::Accessibility::States AccessibleImpl::CalculateStates()
+Dali::Accessibility::States ControlAccessible::CalculateStates()
 {
   Dali::Actor self = Self();
   Dali::Accessibility::States state;
@@ -283,12 +249,12 @@ Dali::Accessibility::States AccessibleImpl::CalculateStates()
   return state;
 }
 
-Dali::Accessibility::States AccessibleImpl::GetStates()
+Dali::Accessibility::States ControlAccessible::GetStates()
 {
   return CalculateStates();
 }
 
-Dali::Accessibility::Attributes AccessibleImpl::GetAttributes()
+Dali::Accessibility::Attributes ControlAccessible::GetAttributes() const
 {
   std::unordered_map<std::string, std::string> attributeMap;
   auto control = Dali::Toolkit::Control::DownCast(Self());
@@ -316,51 +282,25 @@ Dali::Accessibility::Attributes AccessibleImpl::GetAttributes()
   return attributeMap;
 }
 
-Dali::Accessibility::ComponentLayer AccessibleImpl::GetLayer()
-{
-  return Dali::Accessibility::ComponentLayer::WINDOW;
-}
-
-Dali::Rect<> AccessibleImpl::GetExtents(Dali::Accessibility::CoordinateType type)
+bool ControlAccessible::IsHidden() const
 {
-  Dali::Actor self = Self();
-
-  Vector2 screenPosition = self.GetProperty(Dali::DevelActor::Property::SCREEN_POSITION).Get<Vector2>();
-  auto size = self.GetCurrentProperty<Vector3>(Actor::Property::SIZE) * self.GetCurrentProperty<Vector3>(Actor::Property::WORLD_SCALE);
-  bool positionUsesAnchorPoint = self.GetProperty(Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT).Get<bool>();
-  Vector3 anchorPointOffSet = size * (positionUsesAnchorPoint ? self.GetCurrentProperty<Vector3>(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT);
-  Vector2 position = Vector2((screenPosition.x - anchorPointOffSet.x), (screenPosition.y - anchorPointOffSet.y));
+  auto control = Dali::Toolkit::Control::DownCast(Self());
 
-  if(type == Dali::Accessibility::CoordinateType::WINDOW)
-  {
-    return {position.x, position.y, size.x, size.y};
-  }
-  else // Dali::Accessibility::CoordinateType::SCREEN
-  {
-    auto window = Dali::DevelWindow::Get(self);
-    auto windowPosition = window.GetPosition();
-    return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y};
-  }
-}
+  Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
+  Internal::Control::Impl& controlImpl     = Internal::Control::Impl::Get(internalControl);
 
-int16_t AccessibleImpl::GetMdiZOrder()
-{
-  return 0;
-}
-double AccessibleImpl::GetAlpha()
-{
-  return 0;
+  return controlImpl.mAccessibilityHidden;
 }
 
-bool AccessibleImpl::GrabFocus()
+bool ControlAccessible::GrabFocus()
 {
   return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self());
 }
 
-void AccessibleImpl::ScrollToSelf()
+void ControlAccessible::ScrollToSelf()
 {
   auto* child = this;
-  auto* parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(child->GetParent());
+  auto* parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(child->GetParent());
 
   while (parent)
   {
@@ -369,11 +309,11 @@ void AccessibleImpl::ScrollToSelf()
       parent->ScrollToChild(child->Self());
     }
 
-    parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+    parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
   }
 }
 
-void AccessibleImpl::RegisterPositionPropertyNotification()
+void ControlAccessible::RegisterPositionPropertyNotification()
 {
   auto                     control         = Dali::Toolkit::Control::DownCast(Self());
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
@@ -381,7 +321,7 @@ void AccessibleImpl::RegisterPositionPropertyNotification()
   controlImpl.RegisterAccessibilityPositionPropertyNotification();
 }
 
-void AccessibleImpl::UnregisterPositionPropertyNotification()
+void ControlAccessible::UnregisterPositionPropertyNotification()
 {
   auto                     control         = Dali::Toolkit::Control::DownCast(Self());
   Internal::Control&       internalControl = Toolkit::Internal::GetImplementation(control);
@@ -389,7 +329,7 @@ void AccessibleImpl::UnregisterPositionPropertyNotification()
   controlImpl.UnregisterAccessibilityPositionPropertyNotification();
 }
 
-bool AccessibleImpl::GrabHighlight()
+bool ControlAccessible::GrabHighlight()
 {
   Dali::Actor self = Self();
   auto oldHighlightedActor = GetCurrentlyHighlightedActor();
@@ -426,8 +366,8 @@ bool AccessibleImpl::GrabHighlight()
   highlight.SetProperty(Actor::Property::POSITION, Vector2(0.0f, 0.0f));
 
   // Need to set resize policy again, to update SIZE property which is set by
-  // AccessibleImpl_NUI. The highlight could move from AccessibleImpl_NUI to
-  // AccessibleImpl. In this case, highlight has incorrect size.
+  // NUIViewAccessible. The highlight could move from NUIViewAccessible to
+  // ControlAccessible. In this case, highlight has incorrect size.
   highlight.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS);
 
   // Remember the highlight actor, so that when the default is changed with
@@ -442,7 +382,7 @@ bool AccessibleImpl::GrabHighlight()
   return true;
 }
 
-bool AccessibleImpl::ClearHighlight()
+bool ControlAccessible::ClearHighlight()
 {
   Dali::Actor self = Self();
 
@@ -463,7 +403,7 @@ bool AccessibleImpl::ClearHighlight()
   return false;
 }
 
-std::string AccessibleImpl::GetActionName(size_t index)
+std::string ControlAccessible::GetActionName(size_t index) const
 {
   if(index >= GetActionCount())
   {
@@ -476,17 +416,17 @@ std::string AccessibleImpl::GetActionName(size_t index)
   return type.GetActionName(index);
 }
 
-std::string AccessibleImpl::GetLocalizedActionName(size_t index)
+std::string ControlAccessible::GetLocalizedActionName(size_t index) const
 {
   return GetLocaleText(GetActionName(index));
 }
 
-std::string AccessibleImpl::GetActionDescription(size_t index)
+std::string ControlAccessible::GetActionDescription(size_t index) const
 {
   return {};
 }
 
-size_t AccessibleImpl::GetActionCount()
+size_t ControlAccessible::GetActionCount() const
 {
   Dali::TypeInfo type;
   Self().GetTypeInfo(type);
@@ -494,23 +434,23 @@ size_t AccessibleImpl::GetActionCount()
   return type.GetActionCount();
 }
 
-std::string AccessibleImpl::GetActionKeyBinding(size_t index)
+std::string ControlAccessible::GetActionKeyBinding(size_t index) const
 {
   return {};
 }
 
-bool AccessibleImpl::DoAction(size_t index)
+bool ControlAccessible::DoAction(size_t index)
 {
   std::string actionName = GetActionName(index);
   return Self().DoAction(actionName, {});
 }
 
-bool AccessibleImpl::DoAction(const std::string& name)
+bool ControlAccessible::DoAction(const std::string& name)
 {
   return Self().DoAction(name, {});
 }
 
-bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
+bool ControlAccessible::DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo)
 {
   auto control = Dali::Toolkit::Control::DownCast(Self());
 
@@ -527,7 +467,7 @@ bool AccessibleImpl::DoGesture(const Dali::Accessibility::GestureInfo& gestureIn
   return false;
 }
 
-std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
+std::vector<Dali::Accessibility::Relation> ControlAccessible::GetRelationSet()
 {
   auto control = Dali::Toolkit::Control::DownCast(Self());
 
@@ -551,32 +491,27 @@ std::vector<Dali::Accessibility::Relation> AccessibleImpl::GetRelationSet()
   return ret;
 }
 
-Dali::Actor AccessibleImpl::GetInternalActor()
-{
-  return Dali::Actor{};
-}
-
-bool AccessibleImpl::ScrollToChild(Actor child)
+bool ControlAccessible::ScrollToChild(Actor child)
 {
   return false;
 }
 
-Dali::Property::Index AccessibleImpl::GetNamePropertyIndex()
+Dali::Property::Index ControlAccessible::GetNamePropertyIndex()
 {
   return Actor::Property::NAME;
 }
 
-Dali::Property::Index AccessibleImpl::GetDescriptionPropertyIndex()
+Dali::Property::Index ControlAccessible::GetDescriptionPropertyIndex()
 {
   return Dali::Property::INVALID_INDEX;
 }
 
-void AccessibleImpl::SetLastPosition(Vector2 position)
+void ControlAccessible::SetLastPosition(Vector2 position)
 {
   mLastPosition = position;
 }
 
-Vector2 AccessibleImpl::GetLastPosition() const
+Vector2 ControlAccessible::GetLastPosition() const
 {
   return mLastPosition;
 }
@@ -1,5 +1,6 @@
-#ifndef DALI_TOOLKIT_ACCESSIBLE_IMPL_H
-#define DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#ifndef DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
+#define DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
+
 /*
  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * limitations under the License.
  *
  */
+
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility.h>
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
-#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
 #include <dali/devel-api/atspi-interfaces/action.h>
-#include <dali/devel-api/atspi-interfaces/collection.h>
-#include <dali/devel-api/atspi-interfaces/component.h>
 #include <dali/public-api/object/weak-handle.h>
 
 // INTERNAL INCLUDES
@@ -45,29 +45,15 @@ namespace Dali::Toolkit::DevelControl {
  * @see Dali::Accessibility::Text
  * @see Dali::Accessibility::EditableText
  */
-struct DALI_TOOLKIT_API AccessibleImpl : public virtual Dali::Accessibility::Accessible,
-                                         public virtual Dali::Accessibility::Component,
-                                         public virtual Dali::Accessibility::Collection,
-                                         public virtual Dali::Accessibility::Action
+struct DALI_TOOLKIT_API ControlAccessible : public Dali::Accessibility::ActorAccessible,
+                                            public virtual Dali::Accessibility::Action
 {
 protected:
   Vector2                       mLastPosition{0.0f, 0.0f};
-  Dali::WeakHandle<Dali::Actor> mSelf;
   Dali::WeakHandle<Dali::Actor> mCurrentHighlightActor;
   bool mIsModal = false;
   bool mIsRoot = false;
 
-  Dali::Actor Self() const
-  {
-    auto handle = mSelf.GetHandle();
-
-    // Control::Impl holds a std::unique_ptr to the Accessible object,
-    // so that one does not outlive the other.
-    DALI_ASSERT_ALWAYS(handle);
-
-    return handle;
-  }
-
   void ScrollToSelf();
 
   /**
@@ -87,57 +73,37 @@ protected:
   bool IsShowing();
 
 public:
-  AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
+  ControlAccessible(Dali::Actor self, Dali::Accessibility::Role role, bool modal = false);
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetName()
    */
-  std::string GetName() override;
+  std::string GetName() const override;
 
   /**
    * @brief Returns the actor's name in the absence of ACCESSIBILITY_NAME property
    */
-  virtual std::string GetNameRaw();
+  virtual std::string GetNameRaw() const;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetDescription()
    */
-  std::string GetDescription() override;
+  std::string GetDescription() const override;
 
   /**
    * @brief Returns the actor's description in the absence of ACCESSIBILITY_DESCRIPTION property
    */
-  virtual std::string GetDescriptionRaw();
-
-  /**
-   * @copydoc Dali::Accessibility::Accessible::GetParent()
-   */
-  Dali::Accessibility::Accessible* GetParent() override;
-
-  /**
-   * @copydoc Dali::Accessibility::Accessible::GetChildCount()
-   */
-  size_t GetChildCount() override;
-
-  /**
-   * @copydoc Dali::Accessibility::Accessible::GetChildAtIndex()
-   */
-  Dali::Accessibility::Accessible* GetChildAtIndex(size_t index) override;
-
-  /**
-   * @copydoc Dali::Accessibility::Accessible::GetIndexInParent()
-   */
-  size_t GetIndexInParent() override;
+  virtual std::string GetDescriptionRaw() const;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetRole()
    */
-  Dali::Accessibility::Role GetRole() override;
+  Dali::Accessibility::Role GetRole() const override;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetLocalizedRoleName()
    */
-  std::string GetLocalizedRoleName() override;
+  std::string GetLocalizedRoleName() const override;
 
   /**
    * @copydoc Dali::Accessibility::Accessible::GetStates()
@@ -147,22 +113,12 @@ public:
   /**
    * @copydoc Dali::Accessibility::Accessible::GetAttributes()
    */
-  Dali::Accessibility::Attributes GetAttributes() override;
-
-  /**
-   * @copydoc Dali::Accessibility::Component::GetExtents()
-   */
-  Dali::Rect<> GetExtents(Accessibility::CoordinateType type) override;
-
-  /**
-   * @copydoc Dali::Accessibility::Component::GetLayer()
-   */
-  Dali::Accessibility::ComponentLayer GetLayer() override;
+  Dali::Accessibility::Attributes GetAttributes() const override;
 
   /**
-   * @copydoc Dali::Accessibility::Component::GetMdiZOrder()
+   * @copydoc Dali::Accessibility::Accessible::IsHidden()
    */
-  int16_t GetMdiZOrder() override;
+  bool IsHidden() const override;
 
   /**
    * @copydoc Dali::Accessibility::Component::GrabFocus()
@@ -170,11 +126,6 @@ public:
   bool GrabFocus() override;
 
   /**
-   * @copydoc Dali::Accessibility::Component::GetAlpha()
-   */
-  double GetAlpha() override;
-
-  /**
    * @copydoc Dali::Accessibility::Component::GrabHighlight()
    */
   bool GrabHighlight() override;
@@ -187,30 +138,30 @@ public:
   /**
    * @copydoc Dali::Accessibility::Action::GetActionName()
    */
-  std::string GetActionName(size_t index) override;
+  std::string GetActionName(size_t index) const override;
 
   /**
    * @copydoc Dali::Accessibility::Action::GetLocalizedActionName()
    */
-  std::string GetLocalizedActionName(size_t index) override;
+  std::string GetLocalizedActionName(size_t index) const override;
 
   /**
    * @copydoc Dali::Accessibility::Action::GetActionDescription()
    */
-  std::string GetActionDescription(size_t index) override;
+  std::string GetActionDescription(size_t index) const override;
 
   /**
    * @copydoc Dali::Accessibility::Action::GetActionCount()
    */
-  size_t GetActionCount() override;
+  size_t GetActionCount() const override;
 
   /**
    * @copydoc Dali::Accessibility::Action::GetActionKeyBinding()
    */
-  std::string GetActionKeyBinding(size_t index) override;
+  std::string GetActionKeyBinding(size_t index) const override;
 
   /**
-   * @copydoc Dali::Accessibility::Action::DoAction(size_t)
+   * @copydoc Dali::Accessibility::Action::DoAction(std::size_t)
    */
   bool DoAction(size_t index) override;
 
@@ -230,11 +181,6 @@ public:
   std::vector<Dali::Accessibility::Relation> GetRelationSet() override;
 
   /**
-   * @copydoc Dali::Accessibility::Accessible::GetInternalActor()
-   */
-  Dali::Actor GetInternalActor() override;
-
-  /**
    * @copydoc Dali::Accessibility::Accessible::GetStates()
    */
   virtual Dali::Accessibility::States CalculateStates();
@@ -270,4 +216,4 @@ public:
 
 } // namespace Dali::Toolkit::DevelControl
 
-#endif // DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#endif // DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
index 00ff6a0..33e02f5 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/animation/time-period.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/controls/accessible-impl.h>
+#include <dali-toolkit/devel-api/controls/control-accessible.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
 #include <dali-toolkit/public-api/controls/control.h>
 
@@ -175,11 +175,13 @@ enum
    * @see Dali::Accessibility::Role
    */
   ACCESSIBILITY_ROLE,
+
   /**
    * @brief Mark of able to highlight object.
    * @details Name "accessibilityHighlightable", type Property::BOOLEAN.
    */
   ACCESSIBILITY_HIGHLIGHTABLE,
+
   /**
    * @brief Set of accessibility attributes describing object in accessibility hierarchy
    * @details Name "accessibilityAttributes", type Property::MAP
@@ -192,6 +194,13 @@ enum
    * @note If a control's dispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
    */
   DISPATCH_KEY_EVENTS,
+
+  /**
+   * @brief Marks the object as invisible to AT-SPI clients.
+   * @details Name "accessibilityHidden", type Property::BOOLEAN.
+   * @note The representative Accessible object will not appear in the AT-SPI tree.
+   */
+  ACCESSIBILITY_HIDDEN,
 };
 
 } // namespace Property
@@ -563,7 +572,7 @@ DALI_TOOLKIT_API void NotifyAccessibilityStateChange(Dali::Actor control, Dali::
  * @code
  *   SetAccessibilityConstructor( []( Dali::Actor actor ) {
        return std::unique_ptr< Dali::Accessibility::Accessible >(
-       new AccessibleImpl( actor, Dali::Accessibility::Role::DIALOG, true ) );
+       new ControlAccessible( actor, Dali::Accessibility::Role::DIALOG, true ) );
       } );
   * @endcode
   *
index 74c19df..5a35e2d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_EDITOR_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.
@@ -178,6 +178,14 @@ enum Type
   FONT_SIZE_SCALE,
 
   /**
+   * @brief True to enable the font size scale or false to disable.
+   * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+   * @note The default value is true.
+   * If false, font size scale is not apppied.
+   */
+  ENABLE_FONT_SIZE_SCALE,
+
+  /**
    * @brief The position for primary cursor.
    * @details Name "primaryCursorPosition", type Property::INTEGER.
    */
@@ -274,6 +282,18 @@ enum Type
    * @note If the font size is larger than the line size, it works with the font size.
    */
   MIN_LINE_SIZE,
+
+  /**
+   * @brief A horizontal line through the text center.
+   * @details Name "strikethrough", type Property::MAP.
+   */
+  STRIKETHROUGH,
+
+  /**
+   * @brief The strikethrough parameters of the new input text.
+   * @details Name "inputStrikethrough", type Property::MAP.
+   */
+  INPUT_STRIKETHROUGH,
 };
 
 } // namespace Property
index 7498110..9bc6fc1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_FIELD_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.
@@ -163,6 +163,14 @@ enum
   FONT_SIZE_SCALE,
 
   /**
+   * @brief True to enable the font size scale or false to disable.
+   * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+   * @note The default value is true.
+   * If false, font size scale is not apppied.
+   */
+  ENABLE_FONT_SIZE_SCALE,
+
+  /**
    * @brief The position for primary cursor.
    * @details Name "primaryCursorPosition", type Property::INTEGER.
    */
@@ -213,6 +221,18 @@ enum
   * @see DevelText::EllipsisPosition
   */
   ELLIPSIS_POSITION,
+
+  /**
+   * @brief A horizontal line through the text center.
+   * @details Name "strikethrough", type Property::MAP.
+   */
+  STRIKETHROUGH,
+
+  /**
+   * @brief The strikethrough parameters of the new input text.
+   * @details Name "inputStrikethrough", type Property::MAP.
+   */
+  INPUT_STRIKETHROUGH,
 };
 
 } // namespace Property
index 17a808f..47c41a8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_LABEL_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.
@@ -156,12 +156,35 @@ enum Type
   FONT_SIZE_SCALE,
 
   /**
+   * @brief True to enable the font size scale or false to disable.
+   * @details Name "enableFontSizeScale", type Property::BOOLEAN.
+   * @note The default value is true.
+   * If false, font size scale is not apppied.
+   */
+  ENABLE_FONT_SIZE_SCALE,
+
+  /**
   * @brief The enumerations used to specify whether to position the ellipsis at the END, START or MIDDLE of the text.
   * @details Name "EllipsisPosition", type [Type](@ref Dali::Toolkit::DevelText::EllipsisPosition::Type) (Property::INTEGER), or Property::STRING. Read/Write
   * @note Default is EllipsisPosition::END.
   * @see DevelText::EllipsisPosition
   */
   ELLIPSIS_POSITION,
+
+  /**
+   * @brief The default strikethrough parameters.
+   * @details Name "strikethrough", type Property::MAP.
+   *
+   * The strikethrough map contains the following keys:
+   *
+   * | %Property Name       | Type     | Required | Description                                                                                                        |
+   * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------|
+   * | enable               | BOOLEAN  | No       | True to enable the strikethrough or false to disable (the default value is false)                                  |
+   * | color                | VECTOR4  | No       | The color of the strikethrough (the default value is Color::BLACK)                                                 |
+   * | height               | FLOAT    | No       | The height of the strikethrough (the default value is 0)                                                               |
+   *
+   */
+  STRIKETHROUGH,
 };
 
 } // namespace Property
index bd6450c..6b6f3ab 100644 (file)
@@ -147,6 +147,38 @@ enum
 
 } // namespace Background
 
+namespace Strikethrough
+{
+namespace Property
+{
+enum
+{
+  /**
+   * @brief Whether the strikethrough is enabled.
+   * @details Name "enable", type Property::STRING or Property::BOOLEAN. i.e. "true", "false", true or false
+   * @note Optional. By default is disabled.
+   */
+  ENABLE,
+
+  /**
+   * @brief The color of the strikethrough.
+   * @details Name "color", type Property::STRING or Property::VECTOR4
+   * @note Optional. If not provided then the default color is black.
+   */
+  COLOR,
+
+  /**
+   * @brief The height in pixels of the strikethrough.
+   * @details Name "height", type Property::STRING or Property::FLOAT. i.e. "1.0" or 1.f
+   * @note Optional. If not provided then the default height is used (1 pixel).
+   */
+  HEIGHT
+};
+
+} // namespace Property
+
+} // namespace Strikethrough
+
 } // namespace DevelText
 
 /**
index 3a40bc9..0a000bc 100755 (executable)
@@ -9,8 +9,8 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/builder/builder.cpp
   ${devel_api_src_dir}/builder/json-parser.cpp
   ${devel_api_src_dir}/builder/tree-node.cpp
-  ${devel_api_src_dir}/controls/accessible-impl.cpp
   ${devel_api_src_dir}/controls/canvas-view/canvas-view.cpp
+  ${devel_api_src_dir}/controls/control-accessible.cpp
   ${devel_api_src_dir}/controls/control-devel.cpp
   ${devel_api_src_dir}/controls/control-wrapper.cpp
   ${devel_api_src_dir}/controls/control-wrapper-impl.cpp
@@ -67,6 +67,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/transition-effects/cube-transition-fold-effect.cpp
   ${devel_api_src_dir}/transition-effects/cube-transition-wave-effect.cpp
   ${devel_api_src_dir}/utility/npatch-utilities.cpp
+  ${devel_api_src_dir}/utility/npatch-helper.cpp
   ${devel_api_src_dir}/visual-factory/transition-data.cpp
   ${devel_api_src_dir}/visual-factory/visual-factory.cpp
   ${devel_api_src_dir}/visual-factory/visual-base.cpp
@@ -86,8 +87,8 @@ SET( devel_api_accessibility-manager_header_files
 )
 
 SET( devel_api_controls_header_files
-  ${devel_api_src_dir}/controls/accessible-impl.h
   ${devel_api_src_dir}/controls/canvas-view/canvas-view.h
+  ${devel_api_src_dir}/controls/control-accessible.h
   ${devel_api_src_dir}/controls/control-depth-index-ranges.h
   ${devel_api_src_dir}/controls/control-devel.h
   ${devel_api_src_dir}/controls/control-wrapper.h
@@ -271,6 +272,7 @@ SET( devel_api_drag_and_drop_detector_header_files
 
 SET( devel_api_utility_header_files
   ${devel_api_src_dir}/utility/npatch-utilities.h
+  ${devel_api_src_dir}/utility/npatch-helper.h
 )
 
 SET( SOURCES ${SOURCES}
diff --git a/dali-toolkit/devel-api/utility/npatch-helper.cpp b/dali-toolkit/devel-api/utility/npatch-helper.cpp
new file mode 100644 (file)
index 0000000..53c6d4d
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+* Copyright (c) 2021 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* 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/utility/npatch-helper.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace NPatchHelper
+{
+namespace
+{
+/**
+ * @brief Creates the geometry formed from the vertices and indices
+ *
+ * @param[in]  vertices             The vertices to generate the geometry from
+ * @param[in]  indices              The indices to generate the geometry from
+ * @return The geometry formed from the vertices and indices
+ */
+Geometry GenerateGeometry(const Vector<Vector2>& vertices, const Vector<unsigned short>& indices)
+{
+  Property::Map vertexFormat;
+  vertexFormat["aPosition"] = Property::VECTOR2;
+  VertexBuffer vertexBuffer = VertexBuffer::New(vertexFormat);
+  if(vertices.Size() > 0)
+  {
+    vertexBuffer.SetData(&vertices[0], vertices.Size());
+  }
+
+  // Create the geometry object
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer(vertexBuffer);
+  if(indices.Size() > 0)
+  {
+    geometry.SetIndexBuffer(&indices[0], indices.Size());
+  }
+
+  return geometry;
+}
+
+/**
+ * @brief Adds the indices to form a quad composed off two triangles where the indices are organised in a grid
+ *
+ * @param[out] indices     The indices to add to
+ * @param[in]  rowIdx      The row index to start the quad
+ * @param[in]  nextRowIdx  The index to the next row
+ */
+void AddQuadIndices(Vector<unsigned short>& indices, unsigned int rowIdx, unsigned int nextRowIdx)
+{
+  indices.PushBack(rowIdx);
+  indices.PushBack(nextRowIdx + 1);
+  indices.PushBack(rowIdx + 1);
+
+  indices.PushBack(rowIdx);
+  indices.PushBack(nextRowIdx);
+  indices.PushBack(nextRowIdx + 1);
+}
+
+/**
+ * @brief Adds the vertices to create for npatch
+ * @param[out] vertices The vertices to add to
+ * @param[in]  x        The x value of vector
+ * @param[in]  y        The y value of vector
+ */
+void AddVertex(Vector<Vector2>& vertices, unsigned int x, unsigned int y)
+{
+  vertices.PushBack(Vector2(x, y));
+}
+
+} // unnamed namespace
+
+Geometry CreateGridGeometry(Uint16Pair gridSize)
+{
+  uint16_t gridWidth  = gridSize.GetWidth();
+  uint16_t gridHeight = gridSize.GetHeight();
+
+  // Create vertices
+  Vector<Vector2> vertices;
+  vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
+
+  for(int y = 0; y < gridHeight + 1; ++y)
+  {
+    for(int x = 0; x < gridWidth + 1; ++x)
+    {
+      AddVertex(vertices, x, y);
+    }
+  }
+
+  // Create indices
+  Vector<unsigned short> indices;
+  indices.Reserve(gridWidth * gridHeight * 6);
+
+  unsigned int rowIdx     = 0;
+  unsigned int nextRowIdx = gridWidth + 1;
+  for(int y = 0; y < gridHeight; ++y, ++nextRowIdx, ++rowIdx)
+  {
+    for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+    {
+      AddQuadIndices(indices, rowIdx, nextRowIdx);
+    }
+  }
+
+  return GenerateGeometry(vertices, indices);
+}
+
+Geometry CreateBorderGeometry(Uint16Pair gridSize)
+{
+  uint16_t gridWidth  = gridSize.GetWidth();
+  uint16_t gridHeight = gridSize.GetHeight();
+
+  // Create vertices
+  Vector<Vector2> vertices;
+  vertices.Reserve((gridWidth + 1) * (gridHeight + 1));
+
+  //top
+  int y = 0;
+  for(; y < 2; ++y)
+  {
+    for(int x = 0; x < gridWidth + 1; ++x)
+    {
+      AddVertex(vertices, x, y);
+    }
+  }
+
+  for(; y < gridHeight - 1; ++y)
+  {
+    //left
+    AddVertex(vertices, 0, y);
+    AddVertex(vertices, 1, y);
+
+    //right
+    AddVertex(vertices, gridWidth - 1, y);
+    AddVertex(vertices, gridWidth, y);
+  }
+
+  //bottom
+  for(; y < gridHeight + 1; ++y)
+  {
+    for(int x = 0; x < gridWidth + 1; ++x)
+    {
+      AddVertex(vertices, x, y);
+    }
+  }
+
+  // Create indices
+  Vector<unsigned short> indices;
+  indices.Reserve(gridWidth * gridHeight * 6);
+
+  //top
+  unsigned int rowIdx     = 0;
+  unsigned int nextRowIdx = gridWidth + 1;
+  for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+  {
+    AddQuadIndices(indices, rowIdx, nextRowIdx);
+  }
+
+  if(gridHeight > 2)
+  {
+    rowIdx     = gridWidth + 1;
+    nextRowIdx = (gridWidth + 1) * 2;
+
+    unsigned increment = gridWidth - 1;
+    if(gridHeight > 3)
+    {
+      increment = 2;
+      //second row left
+      AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+      rowIdx     = gridWidth * 2;
+      nextRowIdx = (gridWidth + 1) * 2 + 2;
+      //second row right
+      AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+      //left and right
+      rowIdx     = nextRowIdx - 2;
+      nextRowIdx = rowIdx + 4;
+      for(int y = 2; y < 2 * (gridHeight - 3); ++y, rowIdx += 2, nextRowIdx += 2)
+      {
+        AddQuadIndices(indices, rowIdx, nextRowIdx);
+      }
+    }
+
+    //second row left
+    AddQuadIndices(indices, rowIdx, nextRowIdx);
+
+    rowIdx += increment;
+    nextRowIdx += gridWidth - 1;
+    //second row right
+    AddQuadIndices(indices, rowIdx, nextRowIdx);
+  }
+
+  //bottom
+  rowIdx     = nextRowIdx - gridWidth + 1;
+  nextRowIdx = rowIdx + gridWidth + 1;
+  for(int x = 0; x < gridWidth; ++x, ++nextRowIdx, ++rowIdx)
+  {
+    AddQuadIndices(indices, rowIdx, nextRowIdx);
+  }
+
+  return GenerateGeometry(vertices, indices);
+}
+
+void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent)
+{
+  uint16_t     prevEnd     = 0;
+  uint16_t     prevFix     = 0;
+  uint16_t     prevStretch = 0;
+  unsigned int i           = 1;
+  for(NPatchUtility::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i)
+  {
+    uint16_t start = it->GetX();
+    uint16_t end   = it->GetY();
+
+    uint16_t fix     = prevFix + start - prevEnd;
+    uint16_t stretch = prevStretch + end - start;
+
+    std::stringstream uniform;
+    uniform << uniformName << "[" << i << "]";
+    renderer.RegisterProperty(uniform.str(), Vector2(fix, stretch));
+
+    prevEnd     = end;
+    prevFix     = fix;
+    prevStretch = stretch;
+  }
+
+  {
+    prevFix += imageExtent - prevEnd;
+    std::stringstream uniform;
+    uniform << uniformName << "[" << i << "]";
+    renderer.RegisterProperty(uniform.str(), Vector2(prevFix, prevStretch));
+  }
+}
+
+void ApplyTextureAndUniforms(Renderer& renderer, const Internal::NPatchData* data)
+{
+  TextureSet        textureSet;
+  textureSet = data->GetTextures();
+
+  if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
+  {
+    //special case for 9 patch
+    Uint16Pair stretchX = data->GetStretchPixelsX()[0];
+    Uint16Pair stretchY = data->GetStretchPixelsY()[0];
+
+    uint16_t stretchWidth  = (stretchX.GetY() >= stretchX.GetX()) ? stretchX.GetY() - stretchX.GetX() : 0;
+    uint16_t stretchHeight = (stretchY.GetY() >= stretchY.GetX()) ? stretchY.GetY() - stretchY.GetX() : 0;
+
+    renderer.RegisterProperty("uFixed[0]", Vector2::ZERO);
+    renderer.RegisterProperty("uFixed[1]", Vector2(stretchX.GetX(), stretchY.GetX()));
+    renderer.RegisterProperty("uFixed[2]", Vector2(data->GetCroppedWidth() - stretchWidth, data->GetCroppedHeight() - stretchHeight));
+    renderer.RegisterProperty("uStretchTotal", Vector2(stretchWidth, stretchHeight));
+  }
+  else
+  {
+    renderer.RegisterProperty("uNinePatchFactorsX[0]", Vector2::ZERO);
+    renderer.RegisterProperty("uNinePatchFactorsY[0]", Vector2::ZERO);
+
+    RegisterStretchProperties(renderer, "uNinePatchFactorsX", data->GetStretchPixelsX(), data->GetCroppedWidth());
+    RegisterStretchProperties(renderer, "uNinePatchFactorsY", data->GetStretchPixelsY(), data->GetCroppedHeight());
+  }
+}
+
+} // namespace NPatchHelper
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/utility/npatch-helper.h b/dali-toolkit/devel-api/utility/npatch-helper.h
new file mode 100644 (file)
index 0000000..7a198fe
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef DALI_TOOLKIT_NPATCH_HELPER_H
+#define DALI_TOOLKIT_NPATCH_HELPER_H
+
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * 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/public-api/math/uint-16-pair.h>
+#include <dali/public-api/rendering/geometry.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+#include <dali-toolkit/internal/visuals/npatch-data.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace NPatchHelper
+{
+/**
+ * The list that includes stretch pixel ranges
+ */
+using StretchRanges = Dali::Vector<Uint16Pair>;
+
+/**
+ * @brief Creates a Npatch Geometry object
+ *
+ * @param[in] gridSize The gridSize for creating a geometry
+ * @return The Geometry for NPatch
+ */
+DALI_TOOLKIT_API Geometry CreateGridGeometry(Uint16Pair gridSize);
+
+/**
+ * @brief Creates a geometry with the border only for the grid size to be used by this visuals' shaders
+ * e.g. a 5x4 grid would create a geometry that would look like:
+ *
+ *   ---------------------
+ *   |  /|  /|  /|  /|  /|
+ *   |/  |/  |/  |/  |/  |
+ *   ---------------------
+ *   |  /|           |  /|
+ *   |/  |           |/  |
+ *   -----           -----
+ *   |  /|           |  /|
+ *   |/  |           |/  |
+ *   ---------------------
+ *   |  /|  /|  /|  /|  /|
+ *   |/  |/  |/  |/  |/  |
+ *   ---------------------
+ *
+ * @param[in] gridSize The grid size of the solid geometry to create
+ * @return Returns the created geometry for the grid size
+ */
+DALI_TOOLKIT_API Geometry CreateBorderGeometry(Uint16Pair gridSize);
+
+
+/**
+ * @brief Registers a properties for Stretch Ranges
+ *
+ * @param[in,out] renderer The renderer for broken image
+ * @param[in] uniformName The name of the uniform
+ * @param[in] stretchPixels The stretchable pixels in the cropped image space
+ * @param[in] imageExtent The imageExtent
+ */
+void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent);
+
+/**
+ * @brief Apply a texture and uniforms
+ *
+ * @param[in,out] renderer The renderer for broken image
+ * @param[in] data The pointer of npatch-data
+ */
+void ApplyTextureAndUniforms(Renderer& renderer, const Internal::NPatchData* data);
+
+} // namespace NPatchUtility
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_NPATCH_HELPER_H
index 062094f..a8c79d6 100644 (file)
@@ -56,6 +56,11 @@ enum
    * @copydoc Dali::Toolkit::DevelTextLabel::Property::BACKGROUND
    */
   BACKGROUND = UNDERLINE + 2,
+
+  /**
+   * @copydoc Dali::Toolkit::DevelTextLabel::Property::STRIKETHROUGH
+   */
+  STRIKETHROUGH = UNDERLINE + 3,
 };
 
 } // namespace Property
index 1c2271c..d9b3b4d 100644 (file)
@@ -189,7 +189,7 @@ void Alignment::OnInitialize()
 {
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 55259db..5ed17c8 100644 (file)
@@ -219,7 +219,7 @@ void BloomView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::ANIMATION));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::ANIMATION));
   });
 }
 
index 7ff5875..7fb1ab8 100644 (file)
@@ -1303,7 +1303,7 @@ Padding Button::GetForegroundPadding()
   return mForegroundPadding;
 }
 
-std::string Button::AccessibleImpl::GetNameRaw()
+std::string Button::AccessibleImpl::GetNameRaw() const
 {
   std::string   labelText;
   auto          slf      = Toolkit::Button::DownCast(Self());
@@ -1335,7 +1335,7 @@ Property::Index Button::AccessibleImpl::GetNamePropertyIndex()
 
 Dali::Accessibility::States Button::AccessibleImpl::CalculateStates()
 {
-  auto tmp                                    = DevelControl::AccessibleImpl::CalculateStates();
+  auto tmp                                    = DevelControl::ControlAccessible::CalculateStates();
   tmp[Dali::Accessibility::State::SELECTABLE] = true;
   auto slf                                    = Toolkit::Button::DownCast(Self());
   tmp[Dali::Accessibility::State::ENABLED]    = !slf.GetProperty<bool>(Toolkit::Button::Property::DISABLED);
index ced51fd..3e36873 100644 (file)
@@ -535,12 +535,12 @@ private:
   bool mClickActionPerforming; ///< Used to manage signal emissions during action
 
 protected:
-  struct AccessibleImpl : public DevelControl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::ControlAccessible
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
     Dali::Accessibility::States CalculateStates() override;
-    std::string                 GetNameRaw() override;
+    std::string                 GetNameRaw() const override;
     Property::Index             GetNamePropertyIndex() override;
   };
 };
index 1697b20..3010e69 100644 (file)
@@ -383,7 +383,7 @@ Dali::Accessibility::States ToggleButton::AccessibleImpl::CalculateStates()
   return states;
 }
 
-std::string ToggleButton::AccessibleImpl::GetDescriptionRaw()
+std::string ToggleButton::AccessibleImpl::GetDescriptionRaw() const
 {
   auto button   = Toolkit::ToggleButton::DownCast(Self());
   auto index    = button.GetProperty<int>(Toolkit::ToggleButton::Property::CURRENT_STATE_INDEX);
index 322285b..6629d40 100644 (file)
@@ -158,7 +158,7 @@ protected:
     using Button::AccessibleImpl::AccessibleImpl;
 
     Dali::Accessibility::States CalculateStates() override;
-    std::string                 GetDescriptionRaw() override;
+    std::string                 GetDescriptionRaw() const override;
     Property::Index             GetDescriptionPropertyIndex() override;
   };
   void OnStateChange(State newState) override;
index e8fefbf..6ec6fc9 100644 (file)
@@ -99,7 +99,7 @@ void CanvasView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
   });
 
   Adaptor::Get().RegisterProcessor(*this, true);
index 4aecc29..e3cea92 100644 (file)
@@ -411,11 +411,11 @@ void SetVisualsOffScene(const RegisteredVisualContainer& container, Actor parent
   }
 }
 
-Dali::Rect<> GetShowingGeometry(Dali::Rect<> rect, Dali::Toolkit::DevelControl::AccessibleImpl* accessibleImpl)
+Dali::Rect<> GetShowingGeometry(Dali::Rect<> rect, Dali::Toolkit::DevelControl::ControlAccessible* accessible)
 {
   Rect<>  parentRect;
   Vector2 currentPosition;
-  auto    parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(accessibleImpl->GetParent());
+  auto    parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(accessible->GetParent());
 
   while(parent)
   {
@@ -434,7 +434,7 @@ Dali::Rect<> GetShowingGeometry(Dali::Rect<> rect, Dali::Toolkit::DevelControl::
       return rect;
     }
 
-    parent = dynamic_cast<Toolkit::DevelControl::AccessibleImpl*>(parent->GetParent());
+    parent = dynamic_cast<Toolkit::DevelControl::ControlAccessible*>(parent->GetParent());
   }
 
   return rect;
@@ -468,7 +468,8 @@ const PropertyRegistration Control::Impl::PROPERTY_18(typeRegistration, "accessi
 const PropertyRegistration Control::Impl::PROPERTY_19(typeRegistration, "accessibilityRole",              Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE,               Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
 const PropertyRegistration Control::Impl::PROPERTY_20(typeRegistration, "accessibilityHighlightable",     Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE,      Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
 const PropertyRegistration Control::Impl::PROPERTY_21(typeRegistration, "accessibilityAttributes",        Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES,         Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty);
-const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents",              Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS,               Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents",              Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS,              Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_23(typeRegistration, "accessibilityHidden",            Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN,             Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
 
 // clang-format on
 
@@ -513,7 +514,7 @@ Control::Impl::Impl(Control& controlImpl)
     });
 
   mAccessibilityConstructor = [](Dali::Actor actor) -> std::unique_ptr<Dali::Accessibility::Accessible> {
-    return std::unique_ptr<Dali::Accessibility::Accessible>(new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::UNKNOWN));
+    return std::unique_ptr<Dali::Accessibility::Accessible>(new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::UNKNOWN));
   };
 }
 
@@ -551,16 +552,16 @@ const Control::Impl& Control::Impl::Get(const Internal::Control& internalControl
 
 void Control::Impl::CheckHighlightedObjectGeometry()
 {
-  auto accessibleImpl = dynamic_cast<Dali::Toolkit::DevelControl::AccessibleImpl*>(mAccessibilityObject.get());
-  if(!accessibleImpl)
+  auto accessible = dynamic_cast<Dali::Toolkit::DevelControl::ControlAccessible*>(mAccessibilityObject.get());
+  if(!accessible)
   {
-    DALI_LOG_ERROR("accessibleImpl is not a pointer to a DevelControl::AccessibleImpl type");
+    DALI_LOG_ERROR("accessible is not a pointer to a DevelControl::ControlAccessible type");
     return;
   }
 
-  auto lastPosition   = accessibleImpl->GetLastPosition();
-  auto accessibleRect = accessibleImpl->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
-  auto rect = GetShowingGeometry(accessibleRect, accessibleImpl);
+  auto lastPosition   = accessible->GetLastPosition();
+  auto accessibleRect = accessible->GetExtents(Dali::Accessibility::CoordinateType::WINDOW);
+  auto rect = GetShowingGeometry(accessibleRect, accessible);
 
   switch(mAccessibilityLastScreenRelativeMoveType)
   {
@@ -608,7 +609,7 @@ void Control::Impl::CheckHighlightedObjectGeometry()
     }
   }
 
-  accessibleImpl->SetLastPosition(Vector2(accessibleRect.x, accessibleRect.y));
+  accessible->SetLastPosition(Vector2(accessibleRect.x, accessibleRect.y));
 }
 
 void Control::Impl::RegisterAccessibilityPositionPropertyNotification()
@@ -1369,6 +1370,16 @@ void Control::Impl::SetProperty(BaseObject* object, Property::Index index, const
         }
         break;
       }
+
+      case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+      {
+        bool hidden;
+        if(value.Get(hidden))
+        {
+          controlImpl.mImpl->mAccessibilityHidden = hidden;
+        }
+        break;
+      }
     }
   }
 }
@@ -1529,11 +1540,18 @@ Property::Value Control::Impl::GetProperty(BaseObject* object, Property::Index i
         value = controlImpl.mImpl->mAccessibilityAttributes;
         break;
       }
+
       case Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS:
       {
         value = controlImpl.mImpl->mDispatchKeyEvents;
         break;
       }
+
+      case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+      {
+        value = controlImpl.mImpl->mAccessibilityHidden;
+        break;
+      }
     }
   }
 
index c81be41..a227648 100644 (file)
@@ -71,7 +71,7 @@ typedef Dali::OwnerContainer<RegisteredVisual*> RegisteredVisualContainer;
  */
 class Control::Impl : public ConnectionTracker, public Visual::EventObserver
 {
-  friend class Toolkit::DevelControl::AccessibleImpl;
+  friend class Toolkit::DevelControl::ControlAccessible;
 
 public:
   /**
@@ -546,6 +546,8 @@ public:
   bool mAccessibilityHighlightable    = false;
   bool mAccessibilityHighlightableSet = false;
 
+  bool mAccessibilityHidden = false;
+
   Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN;
 
   std::map<Dali::Accessibility::RelationType, std::set<Accessibility::Accessible*>> mAccessibilityRelations;
@@ -596,6 +598,7 @@ public:
   static const PropertyRegistration PROPERTY_20;
   static const PropertyRegistration PROPERTY_21;
   static const PropertyRegistration PROPERTY_22;
+  static const PropertyRegistration PROPERTY_23;
 
 private:
   // Accessibility - notification for highlighted object to check if it is showing.
index 88fa83f..0f3e141 100644 (file)
@@ -236,7 +236,7 @@ void EffectsView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 4a3b065..964afe2 100644 (file)
@@ -837,7 +837,7 @@ void FlexContainer::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 29d36b1..64d5ecb 100644 (file)
@@ -297,7 +297,7 @@ void GaussianBlurView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 1a653a1..1d9deec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -96,7 +96,7 @@ void ImageView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
   });
 }
 
@@ -479,27 +479,43 @@ void ImageView::SetProperty(BaseObject* object, Property::Index index, const Pro
           map = value.GetMap();
           if(map)
           {
-            Property::Value* shaderValue = map->Find(Toolkit::Visual::Property::SHADER, CUSTOM_SHADER);
-            // set image only if property map contains image information other than custom shader
-            if(map->Count() > 1u || !shaderValue)
+            // the property map is emtpy map. Unregister visual.
+            if(DALI_UNLIKELY(map->Count() == 0u))
             {
-              impl.SetImage(*map);
+              // Clear cached properties
+              impl.mPropertyMap.Clear();
+              impl.mUrl.clear();
+
+              // Unregister the exsiting visual
+              DevelControl::UnregisterVisual(impl, Toolkit::ImageView::Property::IMAGE);
+
+              // Trigger a size negotiation request that may be needed when unregistering a visual.
+              impl.RelayoutRequest();
             }
-            // the property map contains only the custom shader
-            else if((map->Count() == 1u) && (shaderValue))
+            else
             {
-              Property::Map* shaderMap = shaderValue->GetMap();
-              if(shaderMap)
+              Property::Value* shaderValue = map->Find(Toolkit::Visual::Property::SHADER, CUSTOM_SHADER);
+              // set image only if property map contains image information other than custom shader
+              if(map->Count() > 1u || !shaderValue)
               {
-                impl.mShaderMap = *shaderMap;
-
-                if(!impl.mUrl.empty())
-                {
-                  impl.SetImage(impl.mUrl, impl.mImageSize);
-                }
-                else if(!impl.mPropertyMap.Empty())
+                impl.SetImage(*map);
+              }
+              // the property map contains only the custom shader
+              else if((map->Count() == 1u) && (shaderValue))
+              {
+                Property::Map* shaderMap = shaderValue->GetMap();
+                if(shaderMap)
                 {
-                  impl.SetImage(impl.mPropertyMap);
+                  impl.mShaderMap = *shaderMap;
+
+                  if(!impl.mUrl.empty())
+                  {
+                    impl.SetImage(impl.mUrl, impl.mImageSize);
+                  }
+                  else if(!impl.mPropertyMap.Empty())
+                  {
+                    impl.SetImage(impl.mPropertyMap);
+                  }
                 }
               }
             }
index e37a534..c4e8ce2 100644 (file)
@@ -220,7 +220,7 @@ void Magnifier::Initialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index f9bf491..b9ee873 100644 (file)
@@ -282,7 +282,7 @@ void Model3dView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::IMAGE));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::IMAGE));
   });
 }
 
index 3dd6909..9eab290 100644 (file)
@@ -72,7 +72,7 @@ void NavigationView::OnInitialize()
 {
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index d74574c..69369de 100644 (file)
@@ -416,7 +416,7 @@ void PageTurnView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::PAGE_TAB_LIST));
   });
 }
 
index 9abcfe0..5331e74 100644 (file)
@@ -1994,7 +1994,7 @@ void Popup::SetupTouch()
   }
 }
 
-std::string Popup::AccessibleImpl::GetNameRaw()
+std::string Popup::AccessibleImpl::GetNameRaw() const
 {
   auto        popup = Toolkit::Popup::DownCast(Self());
   std::string title;
@@ -2018,7 +2018,7 @@ std::string Popup::AccessibleImpl::GetNameRaw()
 
 Dali::Accessibility::States Popup::AccessibleImpl::CalculateStates()
 {
-  auto states       = DevelControl::AccessibleImpl::CalculateStates();
+  auto states       = DevelControl::ControlAccessible::CalculateStates();
   auto popup        = Toolkit::Popup::DownCast(Self());
   auto displayState = popup.GetProperty<std::string>(Toolkit::Popup::Property::DISPLAY_STATE);
 
index 630caa8..50a2fd6 100644 (file)
@@ -241,11 +241,11 @@ public:
   static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
 
 protected:
-  struct AccessibleImpl : public DevelControl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::ControlAccessible
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
-    std::string                 GetNameRaw() override;
+    std::string                 GetNameRaw() const override;
     Dali::Accessibility::States CalculateStates() override;
   };
 
index 1006307..1a243a2 100644 (file)
@@ -676,18 +676,18 @@ void ProgressBar::OnSceneConnection(int depth)
   }
 }
 
-double ProgressBar::AccessibleImpl::GetMinimum()
+double ProgressBar::AccessibleImpl::GetMinimum() const
 {
   return DEFAULT_LOWER_BOUND;
 }
 
-double ProgressBar::AccessibleImpl::GetCurrent()
+double ProgressBar::AccessibleImpl::GetCurrent() const
 {
   auto self = Toolkit::ProgressBar::DownCast(Self());
   return self.GetProperty(Toolkit::ProgressBar::Property::PROGRESS_VALUE).Get<float>();
 }
 
-double ProgressBar::AccessibleImpl::GetMaximum()
+double ProgressBar::AccessibleImpl::GetMaximum() const
 {
   return DEFAULT_UPPER_BOUND;
 }
@@ -704,7 +704,7 @@ bool ProgressBar::AccessibleImpl::SetCurrent(double current)
   return true;
 }
 
-double ProgressBar::AccessibleImpl::GetMinimumIncrement()
+double ProgressBar::AccessibleImpl::GetMinimumIncrement() const
 {
   return 0.0;
 }
index c6729bb..96540d2 100644 (file)
@@ -265,15 +265,16 @@ private:
   Property::Map           mSecondaryProgressVisualMap;    ///< To backup visual properties when switching determinate/indeterminate.
 
 protected:
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::Value
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
-    double GetMinimum() override;
-    double GetCurrent() override;
-    double GetMaximum() override;
+    using DevelControl::ControlAccessible::ControlAccessible;
+
+    double GetMinimum() const override;
+    double GetCurrent() const override;
+    double GetMaximum() const override;
     bool   SetCurrent(double) override;
-    double GetMinimumIncrement() override;
+    double GetMinimumIncrement() const override;
   };
 };
 
index 1da4297..1fef71b 100644 (file)
@@ -861,21 +861,21 @@ Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
   return handle;
 }
 
-double ScrollBar::AccessibleImpl::GetMinimum()
+double ScrollBar::AccessibleImpl::GetMinimum() const
 {
   auto self = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyMinScrollPosition) : 0.0f;
 }
 
-double ScrollBar::AccessibleImpl::GetCurrent()
+double ScrollBar::AccessibleImpl::GetCurrent() const
 {
   auto self = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
   return scrollableHandle ? scrollableHandle.GetCurrentProperty<float>(GetImpl(self).mPropertyScrollPosition) : 0.0f;
 }
 
-double ScrollBar::AccessibleImpl::GetMaximum()
+double ScrollBar::AccessibleImpl::GetMaximum() const
 {
   auto self = Toolkit::ScrollBar::DownCast(Self());
   Handle scrollableHandle = GetImpl(self).mScrollableObject.GetHandle();
@@ -910,7 +910,7 @@ bool ScrollBar::AccessibleImpl::SetCurrent(double current)
   return true;
 }
 
-double ScrollBar::AccessibleImpl::GetMinimumIncrement()
+double ScrollBar::AccessibleImpl::GetMinimumIncrement() const
 {
   return 1.0;
 }
index 8c6ef2a..97a7daa 100644 (file)
@@ -314,15 +314,16 @@ private:
   bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
 
 protected:
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::Value
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
-    double GetMinimum() override;
-    double GetCurrent() override;
-    double GetMaximum() override;
+    using DevelControl::ControlAccessible::ControlAccessible;
+
+    double GetMinimum() const override;
+    double GetCurrent() const override;
+    double GetMaximum() const override;
     bool   SetCurrent(double) override;
-    double GetMinimumIncrement() override;
+    double GetMinimumIncrement() const override;
   };
 };
 
index 609476a..ea3240f 100644 (file)
@@ -92,7 +92,7 @@ Scrollable::~Scrollable()
 {
 }
 
-bool Scrollable::AccessibleImpl::IsScrollable()
+bool Scrollable::AccessibleImpl::IsScrollable() const
 {
   return true;
 }
index 4240a1e..44d9a33 100644 (file)
@@ -117,11 +117,11 @@ public:
   virtual void SetOvershootSize(const Vector2& size) = 0;
 
 protected: // From Control
-  struct AccessibleImpl : public DevelControl::AccessibleImpl
+  struct AccessibleImpl : public DevelControl::ControlAccessible
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
-    bool IsScrollable() override;
+    bool IsScrollable() const override;
   };
 
   /**
index 612a9a4..1197a46 100644 (file)
@@ -258,7 +258,7 @@ void ShadowView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 8cac5ed..7e6370d 100644 (file)
@@ -1411,19 +1411,19 @@ Property::Value Slider::GetProperty(BaseObject* object, Property::Index property
   return value;
 }
 
-double Slider::AccessibleImpl::GetMinimum()
+double Slider::AccessibleImpl::GetMinimum() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::LOWER_BOUND).Get<float>();
 }
 
-double Slider::AccessibleImpl::GetCurrent()
+double Slider::AccessibleImpl::GetCurrent() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
 }
 
-double Slider::AccessibleImpl::GetMaximum()
+double Slider::AccessibleImpl::GetMaximum() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::UPPER_BOUND).Get<float>();
@@ -1477,7 +1477,7 @@ bool Slider::AccessibleImpl::SetCurrent(double current)
   return true;
 }
 
-double Slider::AccessibleImpl::GetMinimumIncrement()
+double Slider::AccessibleImpl::GetMinimumIncrement() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
 
index 082f066..7385953 100644 (file)
@@ -749,15 +749,16 @@ private:
     mSnapToMarks : 1;  ///< Turn on or off snapping to marks
 
 protected:
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::Value
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
-    double GetMinimum() override;
-    double GetCurrent() override;
-    double GetMaximum() override;
+    using DevelControl::ControlAccessible::ControlAccessible;
+
+    double GetMinimum() const override;
+    double GetCurrent() const override;
+    double GetMaximum() const override;
     bool   SetCurrent(double) override;
-    double GetMinimumIncrement() override;
+    double GetMinimumIncrement() const override;
   };
 };
 
index 6325e62..fef8956 100644 (file)
@@ -151,7 +151,7 @@ void SuperBlurView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::FILLER));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::FILLER));
   });
 }
 
index 9aec5ba..2426775 100644 (file)
@@ -1121,7 +1121,7 @@ void TableView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TABLE));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TABLE));
   });
 }
 
index 6e595b1..e26006d 100644 (file)
@@ -105,10 +105,10 @@ protected:
   /**
    * @brief This structure is to connect TextAnchor with Accessible functions.
    */
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::Hyperlink
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
     /**
      * @copydoc Dali::Accessibility::Hyperlink::GetEndIndex()
      */
index 5e9e7d9..a75e21c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -146,6 +146,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "verticalScrollP
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "enableEditing",                        BOOLEAN,   ENABLE_EDITING                      )
 DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY(Toolkit, TextEditor, "selectedText",                         STRING,    SELECTED_TEXT                       )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "fontSizeScale",                        FLOAT,     FONT_SIZE_SCALE                     )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "enableFontSizeScale",                  BOOLEAN,   ENABLE_FONT_SIZE_SCALE              )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "primaryCursorPosition",                INTEGER,   PRIMARY_CURSOR_POSITION             )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "grabHandleColor",                      VECTOR4,   GRAB_HANDLE_COLOR                   )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "enableGrabHandlePopup",                BOOLEAN,   ENABLE_GRAB_HANDLE_POPUP            )
@@ -154,6 +155,8 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "inputFilter",
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "ellipsis",                             BOOLEAN,   ELLIPSIS                            )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "ellipsisPosition",                     INTEGER,   ELLIPSIS_POSITION                   )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "minLineSize",                          FLOAT,     MIN_LINE_SIZE                       )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "strikethrough",                        MAP,       STRIKETHROUGH                       )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextEditor, "inputStrikethrough",                   MAP,       INPUT_STRIKETHROUGH                 )
 
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "textChanged",           SIGNAL_TEXT_CHANGED           )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextEditor, "inputStyleChanged",     SIGNAL_INPUT_STYLE_CHANGED    )
@@ -215,6 +218,11 @@ Toolkit::TextEditor::InputStyle::Mask ConvertInputStyle(Text::InputStyle::Mask i
   {
     editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>(editorInputStyleMask | Toolkit::TextEditor::InputStyle::OUTLINE);
   }
+  if(InputStyle::NONE != static_cast<InputStyle::Mask>(inputStyleMask & InputStyle::INPUT_STRIKETHROUGH))
+  {
+    editorInputStyleMask = static_cast<Toolkit::TextEditor::InputStyle::Mask>(editorInputStyleMask | Toolkit::TextEditor::InputStyle::STRIKETHROUGH);
+  }
+
   return editorInputStyleMask;
 }
 
@@ -1289,13 +1297,13 @@ TextEditor::~TextEditor()
   }
 }
 
-std::string TextEditor::AccessibleImpl::GetName()
+std::string TextEditor::AccessibleImpl::GetName() const
 {
   auto self = Toolkit::TextEditor::DownCast(Self());
   return self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
 }
 
-std::string TextEditor::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextEditor::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
 {
   if(endOffset <= startOffset)
   {
@@ -1313,7 +1321,7 @@ std::string TextEditor::AccessibleImpl::GetText(size_t startOffset, size_t endOf
   return text.substr(startOffset, endOffset - startOffset);
 }
 
-size_t TextEditor::AccessibleImpl::GetCharacterCount()
+size_t TextEditor::AccessibleImpl::GetCharacterCount() const
 {
   auto self = Toolkit::TextEditor::DownCast(Self());
   auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
@@ -1321,7 +1329,7 @@ size_t TextEditor::AccessibleImpl::GetCharacterCount()
   return text.size();
 }
 
-size_t TextEditor::AccessibleImpl::GetCursorOffset()
+size_t TextEditor::AccessibleImpl::GetCursorOffset() const
 {
   auto slf = Toolkit::TextEditor::DownCast(Self());
   return Dali::Toolkit::GetImpl(slf).GetTextController()->GetCursorPosition();
@@ -1343,7 +1351,7 @@ bool TextEditor::AccessibleImpl::SetCursorOffset(size_t offset)
   return true;
 }
 
-Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary)
+Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary) const
 {
   auto self     = Toolkit::TextEditor::DownCast(Self());
   auto text     = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get<std::string>();
@@ -1434,7 +1442,7 @@ Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t of
   return range;
 }
 
-Dali::Accessibility::Range TextEditor::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextEditor::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
 {
   // Since DALi supports only one selection indexes higher than 0 are ignored
   if(selectionIndex > 0)
@@ -1526,12 +1534,12 @@ Dali::Accessibility::States TextEditor::AccessibleImpl::CalculateStates()
 {
   using namespace Dali::Accessibility;
 
-  auto states              = DevelControl::AccessibleImpl::CalculateStates();
+  auto states              = DevelControl::ControlAccessible::CalculateStates();
   states[State::EDITABLE]  = true;
   states[State::FOCUSABLE] = true;
 
   Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
-  if(mSelf == focusControl)
+  if(Self() == focusControl)
   {
     states[State::FOCUSED] = true;
   }
index 50ecda5..6ea1cc8 100644 (file)
@@ -556,32 +556,31 @@ private: // Data
   /**
    * @brief This structure is to connect TextEditor with Accessible functions.
    */
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
-                          public virtual Dali::Accessibility::Text,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::EditableText,
                           public virtual Dali::Accessibility::Hypertext
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
     /**
      * @copydoc Dali::Accessibility::Accessible::GetName()
      */
-    std::string GetName() override;
+    std::string GetName() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetText()
      */
-    std::string GetText(size_t startOffset, size_t endOffset) override;
+    std::string GetText(size_t startOffset, size_t endOffset) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCharacterCount()
      */
-    size_t GetCharacterCount() override;
+    size_t GetCharacterCount() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCursorOffset()
      */
-    size_t GetCursorOffset() override;
+    size_t GetCursorOffset() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::SetCursorOffset()
@@ -591,12 +590,12 @@ private: // Data
     /**
      * @copydoc Dali::Accessibility::Text::GetTextAtOffset()
      */
-    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
      */
-    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::RemoveSelection()
index f35c169..c6698ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#include <dali-toolkit/internal/controls/text-controls/text-editor-property-handler.h>
 #include <dali-toolkit/internal/controls/text-controls/common-text-utils.h>
+#include <dali-toolkit/internal/controls/text-controls/text-editor-property-handler.h>
 
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 
@@ -610,6 +610,15 @@ void TextEditor::PropertyHandler::SetProperty(Toolkit::TextEditor textEditor, Pr
       }
       break;
     }
+    case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
+    {
+      const bool enableFontSizeScale = value.Get<bool>();
+      if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+      {
+        impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+      }
+      break;
+    }
     case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
     {
       uint32_t position = static_cast<uint32_t>(value.Get<int>());
@@ -689,6 +698,24 @@ void TextEditor::PropertyHandler::SetProperty(Toolkit::TextEditor textEditor, Pr
       impl.mRenderer.Reset();
       break;
     }
+    case Toolkit::DevelTextEditor::Property::STRIKETHROUGH:
+    {
+      const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
+      if(update)
+      {
+        impl.mRenderer.Reset();
+      }
+      break;
+    }
+    case Toolkit::DevelTextEditor::Property::INPUT_STRIKETHROUGH:
+    {
+      const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
+      if(update)
+      {
+        impl.mRenderer.Reset();
+      }
+      break;
+    }
   }
 }
 
@@ -975,6 +1002,16 @@ Property::Value TextEditor::PropertyHandler::GetProperty(Toolkit::TextEditor tex
       value = impl.mController->GetLineWrapMode();
       break;
     }
+    case Toolkit::DevelTextEditor::Property::STRIKETHROUGH:
+    {
+      GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
+      break;
+    }
+    case Toolkit::DevelTextEditor::Property::INPUT_STRIKETHROUGH:
+    {
+      GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
+      break;
+    }
     case Toolkit::DevelTextEditor::Property::ENABLE_SHIFT_SELECTION:
     {
       value = impl.mController->IsShiftSelectionEnabled();
@@ -1032,6 +1069,11 @@ Property::Value TextEditor::PropertyHandler::GetProperty(Toolkit::TextEditor tex
       value = impl.mController->GetFontSizeScale();
       break;
     }
+    case Toolkit::DevelTextEditor::Property::ENABLE_FONT_SIZE_SCALE:
+    {
+      value = impl.mController->IsFontSizeScaleEnabled();
+      break;
+    }
     case Toolkit::DevelTextEditor::Property::PRIMARY_CURSOR_POSITION:
     {
       value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
index 9cefc6c..3475b36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -137,10 +137,13 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "selectedTextStar
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "selectedTextEnd",                  INTEGER,   SELECTED_TEXT_END                   )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "enableEditing",                    BOOLEAN,   ENABLE_EDITING                      )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "fontSizeScale",                    FLOAT,     FONT_SIZE_SCALE                     )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "enableFontSizeScale",              BOOLEAN,   ENABLE_FONT_SIZE_SCALE              )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "primaryCursorPosition",            INTEGER,   PRIMARY_CURSOR_POSITION             )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "grabHandleColor",                  VECTOR4,   GRAB_HANDLE_COLOR                   )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "inputFilter",                      MAP,       INPUT_FILTER                        )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "ellipsisPosition",                 INTEGER,   ELLIPSIS_POSITION                   )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "strikethrough",                    MAP,       STRIKETHROUGH                       )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextField, "inputStrikethrough",               MAP,       INPUT_STRIKETHROUGH                 )
 
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "textChanged",           SIGNAL_TEXT_CHANGED           )
 DALI_SIGNAL_REGISTRATION(Toolkit, TextField, "maxLengthReached",      SIGNAL_MAX_LENGTH_REACHED     )
@@ -1138,7 +1141,7 @@ Vector<Vector2> TextField::GetTextPosition(const uint32_t startIndex, const uint
   return mController->GetTextPosition(startIndex, endIndex);
 }
 
-std::string TextField::AccessibleImpl::GetName()
+std::string TextField::AccessibleImpl::GetName() const
 {
   auto self = Toolkit::TextField::DownCast(Self());
   if(IsHiddenInput(self))
@@ -1149,7 +1152,7 @@ std::string TextField::AccessibleImpl::GetName()
   return self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
 }
 
-std::string TextField::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextField::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
 {
   if(endOffset <= startOffset)
   {
@@ -1170,7 +1173,7 @@ std::string TextField::AccessibleImpl::GetText(size_t startOffset, size_t endOff
   return text.substr(startOffset, endOffset - startOffset);
 }
 
-size_t TextField::AccessibleImpl::GetCharacterCount()
+size_t TextField::AccessibleImpl::GetCharacterCount() const
 {
   auto self = Toolkit::TextField::DownCast(Self());
   auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get<std::string>();
@@ -1178,7 +1181,7 @@ size_t TextField::AccessibleImpl::GetCharacterCount()
   return text.size();
 }
 
-size_t TextField::AccessibleImpl::GetCursorOffset()
+size_t TextField::AccessibleImpl::GetCursorOffset() const
 {
   auto self = Toolkit::TextField::DownCast(Self());
   return Dali::Toolkit::GetImpl(self).GetTextController()->GetCursorPosition();
@@ -1201,7 +1204,7 @@ bool TextField::AccessibleImpl::SetCursorOffset(size_t offset)
 }
 
 Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset(
-  size_t offset, Dali::Accessibility::TextBoundary boundary)
+  size_t offset, Dali::Accessibility::TextBoundary boundary) const
 {
   auto self  = Toolkit::TextField::DownCast(Self());
   auto range = Dali::Accessibility::Range{};
@@ -1299,7 +1302,7 @@ Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset(
   return range;
 }
 
-Dali::Accessibility::Range TextField::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextField::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
 {
   // Since DALi supports only one selection indexes higher than 0 are ignored
   if(selectionIndex > 0)
@@ -1399,13 +1402,13 @@ Dali::Accessibility::States TextField::AccessibleImpl::CalculateStates()
 {
   using namespace Dali::Accessibility;
 
-  auto states = DevelControl::AccessibleImpl::CalculateStates();
+  auto states = DevelControl::ControlAccessible::CalculateStates();
 
   states[State::EDITABLE]  = true;
   states[State::FOCUSABLE] = true;
 
   Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
-  if(mSelf == focusControl)
+  if(Self() == focusControl)
   {
     states[State::FOCUSED] = true;
   }
index 6efd495..e53189e 100644 (file)
@@ -504,32 +504,31 @@ protected:
   /**
    * @brief This structure is to connect TextField with Accessible functions.
    */
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
-                          public virtual Dali::Accessibility::Text,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::EditableText,
                           public virtual Dali::Accessibility::Hypertext
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
     /**
      * @copydoc Dali::Accessibility::Accessible::GetName()
      */
-    std::string GetName() override;
+    std::string GetName() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetText()
      */
-    std::string GetText(size_t startOffset, size_t endOffset) override;
+    std::string GetText(size_t startOffset, size_t endOffset) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCharacterCount()
      */
-    size_t GetCharacterCount() override;
+    size_t GetCharacterCount() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCursorOffset()
      */
-    size_t GetCursorOffset() override;
+    size_t GetCursorOffset() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::SetCursorOffset()
@@ -539,12 +538,12 @@ protected:
     /**
      * @copydoc Dali::Accessibility::Text::GetTextAtOffset()
      */
-    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
      */
-    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::RemoveSelection()
index dc253f0..6020ba7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#include <dali-toolkit/internal/controls/text-controls/text-field-property-handler.h>
 #include <dali-toolkit/internal/controls/text-controls/common-text-utils.h>
+#include <dali-toolkit/internal/controls/text-controls/text-field-property-handler.h>
 
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/devel-api/text/rendering-backend.h>
@@ -626,6 +626,15 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope
       }
       break;
     }
+    case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE:
+    {
+      const bool enableFontSizeScale = value.Get<bool>();
+      if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+      {
+        impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+      }
+      break;
+    }
     case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION:
     {
       uint32_t position = static_cast<uint32_t>(value.Get<int>());
@@ -665,6 +674,24 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope
       }
       break;
     }
+    case Toolkit::DevelTextField::Property::STRIKETHROUGH:
+    {
+      const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
+      if(update)
+      {
+        impl.mRenderer.Reset();
+      }
+      break;
+    }
+    case Toolkit::DevelTextField::Property::INPUT_STRIKETHROUGH:
+    {
+      const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
+      if(update)
+      {
+        impl.mRenderer.Reset();
+      }
+      break;
+    }
   }
 }
 
@@ -1003,6 +1030,11 @@ Property::Value TextField::PropertyHandler::GetProperty(Toolkit::TextField textF
       value = impl.mController->GetFontSizeScale();
       break;
     }
+    case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE:
+    {
+      value = impl.mController->IsFontSizeScaleEnabled();
+      break;
+    }
     case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION:
     {
       value = static_cast<int>(impl.mController->GetPrimaryCursorPosition());
@@ -1025,6 +1057,16 @@ Property::Value TextField::PropertyHandler::GetProperty(Toolkit::TextField textF
       value = impl.mController->GetEllipsisPosition();
       break;
     }
+    case Toolkit::DevelTextField::Property::STRIKETHROUGH:
+    {
+      GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
+      break;
+    }
+    case Toolkit::DevelTextField::Property::INPUT_STRIKETHROUGH:
+    {
+      GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT);
+      break;
+    }
   } //switch
   return value;
 }
index 9e15b34..9ef8ed1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -136,7 +136,9 @@ DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "textFit",
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "minLineSize",                  FLOAT,   MIN_LINE_SIZE                  )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "renderingBackend",             INTEGER, RENDERING_BACKEND              )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "fontSizeScale",                FLOAT,   FONT_SIZE_SCALE                )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "enableFontSizeScale",          BOOLEAN, ENABLE_FONT_SIZE_SCALE         )
 DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "ellipsisPosition",             INTEGER, ELLIPSIS_POSITION              )
+DALI_DEVEL_PROPERTY_REGISTRATION(Toolkit,           TextLabel, "strikethrough",                MAP,     STRIKETHROUGH                  )
 
 DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT(Toolkit, TextLabel, "textColor",      Color::BLACK,     TEXT_COLOR   )
 DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION(Toolkit,    TextLabel, "textColorRed",   TEXT_COLOR_RED,   TEXT_COLOR, 0)
@@ -508,6 +510,15 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
         }
         break;
       }
+      case Toolkit::DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE:
+      {
+        const bool enableFontSizeScale = value.Get<bool>();
+        if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale))
+        {
+          impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale);
+        }
+        break;
+      }
       case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION:
       {
         DevelText::EllipsisPosition::Type ellipsisPositionType(static_cast<DevelText::EllipsisPosition::Type>(-1)); // Set to invalid value to ensure a valid mode does get set
@@ -518,6 +529,11 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
         }
         break;
       }
+      case Toolkit::DevelTextLabel::Property::STRIKETHROUGH:
+      {
+        impl.mTextUpdateNeeded = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT) || impl.mTextUpdateNeeded;
+        break;
+      }
     }
 
     // Request relayout when text update is needed. It's necessary to call it
@@ -756,11 +772,21 @@ Property::Value TextLabel::GetProperty(BaseObject* object, Property::Index index
         value = impl.mController->GetFontSizeScale();
         break;
       }
+      case Toolkit::DevelTextLabel::Property::ENABLE_FONT_SIZE_SCALE:
+      {
+        value = impl.mController->IsFontSizeScaleEnabled();
+        break;
+      }
       case Toolkit::DevelTextLabel::Property::ELLIPSIS_POSITION:
       {
         value = impl.mController->GetEllipsisPosition();
         break;
       }
+      case Toolkit::DevelTextLabel::Property::STRIKETHROUGH:
+      {
+        GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT);
+        break;
+      }
     }
   }
 
@@ -1146,7 +1172,7 @@ Vector<Vector2> TextLabel::GetTextPosition(const uint32_t startIndex, const uint
   return mController->GetTextPosition(startIndex, endIndex);
 }
 
-std::string TextLabel::AccessibleImpl::GetNameRaw()
+std::string TextLabel::AccessibleImpl::GetNameRaw() const
 {
   auto self = Toolkit::TextLabel::DownCast(Self());
   return self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
@@ -1157,7 +1183,7 @@ Property::Index TextLabel::AccessibleImpl::GetNamePropertyIndex()
   return Toolkit::TextLabel::Property::TEXT;
 }
 
-std::string TextLabel::AccessibleImpl::GetText(size_t startOffset, size_t endOffset)
+std::string TextLabel::AccessibleImpl::GetText(size_t startOffset, size_t endOffset) const
 {
   if(endOffset <= startOffset)
   {
@@ -1175,7 +1201,7 @@ std::string TextLabel::AccessibleImpl::GetText(size_t startOffset, size_t endOff
   return text.substr(startOffset, endOffset - startOffset);
 }
 
-size_t TextLabel::AccessibleImpl::GetCharacterCount()
+size_t TextLabel::AccessibleImpl::GetCharacterCount() const
 {
   auto self = Toolkit::TextLabel::DownCast(Self());
   auto text = self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
@@ -1183,7 +1209,7 @@ size_t TextLabel::AccessibleImpl::GetCharacterCount()
   return text.size();
 }
 
-size_t TextLabel::AccessibleImpl::GetCursorOffset()
+size_t TextLabel::AccessibleImpl::GetCursorOffset() const
 {
   return {};
 }
@@ -1193,7 +1219,7 @@ bool TextLabel::AccessibleImpl::SetCursorOffset(size_t offset)
   return {};
 }
 
-Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary)
+Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary) const
 {
   auto self     = Toolkit::TextLabel::DownCast(Self());
   auto text     = self.GetProperty(Toolkit::TextLabel::Property::TEXT).Get<std::string>();
@@ -1284,7 +1310,7 @@ Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(size_t off
   return range;
 }
 
-Dali::Accessibility::Range TextLabel::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex)
+Dali::Accessibility::Range TextLabel::AccessibleImpl::GetRangeOfSelection(size_t selectionIndex) const
 {
   // Since DALi supports only one selection indexes higher than 0 are ignored
   if(selectionIndex > 0)
index 3f1080c..8bedc5b 100644 (file)
@@ -243,26 +243,26 @@ protected:
   /**
    * @brief This structure is to connect TextLabel with Accessible functions.
    */
-  struct AccessibleImpl : public DevelControl::AccessibleImpl,
+  struct AccessibleImpl : public DevelControl::ControlAccessible,
                           public virtual Dali::Accessibility::Text,
                           public virtual Dali::Accessibility::Hypertext
   {
-    using DevelControl::AccessibleImpl::AccessibleImpl;
+    using DevelControl::ControlAccessible::ControlAccessible;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetText()
      */
-    std::string GetText(size_t startOffset, size_t endOffset) override;
+    std::string GetText(size_t startOffset, size_t endOffset) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCharacterCount()
      */
-    size_t GetCharacterCount() override;
+    size_t GetCharacterCount() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetCursorOffset()
      */
-    size_t GetCursorOffset() override;
+    size_t GetCursorOffset() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::SetCursorOffset()
@@ -272,12 +272,12 @@ protected:
     /**
      * @copydoc Dali::Accessibility::Text::GetTextAtOffset()
      */
-    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) override;
+    Accessibility::Range GetTextAtOffset(size_t offset, Accessibility::TextBoundary boundary) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetRangeOfSelection()
      */
-    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) override;
+    Accessibility::Range GetRangeOfSelection(size_t selectionIndex) const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::RemoveSelection()
@@ -292,7 +292,7 @@ protected:
     /**
      * @copydoc Dali::Accessibility::Text::GetNameRaw()
      */
-    std::string GetNameRaw() override;
+    std::string GetNameRaw() const override;
 
     /**
      * @copydoc Dali::Accessibility::Text::GetNamePropertyIndex()
index e2d9f91..2ff1bd4 100644 (file)
@@ -399,7 +399,7 @@ void TextSelectionPopup::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::DIALOG, true));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::DIALOG, true));
   });
 
   //Enable highightability
index ba2b8d5..3220328 100644 (file)
@@ -166,7 +166,7 @@ void TextSelectionToolbar::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TOOL_BAR));
   });
 }
 
index 2aefaaf..0e894df 100644 (file)
@@ -313,7 +313,7 @@ void ToolBar::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(Self(), [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::TOOL_BAR));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::TOOL_BAR));
   });
 }
 
index 181a47e..9934f3b 100644 (file)
@@ -120,7 +120,7 @@ void VideoView::OnInitialize()
 
   DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
     return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new DevelControl::AccessibleImpl(actor, Dali::Accessibility::Role::VIDEO));
+      new DevelControl::ControlAccessible(actor, Dali::Accessibility::Role::VIDEO));
   });
 
   //Enable highightability
index 80cc0c5..0a8c129 100755 (executable)
@@ -183,6 +183,7 @@ void WebView::OnInitialize()
   Actor self = Self();
 
   self.SetProperty(Actor::Property::KEYBOARD_FOCUSABLE, true);
+  self.SetProperty(DevelActor::Property::TOUCH_FOCUSABLE, true);
   self.TouchedSignal().Connect(this, &WebView::OnTouchEvent);
   self.HoveredSignal().Connect(this, &WebView::OnHoverEvent);
   self.WheelEventSignal().Connect(this, &WebView::OnWheelEvent);
index d8506cb..ca42ca6 100644 (file)
@@ -1,6 +1,7 @@
 varying mediump vec2 vTexCoord;
 uniform sampler2D sTexture;
 uniform sampler2D sStyle;
+uniform sampler2D sOverlayStyle;
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
 
@@ -8,7 +9,8 @@ void main()
 {
   mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
   mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
+  mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
 
   // Draw the text as overlay above the style
-  gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * vec4( mixColor, 1.0 );
+  gl_FragColor = ( overlayStyleTexture + textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - textTexture.a ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
 }
index b892a17..0d82aa7 100644 (file)
@@ -1,6 +1,7 @@
 varying mediump vec2 vTexCoord;
 uniform sampler2D sTexture;
 uniform sampler2D sStyle;
+uniform sampler2D sOverlayStyle;
 uniform sampler2D sMask;
 uniform lowp float uHasMultipleTextColors;
 uniform lowp vec4 uTextColorAnimatable;
@@ -11,6 +12,7 @@ void main()
 {
   mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
   mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
+  mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
   mediump float maskTexture = texture2D( sMask, vTexCoord ).r;
 
   // Set the color of non-transparent pixel in text to what it is animated to.
@@ -20,5 +22,5 @@ void main()
   textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture * ( 1.0 - uHasMultipleTextColors ) );
 
   // Draw the text as overlay above the style
-  gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * vec4( mixColor, 1.0 );
+  gl_FragColor = ( overlayStyleTexture + textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - textTexture.a ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
 }
index f5d8b1c..cf93f15 100644 (file)
@@ -1,6 +1,7 @@
 varying mediump vec2 vTexCoord;
 uniform sampler2D sTexture;
 uniform sampler2D sStyle;
+uniform sampler2D sOverlayStyle;
 uniform lowp vec4 uTextColorAnimatable;
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
@@ -9,7 +10,8 @@ void main()
 {
   mediump float textTexture = texture2D( sTexture, vTexCoord ).r;
   mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );
+  mediump vec4 overlayStyleTexture = texture2D( sOverlayStyle, vTexCoord );
 
   // Draw the text as overlay above the style
-  gl_FragColor = ( uTextColorAnimatable * textTexture + styleTexture * ( 1.0 - uTextColorAnimatable.a * textTexture ) ) * uColor * vec4( mixColor, 1.0 );
-}
+  gl_FragColor = ( overlayStyleTexture + uTextColorAnimatable * textTexture * (1.0 - overlayStyleTexture.a) + styleTexture * ( 1.0 - uTextColorAnimatable.a * textTexture ) * (1.0 - overlayStyleTexture.a) ) * uColor * vec4( mixColor, 1.0 );
+}
\ No newline at end of file
index 7b08c47..2379bcc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -485,9 +485,9 @@ void GetCursorPosition(GetCursorPositionParameters& parameters,
   const GlyphInfo* const  glyphInfoBuffer          = parameters.visualModel->mGlyphs.Begin();
   CharacterIndex          index;
   GlyphMetrics            glyphMetrics;
-  MetricsPtr&             metrics = parameters.metrics;
-  GlyphIndex glyphIndex = 0u;
-  Length numberOfGlyphs = 0u;
+  MetricsPtr&             metrics        = parameters.metrics;
+  GlyphIndex              glyphIndex     = 0u;
+  Length                  numberOfGlyphs = 0u;
 
   if(isLastNewParagraph)
   {
@@ -503,8 +503,12 @@ void GetCursorPosition(GetCursorPositionParameters& parameters,
 
     cursorInfo.lineHeight = GetLineHeight(newLine);
 
+    index                                = 0u;
     const Length totalNumberOfCharacters = parameters.logicalModel->mText.Count();
-    index                                = totalNumberOfCharacters - 1;
+    if(totalNumberOfCharacters > 0u)
+    {
+      index = totalNumberOfCharacters - 1u;
+    }
 
     GetGlyphMetricsFromCharacterIndex(index, glyphInfoBuffer, charactersToGlyphBuffer, glyphsPerCharacterBuffer, metrics, glyphMetrics, glyphIndex, numberOfGlyphs);
 
index de3a1f2..fed87e8 100644 (file)
@@ -37,18 +37,19 @@ struct InputStyle
 {
   enum Mask
   {
-    NONE               = 0x0000,
-    INPUT_COLOR        = 0x0001,
-    INPUT_FONT_FAMILY  = 0x0002,
-    INPUT_POINT_SIZE   = 0x0004,
-    INPUT_FONT_WEIGHT  = 0x0008,
-    INPUT_FONT_WIDTH   = 0x0010,
-    INPUT_FONT_SLANT   = 0x0020,
-    INPUT_LINE_SPACING = 0x0040,
-    INPUT_UNDERLINE    = 0x0080,
-    INPUT_SHADOW       = 0x0100,
-    INPUT_EMBOSS       = 0x0200,
-    INPUT_OUTLINE      = 0x0400
+    NONE                = 0x0000,
+    INPUT_COLOR         = 0x0001,
+    INPUT_FONT_FAMILY   = 0x0002,
+    INPUT_POINT_SIZE    = 0x0004,
+    INPUT_FONT_WEIGHT   = 0x0008,
+    INPUT_FONT_WIDTH    = 0x0010,
+    INPUT_FONT_SLANT    = 0x0020,
+    INPUT_LINE_SPACING  = 0x0040,
+    INPUT_UNDERLINE     = 0x0080,
+    INPUT_SHADOW        = 0x0100,
+    INPUT_EMBOSS        = 0x0200,
+    INPUT_OUTLINE       = 0x0400,
+    INPUT_STRIKETHROUGH = 0x0800
   };
 
   InputStyle()
@@ -63,6 +64,7 @@ struct InputStyle
     shadowProperties(),
     embossProperties(),
     outlineProperties(),
+    strikethroughProperties(),
     isDefaultColor(true),
     isFamilyDefined(false),
     isWeightDefined(false),
@@ -73,7 +75,8 @@ struct InputStyle
     isUnderlineDefined(false),
     isShadowDefined(false),
     isEmbossDefined(false),
-    isOutlineDefined(false)
+    isOutlineDefined(false),
+    isStrikethroughDefined(false)
   {
   }
 
@@ -118,6 +121,9 @@ struct InputStyle
 
     isOutlineDefined  = inputStyle.isOutlineDefined;
     outlineProperties = inputStyle.outlineProperties;
+
+    isStrikethroughDefined  = inputStyle.isStrikethroughDefined;
+    strikethroughProperties = inputStyle.strikethroughProperties;
   }
 
   /**
@@ -148,7 +154,8 @@ struct InputStyle
        (underlineProperties != inputStyle.underlineProperties) ||
        (shadowProperties != inputStyle.shadowProperties) ||
        (embossProperties != inputStyle.embossProperties) ||
-       (outlineProperties != inputStyle.outlineProperties))
+       (outlineProperties != inputStyle.outlineProperties) ||
+       (isStrikethroughDefined != inputStyle.isStrikethroughDefined))
     {
       return false;
     }
@@ -204,6 +211,10 @@ struct InputStyle
     {
       mask = static_cast<Mask>(mask | INPUT_OUTLINE);
     }
+    if(strikethroughProperties != inputStyle.strikethroughProperties)
+    {
+      mask = static_cast<Mask>(mask | INPUT_STRIKETHROUGH);
+    }
 
     return mask;
   }
@@ -217,10 +228,11 @@ struct InputStyle
 
   float lineSpacing; ///< The line's spacing.
 
-  std::string underlineProperties; ///< The underline properties string.
-  std::string shadowProperties;    ///< The shadow properties string.
-  std::string embossProperties;    ///< The emboss properties string.
-  std::string outlineProperties;   ///< The outline properties string.
+  std::string underlineProperties;     ///< The underline properties string.
+  std::string shadowProperties;        ///< The shadow properties string.
+  std::string embossProperties;        ///< The emboss properties string.
+  std::string outlineProperties;       ///< The outline properties string.
+  std::string strikethroughProperties; ///< The strikethrough properties string.
 
   bool isDefaultColor : 1;  ///< Whether the text's color is the default.
   bool isFamilyDefined : 1; ///< Whether the font's family is defined.
@@ -229,11 +241,12 @@ struct InputStyle
   bool isSlantDefined : 1;  ///< Whether the font's slant is defined.
   bool isSizeDefined : 1;   ///< Whether the font's size is defined.
 
-  bool isLineSpacingDefined : 1; ///< Whether the line spacing is defined.
-  bool isUnderlineDefined : 1;   ///< Whether the underline parameters are defined.
-  bool isShadowDefined : 1;      ///< Whether the shadow parameters are defined.
-  bool isEmbossDefined : 1;      ///< Whether the emboss parameters are defined.
-  bool isOutlineDefined : 1;     ///< Whether the outline parameters are defined.
+  bool isLineSpacingDefined : 1;   ///< Whether the line spacing is defined.
+  bool isUnderlineDefined : 1;     ///< Whether the underline parameters are defined.
+  bool isShadowDefined : 1;        ///< Whether the shadow parameters are defined.
+  bool isEmbossDefined : 1;        ///< Whether the emboss parameters are defined.
+  bool isOutlineDefined : 1;       ///< Whether the outline parameters are defined.
+  bool isStrikethroughDefined : 1; ///< Whether the strikethrough parameters are defined.
 };
 
 } // namespace Text
index ef80844..626ce33 100644 (file)
@@ -70,7 +70,7 @@ struct AtlasRenderer::Impl
   };
 
   /**
-   * brief Struct used to generate the underline mesh.
+   * brief Struct used to generate the underline/striketthrough mesh.
    * There is one Extent per line of text.
    */
   struct Extent
@@ -80,9 +80,10 @@ struct AtlasRenderer::Impl
       mLeft(0.0f),
       mRight(0.0f),
       mUnderlinePosition(0.0f),
-      mUnderlineThickness(0.0f),
+      mLineThickness(0.0f),
       mMeshRecordIndex(0u),
-      mUnderlineChunkId(0u)
+      mUnderlineChunkId(0u),
+      mStrikethroughPosition(0.0f)
     {
     }
 
@@ -90,9 +91,10 @@ struct AtlasRenderer::Impl
     float    mLeft;
     float    mRight;
     float    mUnderlinePosition;
-    float    mUnderlineThickness;
+    float    mLineThickness;
     uint32_t mMeshRecordIndex;
     uint32_t mUnderlineChunkId;
+    float    mStrikethroughPosition;
   };
 
   struct MaxBlockSize
@@ -283,27 +285,31 @@ struct AtlasRenderer::Impl
                     const Vector4&           color,
                     uint16_t                 outline,
                     AtlasManager::AtlasSlot& slot,
-                    bool                     underlineGlyph,
+                    bool                     decorationlineGlyph,
                     float                    currentUnderlinePosition,
-                    float                    currentUnderlineThickness,
+                    float                    currentlineThickness,
                     std::vector<MeshRecord>& meshContainer,
                     Vector<TextCacheEntry>&  newTextCache,
                     Vector<Extent>&          extents,
-                    uint32_t                 underlineChunkId)
+                    uint32_t                 underlineChunkId,
+                    bool                     isGlyphCached)
   {
     // Generate mesh data for this quad, plugging in our supplied position
     AtlasManager::Mesh2D newMesh;
     mGlyphManager.GenerateMeshData(slot.mImageId, position, newMesh);
 
-    TextCacheEntry textCacheEntry;
-    textCacheEntry.mFontId       = glyph.fontId;
-    textCacheEntry.mImageId      = slot.mImageId;
-    textCacheEntry.mIndex        = glyph.index;
-    textCacheEntry.mOutlineWidth = outline;
-    textCacheEntry.isItalic      = glyph.isItalicRequired;
-    textCacheEntry.isBold        = glyph.isBoldRequired;
-
-    newTextCache.PushBack(textCacheEntry);
+    if(!isGlyphCached)
+    {
+      TextCacheEntry textCacheEntry;
+      textCacheEntry.mFontId       = glyph.fontId;
+      textCacheEntry.mImageId      = slot.mImageId;
+      textCacheEntry.mIndex        = glyph.index;
+      textCacheEntry.mOutlineWidth = outline;
+      textCacheEntry.isItalic      = glyph.isItalicRequired;
+      textCacheEntry.isBold        = glyph.isBoldRequired;
+
+      newTextCache.PushBack(textCacheEntry);
+    }
 
     AtlasManager::Vertex2D* verticesBuffer = newMesh.mVertices.Begin();
 
@@ -322,11 +328,12 @@ struct AtlasRenderer::Impl
                    newMesh,
                    extents,
                    position.y + glyph.yBearing,
-                   underlineGlyph,
+                   decorationlineGlyph,
                    currentUnderlinePosition,
-                   currentUnderlineThickness,
+                   currentlineThickness,
                    slot,
-                   underlineChunkId);
+                   underlineChunkId,
+                   position.y + (glyph.height * HALF));
   }
 
   void CreateActors(const std::vector<MeshRecord>& meshContainer,
@@ -416,6 +423,7 @@ struct AtlasRenderer::Impl
     std::vector<MeshRecord> meshContainer;
     std::vector<MeshRecord> meshContainerOutline;
     Vector<Extent>          extents;
+    Vector<Extent>          strikethroughExtents;
     mDepth = depth;
 
     const Vector2&   textSize(view.GetLayoutSize());
@@ -427,10 +435,13 @@ struct AtlasRenderer::Impl
     const float      underlineHeight = view.GetUnderlineHeight();
     const uint16_t   outlineWidth    = view.GetOutlineWidth();
     const Vector4&   outlineColor(view.GetOutlineColor());
-    const bool       isOutline     = 0u != outlineWidth;
-    const GlyphInfo* hyphens       = view.GetHyphens();
-    const Length*    hyphenIndices = view.GetHyphenIndices();
-    const Length     hyphensCount  = view.GetHyphensCount();
+    const bool       isOutline            = 0u != outlineWidth;
+    const GlyphInfo* hyphens              = view.GetHyphens();
+    const Length*    hyphenIndices        = view.GetHyphenIndices();
+    const Length     hyphensCount         = view.GetHyphensCount();
+    const bool       strikethroughEnabled = view.IsStrikethroughEnabled();
+    const Vector4&   strikethroughColor(view.GetStrikethroughColor());
+    const float      strikethroughHeight = view.GetStrikethroughHeight();
 
     // Elided text info. Indices according to elided text.
     const auto startIndexOfGlyphs              = view.GetStartIndexOfElidedGlyphs();
@@ -448,12 +459,14 @@ struct AtlasRenderer::Impl
                           numberOfUnderlineRuns);
 
     bool thereAreUnderlinedGlyphs = false;
+    bool strikethroughGlyphsExist = false;
 
-    float  currentUnderlinePosition  = ZERO;
-    float  currentUnderlineThickness = underlineHeight;
-    FontId lastFontId                = 0;
-    FontId lastUnderlinedFontId      = 0;
-    Style  style                     = STYLE_NORMAL;
+    float  currentUnderlinePosition      = ZERO;
+    float  currentUnderlineThickness     = underlineHeight;
+    float  currentStrikethroughThickness = strikethroughHeight;
+    FontId lastFontId                    = 0;
+    FontId lastUnderlinedFontId          = 0;
+    Style  style                         = STYLE_NORMAL;
 
     if(fabsf(shadowOffset.x) > Math::MACHINE_EPSILON_1 || fabsf(shadowOffset.y) > Math::MACHINE_EPSILON_1)
     {
@@ -499,12 +512,13 @@ struct AtlasRenderer::Impl
 
       const bool isGlyphUnderlined = underlineEnabled || IsGlyphUnderlined(i, underlineRuns);
       thereAreUnderlinedGlyphs     = thereAreUnderlinedGlyphs || isGlyphUnderlined;
+      strikethroughGlyphsExist     = strikethroughGlyphsExist || strikethroughEnabled;
 
       // No operation for white space
       if(glyph.width && glyph.height)
       {
         // Are we still using the same fontId as previous
-        if(isGlyphUnderlined && (glyph.fontId != lastUnderlinedFontId))
+        if((isGlyphUnderlined || strikethroughGlyphsExist) && (glyph.fontId != lastUnderlinedFontId))
         {
           // We need to fetch fresh font underline metrics
           FontMetrics fontMetrics;
@@ -527,6 +541,19 @@ struct AtlasRenderer::Impl
             }
           }
 
+          if(fabsf(strikethroughHeight) < Math::MACHINE_EPSILON_1000)
+          {
+            // Ensure strikethrough will be at least a pixel high
+            if(currentStrikethroughThickness < ONE)
+            {
+              currentStrikethroughThickness = ONE;
+            }
+            else
+            {
+              currentStrikethroughThickness = ceil(currentStrikethroughThickness);
+            }
+          }
+
           // Clamp the underline position at the font descender and check for ( as EFL describes it ) a broken font
           if(currentUnderlinePosition > descender)
           {
@@ -594,7 +621,25 @@ struct AtlasRenderer::Impl
                        meshContainer,
                        newTextCache,
                        extents,
-                       underlineChunkId);
+                       underlineChunkId,
+                       false);
+
+          if(strikethroughGlyphsExist)
+          {
+            GenerateMesh(glyph,
+                         positionPlusOutlineOffset,
+                         color,
+                         NO_OUTLINE,
+                         slot,
+                         strikethroughGlyphsExist,
+                         0.0f,
+                         currentStrikethroughThickness,
+                         meshContainer,
+                         newTextCache,
+                         strikethroughExtents,
+                         0u,
+                         true);
+          }
 
           lastFontId = glyph.fontId; // Prevents searching for existing blocksizes when string of the same fontId.
         }
@@ -612,7 +657,8 @@ struct AtlasRenderer::Impl
                        meshContainerOutline,
                        newTextCache,
                        extents,
-                       0u);
+                       0u,
+                       false);
         }
 
         //The new underlined chunk. Add new id if they are not consecutive indices (this is for Markup case)
@@ -641,6 +687,12 @@ struct AtlasRenderer::Impl
       GenerateUnderlines(meshContainer, extents, underlineColor);
     }
 
+    if(strikethroughGlyphsExist)
+    {
+      // Check to see if any of the text needs a strikethrough
+      GenerateStrikethrough(meshContainer, strikethroughExtents, strikethroughColor);
+    }
+
     // For each MeshData object, create a mesh actor and add to the renderable actor
     bool isShadowDrawn = false;
     if(!meshContainerOutline.empty())
@@ -775,11 +827,12 @@ struct AtlasRenderer::Impl
                       AtlasManager::Mesh2D&    newMesh,
                       Vector<Extent>&          extents,
                       float                    baseLine,
-                      bool                     underlineGlyph,
+                      bool                     decorationlineGlyph,
                       float                    underlinePosition,
-                      float                    underlineThickness,
+                      float                    lineThickness,
                       AtlasManager::AtlasSlot& slot,
-                      uint32_t                 underlineChunkId)
+                      uint32_t                 underlineChunkId,
+                      float                    strikethroughPosition)
   {
     if(slot.mImageId)
     {
@@ -798,7 +851,7 @@ struct AtlasRenderer::Impl
           // Append the mesh to the existing mesh and adjust any extents
           Toolkit::Internal::AtlasMeshFactory::AppendMesh(mIt->mMesh, newMesh);
 
-          if(underlineGlyph)
+          if(decorationlineGlyph)
           {
             AdjustExtents(extents,
                           meshContainer,
@@ -807,8 +860,9 @@ struct AtlasRenderer::Impl
                           right,
                           baseLine,
                           underlinePosition,
-                          underlineThickness,
-                          underlineChunkId);
+                          lineThickness,
+                          underlineChunkId,
+                          strikethroughPosition);
           }
 
           return;
@@ -821,7 +875,7 @@ struct AtlasRenderer::Impl
       meshRecord.mMesh    = newMesh;
       meshContainer.push_back(meshRecord);
 
-      if(underlineGlyph)
+      if(decorationlineGlyph)
       {
         // Adjust extents for this new meshrecord
         AdjustExtents(extents,
@@ -831,8 +885,9 @@ struct AtlasRenderer::Impl
                       right,
                       baseLine,
                       underlinePosition,
-                      underlineThickness,
-                      underlineChunkId);
+                      lineThickness,
+                      underlineChunkId,
+                      strikethroughPosition);
       }
     }
   }
@@ -844,8 +899,9 @@ struct AtlasRenderer::Impl
                      float                    right,
                      float                    baseLine,
                      float                    underlinePosition,
-                     float                    underlineThickness,
-                     uint32_t                 underlineChunkId)
+                     float                    lineThickness,
+                     uint32_t                 underlineChunkId,
+                     float                    strikethroughPosition)
   {
     bool foundExtent = false;
     for(Vector<Extent>::Iterator eIt    = extents.Begin(),
@@ -869,22 +925,23 @@ struct AtlasRenderer::Impl
         {
           eIt->mUnderlinePosition = underlinePosition;
         }
-        if(underlineThickness > eIt->mUnderlineThickness)
+        if(lineThickness > eIt->mLineThickness)
         {
-          eIt->mUnderlineThickness = underlineThickness;
+          eIt->mLineThickness = lineThickness;
         }
       }
     }
     if(!foundExtent)
     {
       Extent extent;
-      extent.mLeft               = left;
-      extent.mRight              = right;
-      extent.mBaseLine           = baseLine;
-      extent.mUnderlinePosition  = underlinePosition;
-      extent.mUnderlineThickness = underlineThickness;
-      extent.mMeshRecordIndex    = index;
-      extent.mUnderlineChunkId   = underlineChunkId;
+      extent.mLeft                  = left;
+      extent.mRight                 = right;
+      extent.mBaseLine              = baseLine;
+      extent.mUnderlinePosition     = underlinePosition;
+      extent.mMeshRecordIndex       = index;
+      extent.mUnderlineChunkId      = underlineChunkId;
+      extent.mLineThickness         = lineThickness;
+      extent.mStrikethroughPosition = strikethroughPosition;
       extents.PushBack(extent);
     }
   }
@@ -945,7 +1002,7 @@ struct AtlasRenderer::Impl
       // Make sure we don't hit texture edge for single pixel texture ( filled pixel is in top left of every atlas )
       float u         = HALF / uv.x;
       float v         = HALF / uv.y;
-      float thickness = eIt->mUnderlineThickness;
+      float thickness = eIt->mLineThickness;
       float baseLine  = eIt->mBaseLine + eIt->mUnderlinePosition - (thickness * HALF);
       float tlx       = eIt->mLeft;
       float brx       = eIt->mRight;
@@ -989,6 +1046,68 @@ struct AtlasRenderer::Impl
     }
   }
 
+  void GenerateStrikethrough(std::vector<MeshRecord>& meshRecords,
+                             Vector<Extent>&          extents,
+                             const Vector4&           strikethroughColor)
+  {
+    AtlasManager::Mesh2D newMesh;
+    unsigned short       faceIndex = 0;
+    for(Vector<Extent>::ConstIterator eIt    = extents.Begin(),
+                                      eEndIt = extents.End();
+        eIt != eEndIt;
+        ++eIt)
+    {
+      AtlasManager::Vertex2D vert;
+      uint32_t               index = eIt->mMeshRecordIndex;
+      Vector2                uv    = mGlyphManager.GetAtlasSize(meshRecords[index].mAtlasId);
+
+      // Make sure we don't hit texture edge for single pixel texture ( filled pixel is in top left of every atlas )
+      float u                     = HALF / uv.x;
+      float v                     = HALF / uv.y;
+      float thickness             = eIt->mLineThickness;
+      float tlx                   = eIt->mLeft;
+      float brx                   = eIt->mRight;
+      float strikethroughPosition = eIt->mStrikethroughPosition;
+
+      vert.mPosition.x  = tlx;
+      vert.mPosition.y  = strikethroughPosition;
+      vert.mTexCoords.x = ZERO;
+      vert.mTexCoords.y = ZERO;
+      vert.mColor       = strikethroughColor;
+      newMesh.mVertices.PushBack(vert);
+
+      vert.mPosition.x  = brx;
+      vert.mPosition.y  = strikethroughPosition;
+      vert.mTexCoords.x = u;
+      vert.mColor       = strikethroughColor;
+      newMesh.mVertices.PushBack(vert);
+
+      vert.mPosition.x  = tlx;
+      vert.mPosition.y  = strikethroughPosition + thickness;
+      vert.mTexCoords.x = ZERO;
+      vert.mTexCoords.y = v;
+      vert.mColor       = strikethroughColor;
+      newMesh.mVertices.PushBack(vert);
+
+      vert.mPosition.x  = brx;
+      vert.mPosition.y  = strikethroughPosition + thickness;
+      vert.mTexCoords.x = u;
+      vert.mColor       = strikethroughColor;
+      newMesh.mVertices.PushBack(vert);
+
+      // Six indices in counter clockwise winding
+      newMesh.mIndices.PushBack(faceIndex + 1u);
+      newMesh.mIndices.PushBack(faceIndex);
+      newMesh.mIndices.PushBack(faceIndex + 2u);
+      newMesh.mIndices.PushBack(faceIndex + 2u);
+      newMesh.mIndices.PushBack(faceIndex + 3u);
+      newMesh.mIndices.PushBack(faceIndex + 1u);
+      faceIndex += 4;
+
+      Toolkit::Internal::AtlasMeshFactory::AppendMesh(meshRecords[index].mMesh, newMesh);
+    }
+  }
+
   Actor                       mActor;            ///< The actor parent which renders the text
   AtlasGlyphManager           mGlyphManager;     ///< Glyph Manager to handle upload and caching
   TextAbstraction::FontClient mFontClient;       ///< The font client used to supply glyph information
index cea2a19..152b732 100644 (file)
@@ -35,6 +35,7 @@ namespace Text
 {
 namespace
 {
+const float HALF(0.5f);
 /**
  * @brief Data struct used to set the buffer of the glyph's bitmap into the final bitmap's buffer.
  */
@@ -275,14 +276,17 @@ bool IsGlyphUnderlined(GlyphIndex              index,
 }
 
 /// Helper method to fetch the underline metrics for the specified font glyph
-void FetchFontUnderlineMetrics(
+void FetchFontDecorationlinesMetrics(
   TextAbstraction::FontClient& fontClient,
   const GlyphInfo* const       glyphInfo,
   float&                       currentUnderlinePosition,
   const float                  underlineHeight,
   float&                       currentUnderlineThickness,
   float&                       maxUnderlineThickness,
-  FontId&                      lastUnderlinedFontId)
+  FontId&                      lastlinedFontId,
+  const float                  strikethroughHeight,
+  float&                       currentStrikethroughThickness,
+  float&                       maxStrikethroughThickness)
 {
   FontMetrics fontMetrics;
   fontClient.GetFontMetrics(glyphInfo->fontId, fontMetrics);
@@ -304,12 +308,31 @@ void FetchFontUnderlineMetrics(
     }
   }
 
+  if(fabsf(strikethroughHeight) < Math::MACHINE_EPSILON_1000)
+  {
+    // Ensure strikethrough will be at least a pixel high
+    if(currentStrikethroughThickness < 1.0f)
+    {
+      currentStrikethroughThickness = 1.0f;
+    }
+    else
+    {
+      currentStrikethroughThickness = ceil(currentStrikethroughThickness);
+    }
+  }
+
   // The underline thickness should be the max underline thickness of all glyphs of the line.
   if(currentUnderlineThickness > maxUnderlineThickness)
   {
     maxUnderlineThickness = currentUnderlineThickness;
   }
 
+  // The strikethrough thickness should be the max strikethrough thickness of all glyphs of the line.
+  if(currentStrikethroughThickness > maxStrikethroughThickness)
+  {
+    maxStrikethroughThickness = currentStrikethroughThickness;
+  }
+
   // Clamp the underline position at the font descender and check for ( as EFL describes it ) a broken font
   if(currentUnderlinePosition > descender)
   {
@@ -322,7 +345,7 @@ void FetchFontUnderlineMetrics(
     currentUnderlinePosition = 1.0f;
   }
 
-  lastUnderlinedFontId = glyphInfo->fontId;
+  lastlinedFontId = glyphInfo->fontId;
 }
 
 /// Draws the specified color to the pixel buffer
@@ -527,6 +550,42 @@ Devel::PixelBuffer DrawGlyphsBackground(const ViewModel* model, Devel::PixelBuff
   return glyphData.bitmapBuffer;
 }
 
+/// Draws the specified strikethrough color to the buffer
+void DrawStrikethrough(
+  const Vector4&     strikethroughColor,
+  const unsigned int bufferWidth,
+  const unsigned int bufferHeight,
+  GlyphData&         glyphData,
+  const float        baseline,
+  const LineRun&     line,
+  const float        maxStrikethroughThickness,
+  const float        lineExtentLeft,
+  const float        lineExtentRight,
+  float              strikethroughStartingYPosition)
+{
+  uint32_t* bitmapBuffer = reinterpret_cast<uint32_t*>(glyphData.bitmapBuffer.GetBuffer());
+
+  for(unsigned int y = strikethroughStartingYPosition; y < strikethroughStartingYPosition + maxStrikethroughThickness; y++)
+  {
+    if(y > bufferHeight - 1)
+    {
+      // Do not write out of bounds.
+      break;
+    }
+
+    for(unsigned int x = glyphData.horizontalOffset + lineExtentLeft; x <= glyphData.horizontalOffset + lineExtentRight; x++)
+    {
+      if(x > bufferWidth - 1)
+      {
+        // Do not write out of bounds.
+        break;
+      }
+
+      WriteColorToPixelBuffer(glyphData, bitmapBuffer, strikethroughColor, x, y);
+    }
+  }
+}
+
 } // namespace
 
 TypesetterPtr Typesetter::New(const ModelInterface* const model)
@@ -659,7 +718,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
     // Generate the image buffer as an alpha mask for color glyphs.
     imageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_MASK, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
   }
-  else if(RENDER_NO_TEXT == behaviour)
+  else if(RENDER_NO_TEXT == behaviour || RENDER_OVERLAY_STYLE == behaviour)
   {
     // Generate an empty image buffer so that it can been combined with the image buffers for styles
     imageBuffer = Devel::PixelBuffer::New(bufferWidth, bufferHeight, Pixel::RGBA8888);
@@ -675,7 +734,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
   {
     // Generate the outline if enabled
     const uint16_t outlineWidth = mModel->GetOutlineWidth();
-    if(outlineWidth != 0u)
+    if(outlineWidth != 0u && RENDER_OVERLAY_STYLE != behaviour)
     {
       // Create the image buffer for outline
       Devel::PixelBuffer outlineImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_OUTLINE, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
@@ -688,7 +747,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
 
     // Generate the shadow if enabled
     const Vector2& shadowOffset = mModel->GetShadowOffset();
-    if(fabsf(shadowOffset.x) > Math::MACHINE_EPSILON_1 || fabsf(shadowOffset.y) > Math::MACHINE_EPSILON_1)
+    if(RENDER_OVERLAY_STYLE != behaviour && (fabsf(shadowOffset.x) > Math::MACHINE_EPSILON_1 || fabsf(shadowOffset.y) > Math::MACHINE_EPSILON_1))
     {
       // Create the image buffer for shadow
       Devel::PixelBuffer shadowImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_SHADOW, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
@@ -707,7 +766,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
 
     // Generate the underline if enabled
     const bool underlineEnabled = mModel->IsUnderlineEnabled();
-    if(underlineEnabled)
+    if(underlineEnabled && RENDER_OVERLAY_STYLE == behaviour)
     {
       // Create the image buffer for underline
       Devel::PixelBuffer underlineImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_UNDERLINE, ignoreHorizontalAlignment, pixelFormat, penX, penY, startIndexOfGlyphs, endIndexOfGlyphs);
@@ -719,7 +778,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
     // Generate the background if enabled
     const bool backgroundEnabled   = mModel->IsBackgroundEnabled();
     const bool backgroundMarkupSet = mModel->IsMarkupBackgroundColorSet();
-    if(backgroundEnabled || backgroundMarkupSet)
+    if((backgroundEnabled || backgroundMarkupSet) && RENDER_OVERLAY_STYLE != behaviour)
     {
       Devel::PixelBuffer backgroundImageBuffer;
 
@@ -741,6 +800,17 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
       imageBuffer = CombineImageBuffer(imageBuffer, backgroundImageBuffer, bufferWidth, bufferHeight);
     }
 
+    // Generate the strikethrough if enabled
+    const bool strikethroughEnabled = mModel->IsStrikethroughEnabled();
+    if(strikethroughEnabled && RENDER_OVERLAY_STYLE == behaviour)
+    {
+      // Create the image buffer for strikethrough
+      Devel::PixelBuffer strikethroughImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, Typesetter::STYLE_STRIKETHROUGH, ignoreHorizontalAlignment, pixelFormat, penX, penY, 0u, endIndexOfGlyphs);
+
+      // Combine the two buffers
+      imageBuffer = CombineImageBuffer(imageBuffer, strikethroughImageBuffer, bufferWidth, bufferHeight);
+    }
+
     // Markup-Processor
 
     imageBuffer = ApplyMarkupProcessorOnPixelBuffer(imageBuffer, bufferWidth, bufferHeight, ignoreHorizontalAlignment, pixelFormat, penX, penY);
@@ -834,6 +904,10 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
     const Vector4& underlineColor   = mModel->GetUnderlineColor();
     const float    underlineHeight  = mModel->GetUnderlineHeight();
 
+    const bool     strikethroughEnabled = mModel->IsStrikethroughEnabled();
+    const Vector4& strikethroughColor   = mModel->GetStrikethroughColor();
+    const float    strikethroughHeight  = mModel->GetStrikethroughHeight();
+
     // Get the underline runs.
     const Length     numberOfUnderlineRuns = mModel->GetNumberOfUnderlineRuns();
     Vector<GlyphRun> underlineRuns;
@@ -841,10 +915,14 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
     mModel->GetUnderlineRuns(underlineRuns.Begin(), 0u, numberOfUnderlineRuns);
 
     bool thereAreUnderlinedGlyphs = false;
+    bool strikethroughGlyphsExist = false;
 
-    float currentUnderlinePosition  = 0.0f;
-    float currentUnderlineThickness = underlineHeight;
-    float maxUnderlineThickness     = currentUnderlineThickness;
+    float currentUnderlinePosition       = 0.0f;
+    float currentUnderlineThickness      = underlineHeight;
+    float maxUnderlineThickness          = currentUnderlineThickness;
+    float currentStrikethroughThickness  = strikethroughHeight;
+    float maxStrikethroughThickness      = currentStrikethroughThickness;
+    float strikethroughStartingYPosition = 0.0f;
 
     FontId lastUnderlinedFontId = 0;
 
@@ -908,11 +986,13 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
       const bool underlineGlyph = underlineEnabled || IsGlyphUnderlined(glyphIndex, underlineRuns);
       thereAreUnderlinedGlyphs  = thereAreUnderlinedGlyphs || underlineGlyph;
 
+      strikethroughGlyphsExist = strikethroughGlyphsExist || strikethroughEnabled;
+
       // Are we still using the same fontId as previous
-      if(underlineGlyph && (glyphInfo->fontId != lastUnderlinedFontId))
+      if((strikethroughEnabled || underlineGlyph) && (glyphInfo->fontId != lastUnderlinedFontId))
       {
         // We need to fetch fresh font underline metrics
-        FetchFontUnderlineMetrics(fontClient, glyphInfo, currentUnderlinePosition, underlineHeight, currentUnderlineThickness, maxUnderlineThickness, lastUnderlinedFontId);
+        FetchFontDecorationlinesMetrics(fontClient, glyphInfo, currentUnderlinePosition, underlineHeight, currentUnderlineThickness, maxUnderlineThickness, lastUnderlinedFontId, strikethroughHeight, currentStrikethroughThickness, maxStrikethroughThickness);
       } // underline
 
       // Retrieves the glyph's position.
@@ -974,7 +1054,7 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
         outlineWidth = 0.0f;
       }
 
-      if(style != Typesetter::STYLE_UNDERLINE)
+      if(style != Typesetter::STYLE_UNDERLINE && style != Typesetter::STYLE_STRIKETHROUGH)
       {
         fontClient.CreateBitmap(glyphInfo->fontId,
                                 glyphInfo->index,
@@ -1040,6 +1120,14 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
       DrawBackgroundColor(mModel->GetBackgroundColor(), bufferWidth, bufferHeight, glyphData, baseline, line, lineExtentLeft, lineExtentRight);
     }
 
+    // Draw the strikethrough from the leftmost glyph to the rightmost glyph
+    if(strikethroughGlyphsExist && style == Typesetter::STYLE_STRIKETHROUGH)
+    {
+      //TODO : The currently implemented strikethrough creates a strikethrough on the line level. We need to create different strikethroughs the case of glyphs with different sizes.
+      strikethroughStartingYPosition = (glyphData.verticalOffset + baseline + currentUnderlinePosition) - ((line.ascender) * HALF); // Since Free Type font doesn't contain the strikethrough-position property, strikethrough position will be calculated by moving the underline position upwards by half the value of the line height.
+      DrawStrikethrough(strikethroughColor, bufferWidth, bufferHeight, glyphData, baseline, line, maxStrikethroughThickness, lineExtentLeft, lineExtentRight, strikethroughStartingYPosition);
+    }
+
     // Increases the vertical offset with the line's descender.
     glyphData.verticalOffset += static_cast<int>(-line.descender);
   }
index ee57e29..51ac259 100644 (file)
@@ -51,9 +51,10 @@ public:
   enum RenderBehaviour
   {
     RENDER_TEXT_AND_STYLES, ///< Render both the text and its styles
-    RENDER_NO_TEXT,         ///< Do not render the text itself
+    RENDER_NO_TEXT,         ///< Do not render the text itself but render the background styles such as outline and background.
     RENDER_NO_STYLES,       ///< Do not render any styles
-    RENDER_MASK             ///< Render an alpha mask (for color glyphs with no color animation, e.g. emoji)
+    RENDER_MASK,            ///< Render an alpha mask (for color glyphs with no color animation, e.g. emoji)
+    RENDER_OVERLAY_STYLE    ///< Do not render the text itself but render the style but overlay the style on the text (foreground styles such as strikethrough and underline)
   };
 
   /**
@@ -61,13 +62,14 @@ public:
    */
   enum Style
   {
-    STYLE_NONE,        ///< No style
-    STYLE_MASK,        ///< Alpha mask
-    STYLE_SHADOW,      ///< Hard shadow
-    STYLE_SOFT_SHADOW, ///< Soft shadow
-    STYLE_UNDERLINE,   ///< Underline
-    STYLE_OUTLINE,     ///< Outline
-    STYLE_BACKGROUND   ///< Text background
+    STYLE_NONE,         ///< No style
+    STYLE_MASK,         ///< Alpha mask
+    STYLE_SHADOW,       ///< Hard shadow
+    STYLE_SOFT_SHADOW,  ///< Soft shadow
+    STYLE_UNDERLINE,    ///< Underline
+    STYLE_OUTLINE,      ///< Outline
+    STYLE_BACKGROUND,   ///< Text background
+    STYLE_STRIKETHROUGH ///< Strikethrough
   };
 
 public: // Constructor.
@@ -215,4 +217,4 @@ private:
 
 } // namespace Dali
 
-#endif // DALI_TOOLKIT_TEXT_TYPESETTER_H
+#endif // DALI_TOOLKIT_TEXT_TYPESETTER_H
\ No newline at end of file
index 2187487..0557e09 100644 (file)
@@ -583,6 +583,21 @@ void ViewModel::ElideGlyphs()
   }
 }
 
+float ViewModel::GetStrikethroughHeight() const
+{
+  return mModel->GetStrikethroughHeight();
+}
+
+const Vector4& ViewModel::GetStrikethroughColor() const
+{
+  return mModel->GetStrikethroughColor();
+}
+
+bool ViewModel::IsStrikethroughEnabled() const
+{
+  return mModel->IsStrikethroughEnabled();
+}
+
 } // namespace Text
 
 } // namespace Toolkit
index fd83b62..b95dfab 100644 (file)
@@ -272,6 +272,12 @@ public:
    */
   void ElideGlyphs();
 
+  float GetStrikethroughHeight() const override;
+
+  const Vector4& GetStrikethroughColor() const override;
+
+  bool IsStrikethroughEnabled() const override;
+
 private:
   const ModelInterface* const mModel;                           ///< Pointer to the text's model.
   Vector<GlyphInfo>           mElidedGlyphs;                    ///< Stores the glyphs of the elided text.
index 1ce7516..bd93e68 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@
 
 namespace Dali::Toolkit::Text
 {
-
 namespace
 {
 #if defined(DEBUG_ENABLED)
@@ -90,7 +89,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
   // Check whether the indices for updating the text is valid
   if(numberOfCharacters > 0u &&
      (impl.mTextUpdateInfo.mParagraphCharacterIndex > numberOfCharacters ||
-         impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
+      impl.mTextUpdateInfo.mRequestedNumberOfCharacters > numberOfCharacters))
   {
     std::string currentText;
     Utf32ToUtf8(impl.mModel->mLogicalModel->mText.Begin(), numberOfCharacters, currentText);
@@ -146,7 +145,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
                      lineBreakInfo);
 
     if(impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::HYPHENATION) ||
-        impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
+       impl.mModel->mLineWrapMode == ((Text::LineWrap::Mode)DevelText::LineWrap::MIXED))
     {
       CharacterIndex end                 = startIndex + requestedNumberOfCharacters;
       LineBreakInfo* lineBreakInfoBuffer = lineBreakInfo.Begin();
@@ -212,7 +211,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
 
       // Get the default font's description.
       TextAbstraction::FontDescription defaultFontDescription;
-      TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.mFontSizeScale;
+      TextAbstraction::PointSize26Dot6 defaultPointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE * impl.GetFontSizeScale();
 
       //Get the number of points per one unit of point-size
       uint32_t numberOfPointsPerOneUnitOfPointSize = impl.mFontClient.GetNumberOfPointsPerOneUnitOfPointSize();
@@ -223,7 +222,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
         defaultFontDescription = impl.mEventData->mPlaceholderFont->mFontDescription;
         if(impl.mEventData->mPlaceholderFont->sizeDefined)
         {
-          defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+          defaultPointSize = impl.mEventData->mPlaceholderFont->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
         }
       }
       else if(nullptr != impl.mFontDefaults)
@@ -237,7 +236,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
         }
         else
         {
-          defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.mFontSizeScale * numberOfPointsPerOneUnitOfPointSize;
+          defaultPointSize = impl.mFontDefaults->mDefaultPointSize * impl.GetFontSizeScale() * numberOfPointsPerOneUnitOfPointSize;
         }
       }
 
@@ -352,7 +351,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
   }
 
   if((nullptr != impl.mEventData) &&
-      impl.mEventData->mPreEditFlag &&
+     impl.mEventData->mPreEditFlag &&
      (0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count()))
   {
     Dali::InputMethodContext::PreEditAttributeDataContainer attrs;
@@ -565,7 +564,7 @@ bool ControllerImplModelUpdater::Update(Controller::Impl& impl, OperationsMask o
 
   if((Controller::NO_OPERATION != (Controller::SHAPE_TEXT & operations)) &&
      !((nullptr != impl.mEventData) &&
-         impl.mEventData->mPreEditFlag &&
+       impl.mEventData->mPreEditFlag &&
        (0u != impl.mModel->mVisualModel->mCharactersToGlyph.Count())))
   {
     //Mark-up processor case
index e0603f8..6ffa715 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -672,11 +672,11 @@ float Controller::Impl::GetDefaultFontLineHeight()
   if(nullptr == mFontDefaults)
   {
     TextAbstraction::FontDescription fontDescription;
-    defaultFontId = mFontClient.GetFontId(fontDescription, TextAbstraction::FontClient::DEFAULT_POINT_SIZE * mFontSizeScale);
+    defaultFontId = mFontClient.GetFontId(fontDescription, TextAbstraction::FontClient::DEFAULT_POINT_SIZE * GetFontSizeScale());
   }
   else
   {
-    defaultFontId = mFontDefaults->GetFontId(mFontClient, mFontDefaults->mDefaultPointSize * mFontSizeScale);
+    defaultFontId = mFontDefaults->GetFontId(mFontClient, mFontDefaults->mDefaultPointSize * GetFontSizeScale());
   }
 
   Text::FontMetrics fontMetrics;
index 3c72bdb..e697d81 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_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.
@@ -357,6 +357,7 @@ struct Controller::Impl
     mTextFitMaxSize(DEFAULT_TEXTFIT_MAX),
     mTextFitStepSize(DEFAULT_TEXTFIT_STEP),
     mFontSizeScale(DEFAULT_FONT_SIZE_SCALE),
+    mFontSizeScaleEnabled(true),
     mTextFitEnabled(false),
     mTextFitChanged(false),
     mIsLayoutDirectionChanged(false)
@@ -497,6 +498,11 @@ struct Controller::Impl
     }
   }
 
+  float GetFontSizeScale()
+  {
+    return mFontSizeScaleEnabled ? mFontSizeScale : 1.0f;
+  }
+
   /**
    * @brief Helper to notify InputMethodContext with surrounding text & cursor changes.
    */
@@ -967,6 +973,7 @@ public:
   bool                  mShadowSetByString : 1;        ///< Set when shadow is set by string (legacy) instead of map
   bool                  mOutlineSetByString : 1;       ///< Set when outline is set by string (legacy) instead of map
   bool                  mFontStyleSetByString : 1;     ///< Set when font style is set by string (legacy) instead of map
+  bool                  mStrikethroughSetByString : 1; ///< Set when strikethrough is set by string (legacy) instead of map
   bool                  mShouldClearFocusOnEscape : 1; ///< Whether text control should clear key input focus
   LayoutDirection::Type mLayoutDirection;              ///< Current system language direction
 
@@ -976,6 +983,7 @@ public:
   float mTextFitMaxSize;               ///< Maximum Font Size for text fit. Default 100
   float mTextFitStepSize;              ///< Step Size for font intervalse. Default 1
   float mFontSizeScale;                ///< Scale value for Font Size. Default 1.0
+  bool  mFontSizeScaleEnabled : 1;     ///< Whether the font size scale is enabled.
   bool  mTextFitEnabled : 1;           ///< Whether the text's fit is enabled.
   bool  mTextFitChanged : 1;           ///< Whether the text fit property has changed.
   bool  mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed.
index 8a3ac3e..988ddd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -393,7 +393,7 @@ void Controller::InputFontHandler::SetInputFontPointSize(Controller& controller,
                                                                              startOfSelectedText,
                                                                              lengthOfSelectedText);
 
-        fontDescriptionRun.size        = static_cast<PointSize26Dot6>(size * controller.mImpl->mFontSizeScale * 64.f);
+        fontDescriptionRun.size        = static_cast<PointSize26Dot6>(size * controller.mImpl->GetFontSizeScale() * 64.f);
         fontDescriptionRun.sizeDefined = true;
 
         controller.mImpl->mTextUpdateInfo.mCharacterIndex             = startOfSelectedText;
index 0bcb97f..ab90270 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -351,7 +351,7 @@ void Controller::TextUpdater::InsertText(Controller& controller, const std::stri
 
       if(addFontSizeRun)
       {
-        fontDescriptionRun.size        = static_cast<PointSize26Dot6>(inputStyle.size * impl.mFontSizeScale * 64.f);
+        fontDescriptionRun.size        = static_cast<PointSize26Dot6>(inputStyle.size * impl.GetFontSizeScale() * 64.f);
         fontDescriptionRun.sizeDefined = true;
       }
 
index be985d1..5f75cf9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -667,6 +667,9 @@ void Controller::SetFontSizeScale(float scale)
 {
   mImpl->mFontSizeScale = scale;
 
+  // No relayout is required
+  if(!mImpl->mFontSizeScaleEnabled) return;
+
   // Update the cursor position if it's in editing mode
   UpdateCursorPosition(mImpl->mEventData);
 
@@ -681,6 +684,24 @@ float Controller::GetFontSizeScale() const
   return mImpl->mFontDefaults ? mImpl->mFontSizeScale : 1.0f;
 }
 
+void Controller::SetFontSizeScaleEnabled(bool enabled)
+{
+  mImpl->mFontSizeScaleEnabled = enabled;
+
+  // Update the cursor position if it's in editing mode
+  UpdateCursorPosition(mImpl->mEventData);
+
+  // Clear the font-specific data
+  mImpl->ClearFontData();
+
+  mImpl->RequestRelayout();
+}
+
+bool Controller::IsFontSizeScaleEnabled() const
+{
+  return mImpl->mFontSizeScaleEnabled;
+}
+
 void Controller::SetDefaultFontSize(float fontSize, FontSizeType type)
 {
   EnsureCreated(mImpl->mFontDefaults);
@@ -1092,6 +1113,65 @@ void Controller::FontStyleSetByString(bool setByString)
   mImpl->mFontStyleSetByString = setByString;
 }
 
+void Controller::SetStrikethroughHeight(float height)
+{
+  mImpl->mModel->mVisualModel->SetStrikethroughHeight(height);
+
+  mImpl->RequestRelayout();
+}
+
+float Controller::GetStrikethroughHeight() const
+{
+  return mImpl->mModel->mVisualModel->GetStrikethroughHeight();
+}
+
+void Controller::SetStrikethroughColor(const Vector4& color)
+{
+  mImpl->mModel->mVisualModel->SetStrikethroughColor(color);
+
+  mImpl->RequestRelayout();
+}
+
+const Vector4& Controller::GetStrikethroughColor() const
+{
+  return mImpl->mModel->mVisualModel->GetStrikethroughColor();
+}
+
+void Controller::SetStrikethroughEnabled(bool enabled)
+{
+  mImpl->mModel->mVisualModel->SetStrikethroughEnabled(enabled);
+
+  mImpl->RequestRelayout();
+}
+
+bool Controller::IsStrikethroughEnabled() const
+{
+  return mImpl->mModel->mVisualModel->IsStrikethroughEnabled();
+}
+
+void Controller::SetInputStrikethroughProperties(const std::string& strikethroughProperties)
+{
+  if(NULL != mImpl->mEventData)
+  {
+    mImpl->mEventData->mInputStyle.strikethroughProperties = strikethroughProperties;
+  }
+}
+
+const std::string& Controller::GetInputStrikethroughProperties() const
+{
+  return (NULL != mImpl->mEventData) ? mImpl->mEventData->mInputStyle.strikethroughProperties : EMPTY_STRING;
+}
+
+bool Controller::IsStrikethroughSetByString()
+{
+  return mImpl->mStrikethroughSetByString;
+}
+
+void Controller::StrikethroughSetByString(bool setByString)
+{
+  mImpl->mStrikethroughSetByString = setByString;
+}
+
 Layout::Engine& Controller::GetLayoutEngine()
 {
   return mImpl->mLayoutEngine;
index b16186b..419cd05 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_CONTROLLER_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.
@@ -659,6 +659,60 @@ public: // Configure the text controller.
    */
   void FontStyleSetByString(bool setByString);
 
+  /**
+   * @brief Query if Strikethrough settings were provided by string or map
+   * @return bool true if set by string
+   */
+  bool IsStrikethroughSetByString();
+
+  /**
+   * Set method Strikethrough setting were set by
+   * @param[in] bool, true if set by string
+   */
+  void StrikethroughSetByString(bool setByString);
+
+  /**
+   * @brief Set the override used for strikethrough height, 0 indicates height will be supplied by font metrics
+   *
+   * @param[in] height The height in pixels of the strikethrough
+   */
+  void SetStrikethroughHeight(float height);
+
+  /**
+   * @brief Retrieves the override height of an strikethrough, 0 indicates height is supplied by font metrics
+   *
+   * @return The height of the strikethrough, or 0 if height is not overrided.
+   */
+  float GetStrikethroughHeight() const;
+
+  /**
+   * @brief Set the strikethrough color.
+   *
+   * @param[in] color color of strikethrough.
+   */
+  void SetStrikethroughColor(const Vector4& color);
+
+  /**
+   * @brief Retrieve the strikethrough color.
+   *
+   * @return The strikethrough color.
+   */
+  const Vector4& GetStrikethroughColor() const;
+
+  /**
+   * @brief Set the strikethrough enabled flag.
+   *
+   * @param[in] enabled The strikethrough enabled flag.
+   */
+  void SetStrikethroughEnabled(bool enabled);
+
+  /**
+   * @brief Returns whether the text has a strikethrough or not.
+   *
+   * @return The strikethrough state.
+   */
+  bool IsStrikethroughEnabled() const;
+
 public: // Update.
   /**
    * @brief Replaces any text previously set.
@@ -908,6 +962,20 @@ public: // Default style & Input style
   float GetFontSizeScale() const;
 
   /**
+   * @brief Set the font size scale enabled flag.
+   *
+   * @param[in] enabled whether to enable the font size scale.
+   */
+  void SetFontSizeScaleEnabled(bool enabled);
+
+  /**
+   * @brief Returns whether the font size scale is enabled or not.
+   *
+   * @return @e true if the font size scale is enabled, otherwise returns @e false.
+   */
+  bool IsFontSizeScaleEnabled() const;
+
+  /**
    * @brief Sets the Placeholder text font size.
    * @param[in] fontSize The placeholder text font size
    * @param[in] type The font size type is point size or pixel size
@@ -1331,6 +1399,22 @@ public: // Default style & Input style
   const std::string& GetInputOutlineProperties() const;
 
   /**
+   * @brief Sets the input strikethrough's properties string.
+   *
+   * @note The string is stored to be recovered.
+   *
+   * @param[in] strikethroughProperties The strikethrough's properties string.
+   */
+  void SetInputStrikethroughProperties(const std::string& strikethroughProperties);
+
+  /**
+   * @brief Retrieves the input strikethrough's properties string.
+   *
+   * @return The strikethrough's properties string.
+   */
+  const std::string& GetInputStrikethroughProperties() const;
+
+  /**
    * @brief Set the control's interface.
    *
    * @param[in] controlInterface The control's interface.
index a367696..38145dc 100644 (file)
@@ -226,6 +226,67 @@ bool ParseBackgroundProperties(const Property::Map& backgroundProperties,
   return 0u == numberOfItems;
 }
 
+bool ParseStrikethroughProperties(const Property::Map& strikethroughPropertiesMap,
+                                  bool&                enabled,
+                                  bool&                colorDefined,
+                                  Vector4&             color,
+                                  bool&                heightDefined,
+                                  float&               height)
+{
+  const unsigned int numberOfItems = strikethroughPropertiesMap.Count();
+
+  // Parses and applies the style.
+  for(unsigned int index = 0u; index < numberOfItems; ++index)
+  {
+    const KeyValuePair& valueGet = strikethroughPropertiesMap.GetKeyValue(index);
+
+    if((DevelText::Strikethrough::Property::ENABLE == valueGet.first.indexKey) || (ENABLE_KEY == valueGet.first.stringKey))
+    {
+      /// Enable key.
+      if(valueGet.second.GetType() == Dali::Property::STRING)
+      {
+        const std::string enableStr = valueGet.second.Get<std::string>();
+        enabled                     = Text::TokenComparison(TRUE_TOKEN, enableStr.c_str(), enableStr.size());
+      }
+      else
+      {
+        enabled = valueGet.second.Get<bool>();
+      }
+    }
+    else if((DevelText::Strikethrough::Property::COLOR == valueGet.first.indexKey) || (COLOR_KEY == valueGet.first.stringKey))
+    {
+      /// Color key.
+      colorDefined = true;
+
+      if(valueGet.second.GetType() == Dali::Property::STRING)
+      {
+        const std::string colorStr = valueGet.second.Get<std::string>();
+        Text::ColorStringToVector4(colorStr.c_str(), colorStr.size(), color);
+      }
+      else
+      {
+        color = valueGet.second.Get<Vector4>();
+      }
+    }
+    else if((DevelText::Strikethrough::Property::HEIGHT == valueGet.first.indexKey) || (HEIGHT_KEY == valueGet.first.stringKey))
+    {
+      /// Height key.
+      heightDefined = true;
+
+      if(valueGet.second.GetType() == Dali::Property::STRING)
+      {
+        const std::string heightStr = valueGet.second.Get<std::string>();
+        height                      = StringToFloat(heightStr.c_str());
+      }
+      else
+      {
+        height = valueGet.second.Get<float>();
+      }
+    }
+  }
+  return 0u == numberOfItems;
+}
+
 bool SetUnderlineProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type)
 {
   bool update = false;
@@ -774,6 +835,153 @@ void GetBackgroundProperties(ControllerPtr controller, Property::Value& value, E
   }
 }
 
+bool SetStrikethroughProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type)
+{
+  bool update = false;
+
+  if(controller)
+  {
+    switch(type)
+    {
+      case EffectStyle::DEFAULT:
+      {
+        const Property::Map& propertiesMap = value.Get<Property::Map>();
+
+        bool    enabled      = false;
+        bool    colorDefined = false;
+        Vector4 color;
+        bool    heightDefined = false;
+        float   height        = 0.f;
+
+        bool empty = true;
+
+        if(propertiesMap.Empty())
+        {
+          // Map empty so check if a string provided
+          const std::string propertyString = value.Get<std::string>();
+
+          if(!propertyString.empty())
+          {
+            Property::Map parsedStringMap;
+            Text::ParsePropertyString(propertyString, parsedStringMap);
+
+            empty = ParseStrikethroughProperties(parsedStringMap,
+                                             enabled,
+                                             colorDefined,
+                                             color,
+                                             heightDefined,
+                                             height);
+
+            controller->StrikethroughSetByString(!empty);
+          }
+        }
+        else
+        {
+          empty = ParseStrikethroughProperties(propertiesMap,
+                                               enabled,
+                                               colorDefined,
+                                               color,
+                                               heightDefined,
+                                               height);
+
+          controller->StrikethroughSetByString(false);
+        }
+
+        if(!empty)
+        {
+          if(enabled != controller->IsStrikethroughEnabled())
+          {
+            controller->SetStrikethroughEnabled(enabled);
+            update = true;
+          }
+
+          // Sets the default strikethrough values.
+          if(colorDefined && (controller->GetStrikethroughColor() != color))
+          {
+            controller->SetStrikethroughColor(color);
+            update = true;
+          }
+          if(heightDefined && (fabsf(controller->GetStrikethroughHeight() - height) > Math::MACHINE_EPSILON_1000))
+          {
+            controller->SetStrikethroughHeight(height);
+            update = true;
+          }
+        }
+        else
+        {
+          // Disable strikethrough.
+          if(controller->IsStrikethroughEnabled())
+          {
+            controller->SetStrikethroughEnabled(false);
+            update = true;
+          }
+        }
+        break;
+      }
+      case EffectStyle::INPUT:
+      {
+        const std::string& strikethroughProperties = value.Get<std::string>();
+
+        controller->SetInputStrikethroughProperties(strikethroughProperties);
+        update = true;
+        break;
+      }
+    } // switch
+  }   // if( controller )
+
+  return update;
+}
+
+void GetStrikethroughProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type)
+{
+  if(controller)
+  {
+    switch(type)
+    {
+      case EffectStyle::DEFAULT:
+      {
+        const bool     enabled = controller->IsStrikethroughEnabled();
+        const Vector4& color   = controller->GetStrikethroughColor();
+        const float    height  = controller->GetStrikethroughHeight();
+
+        if(controller->IsStrikethroughSetByString())
+        {
+          std::string       strikethroughProperties = "{\"enable\":";
+          const std::string enabledStr          = enabled ? "true" : "false";
+          strikethroughProperties += "\"" + enabledStr + "\",";
+
+          std::string colorStr;
+          Vector4ToColorString(color, colorStr);
+          strikethroughProperties += "\"color\":\"" + colorStr + "\",";
+
+          std::string heightStr;
+          FloatToString(height, heightStr);
+          strikethroughProperties += "\"height\":\"" + heightStr + "\"}";
+
+          value = strikethroughProperties;
+        }
+        else
+        {
+          Property::Map map;
+
+          map.Insert(ENABLE_KEY, enabled);
+          map.Insert(COLOR_KEY, color);
+          map.Insert(HEIGHT_KEY, height);
+
+          value = map;
+        }
+
+        break;
+      }
+      case EffectStyle::INPUT:
+      {
+        value = controller->GetInputStrikethroughProperties();
+        break;
+      }
+    }
+  }
+}
+
 } // namespace Text
 
 } // namespace Toolkit
index fcc2381..436e8d1 100644 (file)
@@ -97,6 +97,23 @@ bool ParseBackgroundProperties(const Property::Map& backgroundProperties,
                                Vector4&             color);
 
 /**
+ * @brief Parses the strikethrough properties.
+ *
+ * @param[in] strikethroughProperties The map with the strikethrough properties.
+ * @param[out] enabled Whether the strikethrough is enabled.
+ * @param[out] colorDefined Whether the strikethrough's color is defined.
+ * @param[out] color The strikethrough's color.
+ * @param[out] heightDefined Whether the strikethrough's height is defined.
+ * @param[out] height The strikethrough's height.
+ */
+bool ParseStrikethroughProperties(const Property::Map& strikethroughProperties,
+                              bool&                enabled,
+                              bool&                colorDefined,
+                              Vector4&             color,
+                              bool&                heightDefined,
+                              float&               height);
+
+/**
  * @brief Sets the underline properties.
  *
  * @param[in] controller The text's controller.
@@ -108,6 +125,17 @@ bool ParseBackgroundProperties(const Property::Map& backgroundProperties,
 bool SetUnderlineProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
 
 /**
+ * @brief Sets the strikethrough properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[in] value The values of the strikethrough's properties.
+ * @param[in] type Whether the property is for the default strikethrough or the input strikethrough.
+ *
+ * @return Whether the strikethrough properties have been updated.
+ */
+bool SetStrikethroughProperties(ControllerPtr controller, const Property::Value& value, EffectStyle::Type type);
+
+/**
  * @brief Retrieves the underline's properties.
  *
  * @param[in] controller The text's controller.
@@ -117,6 +145,15 @@ bool SetUnderlineProperties(ControllerPtr controller, const Property::Value& val
 void GetUnderlineProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
 
 /**
+ * @brief Retrieves the strikethrough's properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[out] value The value of the strikethrough's properties.
+ * @param[in] type Whether the property is for the default strikethrough or the input strikethrough.
+ */
+void GetStrikethroughProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type);
+
+/**
  * @brief Sets the shadow properties.
  *
  * @param[in] controller The text's controller.
index d9520f1..415b742 100644 (file)
@@ -335,6 +335,27 @@ public:
    * @return number of hyphens.
    */
   virtual Length GetHyphensCount() const = 0;
+
+  /**
+   * @brief Retrieves the strikethrough color.
+   *
+   * @return The strikethrough color.
+   */
+  virtual const Vector4& GetStrikethroughColor() const = 0;
+
+  /**
+   * @brief Returns whether strikethrough is enabled or not.
+   *
+   * @return The strikethrough state.
+   */
+  virtual bool IsStrikethroughEnabled() const = 0;
+
+  /**
+   * @brief Retrieves the strikethrough height override
+   *
+   * @return Returns the override height for a strikethrough, 0 indicates that adaptor will determine the height
+   */
+  virtual float GetStrikethroughHeight() const = 0;
 };
 
 } // namespace Text
index 4c3e3f0..b202d69 100644 (file)
@@ -241,6 +241,20 @@ Length Model::GetHyphensCount() const
 {
   return mVisualModel->mHyphen.glyph.Size();
 }
+const Vector4& Model::GetStrikethroughColor() const
+{
+  return mVisualModel->GetStrikethroughColor();
+}
+
+bool Model::IsStrikethroughEnabled() const
+{
+  return mVisualModel->IsStrikethroughEnabled();
+}
+
+float Model::GetStrikethroughHeight() const
+{
+  return mVisualModel->GetStrikethroughHeight();
+}
 
 Model::Model()
 : mLogicalModel(),
index 280b63d..0a01400 100644 (file)
@@ -257,6 +257,12 @@ public:
   */
   Length GetHyphensCount() const override;
 
+  float GetStrikethroughHeight() const override;
+
+  const Vector4& GetStrikethroughColor() const override;
+
+  bool IsStrikethroughEnabled() const override;
+
 private: // Private contructors & copy operator.
   /**
    * @brief Private constructor.
index 24994bf..5a2cda2 100644 (file)
@@ -266,6 +266,27 @@ public:
    * @return The second middle index of elided glyphs, index of ellipsis of middle.
    */
   virtual GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const = 0;
+
+  /**
+   * @brief Retrieves the strikethrough color.
+   *
+   * @return The strikethrough color.
+   */
+  virtual const Vector4& GetStrikethroughColor() const = 0;
+
+  /**
+   * @brief Returns whether strikethrough is enabled or not.
+   *
+   * @return The strikethrough state.
+   */
+  virtual bool IsStrikethroughEnabled() const = 0;
+
+  /**
+   * @brief Retrieves the strikethrough height override
+   *
+   * @return Returns the override height for a strikethrough, 0 indicates that adaptor will determine the height
+   */
+  virtual float GetStrikethroughHeight() const = 0;
 };
 
 } // namespace Text
index a5a6b3b..6dfd9e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -213,7 +213,7 @@ Length View::GetGlyphs(GlyphInfo* glyphs,
 
           if(lastGlyphIndexOfLine == index)
           {
-            penY += -line->descender;
+            penY += -line->descender + line->lineSpacing;
 
             // Get the next line.
             ++lineIndex;
@@ -225,7 +225,7 @@ Length View::GetGlyphs(GlyphInfo* glyphs,
 
               lastGlyphIndexOfLine = (line->isSplitToTwoHalves ? line->glyphRunSecondHalf.glyphIndex + line->glyphRunSecondHalf.numberOfGlyphs : line->glyphRun.glyphIndex + line->glyphRun.numberOfGlyphs) - 1u;
 
-              penY += line->ascender + line->lineSpacing;
+              penY += line->ascender;
             }
           }
         }
@@ -742,6 +742,21 @@ GlyphIndex View::GetSecondMiddleIndexOfElidedGlyphs() const
   return secondMiddleIndexOfElidedGlyphs;
 }
 
+const Vector4& View::GetStrikethroughColor() const
+{
+  return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughColor() : Vector4::ZERO;
+}
+
+bool View::IsStrikethroughEnabled() const
+{
+  return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false;
+}
+
+float View::GetStrikethroughHeight() const
+{
+  return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughHeight() : 0.0f;
+}
+
 } // namespace Text
 
 } // namespace Toolkit
index 62324e8..c072abd 100644 (file)
@@ -197,6 +197,21 @@ public:
    */
   GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const override;
 
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughColor()
+   */
+  const Vector4& GetStrikethroughColor() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::IsStrikethroughEnabled()
+   */
+  bool IsStrikethroughEnabled() const override;
+
+  /**
+   * @copydoc Dali::Toolkit::Text::ViewInterface::GetStrikethroughHeight()
+   */
+  float GetStrikethroughHeight() const override;
+
 private:
   // Undefined
   View(const View& handle);
index 9c57494..e138e3c 100644 (file)
@@ -430,6 +430,21 @@ void VisualModel::SetSecondMiddleIndexOfElidedGlyphs(GlyphIndex secondMiddleInde
   mSecondMiddleIndexOfElidedGlyphs = secondMiddleIndexOfElidedGlyphs;
 }
 
+void VisualModel::SetStrikethroughColor(const Vector4& color)
+{
+  mStrikethroughColor = color;
+}
+
+void VisualModel::SetStrikethroughEnabled(bool enabled)
+{
+  mStrikethroughEnabled = enabled;
+}
+
+void VisualModel::SetStrikethroughHeight(float height)
+{
+  mStrikethroughHeight = height;
+}
+
 const Vector4& VisualModel::GetTextColor() const
 {
   return mTextColor;
@@ -525,6 +540,21 @@ Length VisualModel::GetNumberOfUnderlineRuns() const
   return mUnderlineRuns.Count();
 }
 
+const Vector4& VisualModel::GetStrikethroughColor() const
+{
+  return mStrikethroughColor;
+}
+
+bool VisualModel::IsStrikethroughEnabled() const
+{
+  return mStrikethroughEnabled;
+}
+
+float VisualModel::GetStrikethroughHeight() const
+{
+  return mStrikethroughHeight;
+}
+
 void VisualModel::ClearCaches()
 {
   mCachedLineIndex = 0u;
@@ -547,9 +577,11 @@ VisualModel::VisualModel()
   mUnderlineColor(Color::BLACK),
   mOutlineColor(Color::WHITE),
   mBackgroundColor(Color::TRANSPARENT),
+  mStrikethroughColor(Color::BLACK),
   mControlSize(),
   mShadowOffset(),
   mUnderlineHeight(0.0f),
+  mStrikethroughHeight(0.0f),
   mShadowBlurRadius(0.0f),
   mOutlineWidth(0u),
   mNaturalSize(),
@@ -564,7 +596,8 @@ VisualModel::VisualModel()
   mUnderlineEnabled(false),
   mUnderlineColorSet(false),
   mBackgroundEnabled(false),
-  mMarkupProcessorEnabled(false)
+  mMarkupProcessorEnabled(false),
+  mStrikethroughEnabled(false)
 
 {
 }
index ac9b12d..6a96094 100644 (file)
@@ -467,6 +467,48 @@ public:
    */
   GlyphIndex GetSecondMiddleIndexOfElidedGlyphs() const;
 
+  /**
+   * @brief Sets the text's strikethrough color.
+   *
+   * @param[in] color The text's strikethrough color.
+   */
+  void SetStrikethroughColor(const Vector4& color);
+
+  /**
+   * @brief Retrieves the text's strikethrough color.
+   *
+   * @return The text's strikethrough color.
+   */
+  const Vector4& GetStrikethroughColor() const;
+
+  /**
+   * @brief Sets the text strikethrough flag.
+   *
+   * @param[in] enabled true if strikethrough.
+   */
+  void SetStrikethroughEnabled(bool enabled);
+
+  /**
+   * @brief Returns whether the text is strikethrough or not.
+   *
+   * @return strikethrough state.
+   */
+  bool IsStrikethroughEnabled() const;
+
+  /**
+   * @brief Set the override used for strikethrough height, 0 indicates height will be come from font metrics
+   *
+   * @param[in] height The height in pixels of the strikethrough
+   */
+  void SetStrikethroughHeight(float height);
+
+  /**
+   * @brief Retrieves the strikethrough height override
+   *
+   * @return Returns the override height for a strikethrough, 0 indicates that font metrics will determine the height
+   */
+  float GetStrikethroughHeight() const;
+
 protected:
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -499,16 +541,18 @@ public:
   Vector<Vector4>        mBackgroundColors;       ///< Background colors of the glyphs.
   Vector<ColorIndex>     mBackgroundColorIndices; ///< Indices to the vector of background colors for each glyphs.
 
-  Vector4  mTextColor;        ///< The text color
-  Vector4  mShadowColor;      ///< Color of drop shadow
-  Vector4  mUnderlineColor;   ///< Color of underline
-  Vector4  mOutlineColor;     ///< Color of outline
-  Vector4  mBackgroundColor;  ///< Color of text background
-  Size     mControlSize;      ///< The size of the UI control.
-  Vector2  mShadowOffset;     ///< Offset for drop shadow, 0 indicates no shadow
-  float    mUnderlineHeight;  ///< Fixed height for underline to override font metrics.
-  float    mShadowBlurRadius; ///< Blur radius of shadow, 0 indicates no blur.
-  uint16_t mOutlineWidth;     ///< Width of outline.
+  Vector4  mTextColor;           ///< The text color
+  Vector4  mShadowColor;         ///< Color of drop shadow
+  Vector4  mUnderlineColor;      ///< Color of underline
+  Vector4  mOutlineColor;        ///< Color of outline
+  Vector4  mBackgroundColor;     ///< Color of text background
+  Vector4  mStrikethroughColor;  ///< Color of text background
+  Size     mControlSize;         ///< The size of the UI control.
+  Vector2  mShadowOffset;        ///< Offset for drop shadow, 0 indicates no shadow
+  float    mUnderlineHeight;     ///< Fixed height for underline to override font metrics.
+  float    mStrikethroughHeight; ///< Fixed height for strikethrough to override font metrics.
+  float    mShadowBlurRadius;    ///< Blur radius of shadow, 0 indicates no blur.
+  uint16_t mOutlineWidth;        ///< Width of outline.
 
 private:
   Size mNaturalSize; ///< Size of the text with no line wrapping.
@@ -530,6 +574,7 @@ public:
   bool       mBackgroundEnabled : 1;      ///< Background enabled flag
   bool       mMarkupProcessorEnabled : 1; ///< Markup-processor enabled flag
   HyphenInfo mHyphen;                     ///< Contains hyphen glyph info & the character index to draw hyphen after.
+  bool       mStrikethroughEnabled : 1;   ///< Strikethrough enabled flag
 };
 
 } // namespace Text
index 39b18ee..970e309 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -755,7 +755,7 @@ void ImageVisual::DoCreatePropertyMap(Property::Map& map) const
   map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE);
 
   bool sync = IsSynchronousLoadingRequired();
-  map.Insert(SYNCHRONOUS_LOADING, sync);
+  map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync);
   if(mImageUrl.IsValid())
   {
     map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl());
index b9e046a..4325dea 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
 #include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
 #include <dali-toolkit/internal/visuals/npatch-loader.h>
+#include <dali-toolkit/devel-api/utility/npatch-helper.h>
 #include <dali-toolkit/internal/visuals/rendering-addon.h>
 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
@@ -43,91 +44,6 @@ namespace Toolkit
 {
 namespace Internal
 {
-namespace
-{
-/**
- * @brief Creates the geometry formed from the vertices and indices
- *
- * @param[in]  vertices             The vertices to generate the geometry from
- * @param[in]  indices              The indices to generate the geometry from
- * @return The geometry formed from the vertices and indices
- */
-Geometry GenerateGeometry(const Vector<Vector2>& vertices, const Vector<unsigned short>& indices)
-{
-  Property::Map vertexFormat;
-  vertexFormat["aPosition"] = Property::VECTOR2;
-  VertexBuffer vertexBuffer = VertexBuffer::New(vertexFormat);
-  if(vertices.Size() > 0)
-  {
-    vertexBuffer.SetData(&ver