Add auxiliary message for window
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.cpp
index aa0d96a..c2ee17a 100644 (file)
@@ -580,6 +580,20 @@ static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
+// Window Auxiliary Message Callbacks
+/////////////////////////////////////////////////////////////////////////////////////////////////
+static Eina_Bool EcoreEventWindowAuxiliaryMessage(void *data, int type, void *event)
+{
+  WindowBaseEcoreWl2*          windowBase             = static_cast<WindowBaseEcoreWl2*>(data);
+  DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowAuxiliaryMessage, window[ %d ]\n", windowAuxiliaryMessage->win);
+  if(windowBase)
+  {
+    windowBase->OnEcoreEventWindowAuxiliaryMessage(event);
+  }
+  return ECORE_CALLBACK_RENEW;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////
 // ElDBus Accessibility Callbacks
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -842,6 +856,9 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
   // Register Window redraw request event
   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, this));
 
+  // Register Window auxiliary event
+  mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_AUX_MESSAGE, EcoreEventWindowAuxiliaryMessage, this));
+
   // Register Vconf notify - font name and size
   vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this);
   vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this);
@@ -1385,6 +1402,33 @@ void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
   mWindowRedrawRequestSignal.Emit();
 }
 
+void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
+{
+ Ecore_Wl2_Event_Aux_Message *message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
+ if(message)
+ {
+   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n",message->key, message->val);
+   std::string key(message->key);
+   std::string value(message->val);
+   Dali::Property::Array options;
+
+   if(message->options)
+   {
+     Eina_List *l;
+     void* data;
+     EINA_LIST_FOREACH(message->options, l, data)
+     {
+       DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n",(char*)data);
+       std::string option(static_cast<char*>(data));
+       options.Add(option);
+     }
+   }
+
+   mAuxiliaryMessageSignal.Emit(key, value, options);
+ }
+}
+
+
 void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Seat_Keymap_Changed* changed = static_cast<Ecore_Wl2_Event_Seat_Keymap_Changed*>(event);