X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Faccessibility.cpp;h=f69c96cdc768806952b25f6658ba5a8ad6cb10ac;hb=HEAD;hp=4c83f438bb0046fda74132d959cb7f2602577bbe;hpb=cc205aa721b900a930cf212cc045df56422d7f02;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/accessibility.cpp b/dali/devel-api/adaptor-framework/accessibility.cpp index 4c83f43..6caf3d8 100644 --- a/dali/devel-api/adaptor-framework/accessibility.cpp +++ b/dali/devel-api/adaptor-framework/accessibility.cpp @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include @@ -241,6 +243,8 @@ AtspiInterfaces Accessible::DoGetInterfaces() const interfaces[AtspiInterface::HYPERTEXT] = dynamic_cast(this); interfaces[AtspiInterface::SELECTION] = dynamic_cast(this); interfaces[AtspiInterface::SOCKET] = dynamic_cast(this); + interfaces[AtspiInterface::TABLE] = dynamic_cast(this); + interfaces[AtspiInterface::TABLE_CELL] = dynamic_cast(this); interfaces[AtspiInterface::TEXT] = dynamic_cast(this); interfaces[AtspiInterface::VALUE] = dynamic_cast(this); @@ -302,6 +306,13 @@ void Accessible::SetCurrentlyHighlightedActor(Dali::Actor actor) } } +bool Accessible::IsHighlighted() const +{ + Dali::Actor self = GetInternalActor(); + + return self && self == GetCurrentlyHighlightedActor(); +} + Dali::Actor Accessible::GetHighlightActor() { return IsUp() ? Bridge::GetCurrentBridge()->mData->mHighlightActor : Dali::Actor{}; @@ -408,15 +419,14 @@ public: return false; } - auto self = Self(); - if(self != GetCurrentlyHighlightedActor()) + if(!IsHighlighted()) { return false; } SetCurrentlyHighlightedActor({}); - auto window = Dali::DevelWindow::Get(self); + auto window = Dali::DevelWindow::Get(Self()); Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window); windowImpl.EmitAccessibilityHighlightSignal(false); @@ -441,12 +451,17 @@ public: state[State::VISIBLE] = true; state[State::ACTIVE] = visible; } - else + else if(GetParent()) { auto parentState = GetParent()->GetStates(); state[State::SHOWING] = parentState[State::SHOWING]; state[State::VISIBLE] = parentState[State::VISIBLE]; } + else + { + state[State::SHOWING] = false; + state[State::VISIBLE] = false; + } return state; } @@ -480,22 +495,22 @@ public: void SetListenPostRender(bool enabled) override { - if (!mRoot) + if(!mRoot) { return; } - auto window = Dali::DevelWindow::Get(Self()); + auto window = Dali::DevelWindow::Get(Self()); Dali::Internal::Adaptor::Window& windowImpl = Dali::GetImplementation(window); if(!mRenderNotification) { mRenderNotification = std::unique_ptr( - TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &AdaptorAccessible::OnPostRender), - TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER)); + TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &AdaptorAccessible::OnPostRender), + TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER)); } - if (enabled) + if(enabled) { windowImpl.SetRenderNotification(mRenderNotification.get()); } @@ -507,11 +522,11 @@ public: void OnPostRender() { - Accessibility::Bridge::GetCurrentBridge()->EmitPostRender(this); + Accessibility::Bridge::GetCurrentBridge()->EmitPostRender(shared_from_this()); } }; // AdaptorAccessible -using AdaptorAccessiblesType = std::unordered_map >; +using AdaptorAccessiblesType = std::unordered_map>; // Save RefObject from an Actor in Accessible::Get() AdaptorAccessiblesType& GetAdaptorAccessibles() @@ -520,7 +535,7 @@ AdaptorAccessiblesType& GetAdaptorAccessibles() return gAdaptorAccessibles; } -std::function convertingFunctor = [](Dali::Actor) -> Accessible* { +std::function(Dali::Actor)> convertingFunctor = [](Dali::Actor) -> std::shared_ptr { return nullptr; }; @@ -535,12 +550,12 @@ void Accessible::SetObjectRegistry(ObjectRegistry registry) }); } -void Accessible::RegisterExternalAccessibleGetter(std::function functor) +void Accessible::RegisterExternalAccessibleGetter(std::function(Dali::Actor)> functor) { convertingFunctor = functor; } -Accessible* Accessible::Get(Dali::Actor actor) +std::shared_ptr Accessible::GetOwningPtr(Dali::Actor actor) { if(!actor) { @@ -561,8 +576,14 @@ Accessible* Accessible::Get(Dali::Actor actor) } pair.first->second.reset(new AdaptorAccessible(actor, isRoot)); } - accessible = pair.first->second.get(); + accessible = pair.first->second; } return accessible; } + +Accessible* Accessible::Get(Dali::Actor actor) +{ + auto accessible = Accessible::GetOwningPtr(actor); + return accessible ? accessible.get() : nullptr; +} \ No newline at end of file