Merge "Fix typo error" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.cpp
1 /*
2  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // Ecore is littered with C style cast
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wold-style-cast"
21
22 // CLASS HEADER
23 #include <dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h>
24
25 // INTERNAL HEADERS
26 #include <dali/internal/input/common/key-impl.h>
27 #include <dali/internal/system/common/time-service.h>
28 #include <dali/internal/window-system/common/window-impl.h>
29 #include <dali/internal/window-system/common/window-render-surface.h>
30 #include <dali/internal/window-system/common/window-system.h>
31
32 // EXTERNAL_HEADERS
33 #include <Ecore_Input.h>
34 #include <dali/integration-api/debug.h>
35 #include <dali/integration-api/trace.h>
36 #include <dali/public-api/adaptor-framework/window-enumerations.h>
37 #include <dali/public-api/events/mouse-button.h>
38 #include <dali/public-api/object/any.h>
39
40 #if defined(VCONF_ENABLED)
41 #include <vconf-keys.h>
42 #include <vconf.h>
43 #endif
44
45 #define START_DURATION_CHECK()                               \
46   uint32_t durationMilliSeconds = static_cast<uint32_t>(-1); \
47   uint32_t startTime, endTime;                               \
48   startTime = TimeService::GetMilliSeconds();
49
50 #define FINISH_DURATION_CHECK(functionName)                                             \
51   endTime              = TimeService::GetMilliSeconds();                                \
52   durationMilliSeconds = endTime - startTime;                                           \
53   if(durationMilliSeconds > 0)                                                          \
54   {                                                                                     \
55     DALI_LOG_DEBUG_INFO("%s : duration [%u ms]\n", functionName, durationMilliSeconds); \
56   }
57
58 #include <wayland-egl-tizen.h>
59
60 namespace Dali
61 {
62 namespace Internal
63 {
64 namespace Adaptor
65 {
66 namespace
67 {
68 #if defined(DEBUG_ENABLED)
69 Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW_BASE");
70 #endif
71
72 DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false);
73
74 /**
75  * @brief Enumeration of location for window resized by display server.
76  */
77 enum class ResizeLocation
78 {
79   INVALID      = 0,  ///< Invalid value
80   TOP_LEFT     = 5,  ///< Start resizing window to the top-left edge.
81   LEFT         = 4,  ///< Start resizing window to the left side.
82   BOTTOM_LEFT  = 6,  ///< Start resizing window to the bottom-left edge.
83   BOTTOM       = 2,  ///< Start resizing window to the bottom side.
84   BOTTOM_RIGHT = 10, ///< Start resizing window to the bottom-right edge.
85   RIGHT        = 8,  ///< Start resizing window to the right side.
86   TOP_RIGHT    = 9,  ///< Start resizing window to the top-right edge.
87   TOP          = 1   ///< Start resizing window to the top side.
88 };
89
90 const uint32_t       MAX_TIZEN_CLIENT_VERSION = 7;
91 const unsigned int   PRIMARY_TOUCH_BUTTON_ID  = 1;
92 const ResizeLocation RESIZE_LOCATIONS[]       = {ResizeLocation::TOP_LEFT, ResizeLocation::LEFT, ResizeLocation::BOTTOM_LEFT, ResizeLocation::BOTTOM, ResizeLocation::BOTTOM_RIGHT, ResizeLocation::RIGHT, ResizeLocation::TOP_RIGHT, ResizeLocation::TOP, ResizeLocation::INVALID};
93
94 #if defined(VCONF_ENABLED)
95 const char* DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
96 #endif
97
98 struct KeyCodeMap
99 {
100   xkb_keysym_t  keySym;
101   xkb_keycode_t keyCode;
102   bool          isKeyCode;
103 };
104
105 /**
106  * Get the device name from the provided ecore key event
107  */
108 void GetDeviceName(Ecore_Event_Key* keyEvent, std::string& result)
109 {
110   const char* ecoreDeviceName = ecore_device_name_get(keyEvent->dev);
111
112   if(ecoreDeviceName)
113   {
114     result = ecoreDeviceName;
115   }
116 }
117
118 /**
119  * Get the device class from the provided ecore event
120  */
121 void GetDeviceClass(Ecore_Device_Class ecoreDeviceClass, Device::Class::Type& deviceClass)
122 {
123   switch(ecoreDeviceClass)
124   {
125     case ECORE_DEVICE_CLASS_SEAT:
126     {
127       deviceClass = Device::Class::USER;
128       break;
129     }
130     case ECORE_DEVICE_CLASS_KEYBOARD:
131     {
132       deviceClass = Device::Class::KEYBOARD;
133       break;
134     }
135     case ECORE_DEVICE_CLASS_MOUSE:
136     {
137       deviceClass = Device::Class::MOUSE;
138       break;
139     }
140     case ECORE_DEVICE_CLASS_TOUCH:
141     {
142       deviceClass = Device::Class::TOUCH;
143       break;
144     }
145     case ECORE_DEVICE_CLASS_PEN:
146     {
147       deviceClass = Device::Class::PEN;
148       break;
149     }
150     case ECORE_DEVICE_CLASS_POINTER:
151     {
152       deviceClass = Device::Class::POINTER;
153       break;
154     }
155     case ECORE_DEVICE_CLASS_GAMEPAD:
156     {
157       deviceClass = Device::Class::GAMEPAD;
158       break;
159     }
160     default:
161     {
162       deviceClass = Device::Class::NONE;
163       break;
164     }
165   }
166 }
167
168 void GetDeviceSubclass(Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subclass::Type& deviceSubclass)
169 {
170   switch(ecoreDeviceSubclass)
171   {
172     case ECORE_DEVICE_SUBCLASS_FINGER:
173     {
174       deviceSubclass = Device::Subclass::FINGER;
175       break;
176     }
177     case ECORE_DEVICE_SUBCLASS_FINGERNAIL:
178     {
179       deviceSubclass = Device::Subclass::FINGERNAIL;
180       break;
181     }
182     case ECORE_DEVICE_SUBCLASS_KNUCKLE:
183     {
184       deviceSubclass = Device::Subclass::KNUCKLE;
185       break;
186     }
187     case ECORE_DEVICE_SUBCLASS_PALM:
188     {
189       deviceSubclass = Device::Subclass::PALM;
190       break;
191     }
192     case ECORE_DEVICE_SUBCLASS_HAND_SIZE:
193     {
194       deviceSubclass = Device::Subclass::HAND_SIDE;
195       break;
196     }
197     case ECORE_DEVICE_SUBCLASS_HAND_FLAT:
198     {
199       deviceSubclass = Device::Subclass::HAND_FLAT;
200       break;
201     }
202     case ECORE_DEVICE_SUBCLASS_PEN_TIP:
203     {
204       deviceSubclass = Device::Subclass::PEN_TIP;
205       break;
206     }
207     case ECORE_DEVICE_SUBCLASS_TRACKPAD:
208     {
209       deviceSubclass = Device::Subclass::TRACKPAD;
210       break;
211     }
212     case ECORE_DEVICE_SUBCLASS_TRACKPOINT:
213     {
214       deviceSubclass = Device::Subclass::TRACKPOINT;
215       break;
216     }
217     case ECORE_DEVICE_SUBCLASS_TRACKBALL:
218     {
219       deviceSubclass = Device::Subclass::TRACKBALL;
220       break;
221     }
222     case ECORE_DEVICE_SUBCLASS_REMOCON:
223     {
224       deviceSubclass = Device::Subclass::REMOCON;
225       break;
226     }
227     case ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD:
228     {
229       deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD;
230       break;
231     }
232     default:
233     {
234       deviceSubclass = Device::Subclass::NONE;
235       break;
236     }
237   }
238 }
239
240 void FindKeyCode(struct xkb_keymap* keyMap, xkb_keycode_t key, void* data)
241 {
242   KeyCodeMap* foundKeyCode = static_cast<KeyCodeMap*>(data);
243   if(foundKeyCode->isKeyCode)
244   {
245     return;
246   }
247
248   xkb_keysym_t        keySym  = foundKeyCode->keySym;
249   int                 nsyms   = 0;
250   const xkb_keysym_t* symsOut = NULL;
251
252   nsyms = xkb_keymap_key_get_syms_by_level(keyMap, key, 0, 0, &symsOut);
253
254   if(nsyms && symsOut)
255   {
256     if(*symsOut == keySym)
257     {
258       foundKeyCode->keyCode   = key;
259       foundKeyCode->isKeyCode = true;
260     }
261   }
262 }
263
264 /**
265  * Return the recalculated window resizing location according to the current orientation.
266  */
267 ResizeLocation RecalculateLocationToCurrentOrientation(WindowResizeDirection direction, int windowRotationAngle)
268 {
269   int index = 8;
270   switch(direction)
271   {
272     case WindowResizeDirection::TOP_LEFT:
273     {
274       index = 0;
275       break;
276     }
277     case WindowResizeDirection::LEFT:
278     {
279       index = 1;
280       break;
281     }
282     case WindowResizeDirection::BOTTOM_LEFT:
283     {
284       index = 2;
285       break;
286     }
287     case WindowResizeDirection::BOTTOM:
288     {
289       index = 3;
290       break;
291     }
292     case WindowResizeDirection::BOTTOM_RIGHT:
293     {
294       index = 4;
295       break;
296     }
297     case WindowResizeDirection::RIGHT:
298     {
299       index = 5;
300       break;
301     }
302     case WindowResizeDirection::TOP_RIGHT:
303     {
304       index = 6;
305       break;
306     }
307     case WindowResizeDirection::TOP:
308     {
309       index = 7;
310       break;
311     }
312     default:
313     {
314       index = 8;
315       break;
316     }
317   }
318
319   if(index != 8 && windowRotationAngle != 0)
320   {
321     index = (index + (windowRotationAngle / 90) * 2) % 8;
322   }
323
324   return RESIZE_LOCATIONS[index];
325 }
326
327 /////////////////////////////////////////////////////////////////////////////////////////////////
328 // Window Callbacks
329 /////////////////////////////////////////////////////////////////////////////////////////////////
330
331 /// Called when the window iconify state is changed.
332 static Eina_Bool EcoreEventWindowIconifyStateChanged(void* data, int type, void* event)
333 {
334   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
335   if(windowBase)
336   {
337     return windowBase->OnIconifyStateChanged(data, type, event);
338   }
339
340   return ECORE_CALLBACK_PASS_ON;
341 }
342
343 /// Called when the window gains focus
344 static Eina_Bool EcoreEventWindowFocusIn(void* data, int type, void* event)
345 {
346   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
347   if(windowBase)
348   {
349     return windowBase->OnFocusIn(data, type, event);
350   }
351
352   return ECORE_CALLBACK_PASS_ON;
353 }
354
355 /// Called when the window loses focus
356 static Eina_Bool EcoreEventWindowFocusOut(void* data, int type, void* event)
357 {
358   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
359   if(windowBase)
360   {
361     return windowBase->OnFocusOut(data, type, event);
362   }
363
364   return ECORE_CALLBACK_PASS_ON;
365 }
366
367 /// Called when the output is transformed
368 static Eina_Bool EcoreEventOutputTransform(void* data, int type, void* event)
369 {
370   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
371   if(windowBase)
372   {
373     return windowBase->OnOutputTransform(data, type, event);
374   }
375
376   return ECORE_CALLBACK_PASS_ON;
377 }
378
379 /// Called when the output transform should be ignored
380 static Eina_Bool EcoreEventIgnoreOutputTransform(void* data, int type, void* event)
381 {
382   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
383   if(windowBase)
384   {
385     return windowBase->OnIgnoreOutputTransform(data, type, event);
386   }
387
388   return ECORE_CALLBACK_PASS_ON;
389 }
390
391 /**
392  * Called when rotate event is recevied.
393  */
394 static Eina_Bool EcoreEventRotate(void* data, int type, void* event)
395 {
396   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
397   if(windowBase)
398   {
399     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EcoreEventRotate\n");
400     windowBase->OnRotation(data, type, event);
401   }
402   return ECORE_CALLBACK_PASS_ON;
403 }
404
405 /**
406  * Called when configure event is recevied.
407  */
408 static Eina_Bool EcoreEventConfigure(void* data, int type, void* event)
409 {
410   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
411   if(windowBase)
412   {
413     windowBase->OnConfiguration(data, type, event);
414   }
415   return ECORE_CALLBACK_PASS_ON;
416 }
417
418 /////////////////////////////////////////////////////////////////////////////////////////////////
419 // Touch Callbacks
420 /////////////////////////////////////////////////////////////////////////////////////////////////
421
422 /**
423  * Called when a touch down is received.
424  */
425 static Eina_Bool EcoreEventMouseButtonDown(void* data, int type, void* event)
426 {
427   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
428   if(windowBase)
429   {
430     windowBase->OnMouseButtonDown(data, type, event);
431   }
432   return ECORE_CALLBACK_PASS_ON;
433 }
434
435 /**
436  * Called when a touch up is received.
437  */
438 static Eina_Bool EcoreEventMouseButtonUp(void* data, int type, void* event)
439 {
440   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
441   if(windowBase)
442   {
443     windowBase->OnMouseButtonUp(data, type, event);
444   }
445   return ECORE_CALLBACK_PASS_ON;
446 }
447
448 /**
449  * Called when a touch motion is received.
450  */
451 static Eina_Bool EcoreEventMouseButtonMove(void* data, int type, void* event)
452 {
453   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
454   if(windowBase)
455   {
456     windowBase->OnMouseButtonMove(data, type, event);
457   }
458   return ECORE_CALLBACK_PASS_ON;
459 }
460
461 /**
462  * Called when a touch is canceled.
463  */
464 static Eina_Bool EcoreEventMouseButtonCancel(void* data, int type, void* event)
465 {
466   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
467   if(windowBase)
468   {
469     windowBase->OnMouseButtonCancel(data, type, event);
470   }
471   return ECORE_CALLBACK_PASS_ON;
472 }
473
474 /**
475  * Called when a mouse wheel is received.
476  */
477 static Eina_Bool EcoreEventMouseWheel(void* data, int type, void* event)
478 {
479   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
480   if(windowBase)
481   {
482     windowBase->OnMouseWheel(data, type, event);
483   }
484   return ECORE_CALLBACK_PASS_ON;
485 }
486
487 /**
488  * Called when a mouse in is received.
489  */
490 static Eina_Bool EcoreEventMouseIn(void* data, int type, void* event)
491 {
492   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
493   if(windowBase)
494   {
495     windowBase->OnMouseInOut(data, type, event, Dali::DevelWindow::MouseInOutEvent::Type::IN);
496   }
497   return ECORE_CALLBACK_PASS_ON;
498 }
499
500 /**
501  * Called when a mouse out is received.
502  */
503 static Eina_Bool EcoreEventMouseOut(void* data, int type, void* event)
504 {
505   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
506   if(windowBase)
507   {
508     // When the mouse is out, the previous mouse must be canceled.
509     windowBase->OnMouseButtonCancel(data, type, event);
510     windowBase->OnMouseInOut(data, type, event, Dali::DevelWindow::MouseInOutEvent::Type::OUT);
511   }
512   return ECORE_CALLBACK_PASS_ON;
513 }
514
515 /**
516  * Called when a detent rotation event is recevied.
517  */
518 static Eina_Bool EcoreEventDetentRotation(void* data, int type, void* event)
519 {
520   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
521   if(windowBase)
522   {
523     windowBase->OnDetentRotation(data, type, event);
524   }
525   return ECORE_CALLBACK_PASS_ON;
526 }
527
528 /////////////////////////////////////////////////////////////////////////////////////////////////
529 // Key Callbacks
530 /////////////////////////////////////////////////////////////////////////////////////////////////
531
532 /**
533  * Called when a key down is received.
534  */
535 static Eina_Bool EcoreEventKeyDown(void* data, int type, void* event)
536 {
537   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
538   if(windowBase)
539   {
540     windowBase->OnKeyDown(data, type, event);
541   }
542   return ECORE_CALLBACK_PASS_ON;
543 }
544
545 /**
546  * Called when a key up is received.
547  */
548 static Eina_Bool EcoreEventKeyUp(void* data, int type, void* event)
549 {
550   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
551   if(windowBase)
552   {
553     windowBase->OnKeyUp(data, type, event);
554   }
555   return ECORE_CALLBACK_PASS_ON;
556 }
557
558 /////////////////////////////////////////////////////////////////////////////////////////////////
559 // Selection Callbacks
560 /////////////////////////////////////////////////////////////////////////////////////////////////
561
562 /**
563  * Called when the source window notifies us the content in clipboard is selected.
564  */
565 static Eina_Bool EcoreEventDataSend(void* data, int type, void* event)
566 {
567   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
568   if(windowBase)
569   {
570     windowBase->OnDataSend(data, type, event);
571   }
572   return ECORE_CALLBACK_PASS_ON;
573 }
574
575 /**
576  * Called when the source window sends us about the selected content.
577  * For example, when item is selected in the clipboard.
578  */
579 static Eina_Bool EcoreEventDataReceive(void* data, int type, void* event)
580 {
581   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
582   if(windowBase)
583   {
584     windowBase->OnDataReceive(data, type, event);
585   }
586   return ECORE_CALLBACK_PASS_ON;
587 }
588
589 /////////////////////////////////////////////////////////////////////////////////////////////////
590 // Effect Start/End Callbacks
591 /////////////////////////////////////////////////////////////////////////////////////////////////
592
593 /**
594  * Called when transition animation of the window's shown/hidden is started by window manager.
595  */
596 static Eina_Bool EcoreEventEffectStart(void* data, int type, void* event)
597 {
598   WindowBaseEcoreWl2*           windowBase  = static_cast<WindowBaseEcoreWl2*>(data);
599   Ecore_Wl2_Event_Effect_Start* effectStart = static_cast<Ecore_Wl2_Event_Effect_Start*>(event);
600   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectStart, effect type[ %d ]\n", effectStart->type);
601   if(windowBase)
602   {
603     if(effectStart->type < 3) // only under restack
604     {
605       windowBase->OnTransitionEffectEvent(WindowEffectState::START, static_cast<WindowEffectType>(effectStart->type));
606     }
607   }
608   return ECORE_CALLBACK_PASS_ON;
609 }
610
611 /**
612  * Called when transition animation of the window's shown/hidden is ended by window manager.
613  */
614 static Eina_Bool EcoreEventEffectEnd(void* data, int type, void* event)
615 {
616   Ecore_Wl2_Event_Effect_Start* effectEnd  = static_cast<Ecore_Wl2_Event_Effect_Start*>(event);
617   WindowBaseEcoreWl2*           windowBase = static_cast<WindowBaseEcoreWl2*>(data);
618   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventEffectEnd, effect type[ %d ]\n", effectEnd->type);
619   if(windowBase)
620   {
621     if(effectEnd->type < 3) // only under restack
622     {
623       windowBase->OnTransitionEffectEvent(WindowEffectState::END, static_cast<WindowEffectType>(effectEnd->type));
624     }
625   }
626   return ECORE_CALLBACK_PASS_ON;
627 }
628
629 /////////////////////////////////////////////////////////////////////////////////////////////////
630 // Keyboard Repeat Settings Changed Callbacks
631 /////////////////////////////////////////////////////////////////////////////////////////////////
632
633 static Eina_Bool EcoreEventSeatKeyboardRepeatChanged(void* data, int type, void* event)
634 {
635   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
636   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventSeatKeyboardRepeatChanged, id[ %d ]\n", static_cast<Ecore_Wl2_Event_Seat_Keyboard_Repeat_Changed*>(event)->id);
637   if(windowBase)
638   {
639     windowBase->OnKeyboardRepeatSettingsChanged();
640   }
641
642   return ECORE_CALLBACK_RENEW;
643 }
644
645 /////////////////////////////////////////////////////////////////////////////////////////////////
646 // Keymap Changed Callbacks
647 /////////////////////////////////////////////////////////////////////////////////////////////////
648
649 static Eina_Bool EcoreEventSeatKeymapChanged(void* data, int type, void* event)
650 {
651   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
652   if(windowBase)
653   {
654     windowBase->KeymapChanged(data, type, event);
655   }
656
657   return ECORE_CALLBACK_RENEW;
658 }
659
660 /////////////////////////////////////////////////////////////////////////////////////////////////
661 // Font Callbacks
662 /////////////////////////////////////////////////////////////////////////////////////////////////
663
664 #if defined(VCONF_ENABLED)
665 /**
666  * Called when a font name is changed.
667  */
668 static void VconfNotifyFontNameChanged(keynode_t* node, void* data)
669 {
670   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
671   if(windowBase)
672   {
673     windowBase->OnFontNameChanged();
674   }
675 }
676
677 /**
678  * Called when a font size is changed.
679  */
680 static void VconfNotifyFontSizeChanged(keynode_t* node, void* data)
681 {
682   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
683   if(windowBase)
684   {
685     windowBase->OnFontSizeChanged();
686   }
687 }
688 #endif
689
690 /////////////////////////////////////////////////////////////////////////////////////////////////
691 // Window Redraw Request Event Callbacks
692 /////////////////////////////////////////////////////////////////////////////////////////////////
693
694 static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event)
695 {
696   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
697   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowRedrawRequest, window[ %d ]\n", static_cast<Ecore_Wl2_Event_Window_Redraw_Request*>(event)->win);
698   if(windowBase)
699   {
700     windowBase->OnEcoreEventWindowRedrawRequest();
701   }
702
703   return ECORE_CALLBACK_RENEW;
704 }
705
706 /////////////////////////////////////////////////////////////////////////////////////////////////
707 // Window Auxiliary Message Callbacks
708 /////////////////////////////////////////////////////////////////////////////////////////////////
709 static Eina_Bool EcoreEventWindowAuxiliaryMessage(void* data, int type, void* event)
710 {
711   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
712   if(windowBase)
713   {
714     windowBase->OnEcoreEventWindowAuxiliaryMessage(event);
715   }
716   return ECORE_CALLBACK_RENEW;
717 }
718
719 /////////////////////////////////////////////////////////////////////////////////////////////////
720 // Window is Moved/Resized By Server Callbacks
721 /////////////////////////////////////////////////////////////////////////////////////////////////
722 static Eina_Bool EcoreEventWindowMoveCompleted(void* data, int type, void* event)
723 {
724   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
725   if(windowBase)
726   {
727     windowBase->OnMoveCompleted(event);
728   }
729   return ECORE_CALLBACK_RENEW;
730 }
731
732 static Eina_Bool EcoreEventWindowResizeCompleted(void* data, int type, void* event)
733 {
734   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
735   if(windowBase)
736   {
737     windowBase->OnResizeCompleted(event);
738   }
739   return ECORE_CALLBACK_RENEW;
740 }
741
742 /////////////////////////////////////////////////////////////////////////////////////////////////
743 // Conformant Change Callback
744 /////////////////////////////////////////////////////////////////////////////////////////////////
745 static Eina_Bool EcoreEventConformantChange(void* data, int type, void* event)
746 {
747   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
748   if(windowBase)
749   {
750     windowBase->OnEcoreEventConformantChange(event);
751   }
752   return ECORE_CALLBACK_RENEW;
753 }
754
755 static void RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
756 {
757   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
758   if(windowBase)
759   {
760     windowBase->RegistryGlobalCallback(data, registry, name, interface, version);
761   }
762 }
763
764 static void RegistryGlobalCallbackRemove(void* data, struct wl_registry* registry, uint32_t id)
765 {
766   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
767   if(windowBase)
768   {
769     windowBase->RegistryGlobalCallbackRemove(data, registry, id);
770   }
771 }
772
773 static void TizenPolicyConformant(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t isConformant)
774 {
775 }
776
777 static void TizenPolicyConformantArea(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
778 {
779   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
780   if(windowBase)
781   {
782     windowBase->TizenPolicyConformantArea(data, tizenPolicy, surface, conformantPart, state, x, y, w, h);
783   }
784 }
785
786 static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
787 {
788   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
789   if(windowBase)
790   {
791     windowBase->TizenPolicyNotificationChangeDone(data, tizenPolicy, surface, level, state);
792   }
793 }
794
795 static void TizenPolicyTransientForDone(void* data, struct tizen_policy* tizenPolicy, uint32_t childId)
796 {
797 }
798
799 static void TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state)
800 {
801   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
802   if(windowBase)
803   {
804     windowBase->TizenPolicyScreenModeChangeDone(data, tizenPolicy, surface, mode, state);
805   }
806 }
807
808 static void TizenPolicyIconifyStateChanged(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t iconified, uint32_t force)
809 {
810 }
811
812 static void TizenPolicySupportedAuxiliaryHints(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, struct wl_array* hints, uint32_t numNints)
813 {
814 }
815
816 static void TizenPolicyAllowedAuxiliaryHint(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int id)
817 {
818 }
819
820 static void TizenPolicyAuxiliaryMessage(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, const char* key, const char* val, struct wl_array* options)
821 {
822 }
823
824 static void TizenPolicyConformantRegion(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial)
825 {
826 }
827
828 static void DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy* displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state)
829 {
830   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
831   if(windowBase)
832   {
833     windowBase->DisplayPolicyBrightnessChangeDone(data, displayPolicy, surface, brightness, state);
834   }
835 }
836
837 const struct wl_registry_listener registryListener =
838   {
839     RegistryGlobalCallback,
840     RegistryGlobalCallbackRemove};
841
842 const struct tizen_policy_listener tizenPolicyListener =
843   {
844     TizenPolicyConformant,
845     TizenPolicyConformantArea,
846     TizenPolicyNotificationChangeDone,
847     TizenPolicyTransientForDone,
848     TizenPolicyScreenModeChangeDone,
849     TizenPolicyIconifyStateChanged,
850     TizenPolicySupportedAuxiliaryHints,
851     TizenPolicyAllowedAuxiliaryHint,
852     TizenPolicyAuxiliaryMessage,
853     TizenPolicyConformantRegion};
854
855 const struct tizen_display_policy_listener tizenDisplayPolicyListener =
856   {
857     DisplayPolicyBrightnessChangeDone};
858
859 } // unnamed namespace
860
861 WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surface, bool isTransparent)
862 : mEcoreEventHandler(),
863   mEcoreWindow(nullptr),
864   mWlSurface(nullptr),
865   mWlInputPanel(nullptr),
866   mWlOutput(nullptr),
867   mWlInputPanelSurface(nullptr),
868   mEglWindow(nullptr),
869   mDisplay(nullptr),
870   mEventQueue(nullptr),
871   mTizenPolicy(nullptr),
872   mTizenDisplayPolicy(nullptr),
873   mKeyMap(nullptr),
874   mSupportedAuxiliaryHints(),
875   mWindowPositionSize(positionSize),
876   mAuxiliaryHints(),
877   mType(WindowType::NORMAL),
878   mNotificationLevel(-1),
879   mScreenOffMode(0),
880   mBrightness(0),
881   mWindowRotationAngle(0),
882   mScreenRotationAngle(0),
883   mSupportedPreProtation(0),
884   mNotificationChangeState(0),
885   mScreenOffModeChangeState(0),
886   mBrightnessChangeState(0),
887   mLastSubmittedMoveResizeSerial(0),
888   mMoveResizeSerial(0),
889   mNotificationLevelChangeDone(true),
890   mScreenOffModeChangeDone(true),
891   mVisible(true),
892   mOwnSurface(false),
893   mBrightnessChangeDone(true)
894 {
895   Initialize(positionSize, surface, isTransparent);
896 }
897
898 WindowBaseEcoreWl2::~WindowBaseEcoreWl2()
899 {
900 #if defined(VCONF_ENABLED)
901   vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged);
902   vconf_ignore_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged);
903 #endif
904
905   for(Dali::Vector<Ecore_Event_Handler*>::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter)
906   {
907     ecore_event_handler_del(*iter);
908   }
909   mEcoreEventHandler.Clear();
910
911   if(mEventQueue)
912   {
913     wl_event_queue_destroy(mEventQueue);
914   }
915
916   mSupportedAuxiliaryHints.clear();
917   mAuxiliaryHints.clear();
918
919   if(mEglWindow != NULL)
920   {
921     wl_egl_window_destroy(mEglWindow);
922     mEglWindow = NULL;
923   }
924
925   if(mOwnSurface)
926   {
927     ecore_wl2_window_free(mEcoreWindow);
928   }
929 }
930
931 void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool isTransparent)
932 {
933   if(surface.Empty() == false)
934   {
935     // check we have a valid type
936     DALI_ASSERT_ALWAYS((surface.GetType() == typeid(Ecore_Wl2_Window*)) && "Surface type is invalid");
937
938     mEcoreWindow = AnyCast<Ecore_Wl2_Window*>(surface);
939   }
940   else
941   {
942     // we own the surface about to created
943     mOwnSurface = true;
944     CreateWindow(positionSize);
945   }
946
947   mWlSurface = ecore_wl2_window_surface_get(mEcoreWindow);
948
949   SetTransparency(isTransparent);
950
951   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this));
952   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this));
953   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this));
954   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this));
955   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this));
956
957   // Register Rotate event
958   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_ROTATE, EcoreEventRotate, this));
959
960   // Register Configure event
961   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_CONFIGURE, EcoreEventConfigure, this));
962
963   // Register Touch events
964   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this));
965   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this));
966   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this));
967   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this));
968
969   // Register Mouse wheel events
970   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this));
971
972   // Register Mouse IO events
973   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_IN, EcoreEventMouseIn, this));
974   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_OUT, EcoreEventMouseOut, this));
975
976   // Register Detent event
977   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this));
978
979   // Register Key events
980   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this));
981   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this));
982
983   // Register Selection event - clipboard selection
984   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this));
985   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_OFFER_DATA_READY, EcoreEventDataReceive, this));
986
987   // Register Effect Start/End event
988   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_EFFECT_START, EcoreEventEffectStart, this));
989   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_EFFECT_END, EcoreEventEffectEnd, this));
990
991   // Register Keyboard repeat event
992   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_KEYBOARD_REPEAT_CHANGED, EcoreEventSeatKeyboardRepeatChanged, this));
993
994   // Register Window redraw request event
995   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, this));
996
997   // Register Window auxiliary event
998   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_AUX_MESSAGE, EcoreEventWindowAuxiliaryMessage, this));
999
1000   // Register Conformant change event
1001   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, EcoreEventConformantChange, this));
1002
1003 #if defined(VCONF_ENABLED)
1004   // Register Vconf notify - font name and size
1005   vconf_notify_key_changed_for_ui_thread(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this);
1006   vconf_notify_key_changed_for_ui_thread(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this);
1007 #endif
1008
1009   // Register Window is moved and resized done event.
1010   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_MOVE_DONE, EcoreEventWindowMoveCompleted, this));
1011   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_INTERACTIVE_RESIZE_DONE, EcoreEventWindowResizeCompleted, this));
1012
1013   Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
1014   mDisplay                   = ecore_wl2_display_get(display);
1015
1016   if(mDisplay)
1017   {
1018     wl_display* displayWrapper = static_cast<wl_display*>(wl_proxy_create_wrapper(mDisplay));
1019     if(displayWrapper)
1020     {
1021       mEventQueue = wl_display_create_queue(mDisplay);
1022       if(mEventQueue)
1023       {
1024         wl_proxy_set_queue(reinterpret_cast<wl_proxy*>(displayWrapper), mEventQueue);
1025
1026         wl_registry* registry = wl_display_get_registry(displayWrapper);
1027         wl_registry_add_listener(registry, &registryListener, this);
1028
1029         // To support ECORE_WL2_EVENT_CONFORMANT_CHANGE event handler
1030         ecore_wl2_window_conformant_set(mEcoreWindow, true);
1031       }
1032
1033       wl_proxy_wrapper_destroy(displayWrapper);
1034     }
1035   }
1036
1037   Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(display);
1038
1039   if(ecoreWlInput)
1040   {
1041     mKeyMap = ecore_wl2_input_keymap_get(ecoreWlInput);
1042
1043     mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_SEAT_KEYMAP_CHANGED, EcoreEventSeatKeymapChanged, this));
1044   }
1045
1046   // get auxiliary hint
1047   Eina_List* hints = ecore_wl2_window_aux_hints_supported_get(mEcoreWindow);
1048   if(hints)
1049   {
1050     Eina_List* l    = NULL;
1051     char*      hint = NULL;
1052
1053     for(l = hints, (hint = static_cast<char*>(eina_list_data_get(l))); l; l = eina_list_next(l), (hint = static_cast<char*>(eina_list_data_get(l))))
1054     {
1055       mSupportedAuxiliaryHints.push_back(hint);
1056
1057       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::Initialize: %s\n", hint);
1058     }
1059   }
1060 }
1061
1062 Eina_Bool WindowBaseEcoreWl2::OnIconifyStateChanged(void* data, int type, void* event)
1063 {
1064   Ecore_Wl2_Event_Window_Iconify_State_Change* iconifyChangedEvent(static_cast<Ecore_Wl2_Event_Window_Iconify_State_Change*>(event));
1065   Eina_Bool                                    handled(ECORE_CALLBACK_PASS_ON);
1066
1067   if(iconifyChangedEvent->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1068   {
1069     if(iconifyChangedEvent->iconified == EINA_TRUE)
1070     {
1071       mIconifyChangedSignal.Emit(true);
1072     }
1073     else
1074     {
1075       mIconifyChangedSignal.Emit(false);
1076     }
1077     handled = ECORE_CALLBACK_DONE;
1078   }
1079
1080   return handled;
1081 }
1082
1083 Eina_Bool WindowBaseEcoreWl2::OnFocusIn(void* data, int type, void* event)
1084 {
1085   Ecore_Wl2_Event_Focus_In* focusInEvent(static_cast<Ecore_Wl2_Event_Focus_In*>(event));
1086
1087   if(focusInEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1088   {
1089     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n");
1090
1091     mFocusChangedSignal.Emit(true);
1092   }
1093
1094   return ECORE_CALLBACK_PASS_ON;
1095 }
1096
1097 Eina_Bool WindowBaseEcoreWl2::OnFocusOut(void* data, int type, void* event)
1098 {
1099   Ecore_Wl2_Event_Focus_Out* focusOutEvent(static_cast<Ecore_Wl2_Event_Focus_Out*>(event));
1100
1101   if(focusOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1102   {
1103     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n");
1104
1105     mFocusChangedSignal.Emit(false);
1106   }
1107
1108   return ECORE_CALLBACK_PASS_ON;
1109 }
1110
1111 Eina_Bool WindowBaseEcoreWl2::OnOutputTransform(void* data, int type, void* event)
1112 {
1113   Ecore_Wl2_Event_Output_Transform* transformEvent(static_cast<Ecore_Wl2_Event_Output_Transform*>(event));
1114
1115   if(transformEvent->output == ecore_wl2_window_output_find(mEcoreWindow))
1116   {
1117     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow);
1118
1119     mScreenRotationAngle = GetScreenRotationAngle();
1120
1121     mOutputTransformedSignal.Emit();
1122   }
1123
1124   return ECORE_CALLBACK_PASS_ON;
1125 }
1126
1127 Eina_Bool WindowBaseEcoreWl2::OnIgnoreOutputTransform(void* data, int type, void* event)
1128 {
1129   Ecore_Wl2_Event_Ignore_Output_Transform* ignoreTransformEvent(static_cast<Ecore_Wl2_Event_Ignore_Output_Transform*>(event));
1130
1131   if(ignoreTransformEvent->win == mEcoreWindow)
1132   {
1133     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow);
1134
1135     mScreenRotationAngle = GetScreenRotationAngle();
1136
1137     mOutputTransformedSignal.Emit();
1138   }
1139
1140   return ECORE_CALLBACK_PASS_ON;
1141 }
1142
1143 void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
1144 {
1145   Ecore_Wl2_Event_Window_Rotation* ev(static_cast<Ecore_Wl2_Event_Window_Rotation*>(event));
1146
1147   if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1148   {
1149     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, angle: %d, width: %d, height: %d\n", ev->angle, ev->w, ev->h);
1150
1151     RotationEvent rotationEvent;
1152     rotationEvent.angle     = ev->angle;
1153     rotationEvent.winResize = 0;
1154
1155     if(ev->w == 0 || ev->h == 0)
1156     {
1157       // When rotation event does not have the window width or height,
1158       // previous DALi side window's size are used.
1159       ev->w = mWindowPositionSize.width;
1160       ev->h = mWindowPositionSize.height;
1161     }
1162
1163     mWindowRotationAngle = ev->angle;
1164
1165     mWindowPositionSize.width  = ev->w;
1166     mWindowPositionSize.height = ev->h;
1167
1168     PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize);
1169
1170     rotationEvent.x      = newPositionSize.x;
1171     rotationEvent.y      = newPositionSize.y;
1172     rotationEvent.width  = newPositionSize.width;
1173     rotationEvent.height = newPositionSize.height;
1174
1175     mRotationSignal.Emit(rotationEvent);
1176   }
1177 }
1178
1179 void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event)
1180 {
1181   Ecore_Wl2_Event_Window_Configure* ev(static_cast<Ecore_Wl2_Event_Window_Configure*>(event));
1182
1183   if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1184   {
1185     // Note: To comply with the wayland protocol, Dali should make an ack_configure
1186     // by calling ecore_wl2_window_commit
1187
1188     int tempWidth  = ev->w;
1189     int tempHeight = ev->h;
1190
1191     // Initialize with previous size for skip resize when new size is 0.
1192     // When window is just moved or window is resized by client application,
1193     // The configure notification event's size will be 0.
1194     // If new size is 0, the resized work should be skip.
1195     int  newWidth    = mWindowPositionSize.width;
1196     int  newHeight   = mWindowPositionSize.height;
1197     bool windowMoved = false, windowResized = false;
1198
1199     if(ev->x != mWindowPositionSize.x || ev->y != mWindowPositionSize.y)
1200     {
1201       windowMoved = true;
1202     }
1203
1204     if(tempWidth != 0 && tempHeight != 0 && (tempWidth != mWindowPositionSize.width || tempHeight != mWindowPositionSize.height))
1205     {
1206       windowResized = true;
1207       newWidth      = tempWidth;
1208       newHeight     = tempHeight;
1209     }
1210
1211     if(windowMoved || windowResized)
1212     {
1213       mWindowPositionSize.x      = ev->x;
1214       mWindowPositionSize.y      = ev->y;
1215       mWindowPositionSize.width  = newWidth;
1216       mWindowPositionSize.height = newHeight;
1217       DALI_LOG_RELEASE_INFO("Update position & resize signal by server, current angle [%d] x[%d] y[%d] w[%d] h[%d]\n", mWindowRotationAngle, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
1218
1219       ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
1220
1221       Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize);
1222       mUpdatePositionSizeSignal.Emit(newPositionSize);
1223     }
1224
1225     mMaximizeChangedSignal.Emit(static_cast<bool>(ev->states & ECORE_WL2_WINDOW_STATE_MAXIMIZED));
1226
1227     ecore_wl2_window_commit(mEcoreWindow, EINA_FALSE);
1228   }
1229 }
1230
1231 void WindowBaseEcoreWl2::OnMouseButtonDown(void* data, int type, void* event)
1232 {
1233   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
1234
1235   if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1236   {
1237     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_DOWN");
1238
1239     Device::Class::Type    deviceClass;
1240     Device::Subclass::Type deviceSubclass;
1241
1242     GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
1243     GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
1244
1245     PointState::Type state(PointState::DOWN);
1246
1247     if(deviceClass != Device::Class::Type::MOUSE)
1248     {
1249       // Check if the buttons field is set and ensure it's the primary touch button.
1250       // If this event was triggered by buttons other than the primary button (used for touch), then
1251       // just send an interrupted event to Core.
1252       if(touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID))
1253       {
1254         state = PointState::INTERRUPTED;
1255       }
1256     }
1257
1258     Integration::Point point;
1259     point.SetDeviceId(touchEvent->multi.device);
1260     point.SetState(state);
1261     point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
1262     point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y));
1263     point.SetPressure(touchEvent->multi.pressure);
1264     point.SetAngle(Degree(touchEvent->multi.angle));
1265     point.SetDeviceClass(deviceClass);
1266     point.SetDeviceSubclass(deviceSubclass);
1267     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
1268
1269     mTouchEventSignal.Emit(point, touchEvent->timestamp);
1270   }
1271 }
1272
1273 void WindowBaseEcoreWl2::OnMouseButtonUp(void* data, int type, void* event)
1274 {
1275   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
1276
1277   if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1278   {
1279     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_UP");
1280
1281     Device::Class::Type    deviceClass;
1282     Device::Subclass::Type deviceSubclass;
1283
1284     GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
1285     GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
1286
1287     Integration::Point point;
1288     point.SetDeviceId(touchEvent->multi.device);
1289     point.SetState(PointState::UP);
1290     point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
1291     point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y));
1292     point.SetPressure(touchEvent->multi.pressure);
1293     point.SetAngle(Degree(touchEvent->multi.angle));
1294     point.SetDeviceClass(deviceClass);
1295     point.SetDeviceSubclass(deviceSubclass);
1296     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
1297
1298     mTouchEventSignal.Emit(point, touchEvent->timestamp);
1299   }
1300 }
1301
1302 void WindowBaseEcoreWl2::OnMouseButtonMove(void* data, int type, void* event)
1303 {
1304   Ecore_Event_Mouse_Move* touchEvent = static_cast<Ecore_Event_Mouse_Move*>(event);
1305
1306   if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1307   {
1308     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_MOVE");
1309
1310     Device::Class::Type    deviceClass;
1311     Device::Subclass::Type deviceSubclass;
1312
1313     GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
1314     GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
1315
1316     Integration::Point point;
1317     point.SetDeviceId(touchEvent->multi.device);
1318     point.SetState(PointState::MOTION);
1319     point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
1320     point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y));
1321     point.SetPressure(touchEvent->multi.pressure);
1322     point.SetAngle(Degree(touchEvent->multi.angle));
1323     point.SetDeviceClass(deviceClass);
1324     point.SetDeviceSubclass(deviceSubclass);
1325
1326     mTouchEventSignal.Emit(point, touchEvent->timestamp);
1327   }
1328 }
1329
1330 void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
1331 {
1332   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
1333
1334   if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1335   {
1336     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_CANCEL");
1337
1338     Integration::Point point;
1339     point.SetDeviceId(touchEvent->multi.device);
1340     point.SetState(PointState::INTERRUPTED);
1341     point.SetScreenPosition(Vector2(0.0f, 0.0f));
1342
1343     mTouchEventSignal.Emit(point, touchEvent->timestamp);
1344
1345     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
1346   }
1347 }
1348
1349 void WindowBaseEcoreWl2::OnMouseWheel(void* data, int type, void* event)
1350 {
1351   Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast<Ecore_Event_Mouse_Wheel*>(event);
1352
1353   if(mouseWheelEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1354   {
1355     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_WHEEL");
1356
1357     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z);
1358
1359     Integration::WheelEvent wheelEvent(Integration::WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2(mouseWheelEvent->x, mouseWheelEvent->y), mouseWheelEvent->z, mouseWheelEvent->timestamp);
1360
1361     mWheelEventSignal.Emit(wheelEvent);
1362   }
1363 }
1364
1365 void WindowBaseEcoreWl2::OnMouseInOut(void* data, int type, void* event, Dali::DevelWindow::MouseInOutEvent::Type action)
1366 {
1367   Ecore_Event_Mouse_IO* mouseInOutEvent = static_cast<Ecore_Event_Mouse_IO*>(event);
1368
1369   if(mouseInOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1370   {
1371     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_IN_OUT");
1372
1373     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseInOut: timestamp: %d, modifiers: %d, x: %d, y: %d\n", mouseInOutEvent->timestamp, mouseInOutEvent->modifiers, mouseInOutEvent->x, mouseInOutEvent->y);
1374
1375     Device::Class::Type    deviceClass;
1376     Device::Subclass::Type deviceSubclass;
1377
1378     GetDeviceClass(ecore_device_class_get(mouseInOutEvent->dev), deviceClass);
1379     GetDeviceSubclass(ecore_device_subclass_get(mouseInOutEvent->dev), deviceSubclass);
1380
1381     Dali::DevelWindow::MouseInOutEvent inOutEvent(action, mouseInOutEvent->modifiers, Vector2(mouseInOutEvent->x, mouseInOutEvent->y), mouseInOutEvent->timestamp, deviceClass, deviceSubclass);
1382
1383     mMouseInOutEventSignal.Emit(inOutEvent);
1384   }
1385 }
1386
1387 void WindowBaseEcoreWl2::OnDetentRotation(void* data, int type, void* event)
1388 {
1389   Ecore_Event_Detent_Rotate* detentEvent = static_cast<Ecore_Event_Detent_Rotate*>(event);
1390
1391   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::OnDetentRotation\n");
1392
1393   int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
1394
1395   Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
1396
1397   mWheelEventSignal.Emit(wheelEvent);
1398 }
1399
1400 void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
1401 {
1402   Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
1403
1404   if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1405   {
1406     std::string keyName(keyEvent->keyname);
1407     std::string logicalKey("");
1408     std::string keyString("");
1409     std::string compose("");
1410
1411     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_KEY_DOWN");
1412
1413     // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
1414     if(keyEvent->compose)
1415     {
1416       compose = keyEvent->compose;
1417     }
1418
1419     // Ensure key symbol is not NULL as keys like SHIFT have a null string.
1420     if(keyEvent->key)
1421     {
1422       logicalKey = keyEvent->key;
1423     }
1424
1425     int keyCode = 0;
1426     GetKeyCode(keyName, keyCode); // Get key code dynamically.
1427
1428     if(keyCode == 0)
1429     {
1430       // Get a specific key code from dali key look up table.
1431       keyCode = KeyLookup::GetDaliKeyCode(keyEvent->keyname);
1432     }
1433
1434     keyCode = (keyCode == -1) ? 0 : keyCode;
1435     int           modifier(keyEvent->modifiers);
1436     unsigned long time = keyEvent->timestamp;
1437     if(!strncmp(keyEvent->keyname, "Keycode-", 8))
1438     {
1439       keyCode = atoi(keyEvent->keyname + 8);
1440     }
1441
1442     // Ensure key event string is not NULL as keys like SHIFT have a null string.
1443     if(keyEvent->string)
1444     {
1445       keyString = keyEvent->string;
1446     }
1447
1448     std::string            deviceName;
1449     Device::Class::Type    deviceClass;
1450     Device::Subclass::Type deviceSubclass;
1451
1452     GetDeviceName(keyEvent, deviceName);
1453     GetDeviceClass(ecore_device_class_get(keyEvent->dev), deviceClass);
1454     GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
1455
1456     Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass);
1457
1458     mKeyEventSignal.Emit(keyEvent);
1459   }
1460 }
1461
1462 void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
1463 {
1464   Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
1465
1466   if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1467   {
1468 #if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 23)
1469     // Cancel processing flag is sent because this key event will combine with the previous key. So, the event should not actually perform anything.
1470     if(keyEvent->event_flags & ECORE_EVENT_FLAG_CANCEL)
1471     {
1472       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnKeyUp: This event flag indicates the event is canceled. \n");
1473       return;
1474     }
1475 #endif // Since ecore 1.23 version
1476
1477     std::string keyName(keyEvent->keyname);
1478     std::string logicalKey("");
1479     std::string keyString("");
1480     std::string compose("");
1481
1482     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_KEY_UP");
1483
1484     // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
1485     if(keyEvent->compose)
1486     {
1487       compose = keyEvent->compose;
1488     }
1489
1490     // Ensure key symbol is not NULL as keys like SHIFT have a null string.
1491     if(keyEvent->key)
1492     {
1493       logicalKey = keyEvent->key;
1494     }
1495
1496     int keyCode = 0;
1497     GetKeyCode(keyName, keyCode); // Get key code dynamically.
1498
1499     if(keyCode == 0)
1500     {
1501       // Get a specific key code from dali key look up table.
1502       keyCode = KeyLookup::GetDaliKeyCode(keyEvent->keyname);
1503     }
1504
1505     keyCode = (keyCode == -1) ? 0 : keyCode;
1506     int           modifier(keyEvent->modifiers);
1507     unsigned long time = keyEvent->timestamp;
1508     if(!strncmp(keyEvent->keyname, "Keycode-", 8))
1509     {
1510       keyCode = atoi(keyEvent->keyname + 8);
1511     }
1512
1513     // Ensure key event string is not NULL as keys like SHIFT have a null string.
1514     if(keyEvent->string)
1515     {
1516       keyString = keyEvent->string;
1517     }
1518
1519     std::string            deviceName;
1520     Device::Class::Type    deviceClass;
1521     Device::Subclass::Type deviceSubclass;
1522
1523     GetDeviceName(keyEvent, deviceName);
1524     GetDeviceClass(ecore_device_class_get(keyEvent->dev), deviceClass);
1525     GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
1526
1527     Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass);
1528
1529     mKeyEventSignal.Emit(keyEvent);
1530   }
1531 }
1532
1533 void WindowBaseEcoreWl2::OnDataSend(void* data, int type, void* event)
1534 {
1535   mSelectionDataSendSignal.Emit(event);
1536 }
1537
1538 void WindowBaseEcoreWl2::OnDataReceive(void* data, int type, void* event)
1539 {
1540   mSelectionDataReceivedSignal.Emit(event);
1541 }
1542
1543 void WindowBaseEcoreWl2::OnFontNameChanged()
1544 {
1545   mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
1546 }
1547
1548 void WindowBaseEcoreWl2::OnFontSizeChanged()
1549 {
1550   mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
1551 }
1552
1553 void WindowBaseEcoreWl2::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
1554 {
1555   mTransitionEffectEventSignal.Emit(state, type);
1556 }
1557
1558 void WindowBaseEcoreWl2::OnKeyboardRepeatSettingsChanged()
1559 {
1560   mKeyboardRepeatSettingsChangedSignal.Emit();
1561 }
1562
1563 void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
1564 {
1565   mWindowRedrawRequestSignal.Emit();
1566 }
1567
1568 void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
1569 {
1570   Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
1571   if(message)
1572   {
1573     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n", message->key, message->val);
1574     std::string           key(message->key);
1575     std::string           value(message->val);
1576     Dali::Property::Array options;
1577
1578     if(message->options)
1579     {
1580       Eina_List* l;
1581       void*      data;
1582       EINA_LIST_FOREACH(message->options, l, data)
1583       {
1584         DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n", (char*)data);
1585         std::string option(static_cast<char*>(data));
1586         options.Add(option);
1587       }
1588     }
1589
1590     mAuxiliaryMessageSignal.Emit(key, value, options);
1591   }
1592 }
1593
1594 void WindowBaseEcoreWl2::OnEcoreEventConformantChange(void* event)
1595 {
1596   Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(event);
1597   if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
1598   {
1599     WindowInsetsPartType partType = WindowInsetsPartType::STATUS_BAR;
1600
1601     int x = 0;
1602     int y = 0;
1603     int w = 0;
1604     int h = 0;
1605
1606     switch (ev->part_type)
1607     {
1608       case ECORE_WL2_INDICATOR_PART:
1609       {
1610         partType = WindowInsetsPartType::STATUS_BAR;
1611         ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &x, &y, &w, &h);
1612         break;
1613       }
1614       case ECORE_WL2_KEYBOARD_PART:
1615       {
1616         partType = WindowInsetsPartType::KEYBOARD;
1617         ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
1618         break;
1619       }
1620       case ECORE_WL2_CLIPBOARD_PART:
1621       {
1622         partType = WindowInsetsPartType::CLIPBOARD;
1623         ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
1624         break;
1625       }
1626       default:
1627       {
1628         break;
1629       }
1630     }
1631
1632     WindowInsetsPartState partState = WindowInsetsPartState::INVISIBLE;
1633
1634     int left = 0;
1635     int right = 0;
1636     int top = 0;
1637     int bottom = 0;
1638
1639     // Insets are applied only if system UI(e.g. virtual keyboard) satisfies the following 2 conditions.
1640     // 1. System UI fits to the window width or height.
1641     // 2. System UI begins or ends from the edge of window.
1642     // Otherwise, we should not resize window content because there would be empty space around system UI.
1643     bool applyInsets = false;
1644
1645     // Zero insets are applied if state is invisible
1646     if(!ev->state)
1647     {
1648       applyInsets = true;
1649     }
1650     else
1651     {
1652       partState = WindowInsetsPartState::VISIBLE;
1653
1654       int winX = mWindowPositionSize.x;
1655       int winY = mWindowPositionSize.y;
1656       int winW = mWindowPositionSize.width;
1657       int winH = mWindowPositionSize.height;
1658
1659       if((x <= winX) && (x + w >= winX + winW))
1660       {
1661         if((y <= winY) && (y + h >= winY) && (y + h <= winY + winH))
1662         {
1663           top = y + h - winY;
1664           applyInsets = true;
1665         }
1666         else if((y + h >= winY + winH) && (y >= winY) && (y <= winY + winH))
1667         {
1668           bottom = winY + winH - y;
1669           applyInsets = true;
1670         }
1671       }
1672       else if((y <= winY) && (y + h >= winY + winH))
1673       {
1674         if((x <= winX) && (x + w >= winX) && (x + w <= winX + winW))
1675         {
1676           left = x + w - winX;
1677           applyInsets = true;
1678         }
1679         else if((x + w >= winX + winW) && (x >= winX) && (x <= winX + winW))
1680         {
1681           right = winX + winW - x;
1682           applyInsets = true;
1683         }
1684       }
1685     }
1686
1687     if(applyInsets)
1688     {
1689       mInsetsChangedSignal.Emit(partType, partState, Extents(left, right, top, bottom));
1690     }
1691   }
1692 }
1693
1694 void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event)
1695 {
1696   Ecore_Wl2_Event_Seat_Keymap_Changed* changed = static_cast<Ecore_Wl2_Event_Seat_Keymap_Changed*>(event);
1697   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::KeymapChanged, keymap id[ %d ]\n", changed->id);
1698   Ecore_Wl2_Input* ecoreWlInput = ecore_wl2_input_default_input_get(changed->display);
1699   if(ecoreWlInput)
1700   {
1701     mKeyMap = ecore_wl2_input_keymap_get(ecoreWlInput);
1702   }
1703 }
1704
1705 void WindowBaseEcoreWl2::OnMoveCompleted(void* event)
1706 {
1707   Ecore_Wl2_Event_Window_Interactive_Move_Done* movedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Move_Done*>(event);
1708   if(movedDoneEvent && movedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
1709   {
1710     Dali::PositionSize orgPositionSize(movedDoneEvent->x, movedDoneEvent->y, movedDoneEvent->w, movedDoneEvent->h);
1711     Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
1712     Dali::Int32Pair    newPosition(newPositionSize.x, newPositionSize.y);
1713     DALI_LOG_RELEASE_INFO("window(%p) has been moved by server[%d, %d]\n", mEcoreWindow, newPositionSize.x, newPositionSize.y);
1714     mMoveCompletedSignal.Emit(newPosition);
1715   }
1716 }
1717
1718 void WindowBaseEcoreWl2::OnResizeCompleted(void* event)
1719 {
1720   Ecore_Wl2_Event_Window_Interactive_Resize_Done* resizedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Resize_Done*>(event);
1721   if(resizedDoneEvent && resizedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
1722   {
1723     Dali::PositionSize orgPositionSize(resizedDoneEvent->x, resizedDoneEvent->y, resizedDoneEvent->w, resizedDoneEvent->h);
1724     Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
1725     Dali::Uint16Pair   newSize(newPositionSize.width, newPositionSize.height);
1726     DALI_LOG_RELEASE_INFO("window(%p) has been resized by server[%d, %d]\n", mEcoreWindow, newPositionSize.width, newPositionSize.height);
1727     mResizeCompletedSignal.Emit(newSize);
1728   }
1729 }
1730
1731 void WindowBaseEcoreWl2::RegistryGlobalCallback(void* data, struct wl_registry* registry, uint32_t name, const char* interface, uint32_t version)
1732 {
1733   if(strcmp(interface, tizen_policy_interface.name) == 0)
1734   {
1735     uint32_t clientVersion = std::min(version, MAX_TIZEN_CLIENT_VERSION);
1736
1737     mTizenPolicy = static_cast<tizen_policy*>(wl_registry_bind(registry, name, &tizen_policy_interface, clientVersion));
1738     if(!mTizenPolicy)
1739     {
1740       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n");
1741       return;
1742     }
1743
1744     tizen_policy_add_listener(mTizenPolicy, &tizenPolicyListener, data);
1745
1746     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_policy_add_listener is called.\n");
1747   }
1748   else if(strcmp(interface, tizen_display_policy_interface.name) == 0)
1749   {
1750     mTizenDisplayPolicy = static_cast<tizen_display_policy*>(wl_registry_bind(registry, name, &tizen_display_policy_interface, version));
1751     if(!mTizenDisplayPolicy)
1752     {
1753       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n");
1754       return;
1755     }
1756
1757     tizen_display_policy_add_listener(mTizenDisplayPolicy, &tizenDisplayPolicyListener, data);
1758
1759     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n");
1760   }
1761 }
1762
1763 void WindowBaseEcoreWl2::RegistryGlobalCallbackRemove(void* data, struct wl_registry* registry, uint32_t id)
1764 {
1765   mTizenPolicy        = NULL;
1766   mTizenDisplayPolicy = NULL;
1767 }
1768
1769 void WindowBaseEcoreWl2::TizenPolicyConformantArea(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
1770 {
1771   int originalX, originalY, originalWidth, originalHeight;
1772   bool changed = false;
1773
1774   if(!surface)
1775   {
1776     DALI_LOG_ERROR("Failed to get wayland surface in WindowBaseEcoreWl2::TizenPolicyConformantArea()\n");
1777     return;
1778   }
1779
1780   if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_INDICATOR)
1781   {
1782     ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
1783     if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
1784     {
1785       ecore_wl2_window_indicator_geometry_set(mEcoreWindow, x, y, w, h);
1786       changed = true;
1787     }
1788
1789     /**
1790      * The given state is based on the visibility value of indicator.
1791      * Thus we need to add 1 to it before comparing with indicator state.
1792      */
1793     Ecore_Wl2_Indicator_State indState =  ecore_wl2_window_indicator_state_get(mEcoreWindow);
1794     if((state + 1) != indState)
1795     {
1796       ecore_wl2_window_indicator_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Indicator_State>(state + 1));
1797       changed = true;
1798     }
1799   }
1800   else if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_KEYBOARD)
1801   {
1802     ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
1803     if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
1804     {
1805       ecore_wl2_window_keyboard_geometry_set(mEcoreWindow, x, y, w, h);
1806       changed = true;
1807     }
1808
1809     /**
1810      * The given state is based on the visibility value of virtual keyboard window.
1811      * Thus we need to add 1 to it before comparing with keyboard state.
1812      */
1813     Ecore_Wl2_Virtual_Keyboard_State kbdState = ecore_wl2_window_keyboard_state_get(mEcoreWindow);
1814     if((state + 1) != (kbdState))
1815     {
1816       ecore_wl2_window_keyboard_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Virtual_Keyboard_State>(state + 1));
1817       changed = true;
1818     }
1819   }
1820   else if(conformantPart == TIZEN_POLICY_CONFORMANT_PART_CLIPBOARD)
1821   {
1822     ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &originalX, &originalY, &originalWidth, &originalHeight);
1823     if((originalX != x) || (originalY != y) || (originalWidth != w) || (originalHeight != h))
1824     {
1825       ecore_wl2_window_clipboard_geometry_set(mEcoreWindow, x, y, w, h);
1826       changed = true;
1827     }
1828
1829     /**
1830      * The given state is based on the visibility value of clipboard window.
1831      * Thus we need to add 1 to it before comparing with clipboard state.
1832      */
1833     Ecore_Wl2_Clipboard_State clipState = ecore_wl2_window_clipboard_state_get(mEcoreWindow);
1834     if((state + 1) != clipState)
1835     {
1836       ecore_wl2_window_clipboard_state_set(mEcoreWindow, static_cast<Ecore_Wl2_Clipboard_State>(state + 1));
1837       changed = true;
1838     }
1839   }
1840
1841   if(changed)
1842   {
1843     Ecore_Wl2_Event_Conformant_Change *ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
1844
1845     if(!ev)
1846     {
1847       return;
1848     }
1849     ev->win = GetNativeWindowId();
1850     ev->part_type = static_cast<Ecore_Wl2_Conformant_Part_Type>(conformantPart);
1851     ev->state = state;
1852     ecore_event_add(ECORE_WL2_EVENT_CONFORMANT_CHANGE, ev, NULL, NULL);
1853   }
1854
1855   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyConformantArea: conformantPart = %u, state = %u, position = (%d, %d), size = (%d, %d)\n", conformantPart, state, x, y, w, h);
1856 }
1857
1858 void WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state)
1859 {
1860   mNotificationLevel           = level;
1861   mNotificationChangeState     = state;
1862   mNotificationLevelChangeDone = true;
1863
1864   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state);
1865 }
1866
1867 void WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state)
1868 {
1869   mScreenOffMode            = mode;
1870   mScreenOffModeChangeState = state;
1871   mScreenOffModeChangeDone  = true;
1872
1873   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state);
1874 }
1875
1876 void WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy* displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state)
1877 {
1878   mBrightness            = brightness;
1879   mBrightnessChangeState = state;
1880   mBrightnessChangeDone  = true;
1881
1882   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state);
1883 }
1884
1885 void WindowBaseEcoreWl2::GetKeyCode(std::string keyName, int32_t& keyCode)
1886 {
1887   xkb_keysym_t sym = XKB_KEY_NoSymbol;
1888   KeyCodeMap   foundKeyCode;
1889
1890   sym = xkb_keysym_from_name(keyName.c_str(), XKB_KEYSYM_NO_FLAGS);
1891   if(sym == XKB_KEY_NoSymbol)
1892   {
1893     DALI_LOG_ERROR("Failed to get keysym in WindowBaseEcoreWl2\n");
1894     return;
1895   }
1896
1897   foundKeyCode.keySym    = sym;
1898   foundKeyCode.isKeyCode = false;
1899   xkb_keymap_key_for_each(mKeyMap, FindKeyCode, &foundKeyCode);
1900   keyCode = static_cast<int32_t>(foundKeyCode.keyCode);
1901 }
1902
1903 Any WindowBaseEcoreWl2::GetNativeWindow()
1904 {
1905   return mEcoreWindow;
1906 }
1907
1908 int WindowBaseEcoreWl2::GetNativeWindowId()
1909 {
1910   return ecore_wl2_window_id_get(mEcoreWindow);
1911 }
1912
1913 std::string WindowBaseEcoreWl2::GetNativeWindowResourceId()
1914 {
1915 #ifdef OVER_TIZEN_VERSION_7
1916   return std::to_string(ecore_wl2_window_resource_id_get(mEcoreWindow));
1917 #else
1918   return std::string();
1919 #endif
1920 }
1921
1922 EGLNativeWindowType WindowBaseEcoreWl2::CreateEglWindow(int width, int height)
1923 {
1924   int totalAngle = (mWindowRotationAngle + mScreenRotationAngle) % 360;
1925
1926   START_DURATION_CHECK();
1927   if(totalAngle == 90 || totalAngle == 270)
1928   {
1929     mEglWindow = wl_egl_window_create(mWlSurface, height, width);
1930   }
1931   else
1932   {
1933     mEglWindow = wl_egl_window_create(mWlSurface, width, height);
1934   }
1935   FINISH_DURATION_CHECK("wl_egl_window_create");
1936
1937   return static_cast<EGLNativeWindowType>(mEglWindow);
1938 }
1939
1940 void WindowBaseEcoreWl2::DestroyEglWindow()
1941 {
1942   if(mEglWindow != NULL)
1943   {
1944     START_DURATION_CHECK();
1945     wl_egl_window_destroy(mEglWindow);
1946     FINISH_DURATION_CHECK("wl_egl_window_destroy");
1947
1948     mEglWindow = NULL;
1949   }
1950 }
1951
1952 void WindowBaseEcoreWl2::SetEglWindowRotation(int angle)
1953 {
1954   wl_egl_window_tizen_rotation rotation;
1955
1956   switch(angle)
1957   {
1958     case 0:
1959     {
1960       rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0;
1961       break;
1962     }
1963     case 90:
1964     {
1965       rotation = WL_EGL_WINDOW_TIZEN_ROTATION_270;
1966       break;
1967     }
1968     case 180:
1969     {
1970       rotation = WL_EGL_WINDOW_TIZEN_ROTATION_180;
1971       break;
1972     }
1973     case 270:
1974     {
1975       rotation = WL_EGL_WINDOW_TIZEN_ROTATION_90;
1976       break;
1977     }
1978     default:
1979     {
1980       rotation = WL_EGL_WINDOW_TIZEN_ROTATION_0;
1981       break;
1982     }
1983   }
1984
1985   START_DURATION_CHECK();
1986   wl_egl_window_tizen_set_rotation(mEglWindow, rotation);
1987   FINISH_DURATION_CHECK("wl_egl_window_tizen_set_rotation");
1988 }
1989
1990 void WindowBaseEcoreWl2::SetEglWindowBufferTransform(int angle)
1991 {
1992   wl_output_transform bufferTransform;
1993
1994   switch(angle)
1995   {
1996     case 0:
1997     {
1998       bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
1999       break;
2000     }
2001     case 90:
2002     {
2003       bufferTransform = WL_OUTPUT_TRANSFORM_90;
2004       break;
2005     }
2006     case 180:
2007     {
2008       bufferTransform = WL_OUTPUT_TRANSFORM_180;
2009       break;
2010     }
2011     case 270:
2012     {
2013       bufferTransform = WL_OUTPUT_TRANSFORM_270;
2014       break;
2015     }
2016     default:
2017     {
2018       bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
2019       break;
2020     }
2021   }
2022
2023   DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_buffer_transform() with buffer Transform [%d]\n", bufferTransform);
2024   START_DURATION_CHECK();
2025   wl_egl_window_tizen_set_buffer_transform(mEglWindow, bufferTransform);
2026   FINISH_DURATION_CHECK("wl_egl_window_tizen_set_buffer_transform");
2027 }
2028
2029 void WindowBaseEcoreWl2::SetEglWindowTransform(int angle)
2030 {
2031   wl_output_transform windowTransform;
2032
2033   switch(angle)
2034   {
2035     case 0:
2036     {
2037       windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
2038       break;
2039     }
2040     case 90:
2041     {
2042       windowTransform = WL_OUTPUT_TRANSFORM_90;
2043       break;
2044     }
2045     case 180:
2046     {
2047       windowTransform = WL_OUTPUT_TRANSFORM_180;
2048       break;
2049     }
2050     case 270:
2051     {
2052       windowTransform = WL_OUTPUT_TRANSFORM_270;
2053       break;
2054     }
2055     default:
2056     {
2057       windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
2058       break;
2059     }
2060   }
2061
2062   DALI_LOG_RELEASE_INFO("wl_egl_window_tizen_set_window_transform() with window Transform [%d]\n", windowTransform);
2063   START_DURATION_CHECK();
2064   wl_egl_window_tizen_set_window_transform(mEglWindow, windowTransform);
2065   FINISH_DURATION_CHECK("wl_egl_window_tizen_set_window_transform");
2066 }
2067
2068 void WindowBaseEcoreWl2::ResizeEglWindow(PositionSize positionSize)
2069 {
2070   DALI_LOG_RELEASE_INFO("wl_egl_window_resize(), (%d, %d) [%d x %d]\n", positionSize.x, positionSize.y, positionSize.width, positionSize.height);
2071   START_DURATION_CHECK();
2072   wl_egl_window_resize(mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y);
2073
2074   // Note: Both "Resize" and "MoveResize" cases can reach here, but only "MoveResize" needs to submit serial number
2075   if(mMoveResizeSerial != mLastSubmittedMoveResizeSerial)
2076   {
2077     wl_egl_window_tizen_set_window_serial(mEglWindow, mMoveResizeSerial);
2078     mLastSubmittedMoveResizeSerial = mMoveResizeSerial;
2079   }
2080   FINISH_DURATION_CHECK("wl_egl_window functions");
2081 }
2082
2083 bool WindowBaseEcoreWl2::IsEglWindowRotationSupported()
2084 {
2085   START_DURATION_CHECK();
2086   // Check capability
2087   wl_egl_window_tizen_capability capability = static_cast<wl_egl_window_tizen_capability>(wl_egl_window_tizen_get_capabilities(mEglWindow));
2088   FINISH_DURATION_CHECK("wl_egl_window_tizen_get_capabilities");
2089
2090   if(capability == WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED)
2091   {
2092     mSupportedPreProtation = true;
2093     return true;
2094   }
2095   mSupportedPreProtation = false;
2096   return false;
2097 }
2098
2099 PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToSystem(PositionSize positionSize)
2100 {
2101   PositionSize newPositionSize;
2102   int32_t      screenWidth, screenHeight;
2103   WindowSystem::GetScreenSize(screenWidth, screenHeight);
2104
2105   if(mWindowRotationAngle == 90)
2106   {
2107     newPositionSize.x      = positionSize.y;
2108     newPositionSize.y      = screenHeight - (positionSize.x + positionSize.width);
2109     newPositionSize.width  = positionSize.height;
2110     newPositionSize.height = positionSize.width;
2111   }
2112   else if(mWindowRotationAngle == 180)
2113   {
2114     newPositionSize.x      = screenWidth - (positionSize.x + positionSize.width);
2115     newPositionSize.y      = screenHeight - (positionSize.y + positionSize.height);
2116     newPositionSize.width  = positionSize.width;
2117     newPositionSize.height = positionSize.height;
2118   }
2119   else if(mWindowRotationAngle == 270)
2120   {
2121     newPositionSize.x      = screenWidth - (positionSize.y + positionSize.height);
2122     newPositionSize.y      = positionSize.x;
2123     newPositionSize.width  = positionSize.height;
2124     newPositionSize.height = positionSize.width;
2125   }
2126   else
2127   {
2128     newPositionSize.x      = positionSize.x;
2129     newPositionSize.y      = positionSize.y;
2130     newPositionSize.width  = positionSize.width;
2131     newPositionSize.height = positionSize.height;
2132   }
2133
2134   return newPositionSize;
2135 }
2136
2137 PositionSize WindowBaseEcoreWl2::RecalculatePositionSizeToCurrentOrientation(PositionSize positionSize)
2138 {
2139   PositionSize newPositionSize;
2140   int32_t      screenWidth, screenHeight;
2141   WindowSystem::GetScreenSize(screenWidth, screenHeight);
2142
2143   if(mWindowRotationAngle == 90)
2144   {
2145     newPositionSize.x      = screenHeight - (positionSize.y + positionSize.height);
2146     newPositionSize.y      = positionSize.x;
2147     newPositionSize.width  = positionSize.height;
2148     newPositionSize.height = positionSize.width;
2149   }
2150   else if(mWindowRotationAngle == 180)
2151   {
2152     newPositionSize.x      = screenWidth - (positionSize.x + positionSize.width);
2153     newPositionSize.y      = screenHeight - (positionSize.y + positionSize.height);
2154     newPositionSize.width  = positionSize.width;
2155     newPositionSize.height = positionSize.height;
2156   }
2157   else if(mWindowRotationAngle == 270)
2158   {
2159     newPositionSize.x      = positionSize.y;
2160     newPositionSize.y      = screenWidth - (positionSize.x + positionSize.width);
2161     newPositionSize.width  = positionSize.height;
2162     newPositionSize.height = positionSize.width;
2163   }
2164   else
2165   {
2166     newPositionSize.x      = positionSize.x;
2167     newPositionSize.y      = positionSize.y;
2168     newPositionSize.width  = positionSize.width;
2169     newPositionSize.height = positionSize.height;
2170   }
2171
2172   return newPositionSize;
2173 }
2174
2175 void WindowBaseEcoreWl2::Move(PositionSize positionSize)
2176 {
2177   PositionSize newPositionSize = RecalculatePositionSizeToSystem(positionSize);
2178
2179   mWindowPositionSize = newPositionSize;
2180   DALI_LOG_RELEASE_INFO("ecore_wl2_window_position_set x[%d], y[%d]\n", newPositionSize.x, newPositionSize.y);
2181   START_DURATION_CHECK();
2182   ecore_wl2_window_position_set(mEcoreWindow, newPositionSize.x, newPositionSize.y);
2183   FINISH_DURATION_CHECK("ecore_wl2_window_position_set");
2184 }
2185
2186 void WindowBaseEcoreWl2::Resize(PositionSize positionSize)
2187 {
2188   PositionSize newPositionSize = RecalculatePositionSizeToSystem(positionSize);
2189
2190   mWindowPositionSize = newPositionSize;
2191   DALI_LOG_RELEASE_INFO("ecore_wl2_window_sync_geometry_set, x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
2192   START_DURATION_CHECK();
2193   ecore_wl2_window_sync_geometry_set(mEcoreWindow, ++mMoveResizeSerial, newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
2194   FINISH_DURATION_CHECK("ecore_wl2_window_sync_geometry_set");
2195 }
2196
2197 void WindowBaseEcoreWl2::MoveResize(PositionSize positionSize)
2198 {
2199   PositionSize newPositionSize = RecalculatePositionSizeToSystem(positionSize);
2200
2201   mWindowPositionSize = newPositionSize;
2202   DALI_LOG_RELEASE_INFO("ecore_wl2_window_sync_geometry_set, x[%d], y[%d], w{%d], h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
2203   START_DURATION_CHECK();
2204   ecore_wl2_window_sync_geometry_set(mEcoreWindow, ++mMoveResizeSerial, newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
2205   FINISH_DURATION_CHECK("ecore_wl2_window_sync_geometry_set");
2206 }
2207
2208 void WindowBaseEcoreWl2::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
2209 {
2210   DALI_LOG_RELEASE_INFO("ecore_wl2_window_layout_set, numCols[%d], numRows[%d], column[%d], row[%d], colSpan[%d], rowSpan[%d]\n", numCols, numRows, column, row, colSpan, rowSpan);
2211   START_DURATION_CHECK();
2212   ecore_wl2_window_layout_set(mEcoreWindow, numCols, numRows, column, row, colSpan, rowSpan);
2213   FINISH_DURATION_CHECK("ecore_wl2_window_layout_set");
2214 }
2215
2216 void WindowBaseEcoreWl2::SetClass(const std::string& name, const std::string& className)
2217 {
2218   ecore_wl2_window_title_set(mEcoreWindow, name.c_str());
2219   ecore_wl2_window_class_set(mEcoreWindow, className.c_str());
2220 }
2221
2222 void WindowBaseEcoreWl2::Raise()
2223 {
2224   START_DURATION_CHECK();
2225   // Use ecore_wl2_window_activate to prevent the window shown without rendering
2226   ecore_wl2_window_activate(mEcoreWindow);
2227   FINISH_DURATION_CHECK("ecore_wl2_window_activate");
2228 }
2229
2230 void WindowBaseEcoreWl2::Lower()
2231 {
2232   START_DURATION_CHECK();
2233   ecore_wl2_window_lower(mEcoreWindow);
2234   FINISH_DURATION_CHECK("ecore_wl2_window_lower");
2235 }
2236
2237 void WindowBaseEcoreWl2::Activate()
2238 {
2239   START_DURATION_CHECK();
2240   ecore_wl2_window_activate(mEcoreWindow);
2241   FINISH_DURATION_CHECK("ecore_wl2_window_activate");
2242 }
2243
2244 void WindowBaseEcoreWl2::Maximize(bool maximize)
2245 {
2246   START_DURATION_CHECK();
2247   ecore_wl2_window_maximized_set(mEcoreWindow, maximize);
2248   FINISH_DURATION_CHECK("ecore_wl2_window_maximized_set");
2249 }
2250
2251 bool WindowBaseEcoreWl2::IsMaximized() const
2252 {
2253   return ecore_wl2_window_maximized_get(mEcoreWindow);
2254 }
2255
2256 void WindowBaseEcoreWl2::SetMaximumSize(Dali::Window::WindowSize size)
2257 {
2258   DALI_LOG_RELEASE_INFO("ecore_wl2_window_maximum_size_set, width: %d, height: %d\n", size.GetWidth(), size.GetHeight());
2259   START_DURATION_CHECK();
2260   ecore_wl2_window_maximum_size_set(mEcoreWindow, size.GetWidth(), size.GetHeight());
2261   FINISH_DURATION_CHECK("ecore_wl2_window_maximum_size_set");
2262   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
2263 }
2264
2265 void WindowBaseEcoreWl2::Minimize(bool minimize)
2266 {
2267   START_DURATION_CHECK();
2268   ecore_wl2_window_iconified_set(mEcoreWindow, minimize);
2269   FINISH_DURATION_CHECK("ecore_wl2_window_iconified_set");
2270 }
2271
2272 bool WindowBaseEcoreWl2::IsMinimized() const
2273 {
2274   return ecore_wl2_window_iconified_get(mEcoreWindow);
2275 }
2276
2277 void WindowBaseEcoreWl2::SetMimimumSize(Dali::Window::WindowSize size)
2278 {
2279   DALI_LOG_RELEASE_INFO("ecore_wl2_window_minimum_size_set, width: %d, height: %d\n", size.GetWidth(), size.GetHeight());
2280   START_DURATION_CHECK();
2281   ecore_wl2_window_minimum_size_set(mEcoreWindow, size.GetWidth(), size.GetHeight());
2282   FINISH_DURATION_CHECK("ecore_wl2_window_minimum_size_set");
2283   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
2284 }
2285
2286 void WindowBaseEcoreWl2::SetAvailableAnlges(const std::vector<int>& angles)
2287 {
2288   int rotations[4] = {0};
2289   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetAvailableAnlges, angle's count: %d, angles\n", angles.size());
2290   for(std::size_t i = 0; i < angles.size(); ++i)
2291   {
2292     rotations[i] = static_cast<int>(angles[i]);
2293     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "%d ", rotations[i]);
2294   }
2295
2296   START_DURATION_CHECK();
2297   ecore_wl2_window_available_rotations_set(mEcoreWindow, rotations, angles.size());
2298   FINISH_DURATION_CHECK("ecore_wl2_window_available_rotations_set");
2299 }
2300
2301 void WindowBaseEcoreWl2::SetPreferredAngle(int angle)
2302 {
2303   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetPreferredAngle, angle: %d\n", angle);
2304   START_DURATION_CHECK();
2305   ecore_wl2_window_preferred_rotation_set(mEcoreWindow, angle);
2306   FINISH_DURATION_CHECK("ecore_wl2_window_preferred_rotation_set");
2307 }
2308
2309 void WindowBaseEcoreWl2::SetAcceptFocus(bool accept)
2310 {
2311   START_DURATION_CHECK();
2312   ecore_wl2_window_focus_skip_set(mEcoreWindow, !accept);
2313   FINISH_DURATION_CHECK("ecore_wl2_window_focus_skip_set");
2314 }
2315
2316 void WindowBaseEcoreWl2::Show()
2317 {
2318   if(!mVisible)
2319   {
2320     START_DURATION_CHECK();
2321     ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
2322     FINISH_DURATION_CHECK("ecore_wl2_window_geometry_set");
2323   }
2324   mVisible = true;
2325
2326   ecore_wl2_window_show(mEcoreWindow);
2327 }
2328
2329 void WindowBaseEcoreWl2::Hide()
2330 {
2331   mVisible = false;
2332   ecore_wl2_window_hide(mEcoreWindow);
2333 }
2334
2335 unsigned int WindowBaseEcoreWl2::GetSupportedAuxiliaryHintCount() const
2336 {
2337   return mSupportedAuxiliaryHints.size();
2338 }
2339
2340 std::string WindowBaseEcoreWl2::GetSupportedAuxiliaryHint(unsigned int index) const
2341 {
2342   if(index >= GetSupportedAuxiliaryHintCount())
2343   {
2344     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index);
2345   }
2346
2347   return mSupportedAuxiliaryHints[index];
2348 }
2349
2350 unsigned int WindowBaseEcoreWl2::AddAuxiliaryHint(const std::string& hint, const std::string& value)
2351 {
2352   bool supported = false;
2353
2354   // Check if the hint is suppported
2355   for(std::vector<std::string>::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter)
2356   {
2357     if(*iter == hint)
2358     {
2359       supported = true;
2360       break;
2361     }
2362   }
2363
2364   if(!supported)
2365   {
2366     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str());
2367     return 0;
2368   }
2369
2370   // Check if the hint is already added
2371   for(unsigned int i = 0; i < mAuxiliaryHints.size(); i++)
2372   {
2373     if(mAuxiliaryHints[i].first == hint)
2374     {
2375       // Just change the value
2376       mAuxiliaryHints[i].second = value;
2377
2378       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1);
2379
2380       return i + 1; // id is index + 1
2381     }
2382   }
2383
2384   // Add the hint
2385   mAuxiliaryHints.push_back(std::pair<std::string, std::string>(hint, value));
2386
2387   unsigned int id = mAuxiliaryHints.size();
2388
2389   START_DURATION_CHECK();
2390   ecore_wl2_window_aux_hint_add(mEcoreWindow, static_cast<int>(id), hint.c_str(), value.c_str());
2391   FINISH_DURATION_CHECK("ecore_wl2_window_aux_hint_add");
2392
2393   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id);
2394
2395   return id;
2396 }
2397
2398 bool WindowBaseEcoreWl2::RemoveAuxiliaryHint(unsigned int id)
2399 {
2400   if(id == 0 || id > mAuxiliaryHints.size())
2401   {
2402     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: Invalid id [%d]\n", id);
2403     return false;
2404   }
2405
2406   mAuxiliaryHints[id - 1].second = std::string();
2407
2408   START_DURATION_CHECK();
2409   ecore_wl2_window_aux_hint_del(mEcoreWindow, static_cast<int>(id));
2410   FINISH_DURATION_CHECK("ecore_wl2_window_aux_hint_del");
2411
2412   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str());
2413
2414   return true;
2415 }
2416
2417 bool WindowBaseEcoreWl2::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
2418 {
2419   if(id == 0 || id > mAuxiliaryHints.size())
2420   {
2421     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: Invalid id [%d]\n", id);
2422     return false;
2423   }
2424
2425   mAuxiliaryHints[id - 1].second = value;
2426
2427   START_DURATION_CHECK();
2428   ecore_wl2_window_aux_hint_change(mEcoreWindow, static_cast<int>(id), value.c_str());
2429   FINISH_DURATION_CHECK("ecore_wl2_window_aux_hint_change");
2430
2431   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str());
2432
2433   return true;
2434 }
2435
2436 std::string WindowBaseEcoreWl2::GetAuxiliaryHintValue(unsigned int id) const
2437 {
2438   if(id == 0 || id > mAuxiliaryHints.size())
2439   {
2440     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: Invalid id [%d]\n", id);
2441     return std::string();
2442   }
2443
2444   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str());
2445
2446   return mAuxiliaryHints[id - 1].second;
2447 }
2448
2449 unsigned int WindowBaseEcoreWl2::GetAuxiliaryHintId(const std::string& hint) const
2450 {
2451   for(unsigned int i = 0; i < mAuxiliaryHints.size(); i++)
2452   {
2453     if(mAuxiliaryHints[i].first == hint)
2454     {
2455       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1);
2456       return i + 1;
2457     }
2458   }
2459
2460   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str());
2461
2462   return 0;
2463 }
2464
2465 void WindowBaseEcoreWl2::SetInputRegion(const Rect<int>& inputRegion)
2466 {
2467   Rect<int> convertRegion = RecalculatePositionSizeToSystem(inputRegion);
2468
2469   Eina_Rectangle rect;
2470   rect.x = convertRegion.x;
2471   rect.y = convertRegion.y;
2472   rect.w = convertRegion.width;
2473   rect.h = convertRegion.height;
2474
2475   DALI_LOG_RELEASE_INFO("%p, Set input rect (%d, %d, %d x %d)\n", mEcoreWindow, rect.x, rect.y, rect.w, rect.h);
2476   START_DURATION_CHECK();
2477   ecore_wl2_window_input_rect_set(mEcoreWindow, &rect);
2478   FINISH_DURATION_CHECK("ecore_wl2_window_input_rect_set");
2479   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
2480 }
2481
2482 void WindowBaseEcoreWl2::SetType(Dali::WindowType type)
2483 {
2484   if(mType != type)
2485   {
2486     mType = type;
2487     Ecore_Wl2_Window_Type windowType;
2488
2489     switch(type)
2490     {
2491       case Dali::WindowType::NORMAL:
2492       {
2493         windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
2494         break;
2495       }
2496       case Dali::WindowType::NOTIFICATION:
2497       {
2498         windowType = ECORE_WL2_WINDOW_TYPE_NOTIFICATION;
2499         break;
2500       }
2501       case Dali::WindowType::UTILITY:
2502       {
2503         windowType = ECORE_WL2_WINDOW_TYPE_UTILITY;
2504         break;
2505       }
2506       case Dali::WindowType::DIALOG:
2507       {
2508         windowType = ECORE_WL2_WINDOW_TYPE_DIALOG;
2509         break;
2510       }
2511       case Dali::WindowType::IME:
2512       {
2513         windowType = ECORE_WL2_WINDOW_TYPE_NONE;
2514         break;
2515       }
2516       case Dali::WindowType::DESKTOP:
2517       {
2518         windowType = ECORE_WL2_WINDOW_TYPE_DESKTOP;
2519         break;
2520       }
2521       default:
2522       {
2523         windowType = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
2524         break;
2525       }
2526     }
2527
2528     START_DURATION_CHECK();
2529     ecore_wl2_window_type_set(mEcoreWindow, windowType);
2530     FINISH_DURATION_CHECK("ecore_wl2_window_type_set");
2531   }
2532 }
2533
2534 Dali::WindowType WindowBaseEcoreWl2::GetType() const
2535 {
2536   return mType;
2537 }
2538
2539 Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
2540 {
2541   START_DURATION_CHECK();
2542   while(!mTizenPolicy)
2543   {
2544     wl_display_dispatch_queue(mDisplay, mEventQueue);
2545   }
2546
2547   int notificationLevel;
2548
2549   switch(level)
2550   {
2551     case Dali::WindowNotificationLevel::NONE:
2552     {
2553       notificationLevel = TIZEN_POLICY_LEVEL_NONE;
2554       break;
2555     }
2556     case Dali::WindowNotificationLevel::BASE:
2557     {
2558       notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
2559       break;
2560     }
2561     case Dali::WindowNotificationLevel::MEDIUM:
2562     {
2563       notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
2564       break;
2565     }
2566     case Dali::WindowNotificationLevel::HIGH:
2567     {
2568       notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
2569       break;
2570     }
2571     case Dali::WindowNotificationLevel::TOP:
2572     {
2573       notificationLevel = TIZEN_POLICY_LEVEL_TOP;
2574       break;
2575     }
2576     default:
2577     {
2578       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: invalid level [%d]\n", level);
2579       notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
2580       break;
2581     }
2582   }
2583
2584   mNotificationLevelChangeDone = false;
2585   mNotificationChangeState     = TIZEN_POLICY_ERROR_STATE_NONE;
2586
2587   tizen_policy_set_notification_level(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), notificationLevel);
2588
2589   int count = 0;
2590
2591   while(!mNotificationLevelChangeDone && count < 3)
2592   {
2593     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2594     wl_display_dispatch_queue(mDisplay, mEventQueue);
2595     count++;
2596   }
2597   FINISH_DURATION_CHECK("ecore_wl2 & wl_display");
2598
2599   if(!mNotificationLevelChangeDone)
2600   {
2601     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
2602     return Dali::WindowOperationResult::UNKNOWN_ERROR;
2603   }
2604   else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
2605   {
2606     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level);
2607     return Dali::WindowOperationResult::PERMISSION_DENIED;
2608   }
2609
2610   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel);
2611
2612   return Dali::WindowOperationResult::SUCCEED;
2613 }
2614
2615 Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const
2616 {
2617   while(!mTizenPolicy)
2618   {
2619     wl_display_dispatch_queue(mDisplay, mEventQueue);
2620   }
2621
2622   int count = 0;
2623
2624   while(!mNotificationLevelChangeDone && count < 3)
2625   {
2626     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2627     wl_display_dispatch_queue(mDisplay, mEventQueue);
2628     count++;
2629   }
2630
2631   if(!mNotificationLevelChangeDone)
2632   {
2633     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: Error! [%d]\n", mNotificationChangeState);
2634     return Dali::WindowNotificationLevel::NONE;
2635   }
2636
2637   Dali::WindowNotificationLevel level;
2638
2639   switch(mNotificationLevel)
2640   {
2641     case TIZEN_POLICY_LEVEL_NONE:
2642     {
2643       level = Dali::WindowNotificationLevel::NONE;
2644       break;
2645     }
2646     case TIZEN_POLICY_LEVEL_DEFAULT:
2647     {
2648       level = Dali::WindowNotificationLevel::BASE;
2649       break;
2650     }
2651     case TIZEN_POLICY_LEVEL_MEDIUM:
2652     {
2653       level = Dali::WindowNotificationLevel::MEDIUM;
2654       break;
2655     }
2656     case TIZEN_POLICY_LEVEL_HIGH:
2657     {
2658       level = Dali::WindowNotificationLevel::HIGH;
2659       break;
2660     }
2661     case TIZEN_POLICY_LEVEL_TOP:
2662     {
2663       level = Dali::WindowNotificationLevel::TOP;
2664       break;
2665     }
2666     default:
2667     {
2668       DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel);
2669       level = Dali::WindowNotificationLevel::NONE;
2670       break;
2671     }
2672   }
2673
2674   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetNotificationLevel: level [%d]\n", mNotificationLevel);
2675
2676   return level;
2677 }
2678
2679 void WindowBaseEcoreWl2::SetOpaqueState(bool opaque)
2680 {
2681   while(!mTizenPolicy)
2682   {
2683     wl_display_dispatch_queue(mDisplay, mEventQueue);
2684   }
2685
2686   tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), (opaque ? 1 : 0));
2687 }
2688
2689 Dali::WindowOperationResult WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
2690 {
2691   while(!mTizenPolicy)
2692   {
2693     wl_display_dispatch_queue(mDisplay, mEventQueue);
2694   }
2695
2696   mScreenOffModeChangeDone  = false;
2697   mScreenOffModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
2698
2699   unsigned int mode = 0;
2700
2701   switch(screenOffMode)
2702   {
2703     case WindowScreenOffMode::TIMEOUT:
2704     {
2705       mode = 0;
2706       break;
2707     }
2708     case WindowScreenOffMode::NEVER:
2709     {
2710       mode = 1;
2711       break;
2712     }
2713   }
2714
2715   tizen_policy_set_window_screen_mode(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), mode);
2716
2717   int count = 0;
2718
2719   while(!mScreenOffModeChangeDone && count < 3)
2720   {
2721     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2722     wl_display_dispatch_queue(mDisplay, mEventQueue);
2723     count++;
2724   }
2725
2726   if(!mScreenOffModeChangeDone)
2727   {
2728     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState);
2729     return Dali::WindowOperationResult::UNKNOWN_ERROR;
2730   }
2731   else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
2732   {
2733     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode);
2734     return Dali::WindowOperationResult::PERMISSION_DENIED;
2735   }
2736
2737   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode);
2738
2739   return Dali::WindowOperationResult::SUCCEED;
2740 }
2741
2742 WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
2743 {
2744   while(!mTizenPolicy)
2745   {
2746     wl_display_dispatch_queue(mDisplay, mEventQueue);
2747   }
2748
2749   int count = 0;
2750
2751   while(!mScreenOffModeChangeDone && count < 3)
2752   {
2753     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2754     wl_display_dispatch_queue(mDisplay, mEventQueue);
2755     count++;
2756   }
2757
2758   if(!mScreenOffModeChangeDone)
2759   {
2760     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState);
2761     return WindowScreenOffMode::TIMEOUT;
2762   }
2763
2764   WindowScreenOffMode screenMode = WindowScreenOffMode::TIMEOUT;
2765
2766   switch(mScreenOffMode)
2767   {
2768     case 0:
2769     {
2770       screenMode = WindowScreenOffMode::TIMEOUT;
2771       break;
2772     }
2773     case 1:
2774     {
2775       screenMode = WindowScreenOffMode::NEVER;
2776       break;
2777     }
2778   }
2779
2780   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetScreenOffMode: screen mode [%d]\n", mScreenOffMode);
2781
2782   return screenMode;
2783 }
2784
2785 Dali::WindowOperationResult WindowBaseEcoreWl2::SetBrightness(int brightness)
2786 {
2787   START_DURATION_CHECK();
2788   while(!mTizenDisplayPolicy)
2789   {
2790     wl_display_dispatch_queue(mDisplay, mEventQueue);
2791   }
2792
2793   mBrightnessChangeDone  = false;
2794   mBrightnessChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
2795
2796   tizen_display_policy_set_window_brightness(mTizenDisplayPolicy, ecore_wl2_window_surface_get(mEcoreWindow), brightness);
2797
2798   int count = 0;
2799
2800   while(!mBrightnessChangeDone && count < 3)
2801   {
2802     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2803     wl_display_dispatch_queue(mDisplay, mEventQueue);
2804     count++;
2805   }
2806   FINISH_DURATION_CHECK("ecore_wl2_display_flush");
2807
2808   if(!mBrightnessChangeDone)
2809   {
2810     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState);
2811     return Dali::WindowOperationResult::UNKNOWN_ERROR;
2812   }
2813   else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
2814   {
2815     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness);
2816     return Dali::WindowOperationResult::PERMISSION_DENIED;
2817   }
2818
2819   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness);
2820
2821   return Dali::WindowOperationResult::SUCCEED;
2822 }
2823
2824 int WindowBaseEcoreWl2::GetBrightness() const
2825 {
2826   START_DURATION_CHECK();
2827   while(!mTizenDisplayPolicy)
2828   {
2829     wl_display_dispatch_queue(mDisplay, mEventQueue);
2830   }
2831
2832   int count = 0;
2833
2834   while(!mBrightnessChangeDone && count < 3)
2835   {
2836     ecore_wl2_display_flush(ecore_wl2_connected_display_get(NULL));
2837     wl_display_dispatch_queue(mDisplay, mEventQueue);
2838     count++;
2839   }
2840   FINISH_DURATION_CHECK("ecore_wl2_display_flush");
2841
2842   if(!mBrightnessChangeDone)
2843   {
2844     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Error! [%d]\n", mBrightnessChangeState);
2845     return 0;
2846   }
2847
2848   DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::GetBrightness: Brightness [%d]\n", mBrightness);
2849
2850   return mBrightness;
2851 }
2852
2853 bool WindowBaseEcoreWl2::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
2854 {
2855   Ecore_Wl2_Window_Keygrab_Mode mode;
2856
2857   switch(grabMode)
2858   {
2859     case KeyGrab::TOPMOST:
2860     {
2861       mode = ECORE_WL2_WINDOW_KEYGRAB_TOPMOST;
2862       break;
2863     }
2864     case KeyGrab::SHARED:
2865     {
2866       mode = ECORE_WL2_WINDOW_KEYGRAB_SHARED;
2867       break;
2868     }
2869     case KeyGrab::OVERRIDE_EXCLUSIVE:
2870     {
2871       mode = ECORE_WL2_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
2872       break;
2873     }
2874     case KeyGrab::EXCLUSIVE:
2875     {
2876       mode = ECORE_WL2_WINDOW_KEYGRAB_EXCLUSIVE;
2877       break;
2878     }
2879     default:
2880     {
2881       return false;
2882     }
2883   }
2884
2885   return ecore_wl2_window_keygrab_set(mEcoreWindow, KeyLookup::GetKeyName(key), 0, 0, 0, mode);
2886 }
2887
2888 bool WindowBaseEcoreWl2::UngrabKey(Dali::KEY key)
2889 {
2890   return ecore_wl2_window_keygrab_unset(mEcoreWindow, KeyLookup::GetKeyName(key), 0, 0);
2891 }
2892
2893 bool WindowBaseEcoreWl2::GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result)
2894 {
2895   int keyCount         = key.Count();
2896   int keyGrabModeCount = grabMode.Count();
2897
2898   if(keyCount != keyGrabModeCount || keyCount == 0)
2899   {
2900     return false;
2901   }
2902
2903   eina_init();
2904
2905   Eina_List*                     keyList = NULL;
2906   Ecore_Wl2_Window_Keygrab_Info* info    = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
2907
2908   for(int index = 0; index < keyCount; ++index)
2909   {
2910     info[index].key = const_cast<char*>(KeyLookup::GetKeyName(key[index]));
2911
2912     switch(grabMode[index])
2913     {
2914       case KeyGrab::TOPMOST:
2915       {
2916         info[index].mode = ECORE_WL2_WINDOW_KEYGRAB_TOPMOST;
2917         break;
2918       }
2919       case KeyGrab::SHARED:
2920       {
2921         info[index].mode = ECORE_WL2_WINDOW_KEYGRAB_SHARED;
2922         break;
2923       }
2924       case KeyGrab::OVERRIDE_EXCLUSIVE:
2925       {
2926         info[index].mode = ECORE_WL2_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
2927         break;
2928       }
2929       case KeyGrab::EXCLUSIVE:
2930       {
2931         info[index].mode = ECORE_WL2_WINDOW_KEYGRAB_EXCLUSIVE;
2932         break;
2933       }
2934       default:
2935       {
2936         info[index].mode = ECORE_WL2_WINDOW_KEYGRAB_UNKNOWN;
2937         break;
2938       }
2939     }
2940
2941     keyList = eina_list_append(keyList, &info);
2942   }
2943
2944   START_DURATION_CHECK();
2945   Eina_List* grabList = ecore_wl2_window_keygrab_list_set(mEcoreWindow, keyList);
2946   FINISH_DURATION_CHECK("ecore_wl2_window_keygrab_list_set");
2947
2948   result.Resize(keyCount, true);
2949
2950   Eina_List* l        = NULL;
2951   Eina_List* m        = NULL;
2952   void*      listData = NULL;
2953   void*      data     = NULL;
2954   if(grabList != NULL)
2955   {
2956     EINA_LIST_FOREACH(grabList, m, data)
2957     {
2958       int index = 0;
2959       EINA_LIST_FOREACH(keyList, l, listData)
2960       {
2961         if(static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key == NULL)
2962         {
2963           DALI_LOG_ERROR("input key list has null data!");
2964           break;
2965         }
2966
2967         if(strcmp(static_cast<char*>(data), static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key) == 0)
2968         {
2969           result[index] = false;
2970         }
2971         ++index;
2972       }
2973     }
2974   }
2975
2976   delete[] info;
2977
2978   eina_list_free(keyList);
2979   eina_list_free(grabList);
2980   eina_shutdown();
2981
2982   return true;
2983 }
2984
2985 bool WindowBaseEcoreWl2::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result)
2986 {
2987   int keyCount = key.Count();
2988   if(keyCount == 0)
2989   {
2990     return false;
2991   }
2992
2993   eina_init();
2994
2995   Eina_List*                     keyList = NULL;
2996   Ecore_Wl2_Window_Keygrab_Info* info    = new Ecore_Wl2_Window_Keygrab_Info[keyCount];
2997
2998   for(int index = 0; index < keyCount; ++index)
2999   {
3000     info[index].key = const_cast<char*>(KeyLookup::GetKeyName(key[index]));
3001     keyList         = eina_list_append(keyList, &info);
3002   }
3003
3004   START_DURATION_CHECK();
3005   Eina_List* ungrabList = ecore_wl2_window_keygrab_list_unset(mEcoreWindow, keyList);
3006   FINISH_DURATION_CHECK("ecore_wl2_window_keygrab_list_unset");
3007
3008   result.Resize(keyCount, true);
3009
3010   Eina_List* l        = NULL;
3011   Eina_List* m        = NULL;
3012   void*      listData = NULL;
3013   void*      data     = NULL;
3014
3015   if(ungrabList != NULL)
3016   {
3017     EINA_LIST_FOREACH(ungrabList, m, data)
3018     {
3019       int index = 0;
3020       EINA_LIST_FOREACH(keyList, l, listData)
3021       {
3022         if(strcmp(static_cast<char*>(data), static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key) == 0)
3023         {
3024           result[index] = false;
3025         }
3026         ++index;
3027       }
3028     }
3029   }
3030
3031   delete[] info;
3032
3033   eina_list_free(keyList);
3034   eina_list_free(ungrabList);
3035   eina_shutdown();
3036
3037   return true;
3038 }
3039
3040 void WindowBaseEcoreWl2::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
3041 {
3042   // calculate DPI
3043   float xres, yres;
3044
3045   Ecore_Wl2_Output* output = ecore_wl2_window_output_find(mEcoreWindow);
3046
3047   // 1 inch = 25.4 millimeters
3048   xres = ecore_wl2_output_dpi_get(output);
3049   yres = ecore_wl2_output_dpi_get(output);
3050
3051   dpiHorizontal = int(xres + 0.5f); // rounding
3052   dpiVertical   = int(yres + 0.5f);
3053 }
3054
3055 int WindowBaseEcoreWl2::GetWindowRotationAngle() const
3056 {
3057   int orientation = mWindowRotationAngle;
3058   if(mSupportedPreProtation)
3059   {
3060     orientation = 0;
3061   }
3062   return orientation;
3063 }
3064
3065 int WindowBaseEcoreWl2::GetScreenRotationAngle()
3066 {
3067   if(mSupportedPreProtation)
3068   {
3069     DALI_LOG_RELEASE_INFO("Support PreRotation and return 0\n");
3070     return 0;
3071   }
3072   int transform;
3073   if(ecore_wl2_window_ignore_output_transform_get(mEcoreWindow))
3074   {
3075     transform = 0;
3076   }
3077   else
3078   {
3079     transform = ecore_wl2_output_transform_get(ecore_wl2_window_output_find(mEcoreWindow));
3080   }
3081   mScreenRotationAngle = transform * 90;
3082   return mScreenRotationAngle;
3083 }
3084
3085 void WindowBaseEcoreWl2::SetWindowRotationAngle(int degree)
3086 {
3087   mWindowRotationAngle = degree;
3088   ecore_wl2_window_rotation_set(mEcoreWindow, degree);
3089 }
3090
3091 void WindowBaseEcoreWl2::WindowRotationCompleted(int degree, int width, int height)
3092 {
3093   START_DURATION_CHECK();
3094   ecore_wl2_window_rotation_change_done_send(mEcoreWindow, degree, width, height);
3095   FINISH_DURATION_CHECK("ecore_wl2_window_rotation_change_done_send");
3096 }
3097
3098 void WindowBaseEcoreWl2::SetTransparency(bool transparent)
3099 {
3100   START_DURATION_CHECK();
3101   ecore_wl2_window_alpha_set(mEcoreWindow, transparent);
3102   FINISH_DURATION_CHECK("ecore_wl2_window_alpha_set");
3103 }
3104
3105 void WindowBaseEcoreWl2::CreateWindow(PositionSize positionSize)
3106 {
3107   Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL);
3108   if(!display)
3109   {
3110     DALI_ASSERT_ALWAYS(0 && "Failed to get display");
3111   }
3112
3113   START_DURATION_CHECK();
3114   ecore_wl2_display_sync(display);
3115
3116   mEcoreWindow = ecore_wl2_window_new(display, NULL, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
3117
3118   if(mEcoreWindow == 0)
3119   {
3120     DALI_ASSERT_ALWAYS(0 && "Failed to create Wayland window");
3121   }
3122
3123   // Set default type
3124   ecore_wl2_window_type_set(mEcoreWindow, ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
3125   FINISH_DURATION_CHECK("ecore_wl2 functions");
3126 }
3127
3128 void WindowBaseEcoreWl2::SetParent(WindowBase* parentWinBase, bool belowParent)
3129 {
3130   Ecore_Wl2_Window* ecoreParent = NULL;
3131   if(parentWinBase)
3132   {
3133     WindowBaseEcoreWl2* winBaseEcore2 = static_cast<WindowBaseEcoreWl2*>(parentWinBase);
3134     ecoreParent                       = winBaseEcore2->mEcoreWindow;
3135   }
3136
3137   START_DURATION_CHECK();
3138   ecore_wl2_window_transient_parent_set(mEcoreWindow, ecoreParent, belowParent);
3139   FINISH_DURATION_CHECK("ecore_wl2_window_transient_parent_set");
3140 }
3141
3142 int WindowBaseEcoreWl2::CreateFrameRenderedSyncFence()
3143 {
3144   return wl_egl_window_tizen_create_commit_sync_fd(mEglWindow);
3145 }
3146
3147 int WindowBaseEcoreWl2::CreateFramePresentedSyncFence()
3148 {
3149   return wl_egl_window_tizen_create_presentation_sync_fd(mEglWindow);
3150 }
3151
3152 void WindowBaseEcoreWl2::SetPositionSizeWithAngle(PositionSize positionSize, int angle)
3153 {
3154   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::SetPositionSizeWithAngle, angle: %d, x: %d, y: %d, w: %d, h: %d\n", angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
3155   START_DURATION_CHECK();
3156   ecore_wl2_window_rotation_geometry_set(mEcoreWindow, angle, positionSize.x, positionSize.y, positionSize.width, positionSize.height);
3157   FINISH_DURATION_CHECK("ecore_wl2_window_rotation_geometry_set");
3158 }
3159
3160 void WindowBaseEcoreWl2::InitializeIme()
3161 {
3162   Eina_Iterator*      globals;
3163   struct wl_registry* registry;
3164   Ecore_Wl2_Global*   global;
3165   Ecore_Wl2_Display*  ecoreWl2Display;
3166
3167   if(!(ecoreWl2Display = ecore_wl2_connected_display_get(NULL)))
3168   {
3169     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 connected display\n");
3170     return;
3171   }
3172
3173   DALI_LOG_RELEASE_INFO("InitializeIme:  Ecore_Wl2_Display: %p, ecore wl window: %p\n", ecoreWl2Display, mEcoreWindow);
3174
3175   if(!(registry = ecore_wl2_display_registry_get(ecoreWl2Display)))
3176   {
3177     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 display registry\n");
3178     return;
3179   }
3180
3181   if(!(globals = ecore_wl2_display_globals_get(ecoreWl2Display)))
3182   {
3183     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get ecore_wl2 globals\n");
3184     return;
3185   }
3186
3187   START_DURATION_CHECK();
3188   EINA_ITERATOR_FOREACH(globals, global)
3189   {
3190 #ifdef OVER_TIZEN_VERSION_7
3191     if(strcmp(global->interface, "zwp_input_panel_v1") == 0)
3192     {
3193       mWlInputPanel = (zwp_input_panel_v1*)wl_registry_bind(registry, global->id, &zwp_input_panel_v1_interface, 1);
3194     }
3195 #else
3196     if(strcmp(global->interface, "wl_input_panel") == 0)
3197     {
3198       mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
3199     }
3200 #endif
3201     else if(strcmp(global->interface, "wl_output") == 0)
3202     {
3203       mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
3204     }
3205   }
3206
3207   if(!mWlInputPanel)
3208   {
3209     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel interface\n");
3210     return;
3211   }
3212
3213   if(!mWlOutput)
3214   {
3215     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
3216     return;
3217   }
3218 #ifdef OVER_TIZEN_VERSION_7
3219   mWlInputPanelSurface = zwp_input_panel_v1_get_input_panel_surface(mWlInputPanel, mWlSurface);
3220 #else
3221   mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
3222 #endif
3223   if(!mWlInputPanelSurface)
3224   {
3225     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
3226     return;
3227   }
3228 #ifdef OVER_TIZEN_VERSION_7
3229   zwp_input_panel_surface_v1_set_toplevel(mWlInputPanelSurface, mWlOutput, ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM);
3230 #else
3231   wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
3232 #endif
3233   FINISH_DURATION_CHECK("zwp_input_panel_surface_v1_set_toplevel");
3234 }
3235
3236 void WindowBaseEcoreWl2::ImeWindowReadyToRender()
3237 {
3238   if(!mWlInputPanelSurface)
3239   {
3240     DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
3241     return;
3242   }
3243
3244   START_DURATION_CHECK();
3245 #ifdef OVER_TIZEN_VERSION_7
3246   zwp_input_panel_surface_v1_set_ready(mWlInputPanelSurface, 1);
3247 #else
3248   wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
3249 #endif
3250   FINISH_DURATION_CHECK("zwp_input_panel_surface_v1_set_ready");
3251 }
3252
3253 void WindowBaseEcoreWl2::RequestMoveToServer()
3254 {
3255   Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
3256   if(!display)
3257   {
3258     DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get ecore_wl2_display\n");
3259     return;
3260   }
3261
3262   Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
3263   if(!input)
3264   {
3265     DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestMoveToServer, Fail to get default Ecore_Wl2_Input\n");
3266     return;
3267   }
3268
3269   START_DURATION_CHECK();
3270   ecore_wl2_window_move(mEcoreWindow, input);
3271   FINISH_DURATION_CHECK("ecore_wl2_window_move");
3272   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestMoveToServer, starts the window[%p] is moved by server\n", mEcoreWindow);
3273 }
3274
3275 void WindowBaseEcoreWl2::RequestResizeToServer(WindowResizeDirection direction)
3276 {
3277   Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(NULL);
3278   if(!display)
3279   {
3280     DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get ecore_wl2_display\n");
3281     return;
3282   }
3283
3284   Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(display);
3285   if(!input)
3286   {
3287     DALI_LOG_ERROR("WindowBaseEcoreWl2::RequestResizeToServer, Fail to get default Ecore_Wl2_Input\n");
3288     return;
3289   }
3290
3291   ResizeLocation location = RecalculateLocationToCurrentOrientation(direction, mWindowRotationAngle);
3292
3293   START_DURATION_CHECK();
3294   ecore_wl2_window_resize(mEcoreWindow, input, static_cast<int>(location));
3295   FINISH_DURATION_CHECK("ecore_wl2_window_resize");
3296   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::RequestResizeToServer, starts the window[%p] is resized by server, direction:%d oriention:%d mode:%d\n", mEcoreWindow, direction, mWindowRotationAngle, location);
3297 }
3298
3299 void WindowBaseEcoreWl2::EnableFloatingMode(bool enable)
3300 {
3301   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::EnableFloatingMode, floating mode flag: [%p], enable [%d]\n", mEcoreWindow, enable);
3302   START_DURATION_CHECK();
3303   if(enable == true)
3304   {
3305     ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_TRUE);
3306   }
3307   else
3308   {
3309     ecore_wl2_window_floating_mode_set(mEcoreWindow, EINA_FALSE);
3310   }
3311   FINISH_DURATION_CHECK("ecore_wl2_window_floating_mode_set");
3312 }
3313
3314 bool WindowBaseEcoreWl2::IsFloatingModeEnabled() const
3315 {
3316   return ecore_wl2_window_floating_mode_get(mEcoreWindow);
3317 }
3318
3319 void WindowBaseEcoreWl2::IncludeInputRegion(const Rect<int>& inputRegion)
3320 {
3321   Rect<int>      convertRegion = RecalculatePositionSizeToSystem(inputRegion);
3322   Eina_Rectangle rect;
3323
3324   rect.x = convertRegion.x;
3325   rect.y = convertRegion.y;
3326   rect.w = convertRegion.width;
3327   rect.h = convertRegion.height;
3328
3329   DALI_LOG_RELEASE_INFO("%p, Add input_rect(%d, %d, %d x %d)\n", mEcoreWindow, rect.x, rect.y, rect.w, rect.h);
3330   START_DURATION_CHECK();
3331   ecore_wl2_window_input_rect_add(mEcoreWindow, &rect);
3332   FINISH_DURATION_CHECK("ecore_wl2_window_input_rect_add");
3333   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
3334 }
3335
3336 void WindowBaseEcoreWl2::ExcludeInputRegion(const Rect<int>& inputRegion)
3337 {
3338   Rect<int>      convertRegion = RecalculatePositionSizeToSystem(inputRegion);
3339   Eina_Rectangle rect;
3340
3341   rect.x = convertRegion.x;
3342   rect.y = convertRegion.y;
3343   rect.w = convertRegion.width;
3344   rect.h = convertRegion.height;
3345
3346   DALI_LOG_RELEASE_INFO("%p, Subtract input_rect(%d, %d, %d x %d)\n", mEcoreWindow, rect.x, rect.y, rect.w, rect.h);
3347   START_DURATION_CHECK();
3348   ecore_wl2_window_input_rect_subtract(mEcoreWindow, &rect);
3349   FINISH_DURATION_CHECK("ecore_wl2_window_input_rect_subtract");
3350   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
3351 }
3352
3353 } // namespace Adaptor
3354
3355 } // namespace Internal
3356
3357 } // namespace Dali
3358
3359 #pragma GCC diagnostic pop