X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Fcontrols%2Faccessible-impl.cpp;h=1cf9a2697b8ab4d6663d75c1a87d29c15c9d5320;hp=ba1e0ed643ff290ac7cdd8b0df5f7fe2cb2a280d;hb=refs%2Fchanges%2F52%2F267152%2F1;hpb=22e4cff18fd079527c93d76f1d4f784b25731e12 diff --git a/dali-toolkit/devel-api/controls/accessible-impl.cpp b/dali-toolkit/devel-api/controls/accessible-impl.cpp index ba1e0ed..1cf9a26 100644 --- a/dali-toolkit/devel-api/controls/accessible-impl.cpp +++ b/dali-toolkit/devel-api/controls/accessible-impl.cpp @@ -24,6 +24,7 @@ #endif #include +#include // INTERNAL INCLUDES #include @@ -35,7 +36,8 @@ namespace Dali::Toolkit::DevelControl { - +namespace +{ static std::string GetLocaleText(std::string string, const char *domain = "dali-toolkit") { #ifdef DGETTEXT_ENABLED @@ -47,6 +49,23 @@ static std::string GetLocaleText(std::string string, const char *domain = "dali- #endif } +static Dali::Actor CreateHighlightIndicatorActor() +{ + std::string focusBorderImagePath(AssetManager::GetDaliImagePath()); + focusBorderImagePath += "/keyboard_focus.9.png"; + + // Create the default if it hasn't been set and one that's shared by all the + // keyboard focusable actors + auto actor = Toolkit::ImageView::New(focusBorderImagePath); + actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS); + + DevelControl::AppendAccessibilityAttribute(actor, "highlight", std::string()); + actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false); + + return actor; +} +} // unnamed namespace + AccessibleImpl::AccessibleImpl(Dali::Actor self, Dali::Accessibility::Role role, bool modal) : mSelf(self), mIsModal(modal) @@ -202,7 +221,7 @@ std::string AccessibleImpl::GetLocalizedRoleName() bool AccessibleImpl::IsShowing() { Dali::Actor self = Self(); - if(self.GetProperty(Dali::DevelActor::Property::CULLED).Get() || !self.GetCurrentProperty(Actor::Property::VISIBLE)) + if(!self.GetProperty(Actor::Property::VISIBLE) || self.GetProperty(Actor::Property::WORLD_COLOR).a == 0 || self.GetProperty(Dali::DevelActor::Property::CULLED)) { return false; } @@ -218,6 +237,10 @@ bool AccessibleImpl::IsShowing() while(parent) { auto control = Dali::Toolkit::Control::DownCast(parent->Self()); + if(!control.GetProperty(Actor::Property::VISIBLE)) + { + return false; + } auto clipMode = control.GetProperty(Actor::Property::CLIPPING_MODE).Get(); auto parentExtent = parent->GetExtents(Dali::Accessibility::CoordinateType::WINDOW); if ((clipMode != ClippingMode::DISABLED) && !parentExtent.Intersects(childExtent)) @@ -249,7 +272,7 @@ Dali::Accessibility::States AccessibleImpl::CalculateStates() state[Dali::Accessibility::State::HIGHLIGHTED] = GetCurrentlyHighlightedActor() == self; state[Dali::Accessibility::State::ENABLED] = true; state[Dali::Accessibility::State::SENSITIVE] = true; - state[Dali::Accessibility::State::VISIBLE] = true; + state[Dali::Accessibility::State::VISIBLE] = self.GetProperty(Actor::Property::VISIBLE); if(mIsModal) { @@ -308,7 +331,16 @@ Dali::Rect<> AccessibleImpl::GetExtents(Dali::Accessibility::CoordinateType type Vector3 anchorPointOffSet = size * (positionUsesAnchorPoint ? self.GetCurrentProperty(Actor::Property::ANCHOR_POINT) : AnchorPoint::TOP_LEFT); Vector2 position = Vector2((screenPosition.x - anchorPointOffSet.x), (screenPosition.y - anchorPointOffSet.y)); - return {position.x, position.y, size.x, size.y}; + if(type == Dali::Accessibility::CoordinateType::WINDOW) + { + return {position.x, position.y, size.x, size.y}; + } + else // Dali::Accessibility::CoordinateType::SCREEN + { + auto window = Dali::DevelWindow::Get(self); + auto windowPosition = window.GetPosition(); + return {position.x + windowPosition.GetX(), position.y + windowPosition.GetY(), size.x, size.y}; + } } int16_t AccessibleImpl::GetMdiZOrder() @@ -325,22 +357,6 @@ bool AccessibleImpl::GrabFocus() return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()); } -static Dali::Actor CreateHighlightIndicatorActor() -{ - std::string focusBorderImagePath(AssetManager::GetDaliImagePath()); - focusBorderImagePath += "/keyboard_focus.9.png"; - - // Create the default if it hasn't been set and one that's shared by all the - // keyboard focusable actors - auto actor = Toolkit::ImageView::New(focusBorderImagePath); - actor.SetResizePolicy(ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS); - - DevelControl::AppendAccessibilityAttribute(actor, "highlight", std::string()); - actor.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, false); - - return actor; -} - void AccessibleImpl::ScrollToSelf() { auto* child = this; @@ -353,7 +369,6 @@ void AccessibleImpl::ScrollToSelf() parent->ScrollToChild(child->Self()); } - child = parent; parent = dynamic_cast(parent->GetParent()); } } @@ -532,6 +547,11 @@ std::vector AccessibleImpl::GetRelationSet() return ret; } +Dali::Actor AccessibleImpl::GetInternalActor() +{ + return Dali::Actor{}; +} + bool AccessibleImpl::ScrollToChild(Actor child) { return false;