Merge "[AT-SPI] Add resource id to window attribute" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.cpp
index 6041237..4f43ba8 100644 (file)
@@ -508,9 +508,8 @@ static Eina_Bool EcoreEventEffectEnd(void* data, int type, void* event)
 
 static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void* data, int type, void* event)
 {
-  Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed* keyboardRepeat = static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event);
-  WindowBaseEcoreWl2*                           windowBase     = static_cast<WindowBaseEcoreWl2*>(data);
-  DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", keyboardRepeat->id);
+  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+  DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event)->id);
   if(windowBase)
   {
     windowBase->OnKeyboardRepeatSettingsChanged();
@@ -568,9 +567,8 @@ static void VconfNotifyFontSizeChanged(keynode_t* node, void* data)
 
 static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event)
 {
-  Ecore_Wl2_Event_Window_Redraw_Request* windowRedrawRequest = static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event);
-  WindowBaseEcoreWl2*                    windowBase          = static_cast<WindowBaseEcoreWl2*>(data);
-  DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", windowRedrawRequest->win);
+  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+  DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event)->win);
   if(windowBase)
   {
     windowBase->OnEcoreEventWindowRedrawRequest();
@@ -582,9 +580,9 @@ static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event
 /////////////////////////////////////////////////////////////////////////////////////////////////
 // Window Auxiliary Message Callbacks
 /////////////////////////////////////////////////////////////////////////////////////////////////
-static Eina_Bool EcoreEventWindowAuxiliaryMessage(void *data, int type, void *event)
+static Eina_Bool EcoreEventWindowAuxiliaryMessage(void* data, int type, void* event)
 {
-  WindowBaseEcoreWl2*          windowBase             = static_cast<WindowBaseEcoreWl2*>(data);
+  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
   if(windowBase)
   {
     windowBase->OnEcoreEventWindowAuxiliaryMessage(event);
@@ -1212,10 +1210,9 @@ void WindowBaseEcoreWl2::OnDetentRotation(void* data, int type, void* event)
 
   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
 
-  int direction = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
-  int timeStamp = detentEvent->timestamp;
+  int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
 
-  Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, direction, 0, Vector2(0.0f, 0.0f), 0, timeStamp);
+  Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
 
   mWheelEventSignal.Emit(wheelEvent);
 }
@@ -1405,31 +1402,30 @@ void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
 
 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;
 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);
-     }
-   }
+    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);
- }
+    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);
@@ -1534,6 +1530,11 @@ int WindowBaseEcoreWl2::GetNativeWindowId()
   return ecore_wl2_window_id_get(mEcoreWindow);
 }
 
+std::string WindowBaseEcoreWl2::GetNativeWindowResourceId()
+{
+  return std::to_string(ecore_wl2_window_resource_id_get(mEcoreWindow));
+}
+
 EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
 {
   int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;