*/
static void EnableAutoInit();
+ /**
+ * @brief Encodes a widget ID as a usable bus name.
+ *
+ * @param widgetInstanceId The instance ID of a widget
+ * @return std::string Encoded bus name
+ *
+ * @see SetPreferredBusName
+ */
+ static std::string MakeBusNameForWidget(std::string_view widgetInstanceId);
+
static Signal<void()>& EnabledSignal()
{
return mEnabledSignal;
bridge->WindowShown(window);
}
}
+
+std::string Bridge::MakeBusNameForWidget(std::string_view widgetInstanceId)
+{
+ // 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.
+
+ static const char prefix[] = "com.samsung.dali.widget_";
+ static const char underscore = '_';
+
+ std::stringstream tmp;
+
+ tmp << prefix;
+
+ for(char ch : widgetInstanceId)
+ {
+ tmp << (std::isalnum(ch) ? ch : underscore);
+ }
+
+ return tmp.str();
+}
{
}
+std::string MakeBusNameForWidget(std::string_view widgetInstanceId)
+{
+ return std::string{widgetInstanceId};
+}
+
void Accessibility::Accessible::EmitStateChanged(Accessibility::State state, int newValue, int reserved)
{
}
#include <bundle.h>
#include <widget_base.h>
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+
namespace Dali
{
namespace Internal
void WidgetImplTizen::SetInformation(Dali::Window window, const std::string& widgetId)
{
+ using Dali::Accessibility::Bridge;
+
mWindow = window;
mWidgetId = widgetId;
+
+ auto preferredBusName = Bridge::MakeBusNameForWidget(widgetId);
+ Bridge::GetCurrentBridge()->SetPreferredBusName(preferredBusName);
}
Dali::Window WidgetImplTizen::GetWindow() const