X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Faccessibility%2Fbridge%2Fbridge-object.cpp;h=8ac156925fce22ecc7f549ea7faf497c576f116f;hb=fc7b883f6198c5683f596b82a79d11d063eca361;hp=2a0d03e81a6856b4d8be1188ad5b1c930adcb6e4;hpb=7a6df7ca09b96f9894473030ecb6819628b64081;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/accessibility/bridge/bridge-object.cpp b/dali/internal/accessibility/bridge/bridge-object.cpp index 2a0d03e..8ac1569 100644 --- a/dali/internal/accessibility/bridge/bridge-object.cpp +++ b/dali/internal/accessibility/bridge/bridge-object.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -35,35 +35,35 @@ void BridgeObject::RegisterInterfaces() // dbusServer.addInterface("/", desc, true); } -void BridgeObject::EmitActiveDescendantChanged( Accessible* obj, Accessible *child ) +void BridgeObject::EmitActiveDescendantChanged(Accessible* obj, Accessible* child) { - if (!IsUp()) return; + if(!IsUp()) return; auto index = child->GetIndexInParent(); - auto addr = obj->GetAddress(); - const auto prefixPath = "/org/a11y/atspi/accessible/"; - const auto nullPath = "/org/a11y/atspi/null"; + auto addr = obj->GetAddress(); + const auto prefixPath = "/org/a11y/atspi/accessible/"; + const auto nullPath = "/org/a11y/atspi/null"; std::string p; - if( addr ) + if(addr) p = prefixPath + addr.GetPath(); else p = nullPath; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< Address >, Address >( - p, - AtspiDbusInterfaceEventObject, - "ActiveDescendantChanged", - "", - index, - 0, - { child->GetAddress() }, - {"", "root"} ); + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventObject, + "ActiveDescendantChanged", + "", + index, + 0, + {child->GetAddress()}, + {"", "root"}); } -void BridgeObject::Emit( Accessible* obj, Dali::Accessibility::ObjectPropertyChangeEvent ev ) +void BridgeObject::Emit(Accessible* obj, Dali::Accessibility::ObjectPropertyChangeEvent ev) { - if (!IsUp()) return; + if(!IsUp()) return; const char* name = nullptr; - switch( ev ) + switch(ev) { case ObjectPropertyChangeEvent::NAME: { @@ -91,31 +91,31 @@ void BridgeObject::Emit( Accessible* obj, Dali::Accessibility::ObjectPropertyCha break; } } - if( name ) + if(name) { - auto addr = obj->GetAddress(); + auto addr = obj->GetAddress(); std::string p; - if( addr ) + if(addr) p = ATSPI_PREFIX_PATH + addr.GetPath(); else p = ATSPI_NULL_PATH; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >( - p, - AtspiDbusInterfaceEventObject, - "PropertyChange", - name, - 0, - 0, - {0}, - {"", "root"} ); + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventObject, + "PropertyChange", + name, + 0, + 0, + {0}, + {"", "root"}); } } -void BridgeObject::Emit( Accessible* obj, WindowEvent we, unsigned int detail1 ) +void BridgeObject::Emit(Accessible* obj, WindowEvent event, unsigned int detail) { - if (!IsUp()) return; + if(!IsUp()) return; const char* name = nullptr; - switch( we ) + switch(event) { case WindowEvent::PROPERTY_CHANGE: { @@ -213,31 +213,31 @@ void BridgeObject::Emit( Accessible* obj, WindowEvent we, unsigned int detail1 ) break; } } - if( name ) + if(name) { - auto addr = obj->GetAddress(); + auto addr = obj->GetAddress(); std::string p; - if( addr ) + if(addr) p = ATSPI_PREFIX_PATH + addr.GetPath(); else p = ATSPI_NULL_PATH; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >( - p, - AtspiDbusInterfaceEventWindow, - name, - "", - detail1, - 0, - {0}, - {"", "root"} ); + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventWindow, + name, + "", + detail, + 0, + {0}, + {"", "root"}); } } -void BridgeObject::EmitStateChanged( Accessible* obj, State state, int newValue1, int newValue2 ) +void BridgeObject::EmitStateChanged(Accessible* obj, State state, int newValue, int reserved) { - if (!IsUp()) return; + if(!IsUp()) return; const char* stateName = nullptr; - switch( state ) + switch(state) { case State::INVALID: { @@ -474,40 +474,42 @@ void BridgeObject::EmitStateChanged( Accessible* obj, State state, int newValue1 break; } } - if( stateName ) + if(stateName) { - auto addr = obj->GetAddress(); + auto addr = obj->GetAddress(); std::string p; - if( addr ) + if(addr) p = ATSPI_PREFIX_PATH + addr.GetPath(); else p = ATSPI_NULL_PATH; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >( - p, - AtspiDbusInterfaceEventObject, - "StateChanged", - stateName, - newValue1, - newValue2, - {0}, - {"", "root"} ); + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventObject, + "StateChanged", + stateName, + newValue, + reserved, + {0}, + {"", "root"}); } } -void BridgeObject::EmitBoundsChanged( Accessible* obj, Dali::Rect<> rect ) +void BridgeObject::EmitBoundsChanged(Accessible* obj, Dali::Rect<> rect) { - auto addr = obj->GetAddress(); - const auto prefixPath = "/org/a11y/atspi/accessible/"; - const auto nullPath = "/org/a11y/atspi/null"; + if(!allowObjectBoundsChangedEvent) return; + + auto addr = obj->GetAddress(); + const auto prefixPath = "/org/a11y/atspi/accessible/"; + const auto nullPath = "/org/a11y/atspi/null"; std::string p; - if( addr ) + if(addr) p = prefixPath + addr.GetPath(); else p = nullPath; - DBus::EldbusVariant< std::tuple > tmp { - std::tuple{ rect.x, rect.y, rect.width, rect.height } }; + DBus::EldbusVariant > tmp{ + std::tuple{rect.x, rect.y, rect.width, rect.height}}; addFilteredEvent(FilteredEvents::boundsChanged, obj, 1.0f, [=]() { - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< std::tuple >, Address >( + dbusServer.emit2 >, Address>( p, AtspiDbusInterfaceEventObject, "BoundsChanged", @@ -515,15 +517,15 @@ void BridgeObject::EmitBoundsChanged( Accessible* obj, Dali::Rect<> rect ) 0, 0, tmp, - {"", "root"} ); + {"", "root"}); }); } -void BridgeObject::EmitCaretMoved( Accessible* obj, unsigned int cursorPosition ) +void BridgeObject::EmitCursorMoved(Accessible* obj, unsigned int cursorPosition) { - auto addr = obj->GetAddress(); - std::string p = addr ? ATSPI_PREFIX_PATH + addr.GetPath() : ATSPI_NULL_PATH; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< int >, Address >( + auto addr = obj->GetAddress(); + std::string p = addr ? ATSPI_PREFIX_PATH + addr.GetPath() : ATSPI_NULL_PATH; + dbusServer.emit2, Address>( p, AtspiDbusInterfaceEventObject, "TextCaretMoved", @@ -531,13 +533,13 @@ void BridgeObject::EmitCaretMoved( Accessible* obj, unsigned int cursorPosition cursorPosition, 0, {0}, - {"", "root"} ); + {"", "root"}); } -void BridgeObject::EmitTextChanged( Accessible* obj, TextChangedState state, unsigned int position, unsigned int length, const std::string &content ) +void BridgeObject::EmitTextChanged(Accessible* obj, TextChangedState state, unsigned int position, unsigned int length, const std::string& content) { const char* stateName = nullptr; - switch( state ) + switch(state) { case TextChangedState::INSERTED: { @@ -554,18 +556,33 @@ void BridgeObject::EmitTextChanged( Accessible* obj, TextChangedState state, uns break; } } - if( stateName ) + if(stateName) { - auto addr = obj->GetAddress(); - std::string p = addr ? ATSPI_PREFIX_PATH + addr.GetPath() : ATSPI_NULL_PATH; - dbusServer.emit2< std::string, int, int, DBus::EldbusVariant< std::string >, Address >( - p, - AtspiDbusInterfaceEventObject, - "TextChanged", - stateName, - position, - length, - {content}, - {"", "root"} ); + auto addr = obj->GetAddress(); + std::string p = addr ? ATSPI_PREFIX_PATH + addr.GetPath() : ATSPI_NULL_PATH; + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventObject, + "TextChanged", + stateName, + position, + length, + {content}, + {"", "root"}); } } + +void BridgeObject::EmitMovedOutOfScreen(Accessible* obj, ScreenRelativeMoveType type) +{ + auto addr = obj->GetAddress(); + std::string p = addr ? ATSPI_PREFIX_PATH + addr.GetPath() : ATSPI_NULL_PATH; + dbusServer.emit2, Address>( + p, + AtspiDbusInterfaceEventObject, + "MoveOuted", + "", + static_cast(type), + 0, + {0}, + {"", "root"}); +}