A new interface for delivering PostRender event to atspi.
Change-Id: Ic80f3637f74a0b6f99b2cbb9eb11c793c88b9e06
{
class AdaptorAccessible : public ActorAccessible
{
+private:
+ std::unique_ptr<TriggerEventInterface> mRenderNotification = nullptr;
+
protected:
bool mRoot = false;
{
return {};
}
+
+ void SetListenPostRender(bool enabled) override
+ {
+ if (!mRoot)
+ {
+ return;
+ }
+
+ auto window = Dali::DevelWindow::Get(Self());
+ Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
+
+ if(!mRenderNotification)
+ {
+ mRenderNotification = std::unique_ptr<TriggerEventInterface>(
+ TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &AdaptorAccessible::OnPostRender),
+ TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
+ }
+
+ if (enabled)
+ {
+ windowImpl.SetRenderNotification(mRenderNotification.get());
+ }
+ else
+ {
+ windowImpl.SetRenderNotification(nullptr);
+ }
+ }
+
+ void OnPostRender()
+ {
+ Accessibility::Bridge::GetCurrentBridge()->Emit(Accessibility::Accessible::Get(Self()), Accessibility::WindowEvent::POST_RENDER);
+ }
+
}; // AdaptorAccessible
using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
#ifndef DALI_ATSPI_ACCESSIBILITY_H\r
#define DALI_ATSPI_ACCESSIBILITY_H\r
/*\r
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
SHADE,\r
UU_SHADE,\r
RESTYLE,\r
+ POST_RENDER,\r
};\r
\r
/**\r
#define DALI_ADAPTOR_ATSPI_ACCESSIBLE_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
*/
virtual Dali::Actor GetInternalActor() = 0;
+ /**
+ * @brief Sets whether to listen for post render callback.
+ *
+ * @param[in] enabled If ture, registration post render callback, false otherwise
+ */
+ virtual void SetListenPostRender(bool enabled);
+
/**
* @brief Gets all implemented interfaces.
*
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
return false;
}
+void Accessible::SetListenPostRender(bool enabled)
+{
+}
+
bool Accessible::IsProxy() const
{
return false;
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
AddFunctionToInterface(desc, "DoGesture", &BridgeAccessible::DoGesture);
AddFunctionToInterface(desc, "GetReadingMaterial", &BridgeAccessible::GetReadingMaterial);
AddFunctionToInterface(desc, "GetRelationSet", &BridgeAccessible::GetRelationSet);
+ AddFunctionToInterface(desc, "SetListenPostRender", &BridgeAccessible::SetListenPostRender);
mDbusServer.addInterface("/", desc, true);
}
return ret;
}
+
+DBus::ValueOrError<void> BridgeAccessible::SetListenPostRender(bool enabled)
+{
+ FindSelf()->SetListenPostRender(enabled);
+ return {};
+}
#define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_ACCESSIBLE_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
*/
DBus::ValueOrError<std::vector<Relation>> GetRelationSet();
+ /**
+ * @copydoc Dali::Accessibility::Accessible::SetListenPostRender()
+ */
+ DBus::ValueOrError<void> SetListenPostRender(bool enabled);
+
private:
/**
* @brief Calculates Neighbor candidate object in root node.
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
{WindowEvent::SHADE, "Shade"},
{WindowEvent::UU_SHADE, "uUshade"},
{WindowEvent::RESTYLE, "Restyle"},
+ {WindowEvent::POST_RENDER, "PostRender"},
};
if(!IsUp() || obj->IsHidden() || obj->GetSuppressedEvents()[AtspiEvent::WINDOW_CHANGED])
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
return false;
}
+void Accessibility::Accessible::SetListenPostRender(bool enabled)
+{
+}
+
bool Accessibility::Component::IsAccessibleContainingPoint(Point point, CoordinateType type) const
{
return false;
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
mNativeWindowId = mWindowBase->GetNativeWindowId();
}
+void Window::SetRenderNotification(TriggerEventInterface *renderNotification)
+{
+ if(!mWindowSurface)
+ {
+ return;
+ }
+
+ mWindowSurface->SetRenderNotification(renderNotification);
+}
+
void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
{
mEventHandler = EventHandlerPtr(new EventHandler(mWindowSurface->GetWindowBase(), *mAdaptor));
#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
*/
void EmitAccessibilityHighlightSignal(bool highlight);
+ /**
+ * @brief Sets the render notification trigger to call when render thread is completed a frame
+ *
+ * @param[in] renderNotification to use
+ */
+ void SetRenderNotification(TriggerEventInterface *renderNotification);
+
public: // Dali::Internal::Adaptor::SceneHolder
/**
* @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle