virtual bool IsEnabled() = 0;
/**
+ * @brief Calls socket.Embed(plug) via D-Bus.
+ *
+ * @param[in] plug The plug
+ * @param[in] socket The socket
+ *
+ * @return Address returned by the D-Bus call.
+ *
+ * @note Remote object pointed to by 'socket' must implement 'org.a11y.atspi.Socket'.
+ * @see UnembedSocket()
+ */
+ virtual Address EmbedSocket(const Address& plug, const Address& socket) = 0;
+
+ /**
+ * @brief Calls socket.Embedded(plug) via D-Bus.
+ *
+ * The "Embedded" D-Bus method is an ATK extension.
+ * See 'impl_Embedded' in AT_SPI2_ATK/atk-adaptor/adaptors/socket-adaptor.c for more information.
+ *
+ * @param[in] plug The plug
+ * @param[in] socket The socket
+ */
+ virtual void EmbedAtkSocket(const Address& plug, const Address& socket) = 0;
+
+ /**
+ * @brief Calls socket.Unmbed(plug) via D-Bus.
+ *
+ * @param[in] plug The plug
+ * @param[in] socket The socket
+ *
+ * @note Remote object pointed to by 'socket' must implement 'org.a11y.atspi.Socket'.
+ * @see EmbedSocket()
+ */
+ virtual void UnembedSocket(const Address& plug, const Address& socket) = 0;
+
+ /**
* @brief Returns instance of bridge singleton object.
*
* @return The current bridge object
mData->mHighlightActor = {};
mDisabledSignal.Emit();
+ UnembedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
}
+
mHighlightedActor = {};
mHighlightClearAction = {};
BridgeAccessible::ForceDown();
}
});
- auto proxy = DBus::DBusClient{AtspiDbusNameRegistry, AtspiDbusPathRoot, Accessible::GetInterfaceName(AtspiInterface::SOCKET), mConnectionPtr};
- Address root{"", "root"};
- auto res = proxy.method<Address(Address)>("Embed").call(root);
- if(!res)
- {
- LOG() << "Call to Embed failed: " << res.getError().message;
- }
- assert(res);
-
- mApplication.mParent.SetAddress(std::move(std::get<0>(res)));
-
+ auto parentAddress = EmbedSocket(mApplication.GetAddress(), {AtspiDbusNameRegistry, "root"});
+ mApplication.mParent.SetAddress(std::move(parentAddress));
mEnabledSignal.Emit();
return ForceUpResult::JUST_STARTED;
{
return mIsEnabled;
}
+
+ Address EmbedSocket(const Address& plug, const Address& socket) override
+ {
+ auto client = CreateSocketClient(socket);
+ auto reply = client.method<Address(Address)>("Embed").call(plug);
+
+ if(!reply)
+ {
+ DALI_LOG_ERROR("Failed to embed socket %s: %s", socket.ToString().c_str(), reply.getError().message.c_str());
+ return {};
+ }
+
+ return std::get<0>(reply.getValues());
+ }
+
+ void EmbedAtkSocket(const Address& plug, const Address& socket) override
+ {
+ auto client = CreateSocketClient(socket);
+
+ client.method<void(std::string)>("Embedded").call(ATSPI_PREFIX_PATH + plug.GetPath());
+ }
+
+ void UnembedSocket(const Address& plug, const Address& socket) override
+ {
+ auto client = CreateSocketClient(socket);
+
+ client.method<void(Address)>("Unembed").call(plug);
+ }
+
+private:
+ DBus::DBusClient CreateSocketClient(const Address& socket)
+ {
+ return {socket.GetBus(), ATSPI_PREFIX_PATH + socket.GetPath(), Accessible::GetInterfaceName(AtspiInterface::SOCKET), mConnectionPtr};
+ }
}; // BridgeImpl
namespace // unnamed namespace