This enables cross-toolkit embedding (e.g. an EFL widget inside NUI app).
Change-Id: If0efe85d37a6da9805819e287d6a8a73e0b76119
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
* @brief Encodes a widget ID as a usable bus name.
*
* @param widgetInstanceId The instance ID of a widget
+ * @param widgetProcessId The process ID (PID) of the widget
* @return std::string Encoded bus name
*
* @see SetPreferredBusName
*/
- static std::string MakeBusNameForWidget(std::string_view widgetInstanceId);
+ static std::string MakeBusNameForWidget(std::string_view widgetInstanceId, int widgetProcessId);
static Signal<void()>& EnabledSignal()
{
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").asyncCall([](DBus::ValueOrError<void>) {}, ATSPI_PREFIX_PATH + plug.GetPath());
- }
-
void UnembedSocket(const Address& plug, const Address& socket) override
{
auto client = CreateSocketClient(socket);
}
}
-std::string Bridge::MakeBusNameForWidget(std::string_view widgetInstanceId)
+std::string Bridge::MakeBusNameForWidget(std::string_view widgetInstanceId, int widgetProcessId)
{
// The bus name should consist of dot-separated alphanumeric elements, e.g. "com.example.BusName123".
- // Allowed characters in each element: "[A-Z][a-z][0-9]_", but no element may start with a digit.
+ // Allowed characters in each element: "[A-Z][a-z][0-9]_-", but no element may start with a digit.
- static const char prefix[] = "com.samsung.dali.widget_";
+ static const char prefix[] = "elm.atspi.proxy.socket-";
static const char underscore = '_';
std::stringstream tmp;
for(char ch : widgetInstanceId)
{
- tmp << (std::isalnum(ch) ? ch : underscore);
+ tmp << (!std::isalnum(ch) && ch != '_' && ch != '-' && ch != '.' ? underscore : ch);
}
+ tmp << '-' << widgetProcessId;
+
return tmp.str();
}
{
}
-std::string MakeBusNameForWidget(std::string_view widgetInstanceId)
+std::string MakeBusNameForWidget(std::string_view widgetInstanceId, int widgetProcessId)
{
return std::string{widgetInstanceId};
}
return {};
}
- void EmbedAtkSocket(const Address& plug, const Address& socket) override
- {
- }
-
void UnembedSocket(const Address& plug, const Address& socket) override
{
}
// EXTERNAL INCLUDES
#include <dali/public-api/actors/layer.h>
#include <bundle.h>
+#include <unistd.h>
#include <widget_base.h>
// INTERNAL INCLUDES
mWidgetId = widgetId;
auto bridge = Accessibility::Bridge::GetCurrentBridge();
- auto preferredBusName = Accessibility::Bridge::MakeBusNameForWidget(widgetId);
+ auto preferredBusName = Accessibility::Bridge::MakeBusNameForWidget(widgetId, getpid());
// Ensure the bridge is at least in an unlocked state. Normal application callbacks that would
// call Bridge::ApplicationPaused/Resumed() elsewhere are not operational in widget scenarios.