#define A11yDbusPath "/org/a11y/bus"
#define A11yDbusStatusInterface "org.a11y.Status"
#define AtspiDbusNameRegistry "org.a11y.atspi.Registry"
+#define AtspiDbusPathRegistry "/org/a11y/atspi/registry"
+#define AtspiDbusInterfaceRegistry "org.a11y.atspi.Registry"
#define AtspiDbusPathRoot "/org/a11y/atspi/accessible/root"
#define AtspiDbusInterfaceSocket "org.a11y.atspi.Socket"
#define AtspiPath "/org/a11y/atspi/accessible"
return !filteredEvents.empty();
}
+void BridgeBase::RegisteredEventsUpdate()
+{
+ using ReturnType = std::vector<std::tuple<std::string, std::string>>;
+ registry.method<DBus::ValueOrError<ReturnType>()>( "GetRegisteredEvents" ).asyncCall([this](DBus::ValueOrError<ReturnType> msg) {
+ if(!msg)
+ {
+ LOG() << "Get registered events failed";
+ return;
+ }
+
+ allowObjectBoundsChangedEvent = false;
+
+ ReturnType values = std::get<ReturnType>(msg.getValues());
+ for(long unsigned int i = 0; i < values.size(); i++)
+ {
+ if (!std::get<1>(values[i]).compare("Object:BoundsChanged"))
+ {
+ allowObjectBoundsChangedEvent = true;
+ }
+ }
+ });
+}
+
BridgeBase::ForceUpResult BridgeBase::ForceUp()
{
if(Bridge::ForceUp() == ForceUpResult::ALREADY_UP)
dbusServer.addInterface(AtspiPath, desc);
}
+ registry = {AtspiDbusNameRegistry, AtspiDbusPathRegistry, AtspiDbusInterfaceRegistry, con};
+
+ RegisteredEventsUpdate();
+
+ registry.addSignal<void(void)>("EventListenerRegistered", [this](void) {
+ RegisteredEventsUpdate();
+ });
+
+ registry.addSignal<void(void)>("EventListenerDeregistered", [this](void) {
+ RegisteredEventsUpdate();
+ });
+
return ForceUpResult::JUST_STARTED;
}
void BridgeBase::ForceDown()
{
Bridge::ForceDown();
+ registry = {};
dbusServer = {};
con = {};
}
private:
void IdSet(int id);
int IdGet();
+ void RegisteredEventsUpdate();
using CacheElementType = std::tuple<
Dali::Accessibility::Address,
DBus::DBusServer dbusServer;
DBusWrapper::ConnectionPtr con;
int id = 0;
+ DBus::DBusClient registry;
+ bool allowObjectBoundsChangedEvent;
};
#endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_BASE_H
void BridgeObject::EmitBoundsChanged(Accessible* obj, Dali::Rect<> rect)
{
+ if(!allowObjectBoundsChangedEvent) return;
+
auto addr = obj->GetAddress();
const auto prefixPath = "/org/a11y/atspi/accessible/";
const auto nullPath = "/org/a11y/atspi/null";