MESSAGE( STATUS "Profile: ${ENABLE_PROFILE}")
MESSAGE( STATUS "Data Dir (Read/Write): ${dataReadWriteDir}")
MESSAGE( STATUS "Data Dir (Read Only): ${dataReadOnlyDir}")
-MESSAGE( STATUS "EldBus: ${eldbus_available_ENABLED}")
MESSAGE( STATUS "WebP: ${webp_available_ENABLED}")
MESSAGE( STATUS "Shader Binary Cache: ${ENABLE_SHADERBINCACHE}")
MESSAGE( STATUS "Network logging enabled: ${ENABLE_NETWORKLOGGING}")
CHECK_MODULE_AND_SET( ECORE ecore [] )
CHECK_MODULE_AND_SET( ECORE_IPC ecore-ipc [] )
CHECK_MODULE_AND_SET( ECORE_IMF ecore-imf [] )
-CHECK_MODULE_AND_SET( ELDBUS eldbus eldbus_available )
+CHECK_MODULE_AND_SET( ELDBUS eldbus [] )
+CHECK_MODULE_AND_SET( TPKP_CURL tpkp-curl tpkp_curl_available )
CHECK_MODULE_AND_SET( UTILX utilX utilx_available )
CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
CHECK_MODULE_AND_SET( EGL egl [] )
ADD_DEFINITIONS( -DAPPCORE_WATCH_AVAILABLE )
ENDIF()
-IF( eldbus_available )
- SET(DALI_ELDBUS_AVAILABLE 1)
- ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
-ENDIF()
+SET(DALI_ELDBUS_AVAILABLE 1)
+ADD_DEFINITIONS( -DDALI_ELDBUS_AVAILABLE )
IF( webp_available )
SET(DALI_WEBP_AVAILABLE 1)
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_ACTION_HANDLER_H
-#define DALI_ACCESSIBILITY_ACTION_HANDLER_H
-
-/*
- * Copyright (c) 2020 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/dali-adaptor-common.h>
-#include <dali/public-api/events/touch-event.h>
-
-namespace Dali
-{
-/**
- * AccessibilityActionHandler is an abstract interface, used by Dali to handle accessibility actions
- * passed by the accessibility manager.
- */
-class AccessibilityActionHandler
-{
-public:
- /**
- * Change the accessibility status when Accessibility feature(screen-reader) turned on or off.
- * @return whether the status is changed or not.
- */
- virtual bool ChangeAccessibilityStatus() = 0;
-
- /**
- * Clear the accessibility focus from the current focused actor.
- * @return whether the focus is cleared or not.
- */
- virtual bool ClearAccessibilityFocus() = 0;
-
- /**
- * Perform the accessibility action associated with a scroll event.
- * @param touch The touch point (and time) of the event.
- * @return whether the focus is cleared or not.
- */
- virtual bool AccessibilityActionScroll(Dali::TouchEvent& touch) = 0;
-
- /**
- * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick up).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPrevious(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the next focusable actor (by one finger flick down).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionNext(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the previous focusable actor (by one finger flick left).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadPrevious(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to move focus to the next focusable actor (by one finger flick right).
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadNext(bool allowEndFeedback) = 0;
-
- /**
- * Perform the accessibility action to focus and read the actor (by one finger tap or move).
- * @param allowReadAgain true if the action read again the same object (i.e. read action)
- * false if the action just read when the focus object is changed (i.e. over action)
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionRead(bool allowReadAgain) = 0;
-
- /**
- * Perform the accessibility action to activate the current focused actor (by one finger double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionActivate() = 0;
-
- /**
- * Perform the accessibility action to change the value when the current focused actor is a slider
- * (by double finger down and move up and right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionUp() = 0;
-
- /**
- * Perform the accessibility action to change the value when the current focused actor is a slider
- * (by double finger down and move down and left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionDown() = 0;
-
- /**
- * Perform the accessibility action to navigate back (by two fingers circle draw).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionBack() = 0;
-
- /**
- * Perform the accessibility action to scroll up the list and focus on the first item on the list
- * after the scrolling and read the item (by two finger swipe up).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionScrollUp() = 0;
-
- /**
- * Perform the accessibility action to scroll down the list and focus on the first item on the list
- * after the scrolling and read the item (by two finger swipe down).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionScrollDown() = 0;
-
- /**
- * Perform the accessibility action to scroll left to the previous page (by two finger swipe left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageLeft() = 0;
-
- /**
- * Perform the accessibility action to scroll right to the next page (by two finger swipe right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageRight() = 0;
-
- /**
- * Perform the accessibility action to scroll up to the previous page (by one finger swipe left and right).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageUp() = 0;
-
- /**
- * Perform the accessibility action to scroll down to the next page (by one finger swipe right and left).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionPageDown() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the first item on the screen
- * (by one finger swipe up and down).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionMoveToFirst() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the last item on the screen
- * (by one finger swipe down and up).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionMoveToLast() = 0;
-
- /**
- * Perform the accessibility action to move the focus to the first item on the top
- * and read from the top item continuously (by three fingers single tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadFromTop() = 0;
-
- /**
- * Perform the accessibility action to move the focus to and read from the next item
- * continuously (by three fingers double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadFromNext() = 0;
-
- /**
- * Perform the accessibility action to move the focus to do the zooming (by one finger triple tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionZoom() = 0;
-
- /**
- * Perform the accessibility action to pause/resume the current read out (by two fingers single tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionReadPauseResume() = 0;
-
- /**
- * Perform the accessibility action to start/stop the current action (by two fingers double tap).
- * @return whether the accessibility action is performed or not.
- */
- virtual bool AccessibilityActionStartStop() = 0;
-
-}; // class AccessibilityActionHandler
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_ACTION_HANDLER_H
+++ /dev/null
-/*
- * Copyright (c) 2020 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/devel-api/adaptor-framework/accessibility-adaptor.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-namespace Dali
-{
-AccessibilityAdaptor::AccessibilityAdaptor()
-{
-}
-
-AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- return Internal::Adaptor::AccessibilityAdaptor::Get();
-}
-
-AccessibilityAdaptor::~AccessibilityAdaptor()
-{
-}
-
-Vector2 AccessibilityAdaptor::GetReadPosition() const
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).GetReadPosition();
-}
-
-bool AccessibilityAdaptor::IsEnabled() const
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).IsEnabled();
-}
-
-void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetActionHandler(handler);
-}
-
-void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).SetGestureHandler(handler);
-}
-
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionNextEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPreviousEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionActivateEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionActivateEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadEvent(x, y, allowReadAgain);
-}
-
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadNextEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadPreviousEvent(allowEndFeedback);
-}
-
-bool AccessibilityAdaptor::HandleActionUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionClearFocusEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionClearFocusEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp)
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollEvent(point, timeStamp);
-}
-
-bool AccessibilityAdaptor::HandleActionBackEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionBackEvent();
-}
-
-void AccessibilityAdaptor::HandleActionEnableEvent()
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionEnableEvent();
-}
-
-void AccessibilityAdaptor::HandleActionDisableEvent()
-{
- Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionDisableEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionScrollDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageLeftEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageLeftEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageRightEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageRightEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageUpEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageUpEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionPageDownEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionPageDownEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToFirstEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionMoveToFirstEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToLastEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionMoveToLastEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromTopEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadFromTopEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromNextEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadFromNextEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionZoomEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionZoomEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionReadPauseResumeEvent();
-}
-
-bool AccessibilityAdaptor::HandleActionStartStopEvent()
-{
- return Internal::Adaptor::AccessibilityAdaptor::GetImplementation(*this).HandleActionStartStopEvent();
-}
-
-AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& manager)
-: BaseHandle(&manager)
-{
-}
-
-AccessibilityAdaptor::AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* manager)
-: BaseHandle(manager)
-{
-}
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_ADAPTOR_H
-#define DALI_ACCESSIBILITY_ADAPTOR_H
-
-/*
- * Copyright (c) 2020 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/devel-api/events/touch-point.h>
-#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-namespace Internal DALI_INTERNAL
-{
-namespace Adaptor
-{
-class AccessibilityAdaptor;
-}
-} // namespace DALI_INTERNAL
-
-class AccessibilityActionHandler;
-class AccessibilityGestureHandler;
-struct TouchPoint;
-
-/**
- * @brief The AccessibilityAdaptor provides communication to the accessibility manager interface (implemented in toolkit).
- *
- */
-class DALI_ADAPTOR_API AccessibilityAdaptor : public BaseHandle
-{
-public:
- /**
- * @brief Create an uninitialized handle.
- *
- * This can be initialized by calling getting the adaptor from Dali::Adaptor.
- */
- AccessibilityAdaptor();
-
- /**
- * @brief Retrieve a handle to the AccessibilityAdaptor.
- *
- * @return A handle to the AccessibilityAdaptor.
- */
- static AccessibilityAdaptor Get();
-
- /**
- * @brief Destructor
- *
- * This is non-virtual since derived Handle types must not contain data or virtual methods.
- */
- ~AccessibilityAdaptor();
-
- /**
- * @brief Returns the current position of the read action.
- * @return The current event position.
- */
- Vector2 GetReadPosition() const;
-
- /**
- * @brief Query whether the accessibility(screen-reader) is enabled.
- *
- * The accessibility will be enabled by system setting.
- * @return True if the accessibility(screen-reader) is enabled.
- */
- bool IsEnabled() const;
-
- /**
- * @brief Set the handler to handle accessibility actions.
- *
- * @param[in] handler The Accessibility action handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetActionHandler(AccessibilityActionHandler& handler);
-
- /**
- * @brief Set the handler to handle accessibility gestures.
- *
- * @param[in] handler The Accessibility gesture handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- /**
- * @brief Handle the accessibility action to move focus to the next focusable actor
- * (by one finger flick down).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionNextEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to move focus to the previous focusable actor
- * (by one finger flick up).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPreviousEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to activate the current focused actor (by one
- * finger )
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionActivateEvent();
-
- /**
- * @brief Handle the accessibility action to focus and read the actor (by one finger tap or move).
- *
- * @param x x position of event
- * @param y y position of event
- * @param allowReadAgain true if the action read again the same object (i.e. read action)
- * false if the action just read when the focus object is changed (i.e. over action)
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain);
-
- /**
- * @brief Handle the accessibility action to move focus to the next focusable actor
- * (by one finger flick right).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the end
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadNextEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to move focus to the previous focusable actor
- * (by one finger flick up).
- *
- * @param allowEndFeedback true if end of list feedback should be played when the focus is alread reached to the front
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadPreviousEvent(bool allowEndFeedback = true);
-
- /**
- * @brief Handle the accessibility action to change the value when the current focused
- * actor is a slider (by double finger down and move up and right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionUpEvent();
-
- /**
- * @brief Handle the accessibility action to change the value when the current focused
- * actor is a slider (by double finger down and move down and left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionDownEvent();
-
- /**
- * @brief Handle the accessibility action to clear the focus from the current focused
- * actor if any, so that no actor is focused in the focus chain.
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionClearFocusEvent();
-
- /**
- * @brief Handle the accessibility action to scroll when there is a scroller on the touched position
- * (by 2 finger touch & move, 2 finger flick).
- *
- * @param[in] point The touch point information.
- * @param[in] timeStamp The time the touch occurred.
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollEvent(const TouchPoint& point, unsigned long timeStamp);
-
- /**
- * @brief Handle the accessibility action to navigate back (by two fingers circle draw).
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionBackEvent();
-
- /**
- * @brief Handle the accessibility action to enable the feature.
- */
- void HandleActionEnableEvent();
-
- /**
- * @brief Handle the accessibility action to disable the feature.
- */
- void HandleActionDisableEvent();
-
- /**
- * @brief Handle the accessibility action to scroll up the list and focus on
- * the first item on the list after the scrolling and read the item
- * (by two finger swipe up).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollUpEvent();
-
- /**
- * @brief Handle the accessibility action to scroll down the list and focus on
- * the first item on the list after the scrolling and read the item
- * (by two finger swipe down).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionScrollDownEvent();
-
- /**
- * @brief Handle the accessibility action to scroll left to the previous page
- * (by two finger swipe left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageLeftEvent();
-
- /**
- * @brief Handle the accessibility action to scroll right to the next page
- * (by two finger swipe right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageRightEvent();
-
- /**
- * @brief Handle the accessibility action to scroll up to the previous page
- * (by one finger swipe left and right).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageUpEvent();
-
- /**
- * @brief Handle the accessibility action to scroll down to the next page
- * (by one finger swipe right and left).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionPageDownEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the first item on the screen
- * (by one finger swipe up and down).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionMoveToFirstEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the last item on the screen
- * (by one finger swipe down and up).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionMoveToLastEvent();
-
- /**
- * @brief Handle the accessibility action to move the focus to the first item on the top
- * and read from the top item continuously (by three fingers single tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadFromTopEvent();
-
- /**
- * @brief Handle the accessibility action to move focus to and read from the next focusable
- * actor continuously (by three fingers double tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadFromNextEvent();
-
- /**
- * @brief Handle the accessibility action to do the zooming
- * (by one finger triple tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionZoomEvent();
-
- /**
- * @brief Handle the accessibility action to pause/resume the current speech
- * (by two fingers single tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionReadPauseResumeEvent();
-
- /**
- * @brief Handle the accessibility action to start/stop the current action
- * (by two fingers double tap).
- *
- * @return Whether the action is performed successfully or not.
- */
- bool HandleActionStartStopEvent();
-
-public: // Not intended for application developers
- /**
- * @brief Creates a handle using the Adaptor::Internal implementation.
- *
- * @param[in] adaptor The AccessibilityAdaptor implementation.
- */
- DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor& adaptor);
-
- /**
- * @brief This constructor is used by AccessibilityAdaptor::Get().
- *
- * @param[in] adaptor A pointer to the accessibility adaptor.
- */
- explicit DALI_INTERNAL AccessibilityAdaptor(Internal::Adaptor::AccessibilityAdaptor* adaptor);
-};
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_ADAPTOR_H
+++ /dev/null
-#ifndef DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
-#define DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
-
-/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/events/gesture.h>
-#include <dali/public-api/math/vector2.h>
-
-namespace Dali
-{
-struct AccessibilityGestureEvent
-{
- // Construction & Destruction
-
- /**
- * Virtual destructor
- */
- ~AccessibilityGestureEvent()
- {
- }
-
- // Data
-
- /**
- * The previous touch position of the primary touch point in screen coordinates.
- */
- Vector2 previousPosition;
-
- /**
- * This current touch position of the primary touch point in screen coordinates.
- */
- Vector2 currentPosition;
-
- /**
- * The time difference between the previous and latest touch motion events (in ms).
- */
- unsigned long timeDelta;
-
- /**
- * The total number of fingers touching the screen in a pan gesture.
- */
- unsigned int numberOfTouches;
-
- enum State
- {
- CLEAR, ///< There is no state associated with this gesture. @SINCE_1_9.28
- STARTED, ///< The touched points on the screen have moved enough to be considered a gesture. @SINCE_1_9.28
- CONTINUING, ///< The gesture is continuing. @SINCE_1_9.28
- FINISHED, ///< The user has lifted a finger or touched an additional point on the screen. @SINCE_1_9.28
- CANCELLED, ///< The gesture has been cancelled. @SINCE_1_9.28
- POSSIBLE ///< A gesture is possible. @SINCE_1_9.28
- };
-
- State state;
-
- uint32_t time;
-
- /**
- * Default Constructor
- * @param[in] state The state of the gesture
- */
- AccessibilityGestureEvent(AccessibilityGestureEvent::State state)
- : timeDelta(0),
- numberOfTouches(0),
- state(state),
- time(0)
- {
- }
-};
-
-} // namespace Dali
-
-#endif // DALI_INTEGRAION_ACCESSIBILITY_GESTURE_STRUCTS_H
+++ /dev/null
-#ifndef DALI_ACCESSIBILITY_GESTURE_HANDLER_H
-#define DALI_ACCESSIBILITY_GESTURE_HANDLER_H
-
-/*
- * Copyright (c) 2020 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/devel-api/adaptor-framework/accessibility-gesture-event.h>
-
-namespace Dali
-{
-/**
- * AccessibilityGestureHandler is an interface used by Dali to handle accessibility gestures
- * passed by the accessibility manager.
- */
-class AccessibilityGestureHandler
-{
-public:
- /**
- * Handle the accessibility pan gesture.
- * @param[in] panEvent The pan event to be handled.
- * @return whether the gesture is handled successfully or not.
- */
- virtual bool HandlePanGesture(const AccessibilityGestureEvent& panEvent) = 0;
-
-}; // class AccessibilityGestureHandler
-
-} // namespace Dali
-
-#endif // DALI_ACCESSIBILITY_GESTURE_HANDLER_H
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
using namespace Dali::Accessibility;
return nullptr;
};
+ObjectRegistry objectRegistry;
+} // namespace
+
+void Accessible::SetObjectRegistry(ObjectRegistry registry)
+{
+ objectRegistry = registry;
}
void Accessible::RegisterControlAccessibilityGetter( std::function< Accessible*( Dali::Actor ) > functor )
auto accessible = convertingFunctor( actor );
if( !accessible )
{
- if( nonControlAccessibles.empty() )
+ if( nonControlAccessibles.empty() && objectRegistry )
{
- auto registry = Adaptor::Get().GetObjectRegistry();
- registry.ObjectDestroyedSignal().Connect( []( const Dali::RefObject* obj )
+ objectRegistry.ObjectDestroyedSignal().Connect( []( const Dali::RefObject* obj )
{
nonControlAccessibles.erase( obj );
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
#include <dali/public-api/math/rect.h>
+#include <dali/public-api/object/object-registry.h>
#include <atomic>
#include <bitset>
#include <exception>
#include <stdexcept>
//INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/integration-api/debug.h>
namespace Dali
{
namespace Accessibility
{
-class Accessible;
-class Text;
-class Value;
-class Component;
-class Collection;
-class Action;
+class DALI_ADAPTOR_API Accessible;
+class DALI_ADAPTOR_API Text;
+class DALI_ADAPTOR_API Value;
+class DALI_ADAPTOR_API Component;
+class DALI_ADAPTOR_API Collection;
+class DALI_ADAPTOR_API Action;
/**
* @brief Base class for different accessibility bridges
*
* @note This class is singleton.
*/
-struct Bridge
+struct DALI_ADAPTOR_API Bridge
{
enum class ForceUpResult
{
Accessible& operator=( const Accessible& ) = delete;
Accessible& operator=( Accessible&& ) = delete;
std::shared_ptr< Bridge::Data > GetBridgeData();
+
+public:
static Dali::Actor GetHighlightActor();
static void SetHighlightActor(Dali::Actor actor);
static Dali::Actor GetCurrentlyHighlightedActor();
static void SetCurrentlyHighlightedActor(Dali::Actor);
+ static void SetObjectRegistry(ObjectRegistry registry);
private:
friend class Bridge;
*
* @see Dali::Accessibility::EditableText
*/
-class Text : public virtual Accessible
+class DALI_ADAPTOR_API Text : public virtual Accessible
{
public:
/**
*
* @see Dali::Accessibility::EditableText
*/
-class EditableText : public virtual Accessible
+class DALI_ADAPTOR_API EditableText : public virtual Accessible
{
public:
/**
* (embedding for example), but the object itself ain't planned to be used otherwise.
* This object has null parent, no children, empty name and so on
*/
-class EmptyAccessibleWithAddress : public virtual Accessible
+class DALI_ADAPTOR_API EmptyAccessibleWithAddress : public virtual Accessible
{
public:
EmptyAccessibleWithAddress() = default;
* @see Dali::Accessibility::Accessible::GetRoles\r
*/\r
template < size_t I, typename S >\r
-class BitSets\r
+class DALI_ADAPTOR_API BitSets\r
{\r
std::array< uint32_t, I > data;\r
\r
* @brief Class representing unique object address on accessibility bus\r
* @see Dali::Accessibility::Accessible::GetAddress\r
*/\r
-class Address\r
+class DALI_ADAPTOR_API Address\r
{\r
public:\r
Address() = default;\r
/**\r
* @brief Helper class representing two dimensional point with integer coordinates\r
*/\r
-struct Point\r
+struct DALI_ADAPTOR_API Point\r
{\r
int x = 0;\r
int y = 0;\r
/**\r
* @brief Helper class representing size of rectangle object with usage of two integer values\r
*/\r
-struct Size\r
+struct DALI_ADAPTOR_API Size\r
{\r
int width = 0;\r
int height = 0;\r
* @see Dali::Accessibility::Text::GetTextAtOffset\r
* @see Dali::Accessibility::Text::GetSelection\r
*/\r
-struct Range\r
+struct DALI_ADAPTOR_API Range\r
{\r
int32_t startOffset = 0;\r
int32_t endOffset = 0;\r
* eventTime : time when event occured\r
* @see Dali::Accessibility::Accessible::DoGesture\r
*/\r
-struct GestureInfo\r
+struct DALI_ADAPTOR_API GestureInfo\r
{\r
GestureInfo() = default;\r
GestureInfo(Gesture type, int32_t xBeg, int32_t xEnd, int32_t yBeg, int32_t yEnd, GestureState state, uint32_t eventTime)\r
* @see Dali::Accessibility::Accessible::Address\r
* @see Dali::Accessibility::Accessible::RelationType\r
*/\r
-struct Relation\r
+struct DALI_ADAPTOR_API Relation\r
{\r
Relation(RelationType relationType, std::vector<Address> targets)\r
: relationType(relationType),\r
*/
#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
-
-#include <mutex>
-#include <Eldbus.h>
-#include <Ecore_Input.h>
-#include <dali/integration-api/debug.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
void Dali::AtspiAccessibility::Pause()
{
SET( devel_api_src_files
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility-impl.cpp
${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.cpp
${adaptor_devel_api_dir}/adaptor-framework/application-devel.cpp
+ ${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.cpp
${adaptor_devel_api_dir}/adaptor-framework/bitmap-saver.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard.cpp
${adaptor_devel_api_dir}/adaptor-framework/clipboard-event-notifier.cpp
SET( devel_api_adaptor_framework_header_files
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-adaptor.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-action-handler.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-handler.h
- ${adaptor_devel_api_dir}/adaptor-framework/accessibility-gesture-event.h
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility.h
+ ${adaptor_devel_api_dir}/adaptor-framework/accessibility-impl.h
${adaptor_devel_api_dir}/adaptor-framework/animated-image-loading.h
${adaptor_devel_api_dir}/adaptor-framework/application-devel.h
${adaptor_devel_api_dir}/adaptor-framework/atspi-accessibility.h
// INTERNAL INCLUDES
#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus-locators.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/dbus-locators.h>
#define A11yDbusName "org.a11y.Bus"
#define A11yDbusPath "/org/a11y/bus"
{
template < typename T >
-struct signature_accessible_impl
+struct signature_accessible_impl : signature_helper<signature_accessible_impl<T>>
{
+ using subtype = std::pair< std::string, ObjectPath >;
-using subtype = std::pair< std::string, ObjectPath >;
-
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "AtspiAccessiblePtr";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(so)";
- }
+ static constexpr auto name_v = concat("AtspiAccessiblePtr");
+ static constexpr auto sig_v = concat("(so)");
/**
* @brief Marshals value v as marshalled type into message
};
template <>
-struct signature< Dali::Accessibility::Address >
+struct signature< Dali::Accessibility::Address > : signature_helper<signature<Dali::Accessibility::Address>>
{
-using subtype = std::pair< std::string, ObjectPath >;
+ using subtype = std::pair< std::string, ObjectPath >;
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "AtspiAccessiblePtr";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(so)";
- }
+ static constexpr auto name_v = concat("AtspiAccessiblePtr");
+ static constexpr auto sig_v = concat("(so)");
/**
* @brief Marshals value v as marshalled type into message
{
return false;
}
-
+
v = { std::move( tmp.first ), tmp.second.value.substr( strlen( ATSPI_PREFIX_PATH ) ) };
return true;
}
};
template <>
-struct signature< Dali::Accessibility::States >
+struct signature< Dali::Accessibility::States > : signature_helper<signature<Dali::Accessibility::States>>
{
-using subtype = std::array< uint32_t, 2 >;
-
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return signature< subtype >::name();
- }
+ using subtype = std::array<uint32_t, 2>;
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< subtype >::sig();
- }
+ static constexpr auto name_v = signature<subtype>::name_v;
+ static constexpr auto sig_v = signature<subtype>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
// CLASS HEADER
//INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
#include <third-party/libunibreak/wordbreak.h>
#include <third-party/libunibreak/linebreak.h>
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-accessible.h>
+#include <dali/internal/accessibility/bridge/bridge-accessible.h>
// EXTERNAL INCLUDES
#include <iostream>
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-action.h>
+#include <dali/internal/accessibility/bridge/bridge-action.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeAction : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
// EXTERNAL INCLUDES
#include <atomic>
{
return Find( name );
}
- catch( std::domain_error )
+ catch( std::domain_error& )
{
return nullptr;
}
throw std::domain_error{"invalid path '" + path + "'"};
}
auto it = data->knownObjects.find( static_cast<Accessible*>( p ) );
- if( it == data->knownObjects.end() )
+ if( it == data->knownObjects.end() || (*it)->GetStates()[State::DEFUNCT] )
{
throw std::domain_error{"unknown object '" + path + "'"};
}
#include <memory>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
class AppAccessible : public virtual Dali::Accessibility::Accessible, public virtual Dali::Accessibility::Collection
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-collection.h>
+#include <dali/internal/accessibility/bridge/bridge-collection.h>
// EXTERNAL INCLUDES
#include <algorithm>
void BridgeCollection::VisitNodes( Accessible* obj, std::vector< Accessible* >& result, Comparer& cmp, size_t maxCount )
{
- if( result.size() >= maxCount )
+ if( maxCount > 0 && result.size() >= maxCount )
return;
if( cmp( obj ) )
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeCollection : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-component.h>
+#include <dali/internal/accessibility/bridge/bridge-component.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeComponent : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-editable-text.h>
+#include <dali/internal/accessibility/bridge/bridge-editable-text.h>
// INTERNAL INCLUDES
#include <dali/internal/clipboard/common/clipboard-impl.h>
*/
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeEditableText : public virtual BridgeBase
{
#include <unordered_map>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-accessible.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-action.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-collection.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-component.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-object.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-value.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-text.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-editable-text.h>
+#include <dali/internal/accessibility/bridge/bridge-accessible.h>
+#include <dali/internal/accessibility/bridge/bridge-action.h>
+#include <dali/internal/accessibility/bridge/bridge-collection.h>
+#include <dali/internal/accessibility/bridge/bridge-component.h>
+#include <dali/internal/accessibility/bridge/bridge-object.h>
+#include <dali/internal/accessibility/bridge/bridge-value.h>
+#include <dali/internal/accessibility/bridge/bridge-text.h>
+#include <dali/internal/accessibility/bridge/bridge-editable-text.h>
using namespace Dali::Accessibility;
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-object.h>
+#include <dali/internal/accessibility/bridge/bridge-object.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
#include <dali/public-api/math/rect.h>
class BridgeObject : public virtual BridgeBase
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-text.h>
+#include <dali/internal/accessibility/bridge/bridge-text.h>
// INTERNAL INCLUDES
#include <dali/internal/input/common/input-method-context-factory.h>
*/
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeText : public virtual BridgeBase
{
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-value.h>
+#include <dali/internal/accessibility/bridge/bridge-value.h>
// EXTERNAL INCLUDES
#include <iostream>
#include <vector>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/bridge-base.h>
+#include <dali/internal/accessibility/bridge/bridge-base.h>
class BridgeValue : public virtual BridgeBase
{
#include <iostream>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
using namespace Dali::Accessibility;
*/
// CLASS HEADER
-#include <dali/internal/accessibility/tizen-wayland/atspi/dbus.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-common.h>
+#include <dali/internal/accessibility/bridge/dbus.h>
+#include <dali/internal/accessibility/bridge/accessibility-common.h>
// EXTERNAL INCLUDES
#include <sstream>
* limitations under the License.
*/
- // EXTERNAL INCLUDES
-#include <memory>
+// EXTERNAL INCLUDES
#include <array>
#include <atomic>
+#include <cassert>
#include <cstdint>
+#include <cstring>
+#include <functional>
#include <map>
+#include <memory>
#include <sstream>
#include <string>
+#include <string_view>
#include <thread>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <vector>
-#include <functional>
-#include <string.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/internal/accessibility/tizen-wayland/atspi/accessibility-optional.h>
+#include <dali/public-api/common/dali-common.h>
+#include <dali/devel-api/adaptor-framework/accessibility.h>
#define ATSPI_PREFIX_PATH "/org/a11y/atspi/accessible/"
#define ATSPI_NULL_PATH "/org/a11y/atspi/null"
*/
namespace detail
{
+ inline namespace strings {
+ template <std::size_t N>
+ using char_array = std::array<char, N>;
+
+ constexpr char *xcopy_n(const char *src, size_t n, char *dst)
+ {
+ for (std::size_t i = 0; i < n; ++i)
+ dst[i] = src[i];
+
+ return dst + n;
+ }
+
+ template <std::size_t N>
+ constexpr std::size_t xlen(const char (&)[N])
+ {
+ return N - 1;
+ }
+
+ template <std::size_t N>
+ constexpr std::size_t xlen(const char_array<N> &)
+ {
+ return N - 1;
+ }
+
+ template <typename... Args>
+ constexpr auto concat(const Args &... args)
+ {
+ char_array<(1U + ... + xlen(args))> arr{};
+ char *ptr = arr.data();
+
+ if constexpr (!arr.empty())
+ ((ptr = xcopy_n(std::data(args), xlen(args), ptr)), ...);
+
+ return arr;
+ }
+
+ template<std::size_t... Digits>
+ struct to_chars {
+ static constexpr const char value[] = {('0' + static_cast<char>(Digits))..., '\0'};
+
+ static_assert((true && ... && (Digits < 10)));
+ };
+
+ template<std::size_t Remainder, std::size_t... Digits>
+ struct to_chars_helper : to_chars_helper<Remainder / 10, Remainder % 10, Digits...> {};
+
+ template<std::size_t... Digits>
+ struct to_chars_helper<0, Digits...> : to_chars<Digits...> {};
+
+ template<std::size_t N>
+ using to_string = to_chars_helper<N / 10, N % 10>;
+ }
+
template < typename T, typename = void >
struct signature;
template < typename... ARGS >
template < typename A, typename B >
struct signature< std::map< A, B > >;
- /**
- * @brief Signature class for marshalling uint8 type.
- */
- template <>
- struct signature< uint8_t >
+ template <typename T>
+ struct signature_helper
{
/**
* @brief Returns name of type marshalled, for informative purposes
*/
- static std::string name()
+ static constexpr std::string_view name()
{
- return "uint8_t";
+ return {T::name_v.data()};
}
/**
* @brief Returns DBUS' signature of type marshalled
*/
- static std::string sig()
+ static constexpr std::string_view sig()
{
- return "y";
+ return {T::sig_v.data()};
}
+ };
+
+ /**
+ * @brief Signature class for marshalling uint8 type.
+ */
+ template <>
+ struct signature< uint8_t > : signature_helper<signature<uint8_t>>
+ {
+ static constexpr auto name_v = concat("uint8_t");
+ static constexpr auto sig_v = concat("y");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint16 type.
*/
template <>
- struct signature< uint16_t >
+ struct signature< uint16_t > : signature_helper<signature<uint16_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint16_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "q";
- }
+ static constexpr auto name_v = concat("uint16_t");
+ static constexpr auto sig_v = concat("q");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint32 type.
*/
template <>
- struct signature< uint32_t >
+ struct signature< uint32_t > : signature_helper<signature<uint32_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint32_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "u";
- }
+ static constexpr auto name_v = concat("uint32_t");
+ static constexpr auto sig_v = concat("u");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling uint64 type.
*/
template <>
- struct signature< uint64_t >
+ struct signature< uint64_t > : signature_helper<signature<uint64_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "uint64_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "t";
- }
+ static constexpr auto name_v = concat("uint64_t");
+ static constexpr auto sig_v = concat("t");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int16 type.
*/
template <>
- struct signature< int16_t >
+ struct signature< int16_t > : signature_helper<signature<int16_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int16_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "n";
- }
+ static constexpr auto name_v = concat("int16_t");
+ static constexpr auto sig_v = concat("n");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int32 type.
*/
template <>
- struct signature< int32_t >
+ struct signature< int32_t > : signature_helper<signature<int32_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int32_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "i";
- }
+ static constexpr auto name_v = concat("int32_t");
+ static constexpr auto sig_v = concat("i");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling int64 type.
*/
template <>
- struct signature< int64_t >
+ struct signature< int64_t > : signature_helper<signature<int64_t>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "int64_t";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "x";
- }
+ static constexpr auto name_v = concat("int64_t");
+ static constexpr auto sig_v = concat("x");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling double type.
*/
template <>
- struct signature< double >
+ struct signature< double > : signature_helper<signature<double>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "double";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "d";
- }
+ static constexpr auto name_v = concat("double");
+ static constexpr auto sig_v = concat("d");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling float type.
*/
template <>
- struct signature< float >
+ struct signature< float > : signature_helper<signature<float>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "float";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "d";
- }
+ static constexpr auto name_v = concat("float");
+ static constexpr auto sig_v = concat("d");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling boolean type.
*/
template <>
- struct signature< bool >
+ struct signature< bool > : signature_helper<signature<bool>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "bool";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "b";
- }
+ static constexpr auto name_v = concat("bool");
+ static constexpr auto sig_v = concat("b");
/**
* @brief Marshals value v as marshalled type into message
};
template < typename T >
- struct signature< T, typename std::enable_if< std::is_enum< T >::value, void >::type >
+ struct signature<T, typename std::enable_if_t<std::is_enum_v<T>, void>> : signature_helper<signature<T>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "enum";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature<typename std::underlying_type<T>::type>::sig();
- }
+ static constexpr auto name_v = concat("enum");
+ static constexpr auto sig_v = signature<typename std::underlying_type<T>::type>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* Only std::string is accepted as value to receive.
*/
template <>
- struct signature< std::string >
+ struct signature< std::string > : signature_helper<signature<std::string>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "string";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "s";
- }
+ static constexpr auto name_v = concat("string");
+ static constexpr auto sig_v = concat("s");
/**
* @brief Marshals value v as marshalled type into message
};
template <>
- struct signature< ObjectPath >
+ struct signature< ObjectPath > : signature_helper<signature<ObjectPath>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "path";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "o";
- }
+ static constexpr auto name_v = concat("path");
+ static constexpr auto sig_v = concat("o");
/**
* @brief Marshals value v as marshalled type into message
* You can't use (const) char * variable type to receive value.
*/
template <>
- struct signature< char* >
+ struct signature< char* > : signature_helper<signature<char *>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "string";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "s";
- }
+ static constexpr auto name_v = concat("string");
+ static constexpr auto sig_v = concat("s");
/**
* @brief Marshals value v as marshalled type into message
* until INDEX is equal to SIZE, where recursive calling ends.
*/
template < size_t INDEX, size_t SIZE, typename... ARGS >
- struct signature_tuple_helper
+ struct signature_tuple_helper : signature_helper<signature_tuple_helper<INDEX, SIZE, ARGS...>>
{
using current_type = typename signature_tuple_element_type_helper< INDEX, ARGS... >::type;
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- if (INDEX + 1 >= SIZE)
- return signature< current_type >::name();
- return signature< current_type >::name() + ", " + signature_tuple_helper< INDEX + 1, SIZE, ARGS... >::name();
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< current_type >::sig() + signature_tuple_helper< INDEX + 1, SIZE, ARGS... >::sig();
- }
+ static constexpr auto name_v = concat(signature<current_type>::name_v, ", ", signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::name_v);
+ static constexpr auto sig_v = concat(signature<current_type>::sig_v, signature_tuple_helper<INDEX + 1, SIZE, ARGS...>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
* when INDEX value is equal to SIZE.
*/
template < size_t SIZE, typename... ARGS >
- struct signature_tuple_helper< SIZE, SIZE, ARGS... >
+ struct signature_tuple_helper< SIZE, SIZE, ARGS... > : signature_helper<signature_tuple_helper<SIZE, SIZE, ARGS...>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* DBUS struct typle, encoded with character 'r'
*/
template < typename... ARGS >
- struct signature< std::tuple< ARGS... > >
+ struct signature< std::tuple< ARGS... > > : signature_helper<signature<std::tuple<ARGS...>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "tuple<" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::sig() + ")";
- }
+ static constexpr auto name_v = concat("tuple<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
+ static constexpr auto sig_v = concat("(", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v, ")");
/**
* @brief Marshals value v as marshalled type into message
* \code{.cpp} ValueOrError<std::tuple<std::string, std::string, std::tuple<std::string>>> \endcode
*/
template < typename... ARGS >
- struct signature< ValueOrError< ARGS... > >
+ struct signature< ValueOrError< ARGS... > > : signature_helper<signature<ValueOrError<ARGS...>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<" + signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::sig();
- }
+ static constexpr auto name_v = concat("ValueOrError<", signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::name_v, ">");
+ static constexpr auto sig_v = signature_tuple_helper<0, sizeof...(ARGS), ARGS...>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling ValueOrError<void> type
*/
template <>
- struct signature< ValueOrError< void > >
+ struct signature< ValueOrError< void > > : signature_helper<signature<ValueOrError<void>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<void>";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("ValueOrError<void>");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling ValueOrError<> type
*/
template <>
- struct signature< ValueOrError<> >
+ struct signature< ValueOrError<> > : signature_helper<signature<ValueOrError<>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "ValueOrError<>";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "";
- }
+ static constexpr auto name_v = concat("ValueOrError<>");
+ static constexpr auto sig_v = concat("");
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature class for marshalling pair of types
*/
template < typename A, typename B >
- struct signature< std::pair< A, B > >
+ struct signature< std::pair< A, B > > : signature_helper<signature<std::pair<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "pair<" + signature_tuple_helper< 0, 2, A, B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "(" + signature_tuple_helper< 0, 2, A, B >::sig() + ")";
- }
+ static constexpr auto name_v = concat("pair<", signature_tuple_helper<0, 2, A, B>::name_v, ">");
+ static constexpr auto sig_v = concat("(", signature_tuple_helper<0, 2, A, B>::sig_v, ")");
/**
* @brief Marshals value v as marshalled type into message
* This marshals container's content as DBUS a ascii character type code.
*/
template < typename A >
- struct signature< std::vector< A > >
+ struct signature< std::vector< A > > : signature_helper<signature<std::vector<A>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "vector<" + signature< A >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a" + signature< A >::sig();
- }
+ static constexpr auto name_v = concat("vector<", signature<A>::name_v, ">");
+ static constexpr auto sig_v = concat("a", signature<A>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::vector< A >& v)
{
- auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', signature< A >::sig());
+ auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', std::string{signature< A >::sig()});
assert(lst);
for (auto& a : v)
{
* This marshals container's content as DBUS a ascii character type code.
*/
template < typename A, size_t N >
- struct signature< std::array< A, N > >
+ struct signature< std::array< A, N > > : signature_helper<signature<std::array<A, N>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "array<" + signature< A >::name() + ", " + std::to_string(N) + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a" + signature< A >::sig();
- }
+ static constexpr auto name_v = concat("array<", signature<A>::name_v, ", ", to_string<N>::value, ">");
+ static constexpr auto sig_v = concat("a", signature<A>::sig_v);
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::array< A, N >& v)
{
- auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', signature< A >::sig());
+ auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', std::string{signature< A >::sig()});
assert(lst);
for (auto& a : v)
{
* This marshals variant's content as DBUS v ascii character type code.
*/
template < typename A >
- struct signature< EldbusVariant< A > >
+ struct signature< EldbusVariant< A > > : signature_helper<signature<EldbusVariant<A>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "variant<" + signature< A >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "v";
- }
+ static constexpr auto name_v = concat("variant<", signature<A>::name_v, ">");
+ static constexpr auto sig_v = concat("v");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const A& v)
{
- auto var = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'v', signature< A >::sig());
+ auto var = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'v', std::string{signature< A >::sig()});
signature< A >::set(var, v);
}
* Order of such values is unspecified.
*/
template < typename A, typename B >
- struct signature< std::unordered_map< A, B > >
+ struct signature< std::unordered_map< A, B > > : signature_helper<signature<std::unordered_map<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "unordered_map<" + signature< A >::name() + ", " + signature< B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
- }
+ static constexpr auto name_v = concat("unordered_map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
+ static constexpr auto sig_v = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::unordered_map< A, B >& v)
{
- auto sig = "{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
+ auto sig = "{" + std::string{signature_tuple_helper< 0, 2, A, B >::sig()} + "}";
auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', sig);
assert(lst);
for (auto& a : v)
* Order of such values is unspecified.
*/
template < typename A, typename B >
- struct signature< std::map< A, B > >
+ struct signature< std::map< A, B > > : signature_helper<signature<std::map<A, B>>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "map<" + signature< A >::name() + ", " + signature< B >::name() + ">";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return "a{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
- }
+ static constexpr auto name_v = concat("map<", signature<A>::name_v, ", ", signature<B>::name_v, ">");
+ static constexpr auto sig_v = concat("a{", signature_tuple_helper<0, 2, A, B>::sig_v, "}");
/**
* @brief Marshals value v as marshalled type into message
*/
static void set(const DBusWrapper::MessageIterPtr& iter, const std::map< A, B >& v)
{
- auto sig = "{" + signature_tuple_helper< 0, 2, A, B >::sig() + "}";
+ auto sig = "{" + std::string{signature_tuple_helper< 0, 2, A, B >::sig()} + "}";
auto lst = DBUS_W->eldbus_message_iter_container_new_impl(iter, 'a', sig);
assert(lst);
for (auto& a : v)
* @brief Signature helper class for marshalling const reference types
*/
template < typename A >
- struct signature< const A& >
+ struct signature< const A& > : signature_helper<signature<const A &>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "const " + signature< A >::name() + "&";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat("const ", signature<A>::name_v, "&");
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature helper class for marshalling reference types
*/
template < typename A >
- struct signature< A& >
+ struct signature< A& > : signature_helper<signature<A &>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return signature< A >::name() + "&";
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat(signature<A>::name_v, "&");
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
* @brief Signature helper class for marshalling const types
*/
template < typename A >
- struct signature< const A >
+ struct signature< const A > : signature_helper<signature<const A>>
{
- /**
- * @brief Returns name of type marshalled, for informative purposes
- */
- static std::string name()
- {
- return "const " + signature< A >::name();
- }
-
- /**
- * @brief Returns DBUS' signature of type marshalled
- */
- static std::string sig()
- {
- return signature< A >::sig();
- }
+ static constexpr auto name_v = concat("const ", signature<A>::name_v);
+ static constexpr auto sig_v = signature<A>::sig_v;
/**
* @brief Marshals value v as marshalled type into message
template < typename ValueType >
ValueType unpackValues(CallId callId, const DBusWrapper::MessagePtr& msg)
{
+ static const std::string sig{signature< ValueType >::sig().data()};
+
auto iter = DBUS_W->eldbus_message_iter_get_impl(msg, false);
ValueType r;
{
if (!signature< ValueType >::get(iter, r))
{
- DBUS_DEBUG("ValueType is %s", signature< ValueType >::name().c_str());
+ DBUS_DEBUG("ValueType is %s", signature< ValueType >::name().data());
r = Error{ "call " + std::to_string(callId.id) + ": failed to unpack values, got signature '" +
- DBUS_W->eldbus_message_signature_get_impl(msg) + "', expected '" + signature< ValueType >::sig() + "'" };
+ DBUS_W->eldbus_message_signature_get_impl(msg) + "', expected '" + sig + "'" };
}
}
else
packValues_helper(iter, std::forward< ARGS >(r)...);
}
- template < typename >
- struct ReturnType;
- template < typename R, typename... ARGS >
- struct ReturnType< R(ARGS...) >
- {
- using type = R;
- };
-
- template < typename R, typename... ARGS >
- struct ReturnType< std::function< R(ARGS...) > >
- {
- using type = R;
- };
-
- template < int... >
- struct sequence
- {
- };
-
- template < int N, int... S >
- struct sequence_gen : sequence_gen< N - 1, N - 1, S... >
- {
- };
-
- template < int... S >
- struct sequence_gen< 0, S... >
- {
- typedef sequence< S... > type;
- };
-
- template < typename C, typename... ARGS >
- struct apply_helper
- {
- const std::function< C >& c;
- const std::tuple< ARGS... >& args;
-
- template < int... S >
- auto apply_2(sequence< S... >) const -> decltype(c(std::get< S >(args)...))
- {
- return c(std::get< S >(args)...);
- }
- auto apply_1() const -> decltype(apply_2(typename sequence_gen< sizeof...(ARGS) >::type()))
- {
- return apply_2(typename sequence_gen< sizeof...(ARGS) >::type());
- }
- };
-
- template < typename C, typename A, typename... ARGS >
- struct apply_helper_2
- {
- const std::function< C >& c;
- const A& a;
- const std::tuple< ARGS... >& args;
-
- template < int... S >
- auto apply_2(sequence< S... >) const -> decltype(c(a, std::get< S >(args)...))
- {
- return c(a, std::get< S >(args)...);
- }
- auto apply_1() const -> decltype(apply_2(typename sequence_gen< sizeof...(ARGS) >::type()))
- {
- return apply_2(typename sequence_gen< sizeof...(ARGS) >::type());
- }
- };
-
- template < typename C, typename... ARGS >
- auto apply(const std::function< C >& c, const std::tuple< ARGS... >& args) -> typename ReturnType< C >::type
- {
- apply_helper< C, ARGS... > ah{ c, args };
- return ah.apply_1();
- }
-
- template < typename C, typename D, typename... ARGS >
- auto apply(const std::function< C >& c, const D& d, const std::tuple< ARGS... >& args) -> typename ReturnType< C >::type
- {
- apply_helper_2< C, D, ARGS... > ah{ c, d, args };
- return ah.apply_1();
- }
-
struct ConnectionState
{
DBusWrapper::ConnectionPtr connection;
static void add(std::vector< std::pair<std::string, std::string> >& r)
{
auto s = r.size();
- auto sig = signature< A >::sig();
+ auto sig = std::string{signature< A >::sig()};
assert(!sig.empty());
auto name = "p" + std::to_string(s + 1);
r.push_back({ std::move(sig), std::move(name) });
{
static std::string name()
{
- return signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name();
+ return std::string{signature_tuple_helper< 0, sizeof...(ARGS), ARGS... >::name()};
}
static std::vector< std::pair<std::string, std::string> > get()
{
{
static std::string name()
{
- return signature< RetType >::name();
+ return std::string{signature< RetType >::name()};
}
static std::vector< std::pair<std::string, std::string> > get()
{
}
try
{
- detail::apply(callback, params.getValues());
+ std::apply(callback, params.getValues());
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
DBUS_DEBUG("unhandled exception");
assert(0);
{
detail::CallId getterId;
z.getterId = getterId;
- DBUS_DEBUG("call %d: property %s (get) type %s", getterId.id, memberName.c_str(), detail::signature< T >::name().c_str());
+ DBUS_DEBUG("call %d: property %s (get) type %s", getterId.id, memberName.c_str(), detail::signature< T >::name().data());
z.getCallback = [=](const DBusWrapper::MessagePtr& src, const DBusWrapper::MessageIterPtr& dst) -> std::string {
try
{
- auto v = detail::apply(getter, std::tuple<>{});
+ auto v = std::apply(getter, std::tuple<>{});
if (v)
{
detail::signature< T >::set(dst, std::get< 0 >(v.getValues()));
{
return std::string("unhandled exception (") + e.what() + ")";
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- return "unhandled exception";
+ return std::string("unhandled exception (") + e.condition + ")";
}
};
}
{
detail::CallId setterId;
z.setterId = setterId;
- DBUS_DEBUG("call %d: property %s (set) type %s", setterId.id, memberName.c_str(), detail::signature< T >::name().c_str());
+ DBUS_DEBUG("call %d: property %s (set) type %s", setterId.id, memberName.c_str(), detail::signature< T >::name().data());
z.setCallback = [=](const DBusWrapper::MessagePtr& src, const DBusWrapper::MessageIterPtr& src_iter) -> std::string {
std::tuple< T > value;
auto src_signature = DBUS_W->eldbus_message_iter_signature_get_impl(src_iter);
{
try
{
- auto v = detail::apply(setter, std::move(value));
+ auto v = std::apply(setter, std::move(value));
if (v)
{
DBUS_DEBUG("call %d: success", setterId.id);
{
return std::string("unhandled exception (") + e.what() + ")";
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- return "unhandled exception";
+ return std::string("unhandled exception (") + e.condition + ")";
}
}
DBUS_DEBUG("call %d: failed to unpack values, got signature '%s', expected '%s'", setterId.id,
- src_signature.c_str(), detail::signature< T >::sig().c_str());
+ src_signature.c_str(), detail::signature< T >::sig().data());
return "call " + std::to_string(setterId.id) + ": failed to unpack values, got signature '" +
- src_signature + "', expected '" + detail::signature< T >::sig() + "'";
+ src_signature + "', expected '" + std::string{detail::signature< T >::sig()} + "'";
};
}
}
{
try
{
- auto v = detail::apply(callback, std::move(args.getValues()));
+ auto v = std::apply(callback, std::move(args.getValues()));
if (v)
{
DBUS_DEBUG("call %d: success", callId.id);
DBUS_DEBUG("call %d: failed: %s", callId.id, txt.c_str());
ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", txt);
}
- catch (...)
+ catch (const Dali::DaliException &e)
{
- DBUS_DEBUG("call %d: failed: %s", callId.id, "unhandled exception");
- ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", "unhandled exception");
+ auto txt = std::string("unhandled exception (") + e.condition + ")";
+ DBUS_DEBUG("call %d: failed: %s", callId.id, txt.c_str());
+ ret = DBUS_W->eldbus_message_error_new_impl(msg, "org.freedesktop.DBus.Error.Failed", txt);
}
}
else
+++ /dev/null
-/*
- * Copyright (c) 2020 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry.h>
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
-#include <dali/integration-api/events/hover-event-integ.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-} // unnamed namespace
-
-AccessibilityAdaptor::AccessibilityAdaptor()
-: mReadPosition(),
- mActionHandler( NULL ),
- mIsEnabled( false )
-{
- mAccessibilityGestureDetector = new AccessibilityGestureDetector();
-}
-
-void AccessibilityAdaptor::EnableAccessibility()
-{
- if(mIsEnabled == false)
- {
- mIsEnabled = true;
-
- if( mActionHandler )
- {
- mActionHandler->ChangeAccessibilityStatus();
- }
- }
-}
-
-void AccessibilityAdaptor::DisableAccessibility()
-{
- if(mIsEnabled == true)
- {
- mIsEnabled = false;
-
- if( mActionHandler )
- {
- mActionHandler->ChangeAccessibilityStatus();
- }
-
- // Destroy the TtsPlayer if exists.
- if ( Adaptor::IsAvailable() )
- {
- Dali::Adaptor& adaptor = Dali::Adaptor::Get();
- Adaptor& adaptorImpl = Adaptor::GetImplementation( adaptor );
- adaptorImpl.DestroyTtsPlayer( Dali::TtsPlayer::SCREEN_READER );
- }
- }
-}
-
-bool AccessibilityAdaptor::IsEnabled() const
-{
- return mIsEnabled;
-}
-
-Vector2 AccessibilityAdaptor::GetReadPosition() const
-{
- return mReadPosition;
-}
-
-void AccessibilityAdaptor::SetActionHandler(AccessibilityActionHandler& handler)
-{
- mActionHandler = &handler;
-}
-
-void AccessibilityAdaptor::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- if( mAccessibilityGestureDetector )
- {
- mAccessibilityGestureDetector->SetGestureHandler(handler);
- }
-}
-
-bool AccessibilityAdaptor::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = static_cast< float > (x);
- mReadPosition.y = static_cast< float > (y);
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionRead( allowReadAgain );
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionClearFocusEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->ClearAccessibilityFocus();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp)
-{
- bool ret = false;
-
- // We always need to emit a scroll signal, whether it's only a hover or not,
- // so always send the action to the action handler.
- if( mActionHandler )
- {
- Dali::TouchEvent touch = Integration::NewTouchEvent( timeStamp, point );
- ret = mActionHandler->AccessibilityActionScroll( touch );
- }
-
- Integration::TouchEvent touchEvent;
- Integration::HoverEvent hoverEvent;
- Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent( Integration::Point( point ), timeStamp, touchEvent, hoverEvent );
- if( type == Integration::TouchEventCombiner::DISPATCH_TOUCH || type == Integration::TouchEventCombiner::DISPATCH_BOTH ) // hover event is ignored
- {
- // Process the touch event in accessibility gesture detector
- if( mAccessibilityGestureDetector )
- {
- mAccessibilityGestureDetector->SendEvent( touchEvent );
- ret = true;
- }
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionBackEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionBack();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-void AccessibilityAdaptor::HandleActionEnableEvent()
-{
- EnableAccessibility();
-}
-
-void AccessibilityAdaptor::HandleActionDisableEvent()
-{
- DisableAccessibility();
-}
-
-bool AccessibilityAdaptor::HandleActionScrollUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionScrollUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-
-bool AccessibilityAdaptor::HandleActionScrollDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionScrollDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageLeftEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageLeft();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageRightEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageRight();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionPageDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPageDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToFirstEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionMoveToFirst();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionMoveToLastEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionMoveToLast();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromTopEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadFromTop();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadFromNextEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadFromNext();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionZoomEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionZoom();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPauseResume();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptor::HandleActionStartStopEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionStartStop();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptor::~AccessibilityAdaptor()
-{
- // Do any platform specific clean-up in OnDestroy()
- OnDestroy();
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
-#define DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
-
-/*
- * Copyright (c) 2019 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 <string>
-
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/touch-point.h>
-#include <dali/integration-api/events/touch-event-combiner.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
-#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/internal/accessibility/common/accessibility-gesture-detector.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * This class detects to accessibility action
- */
-class AccessibilityAdaptor : public Dali::BaseObject
-{
-public:
-
- /**
- * Constructor.
- */
- AccessibilityAdaptor();
-
- /**
- * @brief Get an instance of the AccessibilityAdaptor.
- *
- * @note This singleton-style getter can be reimplemented for different platforms.
- * @return The instance of the AccessibilityAdaptor.
- */
- static Dali::AccessibilityAdaptor Get();
-
- /**
- * Turn on accessibility action
- * This method should be called by vconf callback
- */
- void EnableAccessibility();
-
- /**
- * Turn off accessibility action
- * This method should be called by vconf callback
- */
- void DisableAccessibility();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::IsEnabled()
- */
- bool IsEnabled() const;
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::GetReadPosition() const
- */
- Vector2 GetReadPosition() const;
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::SetActionHandler()
- */
- void SetActionHandler(AccessibilityActionHandler& handler);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::SetGestureHandler()
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
- */
- virtual bool HandleActionNextEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPreviousEvent()
- */
- virtual bool HandleActionPreviousEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionActivateEvent()
- */
- virtual bool HandleActionActivateEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadEvent()
- */
- virtual bool HandleActionReadEvent( unsigned int x, unsigned int y, bool allowReadAgain );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadNextEvent()
- */
- virtual bool HandleActionReadNextEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPreviousEvent()
- */
- virtual bool HandleActionReadPreviousEvent( bool allowEndFeedback = true);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionUpEvent()
- */
- virtual bool HandleActionUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDownEvent()
- */
- virtual bool HandleActionDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionClearFocusEvent()
- */
- bool HandleActionClearFocusEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollEvent()
- */
- bool HandleActionScrollEvent(const TouchPoint& point, uint32_t timeStamp);
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionBackEvent()
- */
- bool HandleActionBackEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionEnableEvent()
- */
- void HandleActionEnableEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDisableEvent()
- */
- void HandleActionDisableEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollUpEvent()
- */
- bool HandleActionScrollUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionScrollDownEvent()
- */
- bool HandleActionScrollDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageLeftEvent()
- */
- bool HandleActionPageLeftEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageRightEvent()
- */
- bool HandleActionPageRightEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageUpEvent()
- */
- bool HandleActionPageUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPageDownEvent()
- */
- bool HandleActionPageDownEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionMoveToFirstEvent()
- */
- bool HandleActionMoveToFirstEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionMoveToLastEvent()
- */
- bool HandleActionMoveToLastEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadFromTopEvent()
- */
- bool HandleActionReadFromTopEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadFromNextEvent()
- */
- bool HandleActionReadFromNextEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionZoomEvent()
- */
- bool HandleActionZoomEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPauseResumeEvent()
- */
- bool HandleActionReadPauseResumeEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionStartStopEvent()
- */
- bool HandleActionStartStopEvent();
-
-protected:
-
- /**
- * Destructor.
- */
- ~AccessibilityAdaptor() override;
-
-private:
-
- /**
- * @brief Called when the singleton is destroyed.
- *
- * @note This can be reimplemented for different platforms.
- * @return The instance of the AccessibilityAdaptor.
- */
- static void OnDestroy();
-
- // Undefined
- AccessibilityAdaptor( const AccessibilityAdaptor& );
- AccessibilityAdaptor& operator=( AccessibilityAdaptor& );
-
-protected:
-
- Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events.
-
- Vector2 mReadPosition; ///< ActionRead position
-
- AccessibilityActionHandler* mActionHandler; ///< The pointer of accessibility action handler
-
- AccessibilityGestureDetectorPtr mAccessibilityGestureDetector; ///< The accessibility gesture detector
-
- bool mIsEnabled : 1; ///< enable/disable the accessibility action
-
-public:
-
- // Helpers for public-api forwarding methods
-
- inline static Internal::Adaptor::AccessibilityAdaptor& GetImplementation(Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
-
- BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<Internal::Adaptor::AccessibilityAdaptor&>(handle);
- }
-
- inline static const Internal::Adaptor::AccessibilityAdaptor& GetImplementation(const Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptor handle is empty" );
-
- const BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::AccessibilityAdaptor&>(handle);
- }
-
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_H
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/common/accessibility-gesture-detector.h>
-
-// EXTERNAL INCLUDES
-#include <cmath>
-#include <dali/integration-api/events/touch-event-integ.h>
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
- const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN( 15.0f );
- const float MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_BEFORE_PAN );
- const float MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO( 2.0f / 3.0f );
- const unsigned long MAXIMUM_TIME_DIFF_ALLOWED( 500 );
- const unsigned long MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS( 100 );
- const unsigned int MINIMUM_MOTION_EVENTS_BEFORE_PAN(2);
- const unsigned int MINIMUM_TOUCHES_BEFORE_PAN(1);
- const unsigned int MAXIMUM_TOUCHES_BEFORE_PAN(1);
-} // unnamed namespace
-
-
-AccessibilityGestureDetector::AccessibilityGestureDetector()
-: mState( CLEAR ),
- mScene(nullptr),
- mGestureHandler(nullptr),
- mPanning(false),
- mThresholdAdjustmentsRemaining( 0 ),
- mThresholdTotalAdjustments( MINIMUM_MOTION_DISTANCE_BEFORE_PAN * MINIMUM_MOTION_DISTANCE_TO_THRESHOLD_ADJUSTMENTS_RATIO ),
- mPrimaryTouchDownTime( 0 ),
- mMinimumTouchesRequired( MINIMUM_TOUCHES_BEFORE_PAN ),
- mMaximumTouchesRequired( MAXIMUM_TOUCHES_BEFORE_PAN ),
- mMinimumDistanceSquared( MINIMUM_MOTION_DISTANCE_BEFORE_PAN_SQUARED ),
- mMinimumMotionEvents( MINIMUM_MOTION_EVENTS_BEFORE_PAN ),
- mMotionEvents( 0 )
-{
-}
-
-AccessibilityGestureDetector::~AccessibilityGestureDetector()
-{
-}
-
-void AccessibilityGestureDetector::SetGestureHandler(AccessibilityGestureHandler& handler)
-{
- mGestureHandler = &handler;
-}
-
-void AccessibilityGestureDetector::EmitPan(const AccessibilityGestureEvent gesture)
-{
- if( mGestureHandler )
- {
- if(gesture.state == AccessibilityGestureEvent::STARTED)
- {
- mPanning = true;
- }
-
- if( mPanning )
- {
- mGestureHandler->HandlePanGesture(gesture);
-
- if( (gesture.state == AccessibilityGestureEvent::FINISHED) ||
- (gesture.state == AccessibilityGestureEvent::CANCELLED) )
- {
- mPanning = false;
- }
- }
- }
-}
-
-void AccessibilityGestureDetector::SendEvent(const Integration::TouchEvent& event)
-{
- PointState::Type primaryPointState(event.points[0].GetState());
-
- if (primaryPointState == PointState::INTERRUPTED)
- {
- if ( ( mState == STARTED ) || ( mState == POSSIBLE ) )
- {
- // If our pan had started and we are interrupted, then tell Core that pan is cancelled.
- mTouchEvents.push_back(event);
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
- }
- mState = CLEAR; // We should change our state to CLEAR.
- mTouchEvents.clear();
- }
- else
- {
- switch (mState)
- {
- case CLEAR:
- {
- if ( ( primaryPointState == PointState::DOWN ) || ( primaryPointState == PointState::STATIONARY ) )
- {
- mPrimaryTouchDownLocation = event.points[0].GetScreenPosition();
- mPrimaryTouchDownTime = event.time;
- mMotionEvents = 0;
- if (event.GetPointCount() == mMinimumTouchesRequired)
- {
- // We have satisfied the minimum touches required for a pan, tell core that a gesture may be possible and change our state accordingly.
- mState = POSSIBLE;
- SendPan(AccessibilityGestureEvent::POSSIBLE, event);
- }
-
- mTouchEvents.push_back(event);
- }
- break;
- }
-
- case POSSIBLE:
- {
- unsigned int pointCount(event.GetPointCount());
- if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
- {
- if (primaryPointState == PointState::MOTION)
- {
- mTouchEvents.push_back(event);
- mMotionEvents++;
-
- Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
-
- if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
- ( delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) ) )
- {
- // If the touch point(s) have moved enough distance to be considered a pan, then tell Core that the pan gesture has started and change our state accordingly.
- mState = STARTED;
- SendPan(AccessibilityGestureEvent::STARTED, event);
- }
- }
- else if (primaryPointState == PointState::UP)
- {
- Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
- if (delta.LengthSquared() >= static_cast<float>( mMinimumDistanceSquared ) )
- {
- SendPan(AccessibilityGestureEvent::STARTED, event);
- mTouchEvents.push_back(event);
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- }
- else
- {
- // If we have lifted the primary touch point then tell core the pan is cancelled and change our state to CLEAR.
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
- }
- mState = CLEAR;
- mTouchEvents.clear();
- }
- }
- else
- {
- // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
- SendPan(AccessibilityGestureEvent::CANCELLED, event);
-
- if (pointCount == 1 && primaryPointState == PointState::UP)
- {
- // If we have lifted the primary touch point, then change our state to CLEAR...
- mState = CLEAR;
- mTouchEvents.clear();
- }
- else
- {
- // ...otherwise change it to FAILED.
- mState = FAILED;
- }
- }
- break;
- }
-
- case STARTED:
- {
- mTouchEvents.push_back(event);
-
- unsigned int pointCount(event.GetPointCount());
- if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
- {
- switch (primaryPointState)
- {
- case PointState::MOTION:
- // Pan is continuing, tell Core.
- SendPan(AccessibilityGestureEvent::CONTINUING, event);
- break;
-
- case PointState::UP:
- // Pan is finally finished when our primary point is lifted, tell Core and change our state to CLEAR.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- mState = CLEAR;
- mTouchEvents.clear();
- break;
-
- case PointState::STATIONARY:
- if (pointCount == mMinimumTouchesRequired)
- {
- Integration::PointContainerConstIterator iter = event.points.begin() + 1; // We already know the state of the first point
- for(; iter != event.points.end(); ++iter)
- {
- if(iter->GetState() == PointState::UP)
- {
- // The number of touch points will be less than the minimum required. Inform core and change our state to FINISHED.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
- mState = FINISHED;
- break;
- }
- }
- }
- break;
-
- default:
- break;
- }
- }
- else
- {
- // We have gone outside of the pan requirements, inform Core that the gesture is finished.
- SendPan(AccessibilityGestureEvent::FINISHED, event);
-
- if (pointCount == 1 && primaryPointState == PointState::UP)
- {
- // If this was the primary point being released, then we change our state back to CLEAR...
- mState = CLEAR;
- mTouchEvents.clear();
- }
- else
- {
- // ...otherwise we change it to FINISHED.
- mState = FINISHED;
- }
- }
- break;
- }
-
- case FINISHED:
- case FAILED:
- {
- if (primaryPointState == PointState::UP)
- {
- // Change our state back to clear when the primary touch point is released.
- mState = CLEAR;
- mTouchEvents.clear();
- }
- break;
- }
- }
- }
-}
-
-void AccessibilityGestureDetector::SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent)
-{
- AccessibilityGestureEvent gesture(state);
- gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
- gesture.numberOfTouches = currentEvent.GetPointCount();
-
- if ( mTouchEvents.size() > 1 )
- {
- // Get the second last event in the queue, the last one is the current event
- const Integration::TouchEvent& previousEvent( *( mTouchEvents.rbegin() + 1 ) );
-
- Vector2 previousPosition( mPreviousPosition );
- uint32_t previousTime( previousEvent.time );
-
- // If we've just started then we want to remove the threshold from Core calculations.
- if ( state == AccessibilityGestureEvent::STARTED )
- {
- previousPosition = mPrimaryTouchDownLocation;
- previousTime = mPrimaryTouchDownTime;
-
- // If it's a slow pan, we do not want to phase in the threshold over the first few pan-events
- // A slow pan is defined as one that starts the specified number of milliseconds after the down-event
- if ( ( currentEvent.time - previousTime ) > MINIMUM_TIME_BEFORE_THRESHOLD_ADJUSTMENTS )
- {
- mThresholdAdjustmentsRemaining = mThresholdTotalAdjustments;
- mThresholdAdjustmentPerFrame = ( gesture.currentPosition - previousPosition ) / static_cast<float>( mThresholdTotalAdjustments );
- }
- else
- {
- mThresholdAdjustmentsRemaining = 0;
- mThresholdAdjustmentPerFrame = Vector2::ZERO;
- }
- }
-
- gesture.previousPosition = previousPosition;
- gesture.timeDelta = currentEvent.time - previousTime;
-
- // Apply the threshold with a phased approach
- if ( mThresholdAdjustmentsRemaining > 0 )
- {
- --mThresholdAdjustmentsRemaining;
- gesture.currentPosition -= mThresholdAdjustmentPerFrame * static_cast<float>( mThresholdAdjustmentsRemaining );
- }
-
- mPreviousPosition = gesture.currentPosition;
- }
- else
- {
- gesture.previousPosition = gesture.currentPosition;
- gesture.timeDelta = 0;
- }
-
- gesture.time = currentEvent.time;
-
- EmitPan(gesture);
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
-#define DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
-
-/*
- * Copyright (c) 2019 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
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-event.h>
-#include <dali/integration-api/scene.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-struct TouchEvent;
-}
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * Detects an accessibility pan gesture and sends it to the gesture handler.
- */
-class AccessibilityGestureDetector : public RefObject
-{
-public:
-
- /**
- * Constructor
- */
- AccessibilityGestureDetector();
-
- /**
- * Virtual destructor.
- */
- ~AccessibilityGestureDetector() override;
-
- /**
- * Set the handler to handle accessibility gestures.
- * @param[in] handler The Accessibility gesture handler.
- * @note Handlers should remove themselves when they are destroyed.
- */
- void SetGestureHandler(AccessibilityGestureHandler& handler);
-
- void SendEvent(const Integration::TouchEvent& event);
-
- void SendEvent(Integration::Scene& scene, const Integration::TouchEvent& event)
- {
- mScene = &scene;
- SendEvent(event);
- }
-
-private:
-
- /**
- * Emits the pan gesture event (performs some smoothing operation).
- * @param[in] state The state of the pan.
- * @param[in] currentEvent The latest touch event.
- */
- void SendPan(AccessibilityGestureEvent::State state, const Integration::TouchEvent& currentEvent);
-
- /**
- * Emits the pan gesture event to the gesture handler.
- * @param[in] gesture The pan gesture event.
- */
- void EmitPan(const AccessibilityGestureEvent gesture);
-
-private:
-
- /**
- * Internal state machine.
- */
- enum State
- {
- CLEAR, ///< No gesture detected.
- POSSIBLE, ///< The current touch event data suggests that a gesture is possible.
- STARTED, ///< A gesture has been detected.
- FINISHED, ///< A previously started pan gesture has finished.
- FAILED, ///< Current touch event data suggests a pan gesture is not possible.
- };
-
- State mState; ///< The current state of the detector.
-
- Integration::Scene* mScene;
- AccessibilityGestureHandler* mGestureHandler; ///< The pointer of accessibility gesture handler
- bool mPanning; ///< Keep track of panning state, when panning is occuring, this is true.
-
- std::vector<Integration::TouchEvent> mTouchEvents; ///< A container of all touch events after an initial down event.
-
- Vector2 mPrimaryTouchDownLocation; ///< The initial touch down point.
- Vector2 mThresholdAdjustmentPerFrame; ///< The adjustment per frame at the start of a slow pan.
- Vector2 mPreviousPosition; ///< The previous position.
-
- unsigned int mThresholdAdjustmentsRemaining; ///< No. of threshold adjustments still to apply (for a slow-pan).
- unsigned int mThresholdTotalAdjustments; ///< The total number of adjustments required.
-
- uint32_t mPrimaryTouchDownTime; ///< The initial touch down time.
- unsigned int mMinimumTouchesRequired; ///< The minimum touches required before a pan should be emitted.
- unsigned int mMaximumTouchesRequired; ///< The maximum touches after which a pan should not be emitted.
- unsigned int mMinimumDistanceSquared; ///< The minimum distance squared before pan should start.
- unsigned int mMinimumMotionEvents; ///< The minimum motion events before pan should start.
- unsigned int mMotionEvents; ///< The motion events received so far (before pan is emitted).
-};
-
-using AccessibilityGestureDetectorPtr = Dali::IntrusivePtr<AccessibilityGestureDetector>;
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_GESTURE_DETECTOR_H
SET( adaptor_accessibility_common_src_files
${adaptor_accessibility_dir}/common/tts-player-factory.cpp
${adaptor_accessibility_dir}/common/tts-player-impl.cpp
- ${adaptor_accessibility_dir}/common/accessibility-adaptor-impl.cpp
- ${adaptor_accessibility_dir}/common/accessibility-gesture-detector.cpp
+ ${adaptor_accessibility_dir}/bridge/accessible.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-accessible.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-action.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-base.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-collection.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-component.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-editable-text.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-impl.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-object.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-text.cpp
+ ${adaptor_accessibility_dir}/bridge/bridge-value.cpp
+ ${adaptor_accessibility_dir}/bridge/component.cpp
+ ${adaptor_accessibility_dir}/bridge/dbus-tizen.cpp
)
# module: accessibility, backend: tizen-wayland
SET( adaptor_accessibility_tizen_wayland_src_files
${adaptor_accessibility_dir}/tizen-wayland/tts-player-factory-tizen.cpp
${adaptor_accessibility_dir}/tizen-wayland/tts-player-impl-tizen.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/atspi-accessibility-tizen.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/accessibility-impl.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/accessible.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-accessible.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-action.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-base.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-collection.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-component.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-editable-text.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-impl.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-object.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-text.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/bridge-value.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/component.cpp
- ${adaptor_accessibility_dir}/tizen-wayland/atspi/dbus-tizen.cpp
)
# module: accessibility, backend: tizen-common profile
SET( adaptor_accessibility_tizen_common_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-common/accessibility-adaptor-impl-tizen.cpp
)
# module: accessibility, backend: tizen-ivi profile
SET( adaptor_accessibility_tizen_ivi_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-ivi/accessibility-adaptor-impl-ivi.cpp
)
# module: accessibility, backend: tizen-mobile profile
SET( adaptor_accessibility_tizen_mobile_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.cpp
)
# module: accessibility, backend: tizen-tv profile
SET( adaptor_accessibility_tizen_tv_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-tv/accessibility-adaptor-impl-tv.cpp
)
# module: accessibility, backend: tizen-wearable profile
SET( adaptor_accessibility_tizen_wearable_src_files
- ${adaptor_accessibility_dir}/tizen-wayland/tizen-wearable/accessibility-adaptor-impl-wearable.cpp
)
# module: accessibility, backend: ubuntu
SET( adaptor_accessibility_ubuntu_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
- ${adaptor_accessibility_dir}/generic/atspi-accessibility-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-factory-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-impl-generic.cpp
)
# module: accessibility, backend: android
SET( adaptor_accessibility_android_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-factory-generic.cpp
${adaptor_accessibility_dir}/generic/tts-player-impl-generic.cpp
)
# module: accessibility, backend: windows
SET( adaptor_accessibility_windows_src_files
- ${adaptor_accessibility_dir}/generic/accessibility-adaptor-impl-generic.cpp
)
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- // Nothing to do here
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/public-api/dali-adaptor-common.h>
-#include <dali/devel-api/adaptor-framework/atspi-accessibility.h>
-#include <dali/integration-api/debug.h>
-
-void Dali::AtspiAccessibility::Pause()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-void Dali::AtspiAccessibility::Resume()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-void Dali::AtspiAccessibility::Say( const std::string &text, bool discardable, std::function<void(std::string)> callback )
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
-}
-
-int Dali::AtspiAccessibility::SetForcefully( bool turnOn )
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
- return -1;
-}
-
-int Dali::AtspiAccessibility::GetStatus()
-{
- DALI_LOG_ERROR("[ERROR] This is NOT supported\n");
- return -1;
-}
+++ /dev/null
-#ifndef DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
-#define DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
-
-/*
- * Copyright 2019 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 <cassert>
-#include <new>
-#include <type_traits>
-#include <utility>
-
-/**
- * Minimalistic implementation of standard library std::optional (c++17) for c++11 compiler.
- *
- * After project conversion to C++17 standard, this template class will be deleted and
- * Optional will point to std::optional.
- *
- * Allowed operations (note, to make code simplier, than original, value class must have accessible copy and move constructor):
- * - constructing empty (valueless) object
- * - copying Optional (with and without value)
- * - moving Optional (with and without value)
- * - querying, if Optional has value (via explicit operator bool), for example:
- * Optional<int> v = ...;
- * if (v) ... // if v has value, then do something
- * - accessing value (via operator *), for example:
- * Optional<int> v = ...;
- * auto z = *v; // z now has the same int, as v (copied)
- * auto &y = *v; // y now has REFERENCE to int inside v, so modifying y modifies v
- */
-
-template < typename A >
-class Optional
-{
- union
- {
- A place;
- };
- bool hasValue = false;
-
-public:
- /**
- * @brief Empty constructor.
- * Creates empty Optional object, which will be false in boolean context.
- * So:
- * \code{.cpp}
- * Optional<int> o;
- * if (o) printf("1\n");
- * \endcode
- * won't print 1.
- */
- Optional() {}
-
- /**
- * @brief Single element constructor, when implicit convertion can be applied.
- * This constructor will be selected, when type of given argument (U) is
- * implicitly convertable to expected type A. In other words following
- * code must be valid:
- * \code{.cpp}
- * A foo() {
- * return U();
- * }
- * \endcode
- * @param a value held by Optional object will be initialized from a.
- */
- template < typename U = A, typename std::enable_if<
- std::is_convertible< U&&, A >::value &&
- std::is_constructible< A, U&& >::value &&
- !std::is_same< typename std::decay< U >::type, Optional< A > >::value,
- int* >::type = nullptr >
- constexpr Optional( U&& a )
- : place( std::forward< U >( a ) ),
- hasValue( true )
- {
- }
-
- /**
- * @brief Single element constructor, when only explicit convertion can be applied.
- * This constructor will be selected, when type of given argument (U) is
- * convertable to expected type A.
- * @param a value held by Optional object will be initialized from a.
- */
- template < typename U = A, typename std::enable_if<
- !std::is_convertible< U&&, A >::value &&
- std::is_constructible< A, U&& >::value &&
- !std::is_same< typename std::decay< U >::type, Optional< A > >::value,
- int* >::type = nullptr >
- explicit constexpr Optional( U&& a )
- : place( std::forward< U >( a ) ),
- hasValue( true )
- {
- }
-
- /**
- * @brief Copy constructor.
- * @param v Optional value to copy from. Will cause to copy data held by object v,
- * if v has data.
- */
- Optional( const Optional& v ) : hasValue( v.hasValue )
- {
- if( hasValue )
- {
- new( &place ) A( v.place );
- }
- }
-
- /**
- * @brief Move constructor.
- * @param v Optional value to copy from. Will move data help by v, if any.
- * After construction \code{.cpp} bool(v) \endcode will be false.
- */
- Optional( Optional&& v ) : hasValue( v.hasValue )
- {
- if( hasValue )
- {
- new( &place ) A( std::move( v.place ) );
- }
- }
-
- /**
- * @brief Destructor.
- */
- ~Optional()
- {
- if( hasValue )
- {
- place.~A();
- }
- }
-
- /**
- * @brief Explicit bool operator
- * Will return true if and only if object is helding data.
- */
- explicit operator bool() const
- {
- return hasValue;
- }
-
- /**
- * @brief Accessor (*) operator
- * Will return modifiable reference to held object. Will assert, if not object is held.
- */
- A& operator*()
- {
- assert( hasValue );
- return place;
- }
-
- /**
- * @brief Accessor (*) const operator
- * Will return const reference to held object. Will assert, if not object is held.
- */
- const A& operator*() const
- {
- assert( hasValue );
- return place;
- }
-
- /**
- * @brief Accessor (->) operator
- * Will return pointer to held object allowing access to the value's members.
- * Will assert, if not object is held.
- */
- A* operator->()
- {
- assert( hasValue );
- return &place;
- }
-
- /**
- * @brief Accessor (->) operator
- * Will return pointer to (const) held object allowing access to the value's members.
- * Will assert, if not object is held.
- */
- const A* operator->() const
- {
- assert( hasValue );
- return &place;
- }
-
- /**
- * @brief Assignment operator
- * Will copy held value from v, if any.
- * @param v Value to copy from
- */
- Optional& operator=( const Optional& v )
- {
- if( this != &v )
- {
- if( hasValue != v.hasValue )
- {
- if( v.hasValue )
- {
- new( &place ) A( v.place );
- }
- else
- {
- place.~A();
- }
- hasValue = v.hasValue;
- }
- else if( hasValue )
- {
- place = v.place;
- }
- }
- return *this;
- }
-
- /**
- * @brief Assignment move operator
- * Will move held value from v, if any. In all cases v won't held a value
- * after assignment is done.
- * @param v Value to copy from
- */
- Optional& operator=( Optional&& v )
- {
- if( this != &v )
- {
- if( hasValue != v.hasValue )
- {
- if( v.hasValue )
- {
- new( &place ) A( std::move( v.place ) );
- }
- else
- {
- place.~A();
- }
- hasValue = v.hasValue;
- }
- else if( hasValue )
- {
- place = std::move( v.place );
- }
- }
- return *this;
- }
-
- /**
- * @brief Assignment operator from value of type held.
- * Will initialize held value from given parameter a.
- * Type of the parameter must be the same (barring cv convertions),
- * as the type of the value held.
- * @param a Value to copy from
- */
- template < class U, class = typename std::enable_if<
- std::is_same< typename std::remove_reference< U >::type, A >::value &&
- std::is_constructible< A, U >::value &&
- std::is_assignable< A&, U >::value >::type >
- Optional& operator=( U&& a )
- {
- if( hasValue )
- {
- place = std::forward< U >( a );
- }
- else
- {
- hasValue = true;
- new( &place ) A( std::forward< U >( a ) );
- }
- return *this;
- }
-};
-
-#endif // DALI_INTERNAL_ATSPI_ACCESSIBILITY_OPTIONAL_H
+++ /dev/null
-/*
- * Copyright (c) 2018 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-// Disabled Accessibility temporarily in Tizen platform
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- //vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- //vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return static_cast<bool>(isEnabled);
-}
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR" );
-#endif
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- AccessibilityAdaptor& adaptorImpl = AccessibilityAdaptor::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler )
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler )
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
-#define DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
-
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
-#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/internal/accessibility/common/accessibility-gesture-detector.h>
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-/**
- * This mobile version is different since it forwards events to the indicator.
- */
-class AccessibilityAdaptorMobile : public AccessibilityAdaptor
-{
-public:
-
- /**
- * Constructor.
- */
- AccessibilityAdaptorMobile();
-
- // From AccessibilityAdaptor base class
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionNextEvent()
- */
- virtual bool HandleActionNextEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionPreviousEvent()
- */
- virtual bool HandleActionPreviousEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionActivateEvent()
- */
- virtual bool HandleActionActivateEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadEvent()
- */
- virtual bool HandleActionReadEvent( unsigned int x, unsigned int y, bool allowReadAgain );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadNextEvent()
- */
- virtual bool HandleActionReadNextEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionReadPreviousEvent()
- */
- virtual bool HandleActionReadPreviousEvent( bool allowEndFeedback );
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionUpEvent()
- */
- virtual bool HandleActionUpEvent();
-
- /**
- * @copydoc Dali::AccessibilityAdaptor::HandleActionDownEvent()
- */
- virtual bool HandleActionDownEvent();
-
-private:
-
- /**
- * Destructor.
- */
- virtual ~AccessibilityAdaptorMobile();
-
- // Undefined
- AccessibilityAdaptorMobile( const AccessibilityAdaptorMobile& );
- AccessibilityAdaptorMobile& operator=( AccessibilityAdaptorMobile& );
-
-public:
-
- // Helpers for public-api forwarding methods
-
- inline static Internal::Adaptor::AccessibilityAdaptorMobile& GetImplementation(Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptorMobile handle is empty" );
-
- BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<Internal::Adaptor::AccessibilityAdaptorMobile&>(handle);
- }
-
- inline static const Internal::Adaptor::AccessibilityAdaptorMobile& GetImplementation(const Dali::AccessibilityAdaptor& adaptor)
- {
- DALI_ASSERT_ALWAYS( adaptor && "AccessibilityAdaptorMobile handle is empty" );
-
- const BaseObject& handle = adaptor.GetBaseObject();
-
- return static_cast<const Internal::Adaptor::AccessibilityAdaptorMobile&>(handle);
- }
-
-};
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_ACCESSIBILITY_ADAPTOR_MOBILE_H
+++ /dev/null
-/*
- * Copyright (c) 2018 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/internal/accessibility/common/accessibility-adaptor-impl.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace
-{
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-// Disabled Accessibility temporarily in Tizen platform
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- //vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- //vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return static_cast<bool>(isEnabled);
-}
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR" );
-#endif
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptor() );
- AccessibilityAdaptor& adaptorImpl = AccessibilityAdaptor::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-/*
- * Copyright (c) 2019 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/internal/accessibility/tizen-wayland/tizen-mobile/accessibility-adaptor-impl-mobile.h>
-
-// EXTERNAL INCLUDES
-#include <vconf.h>
-
-#ifndef WAYLAND
-#include <dali/internal/system/linux/dali-ecore-x.h>
-#include <dali/internal/system/linux/dali-elementary.h>
-#endif
-
-#include <vconf.h>
-
-#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/common/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/system/common/system-settings.h>
-
-#ifndef WAYLAND
-#define MSG_DOMAIN_CONTROL_ACCESS static_cast< int >( ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL )
-#endif
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-namespace // unnamed namespace
-{
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gAccessibilityAdaptorLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ACCESSIBILITY_ADAPTOR");
-#endif
-
-const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS = "db/setting/accessibility/atspi";
-
-bool GetEnabledVConf()
-{
- int isEnabled = 0;
- vconf_get_bool( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, &isEnabled );
-
- if( isEnabled == 0 )
- {
- vconf_get_bool( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &isEnabled );
- }
-
- return bool( isEnabled );
-}
-
-
-void AccessibilityOnOffNotification(keynode_t* node, void* data)
-{
- AccessibilityAdaptor* adaptor = static_cast<AccessibilityAdaptor*>( data );
-
- bool isEnabled = GetEnabledVConf();
-
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- if( isEnabled )
- {
- adaptor->EnableAccessibility();
- }
- else
- {
- adaptor->DisableAccessibility();
- }
-}
-
-} // unnamed namespace
-
-Dali::AccessibilityAdaptor AccessibilityAdaptor::Get()
-{
- Dali::AccessibilityAdaptor adaptor;
-
- Dali::SingletonService service( SingletonService::Get() );
- if ( service )
- {
- // Check whether the singleton is already created
- Dali::BaseHandle handle = service.GetSingleton( typeid( Dali::AccessibilityAdaptor ) );
- if(handle)
- {
- // If so, downcast the handle
- adaptor = Dali::AccessibilityAdaptor( dynamic_cast< AccessibilityAdaptor* >( handle.GetObjectPtr() ) );
- }
- else
- {
- adaptor = Dali::AccessibilityAdaptor( new AccessibilityAdaptorMobile() );
- AccessibilityAdaptorMobile& adaptorImpl = AccessibilityAdaptorMobile::GetImplementation( adaptor );
-
- bool isEnabled = GetEnabledVConf();
-
- if( isEnabled )
- {
- adaptorImpl.EnableAccessibility();
- }
- DALI_LOG_INFO( gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, isEnabled ? "ENABLED" : "DISABLED" );
-
- vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification, &adaptorImpl );
- vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification, &adaptorImpl );
-
- service.Register( typeid( adaptor ), adaptor );
- }
- }
-
- return adaptor;
-}
-
-void AccessibilityAdaptor::OnDestroy()
-{
- vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, AccessibilityOnOffNotification );
- vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_DBUS_TTS, AccessibilityOnOffNotification );
-}
-
-AccessibilityAdaptorMobile::AccessibilityAdaptorMobile()
-{
-}
-
-bool AccessibilityAdaptorMobile::HandleActionNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionActivateEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionActivate();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadEvent(unsigned int x, unsigned int y, bool allowReadAgain)
-{
- bool ret = false;
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %d , %d\n", __FUNCTION__, __LINE__, x, y);
-
- mReadPosition.x = x;
- mReadPosition.y = y;
-
- if( mActionHandler)
- {
- // The accessibility actions should be handled by the registered accessibility action handler (e.g. focus manager)
- ret = mActionHandler->AccessibilityActionRead(allowReadAgain);
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
- }
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadNextEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadNext(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionReadPreviousEvent(bool allowEndFeedback)
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionReadPrevious(allowEndFeedback);
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionUpEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionUp();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-bool AccessibilityAdaptorMobile::HandleActionDownEvent()
-{
- bool ret = false;
-
- if( mActionHandler )
- {
- ret = mActionHandler->AccessibilityActionDown();
- }
-
- DALI_LOG_INFO(gAccessibilityAdaptorLogFilter, Debug::General, "[%s:%d] %s\n", __FUNCTION__, __LINE__, ret?"TRUE":"FALSE");
-
- return ret;
-}
-
-AccessibilityAdaptorMobile::~AccessibilityAdaptorMobile()
-{
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
#include <dali/integration-api/core.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/internal/system/common/callback-manager.h>
#include <dali/internal/accessibility/common/tts-player-impl.h>
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
#include <dali/internal/window-system/common/event-handler.h>
#include <dali/internal/graphics/gles/gl-proxy-implementation.h>
#include <dali/internal/graphics/gles/gl-implementation.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/system/common/logging.h>
#include <dali/internal/system/common/locale-utils.h>
}
mConfigurationManager = Utils::MakeUnique<ConfigurationManager>( systemCachePath, eglGraphics, mThreadController );
+
+ auto appName = GetApplicationPackageName();
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ bridge->SetApplicationName( appName );
+ bridge->Initialize();
+ Dali::Stage::GetCurrent().KeyEventSignal().Connect( &accessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent );
+}
+
+void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent( const Dali::KeyEvent& event )
+{
+ Accessibility::KeyEventType type;
+ if( event.GetState() == Dali::KeyEvent::DOWN )
+ {
+ type = Accessibility::KeyEventType::KEY_PRESSED;
+ }
+ else if( event.GetState() == Dali::KeyEvent::UP )
+ {
+ type = Accessibility::KeyEventType::KEY_RELEASED;
+ }
+ else
+ {
+ return;
+ }
+ Dali::Accessibility::Bridge::GetCurrentBridge()->Emit( type, event.GetKeyCode(), event.GetKeyName(), event.GetTime(), !event.GetKeyString().empty() );
}
Adaptor::~Adaptor()
{
+ Accessibility::Bridge::GetCurrentBridge()->Terminate();
+
// Ensure stop status
Stop();
void Adaptor::OnWindowShown()
{
+ Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationShown();
+
if( PAUSED_WHILE_HIDDEN == mState )
{
// Adaptor can now be resumed
void Adaptor::OnWindowHidden()
{
+ Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden();
+
if( RUNNING == mState || READY == mState )
{
bool allWindowsHidden = true;
#include <dali/internal/window-system/common/damage-observer.h>
#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <string>
+
namespace Dali
{
class RenderSurfaceInterface;
+namespace Accessibility
+{
+class Bridge;
+}
+
namespace Integration
{
class Core;
*/
void SceneCreated();
+ static std::string GetApplicationPackageName();
+
public: // AdaptorInternalServices implementation
/**
* @copydoc Dali::Adaptor::Start()
std::unique_ptr<Integration::AddOnManager> mAddOnManager; ///< Pointer to the addon manager
+ class AccessibilityObserver : public ConnectionTracker
+ {
+ public:
+ void OnAccessibleKeyEvent( const Dali::KeyEvent& event );
+ };
+ AccessibilityObserver accessibilityObserver;
+
public:
inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) { return *adaptor.mImpl; }
};
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/accessibility-adaptor.h>
#include <dali/devel-api/adaptor-framework/style-monitor.h>
#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
#include <dali/integration-api/adaptor-framework/scene-holder.h>
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/style-monitor.h>
#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/system/common/command-line-options.h>
#include <dali/internal/adaptor/common/framework.h>
void Application::QuitFromMainLoop()
{
+ Accessibility::Bridge::GetCurrentBridge()->Terminate();
+
mAdaptor->Stop();
mFramework->Quit();
// Run the adaptor
mAdaptor->Start();
+ Accessibility::Accessible::SetObjectRegistry(mAdaptor->GetObjectRegistry());
if( ! mStylesheet.empty() )
{
namespace Adaptor
{
+std::string Adaptor::GetApplicationPackageName()
+{
+ return "";
+}
+
void Adaptor::GetDataStoragePath( std::string& path)
{
path = "";
#include <dali/internal/adaptor/tizen-wayland/dali-ecore-wayland.h>
#endif
+#include <aul.h>
+#include <unistd.h>
namespace Dali
{
} // namesapce
+std::string Adaptor::GetApplicationPackageName()
+{
+ char appname[4096] = {0};
+ int pid = getpid();
+ aul_app_get_pkgname_bypid( pid, appname, sizeof( appname ) );
+ return appname;
+}
+
void Adaptor::GetDataStoragePath( std::string& path)
{
#ifdef USE_APPFW
Impl()
{
Eldbus_Object *eldbus_obj;
+ eldbus_init();
cbhm_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
eldbus_obj = eldbus_object_get(cbhm_conn, CBHM_DBUS_INTERFACE, CBHM_DBUS_OBJPATH);
eldbus_proxy = eldbus_proxy_get(eldbus_obj, CBHM_DBUS_INTERFACE);
{
if (cbhm_conn)
eldbus_connection_unref(cbhm_conn);
+ eldbus_shutdown();
}
Eldbus_Proxy* cbhm_proxy_get()
} // unnamed namespace
#endif
-#ifdef DALI_ELDBUS_AVAILABLE
-namespace
-{
-
-// Copied from x server
-static uint32_t GetCurrentMilliSeconds(void)
-{
- struct timeval tv;
-
- struct timespec tp;
- static clockid_t clockid;
-
- if (!clockid)
- {
-#ifdef CLOCK_MONOTONIC_COARSE
- if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
- (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC_COARSE;
- }
- else
-#endif
- if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
- {
- clockid = CLOCK_MONOTONIC;
- }
- else
- {
- clockid = ~0L;
- }
- }
- if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
- {
- return static_cast<uint32_t>( (tp.tv_sec * 1000 ) + (tp.tv_nsec / 1000000L) );
- }
-
- gettimeofday(&tv, NULL);
- return static_cast<uint32_t>( (tv.tv_sec * 1000 ) + (tv.tv_usec / 1000) );
-}
-
-} // unnamed namespace
-#endif
-
EventHandler::EventHandler( WindowBase* windowBase, DamageObserver& damageObserver )
: mStyleMonitor( StyleMonitor::Get() ),
mDamageObserver( damageObserver ),
- mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
mClipboardEventNotifier( ClipboardEventNotifier::Get() ),
mClipboard( Clipboard::Get() ),
mPaused( false )
windowBase->SelectionDataSendSignal().Connect( this, &EventHandler::OnSelectionDataSend );
windowBase->SelectionDataReceivedSignal().Connect( this, &EventHandler::OnSelectionDataReceived );
windowBase->StyleChangedSignal().Connect( this, &EventHandler::OnStyleChanged );
- windowBase->AccessibilitySignal().Connect( this, &EventHandler::OnAccessibilityNotification );
}
else
{
SendEvent( styleChange );
}
-void EventHandler::OnAccessibilityNotification( const WindowBase::AccessibilityInfo& info )
-{
-#ifdef DALI_ELDBUS_AVAILABLE
- if( mPaused )
- {
- return;
- }
-
- if( !mAccessibilityAdaptor )
- {
- DALI_LOG_ERROR( "Invalid accessibility adaptor\n" );
- return;
- }
-
- AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( mAccessibilityAdaptor ) );
- if( !accessibilityAdaptor )
- {
- DALI_LOG_ERROR( "Cannot access accessibility adaptor\n" );
- return;
- }
-
- // Create a touch point object.
- PointState::Type touchPointState( PointState::DOWN );
- if( info.state == 0 )
- {
- touchPointState = PointState::DOWN; // Mouse down.
- }
- else if( info.state == 1 )
- {
- touchPointState = PointState::MOTION; // Mouse move.
- }
- else if( info.state == 2 )
- {
- touchPointState = PointState::UP; // Mouse up.
- }
- else
- {
- touchPointState = PointState::INTERRUPTED; // Error.
- }
-
- // Send touch event to accessibility adaptor.
- TouchPoint point( 0, touchPointState, static_cast< float >( info.startX ), static_cast< float >( info.startY ) );
-
- // Perform actions based on received gestures.
- // Note: This is seperated from the reading so we can have other input readers without changing the below code.
- switch( info.gestureValue )
- {
- case 0: // OneFingerHover
- {
- // Focus, read out.
- accessibilityAdaptor->HandleActionReadEvent( static_cast< unsigned int >( info.startX ), static_cast< unsigned int >( info.startY ), true /* allow read again */ );
- break;
- }
- case 1: // TwoFingersHover
- {
- // In accessibility mode, scroll action should be handled when the currently focused actor is contained in scrollable control
- accessibilityAdaptor->HandleActionScrollEvent( point, GetCurrentMilliSeconds() );
- break;
- }
- case 2: // ThreeFingersHover
- {
- // Read from top item on screen continuously.
- accessibilityAdaptor->HandleActionReadFromTopEvent();
- break;
- }
- case 3: // OneFingerFlickLeft
- {
- // Move to previous item.
- accessibilityAdaptor->HandleActionReadPreviousEvent();
- break;
- }
- case 4: // OneFingerFlickRight
- {
- // Move to next item.
- accessibilityAdaptor->HandleActionReadNextEvent();
- break;
- }
- case 5: // OneFingerFlickUp
- {
- // Move to previous item.
- accessibilityAdaptor->HandleActionPreviousEvent();
- break;
- }
- case 6: // OneFingerFlickDown
- {
- // Move to next item.
- accessibilityAdaptor->HandleActionNextEvent();
- break;
- }
- case 7: // TwoFingersFlickUp
- {
- // Scroll up the list.
- accessibilityAdaptor->HandleActionScrollUpEvent();
- break;
- }
- case 8: // TwoFingersFlickDown
- {
- // Scroll down the list.
- accessibilityAdaptor->HandleActionScrollDownEvent();
- break;
- }
- case 9: // TwoFingersFlickLeft
- {
- // Scroll left to the previous page
- accessibilityAdaptor->HandleActionPageLeftEvent();
- break;
- }
- case 10: // TwoFingersFlickRight
- {
- // Scroll right to the next page
- accessibilityAdaptor->HandleActionPageRightEvent();
- break;
- }
- case 11: // ThreeFingersFlickLeft
- {
- // Not exist yet
- break;
- }
- case 12: // ThreeFingersFlickRight
- {
- // Not exist yet
- break;
- }
- case 13: // ThreeFingersFlickUp
- {
- // Not exist yet
- break;
- }
- case 14: // ThreeFingersFlickDown
- {
- // Not exist yet
- break;
- }
- case 15: // OneFingerSingleTap
- {
- // Focus, read out.
- accessibilityAdaptor->HandleActionReadEvent( static_cast< unsigned int >( info.startX ), static_cast< unsigned int >( info.startY ), true /* allow read again */ );
- break;
- }
- case 16: // OneFingerDoubleTap
- {
- // Activate selected item / active edit mode.
- accessibilityAdaptor->HandleActionActivateEvent();
- break;
- }
- case 17: // OneFingerTripleTap
- {
- // Zoom
- accessibilityAdaptor->HandleActionZoomEvent();
- break;
- }
- case 18: // TwoFingersSingleTap
- {
- // Pause/Resume current speech
- accessibilityAdaptor->HandleActionReadPauseResumeEvent();
- break;
- }
- case 19: // TwoFingersDoubleTap
- {
- // Start/Stop current action
- accessibilityAdaptor->HandleActionStartStopEvent();
- break;
- }
- case 20: // TwoFingersTripleTap
- {
- // Read information from indicator
- // Not supported
- break;
- }
- case 21: // ThreeFingersSingleTap
- {
- // Read from top item on screen continuously.
- accessibilityAdaptor->HandleActionReadFromTopEvent();
- break;
- }
- case 22: // ThreeFingersDoubleTap
- {
- // Read from next item continuously.
- accessibilityAdaptor->HandleActionReadFromNextEvent();
- break;
- }
- case 23: // ThreeFingersTripleTap
- {
- // Not exist yet
- break;
- }
- case 24: // OneFingerFlickLeftReturn
- {
- // Scroll up to the previous page
- accessibilityAdaptor->HandleActionPageUpEvent();
- break;
- }
- case 25: // OneFingerFlickRightReturn
- {
- // Scroll down to the next page
- accessibilityAdaptor->HandleActionPageDownEvent();
- break;
- }
- case 26: // OneFingerFlickUpReturn
- {
- // Move to the first item on screen
- accessibilityAdaptor->HandleActionMoveToFirstEvent();
- break;
- }
- case 27: // OneFingerFlickDownReturn
- {
- // Move to the last item on screen
- accessibilityAdaptor->HandleActionMoveToLastEvent();
- break;
- }
- case 28: // TwoFingersFlickLeftReturn
- {
- // Not exist yet
- break;
- }
- case 29: // TwoFingersFlickRightReturn
- {
- // Not exist yet
- break;
- }
- case 30: // TwoFingersFlickUpReturn
- {
- // Not exist yet
- break;
- }
- case 31: // TwoFingersFlickDownReturn
- {
- // Not exist yet
- break;
- }
- case 32: // ThreeFingersFlickLeftReturn
- {
- // Not exist yet
- break;
- }
- case 33: // ThreeFingersFlickRightReturn
- {
- // Not exist yet
- break;
- }
- case 34: // ThreeFingersFlickUpReturn
- {
- // Not exist yet
- break;
- }
- case 35: // ThreeFingersFlickDownReturn
- {
- // Not exist yet
- break;
- }
- }
-#endif
-}
-
void EventHandler::AddObserver( Observer& observer )
{
ObserverContainer::iterator match ( find(mObservers.begin(), mObservers.end(), &observer) );
#include <dali/devel-api/adaptor-framework/style-monitor.h>
// INTERNAL INCLUDES
-#include <dali/internal/accessibility/common/accessibility-adaptor-impl.h>
#include <dali/internal/clipboard/common/clipboard-event-notifier-impl.h>
#include <dali/internal/window-system/common/damage-observer.h>
#include <dali/internal/window-system/common/window-base.h>
*/
void OnStyleChanged( StyleChange::Type styleChange );
- /**
- * Called when Ecore ElDBus accessibility event is received.
- */
- void OnAccessibilityNotification( const WindowBase::AccessibilityInfo& info );
-
private:
// Undefined
Dali::StyleMonitor mStyleMonitor; ///< Handle to the style monitor, set on construction, to send font size and font change events to.
DamageObserver& mDamageObserver; ///< Reference to the DamageObserver, set on construction, to sent damage events to.
- Dali::AccessibilityAdaptor mAccessibilityAdaptor; ///< Pointer to the accessibility adaptor
Dali::ClipboardEventNotifier mClipboardEventNotifier; ///< Pointer to the clipboard event notifier
Dali::Clipboard mClipboard;///< Pointer to the clipboard
#include <dali/internal/window-system/common/window-system.h>
#include <dali/internal/window-system/common/window-render-surface.h>
#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
namespace Dali
{
Window::~Window()
{
+ if ( mAdaptor )
+ {
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto accessible2 = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( accessible2 );
+ bridge->RemoveTopLevelWindow( accessible );
+
+ mAdaptor->RemoveWindow( this );
+ }
+
if ( mEventHandler )
{
mEventHandler->RemoveObserver( *this );
{
mEventHandler = EventHandlerPtr(new EventHandler( mWindowSurface->GetWindowBase(), *mAdaptor ) );
mEventHandler->AddObserver( *this );
+
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto v = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get( v, true );
+ bridge->AddTopLevelWindow( accessible );
+
+ //FIXME: line below is temporary solution for missing "activate" signal and should be removed
+ Show();
}
void Window::OnSurfaceSet( Dali::RenderSurfaceInterface* surface )
mFocusChangeSignal.Emit( handle, focusIn );
mSurface->SetFullSwapNextFrame();
+
+ if (auto b = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ if (focusIn)
+ {
+ b->ApplicationShown();
+ }
+ else
+ {
+ b->ApplicationHidden();
+ }
+ }
}
void Window::OnOutputTransformed()
/**
* @brief The Text-to-speech (TTS) Player.
+ * @deprecated Instead of this class use Dali::Accessibility::Say() method
* @SINCE_1_0.0
*/
class DALI_ADAPTOR_API TtsPlayer : public BaseHandle
BuildRequires: pkgconfig(capi-system-system-settings)
+# for ATSPI (Accessibility) support
+BuildRequires: pkgconfig(eldbus)
+
# for feedback plugin
BuildRequires: pkgconfig(mm-sound)
BuildRequires: pkgconfig(feedback)