Make sure Emit* is only enabled for ActorAccessible 16/315716/2
authorYoungsun Suh <youngsun.suh@samsung.com>
Wed, 4 Dec 2024 08:03:21 +0000 (17:03 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Wed, 4 Dec 2024 09:01:50 +0000 (18:01 +0900)
Change-Id: Ia6b3525f9a93aa1d7e4a5361890ee7e62ea1bb11

12 files changed:
dali/devel-api/adaptor-framework/accessibility-bridge.h
dali/devel-api/adaptor-framework/accessibility.cpp
dali/devel-api/adaptor-framework/actor-accessible.cpp
dali/devel-api/adaptor-framework/actor-accessible.h
dali/devel-api/atspi-interfaces/accessible.h
dali/internal/accessibility/bridge/accessible.cpp
dali/internal/accessibility/bridge/bridge-base.h
dali/internal/accessibility/bridge/bridge-object.cpp
dali/internal/accessibility/bridge/bridge-object.h
dali/internal/accessibility/bridge/dummy/dummy-atspi.cpp
dali/internal/accessibility/bridge/dummy/dummy-atspi.h
dali/internal/window-system/common/window-impl.cpp

index b7d1615c2803e46e42045805afc4ef1eabf6c44b..cf57cf7aa18f35922b4c933cd956a67639457ca5 100644 (file)
@@ -325,13 +325,6 @@ struct DALI_ADAPTOR_API Bridge
    **/
   virtual void EmitMovedOutOfScreen(Accessible* obj, ScreenRelativeMoveType type) = 0;
 
-  /**
-   * @brief Emits "org.a11y.atspi.Socket.Available" event on AT-SPI bus.
-   *
-   * @param obj Accessible object
-   */
-  virtual void EmitSocketAvailable(Accessible* obj) = 0;
-
   /**
    * @brief Emits ScrollStarted event on at-spi bus.
    *
index 4c6c0a66f697f4e282206c633209c68164a98e26..f56f6184a3db9d53de81df002c2d33931bed1801 100644 (file)
@@ -530,7 +530,14 @@ public:
 
   void OnPostRender()
   {
-    Accessibility::Bridge::GetCurrentBridge()->EmitPostRender(shared_from_this());
+    try
+    {
+      Accessibility::Bridge::GetCurrentBridge()->EmitPostRender(shared_from_this());
+    }
+    catch(const std::bad_weak_ptr& e)
+    {
+      DALI_LOG_ERROR("bad_weak_ptr exception caught: %s", e.what());
+    }
   }
 }; // AdaptorAccessible
 
index b32ea47379b442f9a4f8351296dee75cd7e7b20a..eadf661625cf9cc9857653e254f164a8eef4a0f6 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/actors/actor-devel.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 
+using namespace Dali::Accessibility;
+
+namespace
+{
+bool UpdateLastEmitted(std::map<State, int>& lastEmitted, State state, int newValue)
+{
+  bool updated                = false;
+  const auto [iter, inserted] = lastEmitted.emplace(state, newValue);
+  if(!inserted && iter->second != newValue)
+  {
+    iter->second = newValue;
+    updated      = true;
+  }
+
+  return inserted || updated;
+}
+
+bool IsModalRole(Role role)
+{
+  return role == Role::POPUP_MENU || role == Role::PANEL || role == Role::DIALOG || role == Role::PAGE_TAB;
+}
+
+bool IsWindowRole(Role role)
+{
+  return role == Role::WINDOW || role == Role::FRAME || role == Role::INPUT_METHOD_WINDOW;
+}
+
+bool ShouldEmitVisible(Accessible* accessible)
+{
+  Role role = accessible->GetRole();
+  return IsWindowRole(role);
+}
+
+bool ShouldEmitShowing(Accessible* accessible, bool showing)
+{
+  Role role = accessible->GetRole();
+  return IsWindowRole(role) || IsModalRole(role) || (showing && role == Role::NOTIFICATION) ||
+         (!showing && accessible->IsHighlighted()) || accessible->GetStates()[State::MODAL];
+}
+
+} // namespace
+
 namespace Dali::Accessibility
 {
 ActorAccessible::ActorAccessible(Actor actor)
@@ -207,11 +250,187 @@ void ActorAccessible::UpdateChildren()
 
   // Erase-remove idiom
   // TODO (C++20): Replace with std::erase_if
-  auto it = std::remove_if(mChildren.begin(), mChildren.end(), [shouldIncludeHidden](const Accessible* child) {
-    return !child || (!shouldIncludeHidden && child->IsHidden());
-  });
+  auto it = std::remove_if(mChildren.begin(), mChildren.end(), [shouldIncludeHidden](const Accessible* child) { return !child || (!shouldIncludeHidden && child->IsHidden()); });
   mChildren.erase(it, mChildren.end());
   mChildren.shrink_to_fit();
 }
 
+void ActorAccessible::EmitActiveDescendantChanged(Accessible* child)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitActiveDescendantChanged(this, child);
+  }
+}
+
+void ActorAccessible::EmitStateChanged(State state, int newValue, int reserved)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bool shouldEmit{false};
+
+    switch(state)
+    {
+      case State::SHOWING:
+      {
+        shouldEmit = ShouldEmitShowing(this, static_cast<bool>(newValue));
+        break;
+      }
+      case State::VISIBLE:
+      {
+        shouldEmit = ShouldEmitVisible(this);
+        break;
+      }
+      default:
+      {
+        shouldEmit = UpdateLastEmitted(mLastEmittedState, state, newValue);
+        break;
+      }
+    }
+
+    if(shouldEmit)
+    {
+      try
+      {
+        bridgeData->mBridge->EmitStateChanged(shared_from_this(), state, newValue, reserved);
+      }
+      catch(const std::bad_weak_ptr& e)
+      {
+        DALI_LOG_ERROR("bad_weak_ptr exception caught: %s", e.what());
+      }
+    }
+  }
+}
+
+void ActorAccessible::EmitShowing(bool isShowing)
+{
+  EmitStateChanged(State::SHOWING, isShowing ? 1 : 0);
+}
+
+void ActorAccessible::EmitVisible(bool isVisible)
+{
+  EmitStateChanged(State::VISIBLE, isVisible ? 1 : 0);
+}
+
+void ActorAccessible::EmitHighlighted(bool isHighlighted)
+{
+  EmitStateChanged(State::HIGHLIGHTED, isHighlighted ? 1 : 0);
+}
+
+void ActorAccessible::EmitFocused(bool isFocused)
+{
+  EmitStateChanged(State::FOCUSED, isFocused ? 1 : 0);
+}
+
+void ActorAccessible::EmitTextInserted(unsigned int position, unsigned int length, const std::string& content)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitTextChanged(this, TextChangedState::INSERTED, position, length, content);
+  }
+}
+void ActorAccessible::EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitTextChanged(this, TextChangedState::DELETED, position, length, content);
+  }
+}
+void ActorAccessible::EmitTextCursorMoved(unsigned int cursorPosition)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitCursorMoved(this, cursorPosition);
+  }
+}
+
+void ActorAccessible::EmitMovedOutOfScreen(ScreenRelativeMoveType type)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitMovedOutOfScreen(this, type);
+  }
+}
+
+void ActorAccessible::EmitScrollStarted()
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitScrollStarted(this);
+  }
+}
+
+void ActorAccessible::EmitScrollFinished()
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->EmitScrollFinished(this);
+  }
+}
+
+void ActorAccessible::Emit(WindowEvent event, unsigned int detail)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    bridgeData->mBridge->Emit(this, event, detail);
+  }
+}
+void ActorAccessible::Emit(ObjectPropertyChangeEvent event)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    try
+    {
+      bridgeData->mBridge->Emit(shared_from_this(), event);
+    }
+    catch(const std::bad_weak_ptr& e)
+    {
+      DALI_LOG_ERROR("bad_weak_ptr exception caught: %s", e.what());
+    }
+  }
+}
+
+void ActorAccessible::EmitBoundsChanged(Rect<> rect)
+{
+  if(auto bridgeData = GetBridgeData())
+  {
+    try
+    {
+      bridgeData->mBridge->EmitBoundsChanged(shared_from_this(), rect);
+    }
+    catch(const std::bad_weak_ptr& e)
+    {
+      DALI_LOG_ERROR("bad_weak_ptr exception caught: %s", e.what());
+    }
+  }
+}
+
+void ActorAccessible::NotifyAccessibilityStateChange(Dali::Accessibility::States states, bool isRecursive)
+{
+  if(Accessibility::IsUp())
+  {
+    const auto newStates = GetStates();
+    for(auto i = 0u; i < static_cast<unsigned int>(Dali::Accessibility::State::MAX_COUNT); i++)
+    {
+      const auto index = static_cast<Dali::Accessibility::State>(i);
+      if(states[index])
+      {
+        EmitStateChanged(index, newStates[index]);
+      }
+    }
+
+    if(isRecursive)
+    {
+      auto children = GetChildren();
+      for(auto child : children)
+      {
+        if(auto accessible = dynamic_cast<ActorAccessible*>(child))
+        {
+          accessible->NotifyAccessibilityStateChange(states, isRecursive);
+        }
+      }
+    }
+  }
+}
+
 } // namespace Dali::Accessibility
index a1a3e529e66d21f76cb0ef7cc48304f5a6031925..a830a1bbc12b7ea2f10694a892f90d1246998818 100644 (file)
@@ -34,7 +34,8 @@ class DALI_ADAPTOR_API ActorAccessible : public virtual Accessible,
                                          public virtual Collection,
                                          public virtual Component,
                                          public Dali::ConnectionTracker,
-                                         public Dali::BaseObjectObserver
+                                         public Dali::BaseObjectObserver,
+                                         public std::enable_shared_from_this<ActorAccessible>
 {
 public:
   ActorAccessible() = delete;
@@ -124,6 +125,132 @@ public:
    */
   void OnChildrenChanged();
 
+  /**
+   * @brief Helper function for emiting active-descendant-changed event.
+   *
+   * @param[in] child The child of the object
+   */
+  void EmitActiveDescendantChanged(Accessible* child);
+
+  /**
+   * @brief Helper function for emiting state-changed event.
+   *
+   * @param[in] state The accessibility state (SHOWING, HIGHLIGHTED, etc)
+   * @param[in] newValue Whether the state value is changed to new value or not.
+   * @param[in] reserved Reserved. (TODO : Currently, this argument is not implemented in dali)
+   *
+   * @note The second argument determines which value is depending on State.
+   * For instance, if the state is PRESSED, newValue means isPressed or isSelected.
+   * If the state is SHOWING, newValue means isShowing.
+   */
+  void EmitStateChanged(State state, int newValue, int reserved = 0);
+
+  /**
+   * @brief Helper function for emiting bounds-changed event.
+   *
+   * @param rect The rectangle for changed bounds
+   */
+  void EmitBoundsChanged(Rect<> rect);
+
+  /**
+   * @brief Emits "showing" event.
+   * The method informs accessibility clients about "showing" state.
+   *
+   * @param[in] isShowing The flag pointing if object is showing
+   */
+  void EmitShowing(bool isShowing);
+
+  /**
+   * @brief Emits "visible" event.
+   * The method informs accessibility clients about "visible" state.
+   *
+   * @param[in] isVisible The flag pointing if object is visible
+   */
+  void EmitVisible(bool isVisible);
+
+  /**
+   * @brief Emits "highlighted" event.
+   * The method informs accessibility clients about "highlighted" state.
+   *
+   * @param[in] isHighlighted The flag pointing if object is highlighted
+   */
+  void EmitHighlighted(bool isHighlighted);
+
+  /**
+   * @brief Emits "focused" event.
+   * The method informs accessibility clients about "focused" state.
+   *
+   * @param[in] isFocused The flag pointing if object is focused
+   */
+  void EmitFocused(bool isFocused);
+
+  /**
+   * @brief Emits "text inserted" event.
+   *
+   * @param[in] position The cursor position
+   * @param[in] length The text length
+   * @param[in] content The inserted text
+   */
+  void EmitTextInserted(unsigned int position, unsigned int length, const std::string& content);
+
+  /**
+   * @brief Emits "text deleted" event.
+   *
+   * @param[in] position The cursor position
+   * @param[in] length The text length
+   * @param[in] content The deleted text
+   */
+  void EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content);
+
+  /**
+   * @brief Emits "cursor moved" event.
+   *
+   * @param[in] cursorPosition The new cursor position
+   */
+  void EmitTextCursorMoved(unsigned int cursorPosition);
+
+  /**
+   * @brief Emits "MoveOuted" event.
+   *
+   * @param[in] type moved out of screen type
+   */
+  void EmitMovedOutOfScreen(ScreenRelativeMoveType type);
+
+  /**
+   * @brief Emits "ScrollStarted" event.
+   *
+   */
+  void EmitScrollStarted();
+
+  /**
+   * @brief Emits "ScrollFinished" event.
+   *
+   */
+  void EmitScrollFinished();
+
+  /**
+   * @brief Emits "highlighted" event.
+   *
+   * @param[in] event The enumerated window event
+   * @param[in] detail The additional parameter which interpretation depends on chosen event
+   */
+  void Emit(WindowEvent event, unsigned int detail = 0);
+
+  /**
+   * @brief Emits property-changed event.
+   *
+   * @param[in] event Property changed event
+   **/
+  void Emit(ObjectPropertyChangeEvent event);
+
+  /**
+   * @brief Re-emits selected states of an Accessibility Object.
+   *
+   * @param[in] states The chosen states to re-emit
+   * @param[in] isRecursive If true, all children of the Accessibility object will also re-emit the states
+   */
+  void NotifyAccessibilityStateChange(Dali::Accessibility::States states, bool isRecursive);
+
 protected:
   Dali::Actor Self() const
   {
@@ -167,6 +294,7 @@ private:
   std::vector<Accessible*>      mChildren;
   bool                          mChildrenDirty;
   const uint32_t                mActorId;
+  std::map<State, int>          mLastEmittedState;
 };
 
 } // namespace Dali::Accessibility
index 3ff4dcdb4cf66b491d9dea86a1630a2e16c97f68..e14ffb67adc0d871c33c4edd9e2d8ea0791f860a 100644 (file)
@@ -35,137 +35,11 @@ namespace Dali::Accessibility
 /**
  * @brief Basic interface implemented by all accessibility objects.
  */
-class DALI_ADAPTOR_API Accessible : public std::enable_shared_from_this<Accessible>
+class DALI_ADAPTOR_API Accessible
 {
 public:
   virtual ~Accessible() noexcept;
 
-  /**
-   * @brief Helper function for emiting active-descendant-changed event.
-   *
-   * @param[in] child The child of the object
-   */
-  void EmitActiveDescendantChanged(Accessible* child);
-
-  /**
-   * @brief Helper function for emiting state-changed event.
-   *
-   * @param[in] state The accessibility state (SHOWING, HIGHLIGHTED, etc)
-   * @param[in] newValue Whether the state value is changed to new value or not.
-   * @param[in] reserved Reserved. (TODO : Currently, this argument is not implemented in dali)
-   *
-   * @note The second argument determines which value is depending on State.
-   * For instance, if the state is PRESSED, newValue means isPressed or isSelected.
-   * If the state is SHOWING, newValue means isShowing.
-   */
-  void EmitStateChanged(State state, int newValue, int reserved = 0);
-
-  /**
-   * @brief Helper function for emiting bounds-changed event.
-   *
-   * @param rect The rectangle for changed bounds
-   */
-  void EmitBoundsChanged(Rect<> rect);
-
-  /**
-   * @brief Emits "showing" event.
-   * The method informs accessibility clients about "showing" state.
-   *
-   * @param[in] isShowing The flag pointing if object is showing
-   */
-  void EmitShowing(bool isShowing);
-
-  /**
-   * @brief Emits "visible" event.
-   * The method informs accessibility clients about "visible" state.
-   *
-   * @param[in] isVisible The flag pointing if object is visible
-   */
-  void EmitVisible(bool isVisible);
-
-  /**
-   * @brief Emits "highlighted" event.
-   * The method informs accessibility clients about "highlighted" state.
-   *
-   * @param[in] isHighlighted The flag pointing if object is highlighted
-   */
-  void EmitHighlighted(bool isHighlighted);
-
-  /**
-   * @brief Emits "focused" event.
-   * The method informs accessibility clients about "focused" state.
-   *
-   * @param[in] isFocused The flag pointing if object is focused
-   */
-  void EmitFocused(bool isFocused);
-
-  /**
-   * @brief Emits "text inserted" event.
-   *
-   * @param[in] position The cursor position
-   * @param[in] length The text length
-   * @param[in] content The inserted text
-   */
-  void EmitTextInserted(unsigned int position, unsigned int length, const std::string& content);
-
-  /**
-   * @brief Emits "text deleted" event.
-   *
-   * @param[in] position The cursor position
-   * @param[in] length The text length
-   * @param[in] content The deleted text
-   */
-  void EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content);
-
-  /**
-   * @brief Emits "cursor moved" event.
-   *
-   * @param[in] cursorPosition The new cursor position
-   */
-  void EmitTextCursorMoved(unsigned int cursorPosition);
-
-  /**
-   * @brief Emits "MoveOuted" event.
-   *
-   * @param[in] type moved out of screen type
-   */
-  void EmitMovedOutOfScreen(ScreenRelativeMoveType type);
-
-  /**
-   * @brief Emits "org.a11y.atspi.Socket.Available" signal.
-   */
-  // This belongs to Dali::Accessibility::Socket. However, all Emit*() helpers
-  // are here in Accessible, regardless of what interface they belong to (perhaps
-  // to spare a dynamic_cast if used like this: Accessible::Get()->Emit*(...)).
-  void EmitSocketAvailable();
-
-  /**
-   * @brief Emits "ScrollStarted" event.
-   *
-   */
-  void EmitScrollStarted();
-
-  /**
-   * @brief Emits "ScrollFinished" event.
-   *
-   */
-  void EmitScrollFinished();
-
-  /**
-   * @brief Emits "highlighted" event.
-   *
-   * @param[in] event The enumerated window event
-   * @param[in] detail The additional parameter which interpretation depends on chosen event
-   */
-  void Emit(WindowEvent event, unsigned int detail = 0);
-
-  /**
-   * @brief Emits property-changed event.
-   *
-   * @param[in] event Property changed event
-   **/
-  void Emit(ObjectPropertyChangeEvent event);
-
   /**
    * @brief Gets accessibility name.
    *
@@ -317,14 +191,6 @@ public:
    */
   virtual bool DoGesture(const GestureInfo& gestureInfo) = 0;
 
-  /**
-   * @brief Re-emits selected states of an Accessibility Object.
-   *
-   * @param[in] states The chosen states to re-emit
-   * @param[in] isRecursive If true, all children of the Accessibility object will also re-emit the states
-   */
-  void NotifyAccessibilityStateChange(Dali::Accessibility::States states, bool isRecursive);
-
   /**
    * @brief Gets information about current object and all relations that connects
    * it with other accessibility objects.
@@ -515,7 +381,6 @@ private:
   mutable AtspiInterfaces             mInterfaces;
   AtspiEvents                         mSuppressedEvents;
   bool                                mIsOnRootLevel = false;
-  std::map<State, int>                mLastEmittedState;
 
 }; // Accessible class
 
index 49dd6ee8ec198a1afd6530d6b89180e20efc077b..6661e4f0bb45b82a7eb0dade66736456a913fd18 100644 (file)
 
 using namespace Dali::Accessibility;
 
-namespace
-{
-bool UpdateLastEmitted(std::map<State, int>& lastEmitted, State state, int newValue)
-{
-  bool updated                = false;
-  const auto [iter, inserted] = lastEmitted.emplace(state, newValue);
-  if(!inserted && iter->second != newValue)
-  {
-    iter->second = newValue;
-    updated      = true;
-  }
-
-  return inserted || updated;
-}
-
-bool IsModalRole(Role role)
-{
-  return role == Role::POPUP_MENU || role == Role::PANEL || role == Role::DIALOG || role == Role::PAGE_TAB;
-}
-
-bool IsWindowRole(Role role)
-{
-  return role == Role::WINDOW || role == Role::FRAME || role == Role::INPUT_METHOD_WINDOW;
-}
-
-bool ShouldEmitVisible(Accessible* accessible)
-{
-  Role role = accessible->GetRole();
-  return IsWindowRole(role);
-}
-
-bool ShouldEmitShowing(Accessible* accessible, bool showing)
-{
-  Role role = accessible->GetRole();
-  return IsWindowRole(role) || IsModalRole(role) || (showing && role == Role::NOTIFICATION) ||
-         (!showing && accessible->IsHighlighted()) || accessible->GetStates()[State::MODAL];
-}
-
-} // namespace
-
 Accessible::Accessible()
 {
 }
@@ -78,145 +38,6 @@ Accessible::~Accessible() noexcept
   }
 }
 
-void Accessible::EmitActiveDescendantChanged(Accessible* child)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitActiveDescendantChanged(this, child);
-  }
-}
-
-void Accessible::EmitStateChanged(State state, int newValue, int reserved)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bool shouldEmit{false};
-
-    switch(state)
-    {
-      case State::SHOWING:
-      {
-        shouldEmit = ShouldEmitShowing(this, static_cast<bool>(newValue));
-        break;
-      }
-      case State::VISIBLE:
-      {
-        shouldEmit = ShouldEmitVisible(this);
-        break;
-      }
-      default:
-      {
-        shouldEmit = UpdateLastEmitted(mLastEmittedState, state, newValue);
-        break;
-      }
-    }
-
-    if(shouldEmit)
-    {
-      bridgeData->mBridge->EmitStateChanged(shared_from_this(), state, newValue, reserved);
-    }
-  }
-}
-
-void Accessible::EmitShowing(bool isShowing)
-{
-  EmitStateChanged(State::SHOWING, isShowing ? 1 : 0);
-}
-
-void Accessible::EmitVisible(bool isVisible)
-{
-  EmitStateChanged(State::VISIBLE, isVisible ? 1 : 0);
-}
-
-void Accessible::EmitHighlighted(bool isHighlighted)
-{
-  EmitStateChanged(State::HIGHLIGHTED, isHighlighted ? 1 : 0);
-}
-
-void Accessible::EmitFocused(bool isFocused)
-{
-  EmitStateChanged(State::FOCUSED, isFocused ? 1 : 0);
-}
-
-void Accessible::EmitTextInserted(unsigned int position, unsigned int length, const std::string& content)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitTextChanged(this, TextChangedState::INSERTED, position, length, content);
-  }
-}
-void Accessible::EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitTextChanged(this, TextChangedState::DELETED, position, length, content);
-  }
-}
-void Accessible::EmitTextCursorMoved(unsigned int cursorPosition)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitCursorMoved(this, cursorPosition);
-  }
-}
-
-void Accessible::EmitMovedOutOfScreen(ScreenRelativeMoveType type)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitMovedOutOfScreen(this, type);
-  }
-}
-
-void Accessible::EmitSocketAvailable()
-{
-  DALI_ASSERT_DEBUG(Socket::DownCast(this));
-
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitSocketAvailable(this);
-  }
-}
-
-void Accessible::EmitScrollStarted()
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitScrollStarted(this);
-  }
-}
-
-void Accessible::EmitScrollFinished()
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitScrollFinished(this);
-  }
-}
-
-void Accessible::Emit(WindowEvent event, unsigned int detail)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->Emit(this, event, detail);
-  }
-}
-void Accessible::Emit(ObjectPropertyChangeEvent event)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->Emit(shared_from_this(), event);
-  }
-}
-
-void Accessible::EmitBoundsChanged(Rect<> rect)
-{
-  if(auto bridgeData = GetBridgeData())
-  {
-    bridgeData->mBridge->EmitBoundsChanged(shared_from_this(), rect);
-  }
-}
-
 std::shared_ptr<Bridge::Data> Accessible::GetBridgeData() const
 {
   auto handle = mBridgeData.lock();
@@ -268,28 +89,3 @@ bool Accessible::IsProxy() const
 {
   return false;
 }
-
-void Accessible::NotifyAccessibilityStateChange(Dali::Accessibility::States states, bool isRecursive)
-{
-  if(Accessibility::IsUp())
-  {
-    const auto newStates = GetStates();
-    for(auto i = 0u; i < static_cast<unsigned int>(Dali::Accessibility::State::MAX_COUNT); i++)
-    {
-      const auto index = static_cast<Dali::Accessibility::State>(i);
-      if(states[index])
-      {
-        EmitStateChanged(index, newStates[index]);
-      }
-    }
-
-    if(isRecursive)
-    {
-      auto children = GetChildren();
-      for(auto iter : children)
-      {
-        iter->NotifyAccessibilityStateChange(states, isRecursive);
-      }
-    }
-  }
-}
index ec6c20d66137cc0556487bb957cfe39e42f2353e..174c0fb3b42cb9684a27ecc544f2f84b05336b86 100644 (file)
@@ -27,6 +27,7 @@
 #include <tuple>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
 #include <dali/devel-api/adaptor-framework/proxy-accessible.h>
 #include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/atspi-interfaces/accessible.h>
@@ -134,7 +135,7 @@ public:
    * @return Null if mChildren is empty, otherwise the Accessible object
    * @note Currently, the default window would be returned when mChildren is not empty.
    */
-  Dali::Accessibility::Accessible* GetWindowAccessible(Dali::Window window)
+  Dali::Accessibility::ActorAccessible* GetWindowAccessible(Dali::Window window)
   {
     if(mChildren.empty())
     {
@@ -148,12 +149,12 @@ public:
     {
       if(rootLayer == mChildren[i]->GetInternalActor())
       {
-        return mChildren[i];
+        return dynamic_cast<Dali::Accessibility::ActorAccessible*>(mChildren[i]);
       }
     }
 
     // If can't find its children, return the default window.
-    return mChildren[0];
+    return dynamic_cast<Dali::Accessibility::ActorAccessible*>(mChildren[0]);
   }
 
   bool DoGesture(const Dali::Accessibility::GestureInfo& gestureInfo) override
index 42ea5c9cf3a61ea91f2e7ba33f83ff16ce8a0279..86814cc8955355935ca628d331070392ee3d4910 100644 (file)
@@ -330,21 +330,6 @@ void BridgeObject::EmitMovedOutOfScreen(Accessible* obj, ScreenRelativeMoveType
     {"", "root"});
 }
 
-void BridgeObject::EmitSocketAvailable(Accessible* obj)
-{
-  if(!IsUp() || obj->IsHidden()) //TODO Suppress SocketAvailable event
-  {
-    return;
-  }
-
-  mDbusServer.emit2<Address, Address>(
-    GetAccessiblePath(obj),
-    Accessible::GetInterfaceName(AtspiInterface::SOCKET),
-    "Available",
-    obj->GetAddress(),
-    {"", "root"});
-}
-
 void BridgeObject::EmitScrollStarted(Accessible* obj)
 {
   if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::SCROLL_STARTED])
index e7130c38db6e6065c068393e54a9074bd72936d2..77925274a37cfe4975278622698faba7e9037fc9 100644 (file)
@@ -90,11 +90,6 @@ protected:
    */
   void EmitMovedOutOfScreen(Dali::Accessibility::Accessible* obj, Dali::Accessibility::ScreenRelativeMoveType type) override;
 
-  /**
-   * @copydoc Dali::Accessibility::Bridge::EmitSocketAvailable()
-   */
-  void EmitSocketAvailable(Dali::Accessibility::Accessible* obj) override;
-
   /**
    * @copydoc Dali::Accessibility::Bridge::EmitScrollStarted()
    */
index 764a442e614f5a60e1a00f26362f2890b85de2e4..51c9ff3ae43793dd52b6f3a65962a9e7040b3ce6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -93,68 +93,4 @@ std::string MakeBusNameForWidget(std::string_view widgetInstanceId, int widgetPr
   return std::string{widgetInstanceId};
 }
 
-void Accessibility::Accessible::EmitStateChanged(Accessibility::State state, int newValue, int reserved)
-{
-}
-
-void Accessibility::Accessible::Emit(Accessibility::ObjectPropertyChangeEvent event)
-{
-}
-
-void Accessibility::Accessible::EmitHighlighted(bool set)
-{
-}
-
-void Accessibility::Accessible::EmitBoundsChanged(Rect<> rect)
-{
-}
-
-void Accessibility::Accessible::EmitShowing(bool showing)
-{
-}
-
-void Accessibility::Accessible::EmitFocused(bool set)
-{
-}
-
-void Accessibility::Accessible::EmitVisible(bool visible)
-{
-}
-
-void Accessibility::Accessible::EmitTextInserted(unsigned int position, unsigned int length, const std::string& content)
-{
-}
-
-void Accessibility::Accessible::EmitTextDeleted(unsigned int position, unsigned int length, const std::string& content)
-{
-}
-
-void Accessibility::Accessible::EmitTextCursorMoved(unsigned int cursorPosition)
-{
-}
-
-void Accessibility::Accessible::EmitActiveDescendantChanged(Accessibility::Accessible* child)
-{
-}
-
-void Accessibility::Accessible::EmitMovedOutOfScreen(Accessibility::ScreenRelativeMoveType type)
-{
-}
-
-void Accessibility::Accessible::EmitSocketAvailable()
-{
-}
-
-void Accessibility::Accessible::EmitScrollStarted()
-{
-}
-
-void Accessibility::Accessible::EmitScrollFinished()
-{
-}
-
-void Accessibility::Accessible::NotifyAccessibilityStateChange(Accessibility::States states, bool isRecursive)
-{
-}
-
 } // namespace Dali
index 7e1dde95d95b59afde232c2a9ae6acea99ea949c..8b8e2c7c720f0d3a3cf0183b7f81e95e422bd89a 100644 (file)
@@ -150,10 +150,6 @@ struct DummyBridge : Dali::Accessibility::Bridge
   {
   }
 
-  void EmitSocketAvailable(Accessibility::Accessible* obj) override
-  {
-  }
-
   void EmitScrollStarted(Accessibility::Accessible* obj) override
   {
   }
index ad0f3cfe7acaee55767e93f0c591bf3ab91bc673..2687a32e5d65ebf3ba3aaef616fbc96cdcc8b020 100644 (file)
@@ -32,7 +32,7 @@
 
 // INTERNAL HEADERS
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
-#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/adaptor-framework/actor-accessible.h>
 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 #include <dali/internal/window-system/common/event-handler.h>
 #include <dali/internal/window-system/common/orientation-impl.h>
@@ -763,7 +763,7 @@ void Window::SetSize(Dali::Window::WindowSize size)
 
     if(Dali::Accessibility::IsUp())
     {
-      if(auto accessible = Dali::Accessibility::Accessible::Get(mScene.GetRootLayer()))
+      if(auto accessible = dynamic_cast<Accessibility::ActorAccessible*>(Accessibility::Accessible::Get(mScene.GetRootLayer())))
       {
         accessible->EmitBoundsChanged(Dali::Rect<>(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
       }
@@ -804,7 +804,7 @@ void Window::SetPosition(Dali::Window::WindowPosition position)
 
     if(Dali::Accessibility::IsUp())
     {
-      if(auto accessible = Dali::Accessibility::Accessible::Get(mScene.GetRootLayer()))
+      if(auto accessible = dynamic_cast<Accessibility::ActorAccessible*>(Accessibility::Accessible::Get(mScene.GetRootLayer())))
       {
         accessible->EmitBoundsChanged(Dali::Rect<>(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
       }
@@ -881,7 +881,7 @@ void Window::SetPositionSize(PositionSize positionSize)
 
   if((moved || resize) && Dali::Accessibility::IsUp())
   {
-    if(auto accessible = Dali::Accessibility::Accessible::Get(mScene.GetRootLayer()))
+    if(auto accessible = dynamic_cast<Accessibility::ActorAccessible*>(Accessibility::Accessible::Get(mScene.GetRootLayer())))
     {
       accessible->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
     }
@@ -1145,7 +1145,7 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
 
   if((moved || resize) && Dali::Accessibility::IsUp())
   {
-    if(auto accessible = Dali::Accessibility::Accessible::Get(mScene.GetRootLayer()))
+    if(auto accessible = dynamic_cast<Accessibility::ActorAccessible*>(Accessibility::Accessible::Get(mScene.GetRootLayer())))
     {
       accessible->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
     }