#include <dali/devel-api/atspi-interfaces/hypertext.h>
#include <dali/devel-api/atspi-interfaces/selection.h>
#include <dali/devel-api/atspi-interfaces/socket.h>
+#include <dali/devel-api/atspi-interfaces/table.h>
+#include <dali/devel-api/atspi-interfaces/table-cell.h>
#include <dali/devel-api/atspi-interfaces/text.h>
#include <dali/devel-api/atspi-interfaces/value.h>
#include <dali/internal/adaptor/common/adaptor-impl.h>
interfaces[AtspiInterface::HYPERTEXT] = dynamic_cast<const Hypertext*>(this);
interfaces[AtspiInterface::SELECTION] = dynamic_cast<const Selection*>(this);
interfaces[AtspiInterface::SOCKET] = dynamic_cast<const Socket*>(this);
+ interfaces[AtspiInterface::TABLE] = dynamic_cast<const Table*>(this);
+ interfaces[AtspiInterface::TABLE_CELL] = dynamic_cast<const TableCell*>(this);
interfaces[AtspiInterface::TEXT] = dynamic_cast<const Text*>(this);
interfaces[AtspiInterface::VALUE] = dynamic_cast<const Value*>(this);
{
class AdaptorAccessible : public ActorAccessible
{
+private:
+ std::unique_ptr<TriggerEventInterface> mRenderNotification = nullptr;
+
protected:
bool mRoot = false;
return false;
}
- auto self = Self();
+ auto self = Self();
auto oldHighlightedActor = GetCurrentlyHighlightedActor();
if(self == oldHighlightedActor)
{
SetCurrentlyHighlightedActor(self);
- auto window = Dali::DevelWindow::Get(self);
+ auto window = Dali::DevelWindow::Get(self);
Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
windowImpl.EmitAccessibilityHighlightSignal(true);
SetCurrentlyHighlightedActor({});
- auto window = Dali::DevelWindow::Get(self);
+ auto window = Dali::DevelWindow::Get(self);
Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
windowImpl.EmitAccessibilityHighlightSignal(false);
if(mRoot)
{
- Dali::Window window = Dali::DevelWindow::Get(Self());
+ Dali::Window window = Dali::DevelWindow::Get(Self());
Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window);
attributes["resID"] = windowImpl.GetNativeResourceId();
}
{
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()->EmitPostRender(this);
+ }
}; // AdaptorAccessible
using AdaptorAccessiblesType = std::unordered_map<const Dali::RefObject*, std::unique_ptr<AdaptorAccessible> >;
// Save RefObject from an Actor in Accessible::Get()
-AdaptorAccessiblesType gAdaptorAccessibles;
+AdaptorAccessiblesType& GetAdaptorAccessibles()
+{
+ static AdaptorAccessiblesType gAdaptorAccessibles;
+ return gAdaptorAccessibles;
+}
std::function<Accessible*(Dali::Actor)> convertingFunctor = [](Dali::Actor) -> Accessible* {
return nullptr;
{
objectRegistry = registry;
objectRegistry.ObjectDestroyedSignal().Connect([](const Dali::RefObject* obj) {
- gAdaptorAccessibles.erase(obj);
+ GetAdaptorAccessibles().erase(obj);
});
}
convertingFunctor = functor;
}
-Accessible* Accessible::Get(Dali::Actor actor, bool isRoot)
+Accessible* Accessible::Get(Dali::Actor actor)
{
if(!actor)
{
auto accessible = convertingFunctor(actor);
if(!accessible)
{
- auto pair = gAdaptorAccessibles.emplace(&actor.GetBaseObject(), nullptr);
+ auto pair = GetAdaptorAccessibles().emplace(&actor.GetBaseObject(), nullptr);
if(pair.second)
{
+ bool isRoot = false;
+ Dali::Integration::Scene scene = Dali::Integration::Scene::Get(actor);
+ if(scene)
+ {
+ isRoot = (actor == scene.GetRootLayer());
+ }
pair.first->second.reset(new AdaptorAccessible(actor, isRoot));
}
accessible = pair.first->second.get();