[Tizen] Save and send the position of the focused actor 11/258311/3
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 13 May 2021 08:38:14 +0000 (17:38 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 13 May 2021 12:13:28 +0000 (21:13 +0900)
- Sends the current position of the focused actor to dbus.
- Even though user's finger presses a place other than the focused position,
 the behavior of accessibility has to work well.
 e.g. double tap and hold gesture

Change-Id: I6e992775cfc5ccbdae0fa31b43a6a1e087fed82a
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/devel-api/adaptor-framework/accessibility-adaptor.cpp
dali/devel-api/adaptor-framework/accessibility-adaptor.h
dali/internal/accessibility/common/accessibility-adaptor-impl.cpp
dali/internal/accessibility/common/accessibility-adaptor-impl.h
dali/internal/window-system/common/event-handler.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp

index 6c1166d..711a6af 100644 (file)
@@ -74,6 +74,11 @@ void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handle
   Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetGestureHandler(handler);
 }
 
+void AccessibilityAdaptor::SetFocusedActorPosition(Vector2 currentPosition)
+{
+  Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetFocusedActorPosition(currentPosition);
+}
+
 bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
 {
   return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionNextEvent(allowEndFeedback);
index ec09c7f..47292c2 100644 (file)
@@ -108,6 +108,12 @@ public:
   void SetGestureHandler(AccessibilityGestureHandler& handler);
 
   /**
+   * @brief Sets the position of the focused actor.
+   * @param currentPosition The position of the focused actor
+   */
+  void SetFocusedActorPosition(Vector2 currentPosition);
+
+  /**
    * @brief Handle the accessibility action to move focus to the next focusable actor
    * (by one finger flick down).
    *
index e057821..eb3b99f 100644 (file)
@@ -50,6 +50,7 @@ Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogg
 
 AccessibilityAdaptor::AccessibilityAdaptor()
 : mReadPosition(),
+  mFocusedActorPosition(),
   mActionHandler( NULL ),
   mIsEnabled( false ),
   mIsForced( false )
@@ -132,6 +133,16 @@ void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handle
   }
 }
 
+void AccessibilityAdaptor::SetFocusedActorPosition(Vector2 currentPosition)
+{
+  mFocusedActorPosition = currentPosition;
+}
+
+Vector2 AccessibilityAdaptor::GetFocusedActorPosition() const
+{
+  return mFocusedActorPosition;
+}
+
 bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
 {
   bool ret = false;
index b67f506..490e352 100644 (file)
@@ -104,6 +104,17 @@ public:
   void SetGestureHandler(AccessibilityGestureHandler& handler);
 
   /**
+   * @copydoc Dali::AccessibilityAdaptor::SetFocusedActorPosition()
+   */
+  void SetFocusedActorPosition(Vector2 currentPosition);
+
+  /**
+   * @brief Returns the current position of the focused actor.
+   * @return The current position of the focused actor
+   */
+  Vector2 GetFocusedActorPosition() const;
+
+  /**
    * @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
    */
   virtual bool HandleActionNextEvent( bool allowEndFeedback = true);
@@ -259,6 +270,7 @@ protected:
   Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
 
   Vector2 mReadPosition; ///< ActionRead position
+  Vector2 mFocusedActorPosition; ///< Focused actor position
 
   AccessibilityActionHandler* mActionHandler; ///< The pointer of accessibility action handler
 
index 9c28aad..5ae362c 100755 (executable)
@@ -283,6 +283,15 @@ void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityI
     return;
   }
 
+  // When gesture is ONE_FINGER_SINGLE_TAP, the gesture value is 15.
+  // When the state is aborted, the state of accessibility info is 3.
+  if( info.gestureValue == 15 && info.state == 3 )
+  {
+    Vector2 localPosition = accessibilityAdaptor->GetFocusedActorPosition();
+
+    eldbus_proxy_call( info.proxy, "HighlightedObjectInfo", NULL, NULL, -1, "ii", static_cast<int>( localPosition.x ), static_cast<int>( localPosition.y ) );
+  }
+
   // Create a touch point object.
   PointState::Type touchPointState( PointState::DOWN );
   if( info.state == 0 )
index 6dc03bd..2a6d548 100644 (file)
 #include <dali/internal/window-system/common/rotation-event.h>
 #include <dali/internal/graphics/gles/egl-implementation.h>
 
+#ifdef DALI_ELDBUS_AVAILABLE
+#include <Eldbus.h>
+#endif
+
 namespace Dali
 {
 namespace Internal
@@ -62,6 +66,9 @@ public:
     int state;
     int eventTime;
     unsigned char quickpanelInfo; // to retrieve quick panel information for Accessibility
+    #ifdef DALI_ELDBUS_AVAILABLE
+    Eldbus_Proxy* proxy;
+    #endif // DALI_ELDBUS_AVAILABLE
   };
 
   // Window
index 6fbd2de..710f51f 100755 (executable)
@@ -2463,6 +2463,9 @@ void WindowBaseEcoreWl2::InitializeEcoreElDBus()
     return;
   }
 
+  // Save dbus proxy on init.
+  mAccessibilityInfo.proxy = manager;
+
   if( !eldbus_proxy_signal_handler_add( manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this ) )
   {
     DALI_LOG_ERROR( "No signal handler returned\n" );