1 #include "BridgeComponent.hpp"
4 #define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
6 using namespace Dali::Accessibility;
8 BridgeComponent::BridgeComponent()
12 void BridgeComponent::RegisterInterfaces()
14 DBus::DBusInterfaceDescription desc{ATSPI_DBUS_INTERFACE_COMPONENT};
15 AddFunctionToInterface( desc, "Contains", &BridgeComponent::Contains );
16 AddFunctionToInterface( desc, "GetAccessibleAtPoint", &BridgeComponent::GetAccessibleAtPoint );
17 AddFunctionToInterface( desc, "GetExtents", &BridgeComponent::GetExtents );
18 AddFunctionToInterface( desc, "GetPosition", &BridgeComponent::GetPosition );
19 AddFunctionToInterface( desc, "GetSize", &BridgeComponent::GetSize );
20 AddFunctionToInterface( desc, "GetLayer", &BridgeComponent::GetLayer );
21 AddFunctionToInterface( desc, "GetAlpha", &BridgeComponent::GetAlpha );
22 AddFunctionToInterface( desc, "GrabHighlight", &BridgeComponent::GrabHighlight );
23 AddFunctionToInterface( desc, "ClearHighlight", &BridgeComponent::ClearHighlight );
24 dbusServer.addInterface( "/", desc, true );
27 Component* BridgeComponent::FindSelf() const
29 auto s = BridgeBase::FindSelf();
31 auto s2 = dynamic_cast< Component* >( s );
33 throw AccessibleError{"object " + s->GetAddress().ToString() + " doesn't have Component interface"};
37 DBus::ValueOrError< bool > BridgeComponent::Contains( int32_t x, int32_t y, uint32_t coordType )
39 return FindSelf()->Contains( {x, y}, static_cast< CoordType >( coordType ) );
41 DBus::ValueOrError< Accessible* > BridgeComponent::GetAccessibleAtPoint( int32_t x, int32_t y, uint32_t coordType )
43 return FindSelf()->GetAccessibleAtPoint( {x, y}, static_cast< CoordType >( coordType ) );
45 DBus::ValueOrError< std::tuple< int32_t, int32_t, int32_t, int32_t > > BridgeComponent::GetExtents( uint32_t coordType )
47 auto p = FindSelf()->GetExtents( static_cast< CoordType >( coordType ) );
48 return std::tuple< int32_t, int32_t, int32_t, int32_t >{p.position.x, p.position.y, p.size.width, p.size.height};
50 DBus::ValueOrError< int32_t, int32_t > BridgeComponent::GetPosition( uint32_t coordType )
52 auto p = FindSelf()->GetExtents( static_cast< CoordType >( coordType ) );
53 return {p.position.x, p.position.y};
55 DBus::ValueOrError< int32_t, int32_t > BridgeComponent::GetSize( uint32_t coordType )
57 auto p = FindSelf()->GetExtents( static_cast< CoordType >( coordType ) );
58 return {p.size.width, p.size.height};
60 DBus::ValueOrError< ComponentLayer > BridgeComponent::GetLayer()
62 return FindSelf()->GetLayer();
64 DBus::ValueOrError< double > BridgeComponent::GetAlpha()
66 return FindSelf()->GetAlpha();
68 DBus::ValueOrError< bool > BridgeComponent::GrabHighlight()
70 return FindSelf()->GrabHighlight();
72 DBus::ValueOrError< bool > BridgeComponent::ClearHighlight()
74 return FindSelf()->ClearHighlight();