[dali_2.1.4] Merge branch 'devel/master' 95/269095/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 7 Jan 2022 10:06:29 +0000 (10:06 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 7 Jan 2022 10:06:29 +0000 (10:06 +0000)
Change-Id: Ib329cf50ee8f68f7df6dbcb311699359967fa79e

86 files changed:
automated-tests/.clang-format [deleted file]
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.cpp
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-Accessibility-Controls.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Text.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Value.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.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 65% similarity]
dali-toolkit/devel-api/controls/control-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/internal/accessibility-manager/accessibility-manager-impl.cpp
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-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
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/text/cursor-helper-functions.cpp
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/npatch-data.cpp
dali-toolkit/internal/visuals/npatch-data.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.h
dali-toolkit/internal/visuals/texture-upload-observer.cpp
dali-toolkit/internal/visuals/texture-upload-observer.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/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

diff --git a/automated-tests/.clang-format b/automated-tests/.clang-format
deleted file mode 100644 (file)
index 297ddc2..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
----
-Language:        Cpp
-DisableFormat: true
-SortIncludes: false
-...
index 2747582..8a7d7f1 100644 (file)
@@ -1,7 +1,8 @@
 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/accessibility-test-utils.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali/devel-api/common/stage.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
 #include "dbus-wrapper.h"
 
 namespace Dali
index 12abee1..643b552 100644 (file)
 
 #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-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
 
 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
 
@@ -141,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 047018d..1ed53dc 100644 (file)
@@ -3,8 +3,11 @@
 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
 #include <dali-toolkit/devel-api/controls/buttons/toggle-button.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/popup/popup.h>
@@ -610,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);
@@ -1074,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)
@@ -1129,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))
@@ -1152,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;
@@ -1194,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);
@@ -1220,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);
@@ -1258,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 a30078a..e610f2f 100644 (file)
@@ -4,7 +4,13 @@
 
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/table-view/table-view.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hyperlink.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 
 #include <automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dbus-wrapper.h>
 
index eea6fa6..ab7f8bf 100644 (file)
@@ -23,6 +23,8 @@
 #include <dali-toolkit/dali-toolkit.h>
 
 #include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 #include <dali-toolkit/internal/controls/text-controls/text-field-impl.h>
 #include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
 
index af4739b..2f8739b 100644 (file)
@@ -24,7 +24,9 @@
 #include <dali-toolkit/dali-toolkit.h>
 
 #include <dali/devel-api/adaptor-framework/accessibility.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/value.h>
 
 #include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
 
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
index 1553f97..d279482 100644 (file)
@@ -76,20 +76,19 @@ public:
   {
   }
 
-  virtual void UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet,
-                               bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override
+  virtual void LoadComplete( bool loadSuccess, TextureInformation textureInformation ) override
   {
-    mCompleteType = CompleteType::UPLOAD_COMPLETE;
-    mLoaded = loadSuccess;
-    mObserverCalled = true;
-    mTextureSet = textureSet;
-  }
-
-  virtual void LoadComplete( bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied ) override
-  {
-    mCompleteType = CompleteType::LOAD_COMPLETE;
+    if(textureInformation.returnType == TextureUploadObserver::ReturnType::TEXTURE)
+    {
+      mCompleteType = CompleteType::UPLOAD_COMPLETE;
+    }
+    else
+    {
+      mCompleteType = CompleteType::LOAD_COMPLETE;
+    }
     mLoaded = loadSuccess;
     mObserverCalled = true;
+    mTextureSet = textureInformation.textureSet;
   }
 
   CompleteType mCompleteType;
index e309bfe..cccb922 100644 (file)
@@ -21,7 +21,8 @@
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
 #include <toolkit-adaptor-impl.h>
 #include <toolkit-lifecycle-controller.h>
index e8dd77e..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
 {
 
@@ -3048,7 +3130,7 @@ void OnResourceReadySignal03( Control control )
   if(gResourceReadySignalCounter == 0)
   {
     // Queue loading
-    // 1. Use cached image, then UploadComplete will be called right after OnResourceReadySignal03.
+    // 1. Use cached image, then LoadComplete will be called right after OnResourceReadySignal03.
     gImageView2[ImageView::Property::IMAGE] = gImage_34_RGBA;
 
     // 2. Load a new image
index d1a04e9..a6e2668 100644 (file)
@@ -3565,6 +3565,12 @@ int UtcDaliTextFieldSelectWholeText(void)
   application.SendNotification();
   application.Render();
 
+  // Even if resize, selection should remain.
+  textField.SetProperty( Actor::Property::SIZE, Vector2( 150.f, 50.f ) );
+
+  application.SendNotification();
+  application.Render();
+
   // Should be 2 children, the stencil and the layer
   DALI_TEST_EQUALS( 2u, textField.GetChildCount(), TEST_LOCATION );
 
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-impl.h>
 #include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
+#include <dali/devel-api/atspi-interfaces/action.h>
 #include <dali/public-api/object/weak-handle.h>
 
 // INTERNAL INCLUDES
@@ -41,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();
 
   /**
@@ -83,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()
@@ -143,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()
@@ -166,11 +126,6 @@ public:
   bool GrabFocus() override;
 
   /**
-   * @copydoc Dali::Accessibility::Component::GetAlpha()
-   */
-  double GetAlpha() override;
-
-  /**
    * @copydoc Dali::Accessibility::Component::GrabHighlight()
    */
   bool GrabHighlight() override;
@@ -183,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;
 
@@ -226,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();
@@ -266,4 +216,4 @@ public:
 
 } // namespace Dali::Toolkit::DevelControl
 
-#endif // DALI_TOOLKIT_ACCESSIBLE_IMPL_H
+#endif // DALI_TOOLKIT_CONTROL_ACCESSIBLE_H
index 8877646..33e02f5 100644 (file)
  *
  */
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
 #include <dali/public-api/animation/alpha-function.h>
 #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 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 3a20928..6337f59 100644 (file)
@@ -19,8 +19,8 @@
 #include "accessibility-manager-impl.h"
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
 #include <dali/devel-api/adaptor-framework/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
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 9ff203a..96540d2 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
@@ -262,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 abb5200..97a7daa 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/animation/constraint.h>
@@ -313,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 134b9f2..7385953 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/value.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/property-map.h>
@@ -748,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 b590862..e26006d 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali/devel-api/atspi-interfaces/hyperlink.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/text-controls/text-anchor-devel.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
 #include <dali-toolkit/internal/text/text-anchor-control-interface.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
 
 namespace Dali
 {
@@ -104,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..d35e92b 100644 (file)
@@ -1289,13 +1289,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 +1313,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 +1321,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 +1343,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 +1434,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 +1526,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 9d41735..6ea1cc8 100644 (file)
@@ -22,6 +22,9 @@
 #include <dali/devel-api/adaptor-framework/accessibility.h>
 #include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 #include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
@@ -553,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()
@@ -588,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 9cefc6c..7eec04e 100644 (file)
@@ -1138,7 +1138,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 +1149,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 +1170,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 +1178,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 +1201,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 +1299,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 +1399,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 1f97263..e53189e 100644 (file)
@@ -21,6 +21,9 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/clipboard-event-notifier.h>
 #include <dali/devel-api/adaptor-framework/input-method-context.h>
+#include <dali/devel-api/atspi-interfaces/editable-text.h>
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/control-devel.h>
@@ -501,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()
@@ -536,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 9e15b34..ae948e2 100644 (file)
@@ -1146,7 +1146,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 +1157,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 +1175,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 +1183,7 @@ size_t TextLabel::AccessibleImpl::GetCharacterCount()
   return text.size();
 }
 
-size_t TextLabel::AccessibleImpl::GetCursorOffset()
+size_t TextLabel::AccessibleImpl::GetCursorOffset() const
 {
   return {};
 }
@@ -1193,7 +1193,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 +1284,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 d776c32..8bedc5b 100644 (file)
@@ -19,6 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/atspi-interfaces/hypertext.h>
+#include <dali/devel-api/atspi-interfaces/text.h>
 #include <dali/public-api/object/property-map.h>
 
 // INTERNAL INCLUDES
@@ -241,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()
@@ -270,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()
@@ -290,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 85b2fe1..f791349 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 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 34e7053..c9a4fb0 100644 (file)
@@ -397,8 +397,11 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll
     textUpdateInfo.mCharacterIndex     = 0u;
   }
 
+  bool layoutDirectionChanged = false;
   if(impl.mLayoutDirection != layoutDirection)
   {
+    // Flag to indicate that the layout direction has changed.
+    layoutDirectionChanged = true;
     // Clear the update info. This info will be set the next time the text is updated.
     textUpdateInfo.mClearAll = true;
     // Apply modifications to the model
@@ -449,13 +452,25 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll
 
   if(isEditable)
   {
-    if(newSize)
+    if(newSize || layoutDirectionChanged)
     {
-      // If there is a new size, the scroll position needs to be clamped.
+      // If there is a new size or layout direction is changed, the scroll position needs to be clamped.
       impl.ClampHorizontalScroll(layoutSize);
 
       // Update the decorator's positions is needed if there is a new size.
       impl.mEventData->mDecorator->UpdatePositions(model->mScrollPosition - offset);
+
+      // All decorator elements need to be updated.
+      if(EventData::IsEditingState(impl.mEventData->mState))
+      {
+        impl.mEventData->mScrollAfterUpdatePosition = true;
+        impl.mEventData->mUpdateCursorPosition = true;
+        impl.mEventData->mUpdateGrabHandlePosition = true;
+      }
+      else if(impl.mEventData->mState == EventData::SELECTING)
+      {
+        impl.mEventData->mUpdateHighlightBox = true;
+      }
     }
 
     // Move the cursor, grab handle etc.
index 4593bc7..dcb6621 100644 (file)
@@ -131,9 +131,9 @@ void FixedImageCache::LoadBatch()
 
     mReadyFlags.push_back(false);
 
-    // Note, if the image is already loaded, then UploadComplete will get called
+    // Note, if the image is already loaded, then LoadComplete will get called
     // from within this method. This means it won't yet have a texture id, so we
-    // need to account for this inside the UploadComplete method using mRequestingLoad.
+    // need to account for this inside the LoadComplete method using mRequestingLoad.
     mRequestingLoad = true;
 
     bool                               synchronousLoading = false;
@@ -186,42 +186,25 @@ void FixedImageCache::CheckFrontFrame(bool wasReady)
   }
 }
 
-void FixedImageCache::UploadComplete(
-  bool           loadSuccess,
-  int32_t        textureId,
-  TextureSet     textureSet,
-  bool           useAtlasing,
-  const Vector4& atlasRect,
-  bool           preMultiplied)
+void FixedImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
 {
   bool frontFrameReady = IsFrontReady();
 
   if(!mRequestingLoad)
   {
-    SetImageFrameReady(textureId);
+    SetImageFrameReady(textureInformation.textureId);
 
     CheckFrontFrame(frontFrameReady);
   }
   else
   {
-    // UploadComplete has been called from within RequestLoad. TextureManager must
+    // LoadComplete has been called from within RequestLoad. TextureManager must
     // therefore already have the texture cached, so make the texture ready.
     // (Use the last texture, as the texture id hasn't been assigned yet)
     mReadyFlags.back() = true;
   }
 }
 
-void FixedImageCache::LoadComplete(
-  bool               loadSuccess,
-  Devel::PixelBuffer pixelBuffer,
-  const VisualUrl&   url,
-  bool               preMultiplied)
-{
-  // LoadComplete is called if this TextureUploadObserver requested to load
-  // an image that will be returned as a type of PixelBuffer by using a method
-  // TextureManager::LoadPixelBuffer.
-}
-
 } //namespace Internal
 } //namespace Toolkit
 } //namespace Dali
\ No newline at end of file
index 63212df..dc19937 100644 (file)
@@ -110,19 +110,7 @@ private:
   void CheckFrontFrame(bool wasReady);
 
 protected:
-  void UploadComplete(
-    bool           loadSuccess,
-    int32_t        textureId,
-    TextureSet     textureSet,
-    bool           useAtlasing,
-    const Vector4& atlasRect,
-    bool           premultiplied) override;
-
-  void LoadComplete(
-    bool               loadSuccess,
-    Devel::PixelBuffer pixelBuffer,
-    const VisualUrl&   url,
-    bool               preMultiplied) override;
+  void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
 
 private:
   std::vector<UrlStore>& mImageUrls;
index eba9341..490c3be 100644 (file)
@@ -274,28 +274,22 @@ void RollingAnimatedImageCache::CheckFrontFrame(bool wasReady)
   }
 }
 
-void RollingAnimatedImageCache::UploadComplete(
-  bool           loadSuccess,
-  int32_t        textureId,
-  TextureSet     textureSet,
-  bool           useAtlasing,
-  const Vector4& atlasRect,
-  bool           preMultiplied)
+void RollingAnimatedImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
 {
-  DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::UploadComplete(textureId:%d) start\n", textureId);
+  DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadComplete(textureId:%d) start\n", textureInformation.textureId);
   LOG_CACHE;
 
   bool frontFrameReady = IsFrontReady();
 
   if(!mRequestingLoad)
   {
-    SetImageFrameReady(textureId);
+    SetImageFrameReady(textureInformation.textureId);
 
     CheckFrontFrame(frontFrameReady);
   }
   else
   {
-    // UploadComplete has been called from within RequestLoad. TextureManager must
+    // LoadComplete has been called from within RequestLoad. TextureManager must
     // therefore already have the texture cached, so make the texture ready.
     // (Use the last texture, as the texture id hasn't been assigned yet)
     mQueue.Back().mReady = true;
@@ -316,17 +310,6 @@ void RollingAnimatedImageCache::UploadComplete(
   LOG_CACHE;
 }
 
-void RollingAnimatedImageCache::LoadComplete(
-  bool               loadSuccess,
-  Devel::PixelBuffer pixelBuffer,
-  const VisualUrl&   url,
-  bool               preMultiplied)
-{
-  // LoadComplete is called if this TextureUploadObserver requested to load
-  // an image that will be returned as a type of PixelBuffer by using a method
-  // TextureManager::LoadPixelBuffer.
-}
-
 } //namespace Internal
 } //namespace Toolkit
 } //namespace Dali
index b1b4afc..e1d201b 100644 (file)
@@ -138,19 +138,7 @@ private:
   void CheckFrontFrame(bool wasReady);
 
 protected:
-  void UploadComplete(
-    bool           loadSuccess,
-    int32_t        textureId,
-    TextureSet     textureSet,
-    bool           useAtlasing,
-    const Vector4& atlasRect,
-    bool           preMultiplied) override;
-
-  void LoadComplete(
-    bool               loadSuccess,
-    Devel::PixelBuffer pixelBuffer,
-    const VisualUrl&   url,
-    bool               preMultiplied) override;
+  void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
 
 private:
   /**
index 9bcf8e4..caecf39 100644 (file)
@@ -190,9 +190,9 @@ void RollingImageCache::LoadBatch()
 
     mQueue.PushBack(imageFrame);
 
-    // Note, if the image is already loaded, then UploadComplete will get called
+    // Note, if the image is already loaded, then LoadComplete will get called
     // from within this method. This means it won't yet have a texture id, so we
-    // need to account for this inside the UploadComplete method using mRequestingLoad.
+    // need to account for this inside the LoadComplete method using mRequestingLoad.
     mRequestingLoad = true;
 
     bool                               synchronousLoading = false;
@@ -246,28 +246,22 @@ void RollingImageCache::CheckFrontFrame(bool wasReady)
   }
 }
 
-void RollingImageCache::UploadComplete(
-  bool           loadSuccess,
-  int32_t        textureId,
-  TextureSet     textureSet,
-  bool           useAtlasing,
-  const Vector4& atlasRect,
-  bool           preMultiplied)
+void RollingImageCache::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
 {
-  DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::UploadComplete(textureId:%d) start\n", textureId);
+  DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "AnimatedImageVisual::LoadComplete(textureId:%d) start\n", textureInformation.textureId);
   LOG_CACHE;
 
   bool frontFrameReady = IsFrontReady();
 
   if(!mRequestingLoad)
   {
-    SetImageFrameReady(textureId);
+    SetImageFrameReady(textureInformation.textureId);
 
     CheckFrontFrame(frontFrameReady);
   }
   else
   {
-    // UploadComplete has been called from within RequestLoad. TextureManager must
+    // LoadComplete has been called from within RequestLoad. TextureManager must
     // therefore already have the texture cached, so make the texture ready.
     // (Use the last texture, as the texture id hasn't been assigned yet)
     mQueue.Back().mReady = true;
@@ -276,17 +270,6 @@ void RollingImageCache::UploadComplete(
   LOG_CACHE;
 }
 
-void RollingImageCache::LoadComplete(
-  bool               loadSuccess,
-  Devel::PixelBuffer pixelBuffer,
-  const VisualUrl&   url,
-  bool               preMultiplied)
-{
-  // LoadComplete is called if this TextureUploadObserver requested to load
-  // an image that will be returned as a type of PixelBuffer by using a method
-  // TextureManager::LoadPixelBuffer.
-}
-
 } //namespace Internal
 } //namespace Toolkit
 } //namespace Dali
index 1fcbe88..1490c41 100644 (file)
@@ -126,19 +126,7 @@ private:
   void CheckFrontFrame(bool wasReady);
 
 protected:
-  void UploadComplete(
-    bool           loadSuccess,
-    int32_t        textureId,
-    TextureSet     textureSet,
-    bool           useAtlasing,
-    const Vector4& atlasRect,
-    bool           preMultiplied) override;
-
-  void LoadComplete(
-    bool               loadSuccess,
-    Devel::PixelBuffer pixelBuffer,
-    const VisualUrl&   url,
-    bool               preMultiplied) override;
+  void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
 
 private:
   /**
index 7676bf8..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());
@@ -853,17 +853,17 @@ void ImageVisual::UploadCompleted()
 }
 
 // From Texture Manager
-void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied)
+void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureInformation)
 {
   Toolkit::Visual::ResourceStatus resourceStatus;
   if(mImpl->mRenderer)
   {
-    if(usingAtlas)
+    if(textureInformation.useAtlasing)
     {
       mImpl->mRenderer.RegisterProperty(ATLAS_RECT_UNIFORM_NAME, mAtlasRect);
     }
 
-    EnablePreMultipliedAlpha(preMultiplied);
+    EnablePreMultipliedAlpha(textureInformation.preMultiplied);
 
     Actor actor = mPlacementActor.GetHandle();
     if(!loadingSuccess)
@@ -874,14 +874,14 @@ void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, Texture
         imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
       }
       mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
-      textureSet = mImpl->mRenderer.GetTextures();
+      textureInformation.textureSet = mImpl->mRenderer.GetTextures();
     }
     else
     {
       Sampler sampler = Sampler::New();
       sampler.SetWrapMode(mWrapModeU, mWrapModeV);
-      textureSet.SetSampler(0u, sampler);
-      mImpl->mRenderer.SetTextures(textureSet);
+      textureInformation.textureSet.SetSampler(0u, sampler);
+      mImpl->mRenderer.SetTextures(textureInformation.textureSet);
     }
 
     if(actor)
@@ -895,7 +895,7 @@ void ImageVisual::UploadComplete(bool loadingSuccess, int32_t textureId, Texture
   // Storing TextureSet needed when renderer staged.
   if(!mImpl->mRenderer)
   {
-    mTextures = textureSet;
+    mTextures = textureInformation.textureSet;
   }
 
   // Image loaded, set status regardless of staged status.
index 55fb59b..bc94ffb 100644 (file)
@@ -248,25 +248,15 @@ public:
   void UploadCompleted() override;
 
   /**
-   * @copydoc TextureUploadObserver::UploadCompleted
+   * @copydoc TextureUploadObserver::LoadCompleted
    *
    * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
    * This callback is the place to add the renderer as it would be called once the loading is finished.
    */
-  void UploadComplete(bool success, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied) override;
+  void LoadComplete(bool success, TextureInformation textureInformation) override;
 
 private:
   /**
-   * @copydoc TextureUploadObserver::LoadComplete
-   *
-   * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
-   * This callback is the place to add the renderer as it would be called once the PixelBuffer loading is finished.
-   */
-  void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override
-  {
-  }
-
-  /**
    * Allocate the mask data when a masking property is defined in the property map
    */
   void AllocateMaskData();
index cb144b8..e8a6042 100644 (file)
@@ -224,11 +224,11 @@ void NPatchData::SetLoadedNPatchData(Devel::PixelBuffer& pixelBuffer, bool preMu
   mLoadingState = LoadingState::LOAD_COMPLETE;
 }
 
-void NPatchData::LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied)
+void NPatchData::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
 {
   if(loadSuccess)
   {
-    SetLoadedNPatchData(pixelBuffer, preMultiplied);
+    SetLoadedNPatchData(textureInformation.pixelBuffer, textureInformation.preMultiplied);
   }
   else
   {
@@ -238,7 +238,7 @@ void NPatchData::LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer,
   for(uint32_t index = 0; index < mObserverList.Count(); ++index)
   {
     TextureUploadObserver* observer = mObserverList[index];
-    observer->UploadComplete(loadSuccess, TextureManager::INVALID_TEXTURE_ID, mTextureSet, false, Vector4(), preMultiplied);
+    observer->LoadComplete(loadSuccess, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, TextureManager::INVALID_TEXTURE_ID, mTextureSet, false, Vector4(), textureInformation.preMultiplied));
   }
 }
 
index 7a052c4..94d7f2b 100644 (file)
@@ -253,22 +253,12 @@ public:
 
 private:
   /**
-   * @copydoc TextureUploadObserver::UploadCompleted
-   *
-   * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
-   * This callback is the place to add the renderer as it would be called once the loading is finished.
-   */
-  void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override
-  {
-  }
-
-  /**
    * @copydoc TextureUploadObserver::LoadComplete
    *
    * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
    * This callback is the place to add the renderer as it would be called once the loading is finished.
    */
-  void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override;
+  void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
 
 private:
   using ObserverListType = Dali::Vector<TextureUploadObserver*>;
index 1f48eca..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(&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);
-}
-
-void AddVertex(Vector<Vector2>& vertices, unsigned int x, unsigned int y)
-{
-  vertices.PushBack(Vector2(x, y));
-}
-
-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));
-  }
-}
-
-} //unnamed namespace
 
 /////////////////NPatchVisual////////////////
 
@@ -421,12 +337,12 @@ Geometry NPatchVisual::CreateGeometry()
       Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
       if(!data->GetRenderingMap())
       {
-        geometry = !mBorderOnly ? CreateGridGeometry(gridSize) : CreateBorderGeometry(gridSize);
+        geometry = !mBorderOnly ?  NPatchHelper::CreateGridGeometry(gridSize) :  NPatchHelper::CreateBorderGeometry(gridSize);
       }
       else
       {
         uint32_t elementCount[2];
-        geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : CreateBorderGeometry(gridSize);
+        geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) :  NPatchHelper::CreateBorderGeometry(gridSize);
         if(mImpl->mRenderer)
         {
           RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
@@ -530,29 +446,7 @@ void NPatchVisual::ApplyTextureAndUniforms()
   if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
   {
     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;
-
-      mImpl->mRenderer.RegisterProperty("uFixed[0]", Vector2::ZERO);
-      mImpl->mRenderer.RegisterProperty("uFixed[1]", Vector2(stretchX.GetX(), stretchY.GetX()));
-      mImpl->mRenderer.RegisterProperty("uFixed[2]", Vector2(data->GetCroppedWidth() - stretchWidth, data->GetCroppedHeight() - stretchHeight));
-      mImpl->mRenderer.RegisterProperty("uStretchTotal", Vector2(stretchWidth, stretchHeight));
-    }
-    else
-    {
-      mImpl->mRenderer.RegisterProperty("uNinePatchFactorsX[0]", Vector2::ZERO);
-      mImpl->mRenderer.RegisterProperty("uNinePatchFactorsY[0]", Vector2::ZERO);
-
-      RegisterStretchProperties(mImpl->mRenderer, "uNinePatchFactorsX", data->GetStretchPixelsX(), data->GetCroppedWidth());
-      RegisterStretchProperties(mImpl->mRenderer, "uNinePatchFactorsY", data->GetStretchPixelsY(), data->GetCroppedHeight());
-    }
+    NPatchHelper::ApplyTextureAndUniforms(mImpl->mRenderer, data);
   }
   else
   {
@@ -611,148 +505,17 @@ Geometry NPatchVisual::GetNinePatchGeometry(VisualFactoryCache::GeometryType sub
   {
     if(DALI_LIKELY(VisualFactoryCache::NINE_PATCH_GEOMETRY == subType))
     {
-      geometry = CreateGridGeometry(Uint16Pair(3, 3));
+      geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3, 3));
     }
     else if(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType)
     {
-      geometry = CreateBorderGeometry(Uint16Pair(3, 3));
+      geometry = NPatchHelper::CreateBorderGeometry(Uint16Pair(3, 3));
     }
     mFactoryCache.SaveGeometry(subType, geometry);
   }
   return geometry;
 }
 
-Geometry NPatchVisual::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 NPatchVisual::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 NPatchVisual::SetResource()
 {
   const NPatchData* data;
@@ -777,32 +540,34 @@ void NPatchVisual::SetResource()
   }
 }
 
-void NPatchVisual::UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied)
+void NPatchVisual::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
 {
-  EnablePreMultipliedAlpha(preMultiplied);
-  if(!loadSuccess)
-  {
-    // Image loaded and ready to display
-    ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
-  }
-
-  if(mAuxiliaryPixelBuffer || !mAuxiliaryUrl.IsValid())
+  if(textureInformation.returnType == TextureUploadObserver::ReturnType::TEXTURE)
   {
-    SetResource();
-  }
-}
+    EnablePreMultipliedAlpha(textureInformation.preMultiplied);
+    if(!loadSuccess)
+    {
+      // Image loaded and ready to display
+      ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+    }
 
-void NPatchVisual::LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied)
-{
-  if(loadSuccess && url.GetUrl() == mAuxiliaryUrl.GetUrl())
-  {
-    mAuxiliaryPixelBuffer = pixelBuffer;
-    SetResource();
+    if(mAuxiliaryPixelBuffer || !mAuxiliaryUrl.IsValid())
+    {
+      SetResource();
+    }
   }
-  else
+  else  // for the ReturnType::PIXEL_BUFFER
   {
-    // Image loaded and ready to display
-    ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+    if(loadSuccess && textureInformation.url == mAuxiliaryUrl.GetUrl())
+    {
+      mAuxiliaryPixelBuffer = textureInformation.pixelBuffer;
+      SetResource();
+    }
+    else
+    {
+      // Image loaded and ready to display
+      ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+    }
   }
 }
 
index 02db5a4..a266edc 100644 (file)
@@ -207,20 +207,12 @@ private:
 
 private:
   /**
-   * @copydoc TextureUploadObserver::UploadCompleted
+   * @copydoc TextureUploadObserver::LoadCompleted
    *
    * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
    * This callback is the place to add the renderer as it would be called once the loading is finished.
    */
-  void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override;
-
-  /**
-   * @copydoc TextureUploadObserver::LoadComplete
-   *
-   * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
-   * This callback is the place to add the renderer as it would be called once the loading is finished.
-   */
-  void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override;
+  void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
 
 private:
   WeakHandle<Actor>                         mPlacementActor; ///< Weakhandle to contain Actor during texture loading
index 49867c4..3578ede 100644 (file)
@@ -179,7 +179,7 @@ TextureSet TextureManager::LoadAnimatedImageTexture(
     TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
     if(loadState == TextureManager::LoadState::UPLOADED)
     {
-      // UploadComplete has already been called - keep the same texture set
+      // LoadComplete has already been called - keep the same texture set
       textureSet = GetTextureSet(textureId);
     }
   }
@@ -330,7 +330,7 @@ TextureSet TextureManager::LoadTexture(
         TextureManager::LoadState loadState = GetTextureStateInternal(textureId);
         if(loadState == TextureManager::LoadState::UPLOADED)
         {
-          // UploadComplete has already been called - keep the same texture set
+          // LoadComplete has already been called - keep the same texture set
           textureSet = GetTextureSet(textureId);
         }
 
@@ -978,7 +978,7 @@ void TextureManager::LoadOrQueueTexture(TextureInfo& textureInfo, TextureUploadO
       {
         // The Texture has already loaded. The other observers have already been notified.
         // We need to send a "late" loaded notification for this observer.
-        observer->UploadComplete(true, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied);
+        observer->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied));
       }
       break;
     }
@@ -1040,11 +1040,11 @@ void TextureManager::ProcessQueuedTextures()
       TextureInfo& textureInfo(mTextureInfoContainer[cacheIndex]);
       if(textureInfo.loadState == LoadState::UPLOADED)
       {
-        element.mObserver->UploadComplete(true, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied);
+        element.mObserver->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, textureInfo.textureId, textureInfo.textureSet, textureInfo.useAtlas, textureInfo.atlasRect, textureInfo.preMultiplied));
       }
       else if(textureInfo.loadState == LoadState::LOAD_FINISHED && textureInfo.storageType == StorageType::RETURN_PIXEL_BUFFER)
       {
-        element.mObserver->LoadComplete(true, textureInfo.pixelBuffer, textureInfo.url, textureInfo.preMultiplied);
+        element.mObserver->LoadComplete(true, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::PIXEL_BUFFER, textureInfo.pixelBuffer, textureInfo.url.GetUrl(), textureInfo.preMultiplied));
       }
       else
       {
@@ -1266,7 +1266,7 @@ void TextureManager::NotifyObservers(TextureInfo& textureInfo, bool success)
   {
     TextureUploadObserver* observer = info->observerList[0];
 
-    // During UploadComplete() a Control ResourceReady() signal is emitted.
+    // During LoadComplete() a Control ResourceReady() signal is emitted.
     // During that signal the app may add remove /add Textures (e.g. via
     // ImageViews).
     // It is possible for observers to be removed from the observer list,
@@ -1284,11 +1284,11 @@ void TextureManager::NotifyObservers(TextureInfo& textureInfo, bool success)
 
     if(info->storageType == StorageType::RETURN_PIXEL_BUFFER)
     {
-      observer->LoadComplete(success, info->pixelBuffer, info->url, info->preMultiplied);
+      observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::PIXEL_BUFFER, info->pixelBuffer, info->url.GetUrl(), info->preMultiplied));
     }
     else
     {
-      observer->UploadComplete(success, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, info->preMultiplied);
+      observer->LoadComplete(success, TextureUploadObserver::TextureInformation(TextureUploadObserver::ReturnType::TEXTURE, info->textureId, info->textureSet, info->useAtlas, info->atlasRect, info->preMultiplied));
     }
 
     // Get the textureInfo from the container again as it may have been invalidated.
index 7730d28..7ca7a05 100644 (file)
@@ -219,7 +219,7 @@ public:
    * @brief Requests an image load of the given URL.
    *
    * The parameters are used to specify how the image is loaded.
-   * The observer has the UploadComplete method called when the load is ready.
+   * The observer has the LoadComplete method called when the load is ready.
    *
    * When the client has finished with the Texture, Remove() should be called.
    *
@@ -276,7 +276,7 @@ public:
    * @brief Requests an image load of the given URL.
    *
    * The parameters are used to specify how the image is loaded.
-   * The observer has the UploadComplete method called when the load is ready.
+   * The observer has the LoadComplete method called when the load is ready.
    *
    * When the client has finished with the Texture, Remove() should be called.
    *
@@ -311,7 +311,7 @@ public:
    * the blended texture.
    *
    * The parameters are used to specify how the image is loaded.
-   * The observer has the UploadComplete method called when the load is ready.
+   * The observer has the LoadComplete method called when the load is ready.
    *
    * When the client has finished with the Texture, Remove() should be called.
    *
@@ -469,7 +469,7 @@ private:
    * CPU blend with the mask, and upload the blend texture.
    *
    * The parameters are used to specify how the image is loaded.
-   * The observer has the UploadComplete method called when the load is ready.
+   * The observer has the LoadComplete method called when the load is ready.
    *
    * When the client has finished with the Texture, Remove() should be called.
    *
@@ -752,12 +752,6 @@ private:
   bool CreateTiledGeometry(const Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo);
 
   /**
-   * Mark the texture as complete, and inform observers
-   * @param[in] textureInfo The struct associated with this Texture
-   */
-  void UploadComplete(TextureInfo& textureInfo);
-
-  /**
    * Notify the current observers that the texture upload is complete,
    * then remove the observers from the list.
    * @param[in] textureInfo The struct associated with this Texture
index 5c46ff2..6e18175 100644 (file)
 // CLASS HEADER
 #include "texture-upload-observer.h"
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+
 namespace Dali
 {
 namespace Toolkit
 {
+TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied)
+: returnType(returnType),
+  textureId(textureId),
+  textureSet(textureSet),
+  useAtlasing(useAtlasing),
+  atlasRect(atlasRect),
+  preMultiplied(preMultiplied),
+  pixelBuffer(),
+  url()
+{
+}
+
+TextureUploadObserver::TextureInformation::TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied)
+: returnType(returnType),
+  textureId(Internal::TextureManager::INVALID_TEXTURE_ID),
+  textureSet(),
+  useAtlasing(false),
+  atlasRect(Vector4::ZERO),
+  preMultiplied(preMultiplied),
+  pixelBuffer(pixelBuffer),
+  url(url)
+{
+}
+
 TextureUploadObserver::TextureUploadObserver()
 {
 }
index d6657a2..4bb21e8 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include <dali/public-api/rendering/texture-set.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-url.h>
 
 namespace Dali
 {
-class TextureSet;
 
 namespace Toolkit
 {
 /**
  * @brief Base class used to observe the upload status of a texture.
  *
- * Derived class must implement the UploadComplete method which is
+ * Derived class must implement the LoadComplete method which is
  * executed once the texture is ready to draw.
  */
 class TextureUploadObserver
@@ -43,6 +43,30 @@ class TextureUploadObserver
 public:
   typedef Signal<void(TextureUploadObserver*)> DestructionSignalType; ///< Signal prototype for the Destruction Signal.
 
+  enum class ReturnType
+  {
+    TEXTURE = 0,
+    PIXEL_BUFFER
+  };
+
+  struct TextureInformation
+  {
+    TextureInformation(ReturnType returnType, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied);
+    TextureInformation(ReturnType returnType, Devel::PixelBuffer pixelBuffer, const std::string& url, bool preMultiplied);
+
+    TextureInformation();
+
+    ReturnType                 returnType;    ///< Returned Texture type.
+    int32_t                    textureId;     ///< The textureId of the loaded texture in the TextureManager
+    TextureSet                 textureSet;    ///< The TextureSet containing the Texture
+    bool                       useAtlasing;   ///< True if atlasing was used (note: this may be different to what was requested)
+    const Vector4&             atlasRect;     ///< If using atlasing, this is the rectangle within the atlas to use.
+    bool                       preMultiplied; ///< True if the image had pre-multiplied alpha applied
+    Devel::PixelBuffer         pixelBuffer;   ///< The PixelBuffer of the loaded image.
+    std::string_view           url;           ///< The url address of the loaded image.
+  };
+
+public:
   /**
    * @brief Constructor.
    */
@@ -54,28 +78,14 @@ public:
   virtual ~TextureUploadObserver();
 
   /**
-   * The action to be taken once the async load has finished and the upload to GPU is completed.
-   * This should be overridden by the deriving class.
-   *
-   * @param[in] loadSuccess True if the texture load was successful (i.e. the resource is available). If false, then the resource failed to load. In future, this will automatically upload a "broken" image.
-   * @param[in] textureId   The textureId of the loaded texture in the TextureManager
-   * @param[in] textureSet  The TextureSet containing the Texture
-   * @param[in] useAtlasing True if atlasing was used (note: this may be different to what was requested)
-   * @param[in] atlasRect   If using atlasing, this is the rectangle within the atlas to use.
-   * @param[in] preMultiplied True if the image had pre-multiplied alpha applied
-   */
-  virtual void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) = 0;
-
-  /**
    * The action to be taken once the async load has finished.
+   * And in case of texture loading, this method is called after uploading.
    * This should be overridden by the deriving class.
    *
-   * @param[in] loadSuccess   True if the image load was successful (i.e. the resource is available). If false, then the resource failed to load.
-   * @param[in] pixelBuffer   The PixelBuffer of the loaded image.
-   * @param[in] url           The url address of the loaded image.
-   * @param[in] preMultiplied True if the image had pre-multiplied alpha applied
+   * @param[in] loadSuccess True if the texture load was successful (i.e. the resource is available). If false, then the resource failed to load. In future, this will automatically upload a "broken" image.
+   * @param[in] textureInformation Structure that contains loaded texture information.
    */
-  virtual void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const Internal::VisualUrl& url, bool preMultiplied) = 0;
+  virtual void LoadComplete(bool loadSuccess, TextureInformation textureInformation) = 0;
 
   /**
    * @brief Returns the destruction signal.
index febd285..a65c779 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
 #include <dali-toolkit/internal/visuals/svg/svg-visual.h>
 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
+#include <dali-toolkit/devel-api/utility/npatch-helper.h>
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -35,73 +36,14 @@ 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(&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
 
 VisualFactoryCache::VisualFactoryCache(bool preMultiplyOnLoad)
 : mSvgRasterizeThread(NULL),
   mVectorAnimationManager(),
   mPreMultiplyOnLoad(preMultiplyOnLoad),
-  mBrokenImageInfoContainer()
+  mBrokenImageInfoContainer(),
+  mDefaultBrokenImageUrl(""),
+  mUseDefaultBrokenImageOnly(true)
 {
 }
 
@@ -168,10 +110,7 @@ ImageAtlasManagerPtr VisualFactoryCache::GetAtlasManager()
   if(!mAtlasManager)
   {
     mAtlasManager = new ImageAtlasManager();
-    if(!mBrokenImageInfoContainer.empty())
-    {
-      mAtlasManager->SetBrokenImage(mBrokenImageInfoContainer[0].url);
-    }
+    mAtlasManager->SetBrokenImage(mDefaultBrokenImageUrl);
   }
 
   return mAtlasManager;
@@ -302,14 +241,17 @@ bool VisualFactoryCache::GetPreMultiplyOnLoad()
   return mPreMultiplyOnLoad;
 }
 
-void VisualFactoryCache::SetBrokenImageUrl(const std::vector<std::string>& brokenImageUrlList)
+void VisualFactoryCache::SetBrokenImageUrl(std::string& defaultBrokenUrl, const std::vector<std::string>& brokenImageUrlList)
 {
+  mUseDefaultBrokenImageOnly = false;
   mBrokenImageInfoContainer.clear();
   mBrokenImageInfoContainer.assign(brokenImageUrlList.size(), BrokenImageInfo());
   for(unsigned int i = 0; i < brokenImageUrlList.size(); i++)
   {
     mBrokenImageInfoContainer[i].url = brokenImageUrlList[i];
   }
+
+  mDefaultBrokenImageUrl = defaultBrokenUrl;
 }
 
 VisualUrl::Type VisualFactoryCache::GetBrokenImageVisualType(int index)
@@ -317,40 +259,6 @@ VisualUrl::Type VisualFactoryCache::GetBrokenImageVisualType(int index)
   return mBrokenImageInfoContainer[index].visualType;
 }
 
-Geometry VisualFactoryCache::CreateNPatchGeometry(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 VisualFactoryCache::GetNPatchGeometry(int index)
 {
   Geometry          geometry;
@@ -362,14 +270,14 @@ Geometry VisualFactoryCache::GetNPatchGeometry(int index)
       geometry = GetGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
       if(!geometry)
       {
-        geometry = CreateNPatchGeometry(Uint16Pair(3,3));
+        geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3,3));
         SaveGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY, geometry);
       }
     }
     else if(data->GetStretchPixelsX().Size() > 0 || data->GetStretchPixelsY().Size() > 0)
     {
       Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
-      geometry = CreateNPatchGeometry(gridSize);
+      geometry = NPatchHelper::CreateGridGeometry(gridSize);
     }
   }
   else
@@ -378,7 +286,7 @@ Geometry VisualFactoryCache::GetNPatchGeometry(int index)
     geometry = GetGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
     if(!geometry)
     {
-      geometry = CreateNPatchGeometry(Uint16Pair(3,3));
+      geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3,3));
       SaveGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY, geometry);
     }
   }
@@ -401,7 +309,7 @@ Shader VisualFactoryCache::GetNPatchShader(int index)
     yStretchCount = data->GetStretchPixelsY().Count();
   }
 
-  if(DALI_LIKELY((xStretchCount == 0 && yStretchCount == 0)))
+  if(DALI_LIKELY((xStretchCount == 0 && yStretchCount == 0) || (xStretchCount == 1 && yStretchCount == 1)))
   {
     shader = GetShader(VisualFactoryCache::NINE_PATCH_SHADER);
     if(DALI_UNLIKELY(!shader))
@@ -423,37 +331,6 @@ Shader VisualFactoryCache::GetNPatchShader(int index)
   return shader;
 }
 
-void VisualFactoryCache::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 VisualFactoryCache::ApplyTextureAndUniforms(Renderer& renderer, int index)
 {
   const NPatchData* data;
@@ -461,38 +338,23 @@ void VisualFactoryCache::ApplyTextureAndUniforms(Renderer& renderer, int index)
   if(mNPatchLoader.GetNPatchData(mBrokenImageInfoContainer[index].npatchId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
   {
     textureSet = data->GetTextures();
-    mBrokenImageInfoContainer[index].texture = data->GetTextures().GetTexture(0);
-
-    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());
-    }
+    mBrokenImageInfoContainer[index].texture = textureSet.GetTexture(0);
+    NPatchHelper::ApplyTextureAndUniforms(renderer, data);
     renderer.SetTextures(textureSet);
   }
 }
 
 void VisualFactoryCache::UpdateBrokenImageRenderer(Renderer& renderer, const Vector2& size)
 {
+
+  bool useDefaultBrokenImage = false;
+  if(mBrokenImageInfoContainer.size() == 0)
+  {
+    useDefaultBrokenImage = true;
+  }
+
   // Load Information for broken image
-  for(uint32_t index = 0; index < mBrokenImageInfoContainer.size(); index++)
+  for(uint32_t index = 0; (index  < mBrokenImageInfoContainer.size()) && !useDefaultBrokenImage; index++)
   {
     if(mBrokenImageInfoContainer[index].width == 0 && mBrokenImageInfoContainer[index].height == 0)
     {
@@ -512,17 +374,36 @@ void VisualFactoryCache::UpdateBrokenImageRenderer(Renderer& renderer, const Vec
           }
           else
           {
-            DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [path:%s] \n",mBrokenImageInfoContainer[index].url.c_str());
+            DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [index:%d] [path:%s] \n",index, mBrokenImageInfoContainer[index].url.c_str());
+            useDefaultBrokenImage = true;
           }
         }
         else
         {
-          GetBrokenVisualImage(index);
+          if(!GetBrokenVisualImage(index))
+          {
+            DALI_LOG_ERROR("Can't update renderer for broken image. maybe image loading is failed [index:%d] [path:%s] \n",index, mBrokenImageInfoContainer[index].url.c_str());
+            useDefaultBrokenImage = true;
+          }
         }
       }
     }
   }
 
+  if(!mUseDefaultBrokenImageOnly && useDefaultBrokenImage)
+  {
+    // Clear broken info
+    mBrokenImageInfoContainer.clear();
+
+    // assign for broken image
+    const int defaultBrokenIndex = 0;
+    mBrokenImageInfoContainer.assign(1, BrokenImageInfo());
+    mBrokenImageInfoContainer[defaultBrokenIndex].url = mDefaultBrokenImageUrl;
+    VisualUrl visualUrl(mBrokenImageInfoContainer[defaultBrokenIndex].url);
+    mBrokenImageInfoContainer[defaultBrokenIndex].visualType = visualUrl.GetType();
+    mUseDefaultBrokenImageOnly = true;
+  }
+
   // Set Texutre to renderer
   int brokenIndex = GetProperBrokenImageIndex(size);
   if(GetBrokenImageVisualType(brokenIndex) == VisualUrl::N_PATCH)
@@ -547,7 +428,7 @@ int32_t VisualFactoryCache::GetProperBrokenImageIndex(const Vector2& size)
 {
   // Sets the default broken type
   int32_t returnIndex = 0;
-  if((size.width == 0 || size.height == 0))
+  if((size.width == 0 || size.height == 0) || mUseDefaultBrokenImageOnly )
   {
     // To do : Need to add observer about size
     return returnIndex;
index deae0b0..b19bad4 100644 (file)
@@ -195,7 +195,7 @@ public:
    * @brief Set an image to be used when a visual has failed to correctly render
    * @param[in] brokenImageUrlList The broken image url list
    */
-  void SetBrokenImageUrl(const std::vector<std::string>& brokenImageUrlList);
+  void SetBrokenImageUrl(std::string& defaultBrokenUrl, const std::vector<std::string>& brokenImageUrlList);
 
   /**
    * @brief Update the broken image Renderer object
@@ -272,14 +272,6 @@ private:
   void ApplyTextureAndUniforms(Renderer& renderer, int index);
 
   /**
-   * @brief Creates a Npatch Geometry object
-   *
-   * @param[in] gridSize The gridSize for creating a geometry
-   * @return The Geometry for NPatch
-   */
-  Geometry CreateNPatchGeometry(Uint16Pair gridSize);
-
-  /**
    * @brief Gets a geometry for npatch image
    *
    * @param[in] index the index of broken image
@@ -296,16 +288,6 @@ private:
   Shader GetNPatchShader(int index);
 
   /**
-   * @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 Returns a broken image type
    * @param[in] index BrokenImage index
    * @return The broken image type.
@@ -349,6 +331,8 @@ private:
   std::unique_ptr<VectorAnimationManager> mVectorAnimationManager;
   bool                                    mPreMultiplyOnLoad;
   std::vector<BrokenImageInfo>            mBrokenImageInfoContainer;
+  std::string                             mDefaultBrokenImageUrl;
+  bool                                    mUseDefaultBrokenImageOnly;
 };
 
 } // namespace Internal
index 112fdd3..4220b00 100644 (file)
@@ -377,20 +377,12 @@ void VisualFactory::SetBrokenImageUrl(Toolkit::StyleManager& styleManager)
   if(styleManager)
   {
     customBrokenImageUrlList = Toolkit::DevelStyleManager::GetBrokenImageUrlList(styleManager);
-    if(customBrokenImageUrlList.size() == 0)
-    {
-      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
-      config["brokenImageUrl"].Get(brokenImageUrl);
-      customBrokenImageUrlList.push_back(brokenImageUrl);
-    }
-    mFactoryCache->SetBrokenImageUrl(customBrokenImageUrlList);
-  }
-  else
-  {
-    // Set default image
-    customBrokenImageUrlList.push_back(brokenImageUrl);
-    mFactoryCache->SetBrokenImageUrl(customBrokenImageUrlList);
+    Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
+    config["brokenImageUrl"].Get(brokenImageUrl);
   }
+
+  // Add default image
+  mFactoryCache->SetBrokenImageUrl(brokenImageUrl, customBrokenImageUrlList);
 }
 
 Internal::VisualFactoryCache& VisualFactory::GetFactoryCache()
index db99728..9c52f22 100644 (file)
@@ -566,7 +566,7 @@ void Control::OnPropertySet(Property::Index index, const Property::Value& proper
     }
     case Actor::Property::VISIBLE:
     {
-      if(Dali::Accessibility::IsUp())
+      if(Dali::Accessibility::IsUp() && !Self().GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN))
       {
         Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get<bool>());
       }
index ed05a9a..4223c6f 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 3;
+const unsigned int TOOLKIT_MICRO_VERSION = 4;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 10bf3ed..d67f76d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.1.3
+Version:    2.1.4
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT