using namespace Dali::Accessibility;
+namespace
+{
+inline std::string GetAccessiblePath(Accessible* accessible)
+{
+ auto address = accessible->GetAddress();
+ return address ? ATSPI_PREFIX_PATH + address.GetPath() : ATSPI_NULL_PATH;
+}
+} // namespace
+
BridgeObject::BridgeObject()
{
}
void BridgeObject::RegisterInterfaces()
{
// DBus::DBusInterfaceDescription desc{ AtspiDbusInterfaceEventObject };
- // stateChanged = addSignal<std::string, int, int, DBus::EldbusVariant<int>, Accessible*>(desc, "StateChanged");
- // dbusServer.addInterface("/", desc, true);
+ // mStateChanged = addSignal<std::string, int, int, DBus::EldbusVariant<int>, Accessible*>(desc, "StateChanged");
+ // mDbusServer.addInterface("/", desc, true);
}
void BridgeObject::EmitActiveDescendantChanged(Accessible* obj, Accessible* child)
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";
- std::string p;
- if(addr)
- p = prefixPath + addr.GetPath();
- else
- p = nullPath;
- dbusServer.emit2<std::string, int, int, DBus::EldbusVariant<Address>, Address>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<Address>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"ActiveDescendantChanged",
"",
{"", "root"});
}
-void BridgeObject::Emit(Accessible* obj, Dali::Accessibility::ObjectPropertyChangeEvent ev)
+void BridgeObject::Emit(Accessible* obj, Dali::Accessibility::ObjectPropertyChangeEvent event)
{
if(!IsUp()) return;
const char* name = nullptr;
- switch(ev)
+
+ switch(event)
{
case ObjectPropertyChangeEvent::NAME:
{
break;
}
}
+
if(name)
{
- auto addr = obj->GetAddress();
- std::string p;
- if(addr)
- p = ATSPI_PREFIX_PATH + addr.GetPath();
- else
- p = ATSPI_NULL_PATH;
- dbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"PropertyChange",
name,
{
if(!IsUp()) return;
const char* name = nullptr;
+
switch(event)
{
case WindowEvent::PROPERTY_CHANGE:
break;
}
}
+
if(name)
{
- auto addr = obj->GetAddress();
- std::string p;
- if(addr)
- p = ATSPI_PREFIX_PATH + addr.GetPath();
- else
- p = ATSPI_NULL_PATH;
- dbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventWindow,
name,
"",
{
if(!IsUp()) return;
const char* stateName = nullptr;
+
switch(state)
{
case State::INVALID:
break;
}
}
+
if(stateName)
{
- auto addr = obj->GetAddress();
- std::string p;
- if(addr)
- p = ATSPI_PREFIX_PATH + addr.GetPath();
- else
- p = ATSPI_NULL_PATH;
- dbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"StateChanged",
stateName,
void BridgeObject::EmitBoundsChanged(Accessible* obj, Dali::Rect<> rect)
{
- if(!allowObjectBoundsChangedEvent) return;
+ if(!IsBoundsChangedEventAllowed) return;
- auto addr = obj->GetAddress();
- const auto prefixPath = "/org/a11y/atspi/accessible/";
- const auto nullPath = "/org/a11y/atspi/null";
- std::string p;
- if(addr)
- p = prefixPath + addr.GetPath();
- else
- p = nullPath;
DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> > tmp{
std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height}};
- addFilteredEvent(FilteredEvents::boundsChanged, obj, 1.0f, [=]() {
- dbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> >, Address>(
- p,
+
+ AddFilteredEvent(FilteredEvents::BOUNDS_CHANGED, obj, 1.0f, [=]() {
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> >, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"BoundsChanged",
"",
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>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"TextCaretMoved",
"",
break;
}
}
+
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,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::string>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"TextChanged",
stateName,
}
}
-void BridgeObject::EmitMovedOutOfScreen(Accessible* obj, MovedOutOfScreenType type)
+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<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- p,
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
AtspiDbusInterfaceEventObject,
"MoveOuted",
"",