{
}
- ~AdaptorAccessible() override
- {
- if(mRoot)
- {
- if(auto bridge = Accessibility::Bridge::GetCurrentBridge())
- {
- bridge->RemoveTopLevelWindow(this);
- }
- }
- }
-
bool GrabFocus() override
{
return false;
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
+int Dali::AtspiAccessibility::SetForcefully(bool turnOn)
+{
+ if(turnOn)
+ {
+ if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ bridge->Initialize();
+ auto ret = bridge->ForceUp();
+ return (int)ret;
+ }
+ }
+ else
+ {
+ if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ bridge->ForceDown();
+ return 0;
+ }
+ }
+ return -1;
+}
+
+int Dali::AtspiAccessibility::GetStatus()
+{
+ //0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF), 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+ if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+ {
+ if(bridge->GetScreenReaderEnabled())
+ {
+ if(bridge->IsEnabled())
+ {
+ return 3;
+ }
+ else
+ {
+ return 2;
+ }
+ }
+ else
+ {
+ if(bridge->IsEnabled())
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+ return -1;
+}
+
bool Dali::AtspiAccessibility::IsEnabled()
{
return Dali::Accessibility::IsUp();
#ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
#define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
/*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
+/**
+ * @brief Sets ATSPI to be turned On or Off forcibly.
+ *
+ * @param[in] turnOn true to turn on, false to turn off.
+ * @return The status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
+ * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+ */
+DALI_ADAPTOR_API int SetForcefully(bool turnOn);
+
+/**
+ * @brief Gets ATSPI status.
+ * @return Status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
+ * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+ */
+DALI_ADAPTOR_API int GetStatus();
+
/**
* @brief Returns whether the state of Accessibility is enabled or not.
*
return GetImplementation(window).IsAlwaysOnTop();
}
-void SetBottom(Window window, bool enable)
+void SetToBottom(Window window, bool toBottom)
{
- GetImplementation(window).SetBottom(enable);
+ GetImplementation(window).SetToBottom(toBottom);
}
bool IsBottom(Window window)
/**
* @brief Enables or disables the window always is on top.
- *
- * This is valid between windows that have no notification level or a notification level of 'none'.
- * If it has a notification level, this will not do anything.
+ *
*
* @param[in] window The window instance.
* @param[in] alwaysOnTop true to enable the window always is on top, false to disable.
/**
* @brief Returns whether the window always is on top.
*
+ * This is valid between windows that have no notification level or a notification level of 'none'.
+ * If it has a notification level, this will not do anything.
+ *
* @param[in] window The window instance.
* @return True if the window always is on top, false otherwise.
*/
DALI_ADAPTOR_API bool IsAlwaysOnTop(Window window);
/**
- * @brief Enables or disables the window's layer is changed to bottom.
- *
- * If the enable flag is true, this window will be placed below other windows.
- * Otherwise, if it's called with a false value, it will be located above other windows.
+ * @brief Enables or disables the window's layer is changed to the bottom.
*
* @param[in] window The window instance.
- * @param[in] enable true to change the window layer to the bottom.
+ * @param[in] toBottom true to change the window layer to the bottom.
*/
-DALI_ADAPTOR_API void SetBottom(Window window, bool enable);
+DALI_ADAPTOR_API void SetToBottom(Window window, bool toBottom);
/**
* @brief Returns whether the window layer is the bottom or not.
BridgeBase::~BridgeBase()
{
+ mApplication.mChildren.clear();
}
void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
if(mApplication.mChildren[i] == windowAccessible)
{
mApplication.mChildren.erase(mApplication.mChildren.begin() + i);
- Emit(windowAccessible, WindowEvent::DESTROY);
break;
}
}
return false;
}
-void WindowBaseAndroid::SetBottom(bool enable)
+void WindowBaseAndroid::SetToBottom(bool toBottom)
{
}
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
virtual bool IsAlwaysOnTop() = 0;
/**
- * @brief Enables or disables the window's layer is changed to bottom.
+ * @brief Enables or disables the window's layer is changed to the bottom.
*
- * If the enable flag is true, this window will be placed below other windows.
- * Otherwise, if it's called with a false value, it will be located above other windows.
- *
- * @param[in] window The window instance.
- * @param[in] enable true to change the window layer to the bottom.
+ * @param[in] toBottom true to change the window layer to the bottom.
*/
- virtual void SetBottom(bool enable) = 0;
+ virtual void SetToBottom(bool toBottom) = 0;
/**
* @brief Returns whether the window layer is the bottom or not.
Window::~Window()
{
+ if(mScene)
+ {
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer);
+ bridge->RemoveTopLevelWindow(accessible);
+ // Related to multi-window case. This is called for default window and non-default window, but it is effective for non-default window.
+ bridge->Emit(accessible, Accessibility::WindowEvent::DESTROY);
+ }
+
if(mAdaptor)
{
mAdaptor->RemoveWindow(this);
void Window::OnAccessibilityDisabled()
{
+ auto bridge = Accessibility::Bridge::GetCurrentBridge();
+ auto rootLayer = mScene.GetRootLayer();
+ auto accessible = Accessibility::Accessible::Get(rootLayer);
+
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is disabled\n", this, mNativeWindowId);
InterceptKeyEventSignal().Disconnect(this, &Window::OnAccessibilityInterceptKeyEvent);
+ bridge->RemoveTopLevelWindow(accessible);
}
bool Window::OnAccessibilityInterceptKeyEvent(const Dali::KeyEvent& keyEvent)
return mWindowBase->IsAlwaysOnTop();
}
-void Window::SetBottom(bool enable)
+void Window::SetToBottom(bool toBottom)
{
- mWindowBase->SetBottom(enable);
+ mWindowBase->SetToBottom(toBottom);
}
bool Window::IsBottom()
bool IsAlwaysOnTop();
/**
- * @copydoc Dali::DevelWindow::SetBottom()
+ * @copydoc Dali::DevelWindow::SetToBottom()
*/
- void SetBottom(bool enable);
+ void SetToBottom(bool toBottom);
/**
* @copydoc Dali::DevelWindow::IsBottom()
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
return false;
}
-void WindowBaseCocoa::SetBottom(bool enable)
+void WindowBaseCocoa::SetToBottom(bool toBottom)
{
}
mBrightnessChangeDone(true),
mIsFrontBufferRendering(false),
mIsIMEWindowInitialized(false),
- mBottom(false)
+ mToBottom(false)
{
Initialize(positionSize, surface, isTransparent);
}
return ret;
}
-void WindowBaseEcoreWl2::SetBottom(bool enable)
+void WindowBaseEcoreWl2::SetToBottom(bool toBottom)
{
START_DURATION_CHECK();
- mBottom = enable;
- if(mBottom)
+ mToBottom = toBottom;
+ if(toBottom)
{
- DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, mBottom);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, toBottom);
ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_BELOW);
}
else
{
- DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, mBottom);
+ DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, toBottom);
ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_NONE);
}
ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
- FINISH_DURATION_CHECK("ecore_wl2_window_stack_mode_set");
+ FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set");
}
bool WindowBaseEcoreWl2::IsBottom()
{
- return mBottom;
+ return mToBottom;
}
Any WindowBaseEcoreWl2::GetNativeBuffer() const
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
bool mBrightnessChangeDone;
bool mIsFrontBufferRendering;
bool mIsIMEWindowInitialized;
- bool mBottom;
+ bool mToBottom;
};
} // namespace Adaptor
return false;
}
-void WindowBaseEcoreX::SetBottom(bool enable)
+void WindowBaseEcoreX::SetToBottom(bool toBottom)
{
}
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
return false;
}
-void WindowBaseWin::SetBottom(bool enable)
+void WindowBaseWin::SetToBottom(bool toBottom)
{
}
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
return false;
}
-void WindowBaseX::SetBottom(bool enable)
+void WindowBaseX::SetToBottom(bool toBottom)
{
}
bool IsAlwaysOnTop() override;
/**
- * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+ * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
*/
- void SetBottom(bool enable) override;
+ void SetToBottom(bool toBottom) override;
/**
* @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()