Merge "AsyncTaskManager overhead reduce" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.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 // CLASS HEADER
19 #include <dali/internal/window-system/common/window-impl.h>
20
21 // EXTERNAL HEADERS
22 #include <dali/devel-api/adaptor-framework/orientation.h>
23 #include <dali/devel-api/events/key-event-devel.h>
24 #include <dali/integration-api/core.h>
25 #include <dali/integration-api/events/touch-event-integ.h>
26 #include <dali/integration-api/events/touch-integ.h>
27 #include <dali/public-api/actors/actor.h>
28 #include <dali/public-api/actors/camera-actor.h>
29 #include <dali/public-api/actors/layer.h>
30 #include <dali/public-api/adaptor-framework/window-enumerations.h>
31 #include <dali/public-api/render-tasks/render-task-list.h>
32 #include <dali/public-api/render-tasks/render-task.h>
33 #include <dali/public-api/rendering/frame-buffer.h>
34 #include <thread>
35
36 // INTERNAL HEADERS
37 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
38 #include <dali/devel-api/atspi-interfaces/accessible.h>
39 #include <dali/integration-api/adaptor-framework/render-surface-interface.h>
40 #include <dali/internal/graphics/gles/egl-graphics.h>
41 #include <dali/internal/window-system/common/event-handler.h>
42 #include <dali/internal/window-system/common/orientation-impl.h>
43 #include <dali/internal/window-system/common/render-surface-factory.h>
44 #include <dali/internal/window-system/common/window-base.h>
45 #include <dali/internal/window-system/common/window-factory.h>
46 #include <dali/internal/window-system/common/window-render-surface.h>
47 #include <dali/internal/window-system/common/window-system.h>
48 #include <dali/internal/window-system/common/window-visibility-observer.h>
49
50 namespace Dali
51 {
52 namespace Internal
53 {
54 namespace Adaptor
55 {
56 namespace
57 {
58 #if defined(DEBUG_ENABLED)
59 Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
60 #endif
61 } // unnamed namespace
62
63 Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
64 {
65   Any surface;
66   return Window::New(surface, positionSize, name, className, type, isTransparent);
67 }
68
69 Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
70 {
71   Window* window         = new Window();
72   window->mIsTransparent = isTransparent;
73   window->Initialize(surface, positionSize, name, className, type);
74   return window;
75 }
76
77 Window::Window()
78 : mWindowSurface(nullptr),
79   mWindowBase(),
80   mParentWindow(NULL),
81   mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
82   mRotationAngle(0),
83   mWindowWidth(0),
84   mWindowHeight(0),
85   mNativeWindowId(-1),
86   mOrientationMode(Internal::Adaptor::Window::OrientationMode::PORTRAIT),
87   mDeleteRequestSignal(),
88   mFocusChangeSignal(),
89   mResizeSignal(),
90   mVisibilityChangedSignal(),
91   mTransitionEffectEventSignal(),
92   mKeyboardRepeatSettingsChangedSignal(),
93   mAuxiliaryMessageSignal(),
94   mMovedSignal(),
95   mOrientationChangedSignal(),
96   mLastKeyEvent(),
97   mLastTouchEvent(),
98   mIsTransparent(false),
99   mIsFocusAcceptable(true),
100   mIconified(false),
101   mMaximized(false),
102   mOpaqueState(false),
103   mWindowRotationAcknowledgement(false),
104   mFocused(false),
105   mIsWindowRotating(false)
106 {
107 }
108
109 Window::~Window()
110 {
111   if(mScene)
112   {
113     auto bridge     = Accessibility::Bridge::GetCurrentBridge();
114     auto rootLayer  = mScene.GetRootLayer();
115     auto accessible = Accessibility::Accessible::Get(rootLayer);
116     bridge->RemoveTopLevelWindow(accessible);
117     // Related to multi-window case. This is called for default window and non-default window, but it is effective for non-default window.
118     bridge->Emit(accessible, Accessibility::WindowEvent::DESTROY);
119   }
120
121   if(mAdaptor)
122   {
123     mAdaptor->RemoveWindow(this);
124   }
125
126   if(mEventHandler)
127   {
128     mEventHandler->RemoveObserver(*this);
129   }
130 }
131
132 void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type)
133 {
134   // Create a window render surface
135   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
136   mSurface                  = renderSurfaceFactory->CreateWindowRenderSurface(positionSize, surface, mIsTransparent);
137   mWindowSurface            = static_cast<WindowRenderSurface*>(mSurface.get());
138
139   // Get a window base
140   mWindowBase = mWindowSurface->GetWindowBase();
141
142   // Set Window Type
143   mWindowBase->SetType(type);
144
145   // Initialize for Ime window type
146   if(type == WindowType::IME)
147   {
148     mWindowBase->InitializeIme();
149     mWindowSurface->InitializeImeSurface();
150   }
151
152   // Connect signals
153   mWindowBase->IconifyChangedSignal().Connect(this, &Window::OnIconifyChanged);
154   mWindowBase->MaximizeChangedSignal().Connect(this, &Window::OnMaximizeChanged);
155   mWindowBase->FocusChangedSignal().Connect(this, &Window::OnFocusChanged);
156   mWindowBase->DeleteRequestSignal().Connect(this, &Window::OnDeleteRequest);
157   mWindowBase->TransitionEffectEventSignal().Connect(this, &Window::OnTransitionEffectEvent);
158   mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect(this, &Window::OnKeyboardRepeatSettingsChanged);
159   mWindowBase->WindowRedrawRequestSignal().Connect(this, &Window::OnWindowRedrawRequest);
160   mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
161   mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
162
163   mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
164   mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
165
166   AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
167
168   SetClass(name, className);
169
170   mOrientation = Orientation::New(this);
171
172   // Get OrientationMode
173   int screenWidth, screenHeight;
174   WindowSystem::GetScreenSize(screenWidth, screenHeight);
175   if(screenWidth > screenHeight)
176   {
177     mOrientationMode = Internal::Adaptor::Window::OrientationMode::LANDSCAPE;
178   }
179   else
180   {
181     mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
182   }
183
184   if(positionSize.width <= 0 || positionSize.height <= 0)
185   {
186     mWindowWidth  = screenWidth;
187     mWindowHeight = screenHeight;
188   }
189   else
190   {
191     mWindowWidth  = positionSize.width;
192     mWindowHeight = positionSize.height;
193   }
194
195   // For Debugging
196   mNativeWindowId = mWindowBase->GetNativeWindowId();
197 }
198
199 void Window::SetRenderNotification(TriggerEventInterface *renderNotification)
200 {
201   if(!mWindowSurface)
202   {
203     return;
204   }
205
206   mWindowSurface->SetRenderNotification(renderNotification);
207 }
208
209 void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
210 {
211   mEventHandler = EventHandlerPtr(new EventHandler(mWindowSurface->GetWindowBase(), *mAdaptor));
212   mEventHandler->AddObserver(*this);
213
214   // Add Window to bridge for ATSPI
215   auto bridge = Accessibility::Bridge::GetCurrentBridge();
216   if(bridge->IsUp())
217   {
218     auto rootLayer  = mScene.GetRootLayer();
219     auto accessible = Accessibility::Accessible::Get(rootLayer);
220     bridge->AddTopLevelWindow(accessible);
221
222     // Emit Window create event
223     // Create and Destory signal only emit in multi-window environment, so it does not emit on default layer.
224     bridge->Emit(accessible, Accessibility::WindowEvent::CREATE);
225   }
226
227   bridge->EnabledSignal().Connect(this, &Window::OnAccessibilityEnabled);
228   bridge->DisabledSignal().Connect(this, &Window::OnAccessibilityDisabled);
229
230   // If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
231   // The show must be called after the adaptor is initialized.
232   Show();
233 }
234
235 void Window::OnSurfaceSet(Dali::RenderSurfaceInterface* surface)
236 {
237   mWindowSurface = static_cast<WindowRenderSurface*>(surface);
238 }
239
240 void Window::SetClass(std::string name, std::string className)
241 {
242   mName      = name;
243   mClassName = className;
244   mWindowBase->SetClass(name, className);
245 }
246
247 std::string Window::GetClassName() const
248 {
249   return mClassName;
250 }
251
252 void Window::Raise()
253 {
254   mWindowBase->Raise();
255
256   mSurface->SetFullSwapNextFrame();
257
258   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId);
259 }
260
261 void Window::Lower()
262 {
263   mWindowBase->Lower();
264
265   mSurface->SetFullSwapNextFrame();
266
267   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId);
268 }
269
270 void Window::Activate()
271 {
272   mWindowBase->Activate();
273
274   mSurface->SetFullSwapNextFrame();
275
276   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId);
277 }
278
279 void Window::Maximize(bool maximize)
280 {
281   mWindowBase->Maximize(maximize);
282
283   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Maximize: %d\n", this, mNativeWindowId, maximize);
284 }
285
286 bool Window::IsMaximized() const
287 {
288   return mWindowBase->IsMaximized();
289 }
290
291 void Window::SetMaximumSize(Dali::Window::WindowSize size)
292 {
293   mWindowBase->SetMaximumSize(size);
294 }
295
296 void Window::Minimize(bool minimize)
297 {
298   mWindowBase->Minimize(minimize);
299
300   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Minimize: %d\n", this, mNativeWindowId, minimize);
301 }
302
303 bool Window::IsMinimized() const
304 {
305   return mWindowBase->IsMinimized();
306 }
307
308 void Window::SetMimimumSize(Dali::Window::WindowSize size)
309 {
310   mWindowBase->SetMimimumSize(size);
311 }
312
313 uint32_t Window::GetLayerCount() const
314 {
315   return mScene.GetLayerCount();
316 }
317
318 Dali::Layer Window::GetLayer(uint32_t depth) const
319 {
320   return mScene.GetLayer(depth);
321 }
322
323 Dali::RenderTaskList Window::GetRenderTaskList() const
324 {
325   return mScene.GetRenderTaskList();
326 }
327
328 std::string Window::GetNativeResourceId() const
329 {
330   return mWindowBase->GetNativeWindowResourceId();
331 }
332
333 void Window::AddAvailableOrientation(WindowOrientation orientation)
334 {
335   if(IsOrientationAvailable(orientation) == false)
336   {
337     return;
338   }
339
340   bool found          = false;
341   int  convertedAngle = ConvertToAngle(orientation);
342   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), AddAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle);
343   for(std::size_t i = 0; i < mAvailableAngles.size(); i++)
344   {
345     if(mAvailableAngles[i] == convertedAngle)
346     {
347       found = true;
348       break;
349     }
350   }
351
352   if(!found)
353   {
354     mAvailableAngles.push_back(convertedAngle);
355     SetAvailableAnlges(mAvailableAngles);
356   }
357 }
358
359 void Window::RemoveAvailableOrientation(WindowOrientation orientation)
360 {
361   if(IsOrientationAvailable(orientation) == false)
362   {
363     return;
364   }
365
366   int convertedAngle = ConvertToAngle(orientation);
367   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), RemoveAvailableOrientation: %d\n", this, mNativeWindowId, convertedAngle);
368   for(std::vector<int>::iterator iter = mAvailableAngles.begin();
369       iter != mAvailableAngles.end();
370       ++iter)
371   {
372     if(*iter == convertedAngle)
373     {
374       mAvailableAngles.erase(iter);
375       break;
376     }
377   }
378
379   SetAvailableAnlges(mAvailableAngles);
380 }
381
382 void Window::SetPreferredOrientation(WindowOrientation orientation)
383 {
384   if(orientation < WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE)
385   {
386     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::CheckOrientation: Invalid input orientation [%d]\n", orientation);
387     return;
388   }
389   mPreferredAngle = ConvertToAngle(orientation);
390   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle);
391   mWindowBase->SetPreferredAngle(mPreferredAngle);
392 }
393
394 WindowOrientation Window::GetPreferredOrientation()
395 {
396   WindowOrientation preferredOrientation = ConvertToOrientation(mPreferredAngle);
397   return preferredOrientation;
398 }
399
400 void Window::SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation)
401 {
402   int angle = ConvertToAngle(orientation);
403   mWindowBase->SetPositionSizeWithAngle(positionSize, angle);
404 }
405
406 void Window::EmitAccessibilityHighlightSignal(bool highlight)
407 {
408   Dali::Window handle(this);
409   mAccessibilityHighlightSignal.Emit(handle, highlight);
410 }
411
412 void Window::SetAvailableAnlges(const std::vector<int>& angles)
413 {
414   if(angles.size() > 4)
415   {
416     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetAvailableAnlges: Invalid vector size! [%d]\n", angles.size());
417     return;
418   }
419
420   mWindowBase->SetAvailableAnlges(angles);
421 }
422
423 int Window::ConvertToAngle(WindowOrientation orientation)
424 {
425   int convertAngle = static_cast<int>(orientation);
426   if(mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE)
427   {
428     switch(orientation)
429     {
430       case WindowOrientation::LANDSCAPE:
431       {
432         convertAngle = 0;
433         break;
434       }
435       case WindowOrientation::PORTRAIT:
436       {
437         convertAngle = 90;
438         break;
439       }
440       case WindowOrientation::LANDSCAPE_INVERSE:
441       {
442         convertAngle = 180;
443         break;
444       }
445       case WindowOrientation::PORTRAIT_INVERSE:
446       {
447         convertAngle = 270;
448         break;
449       }
450       case WindowOrientation::NO_ORIENTATION_PREFERENCE:
451       {
452         convertAngle = -1;
453         break;
454       }
455     }
456   }
457   return convertAngle;
458 }
459
460 WindowOrientation Window::ConvertToOrientation(int angle) const
461 {
462   WindowOrientation orientation = static_cast<WindowOrientation>(angle);
463   if(mOrientationMode == Internal::Adaptor::Window::OrientationMode::LANDSCAPE)
464   {
465     switch(angle)
466     {
467       case 0:
468       {
469         orientation = WindowOrientation::LANDSCAPE;
470         break;
471       }
472       case 90:
473       {
474         orientation = WindowOrientation::PORTRAIT;
475         break;
476       }
477       case 180:
478       {
479         orientation = WindowOrientation::LANDSCAPE_INVERSE;
480         break;
481       }
482       case 270:
483       {
484         orientation = WindowOrientation::PORTRAIT_INVERSE;
485         break;
486       }
487       case -1:
488       {
489         orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
490         break;
491       }
492     }
493   }
494   return orientation;
495 }
496
497 bool Window::IsOrientationAvailable(WindowOrientation orientation) const
498 {
499   if(orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE)
500   {
501     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation);
502     return false;
503   }
504   return true;
505 }
506
507 Dali::Any Window::GetNativeHandle() const
508 {
509   return mWindowSurface->GetNativeWindow();
510 }
511
512 void Window::SetAcceptFocus(bool accept)
513 {
514   mIsFocusAcceptable = accept;
515
516   mWindowBase->SetAcceptFocus(accept);
517 }
518
519 bool Window::IsFocusAcceptable() const
520 {
521   return mIsFocusAcceptable;
522 }
523
524 void Window::Show()
525 {
526   mVisible = true;
527
528   mWindowBase->Show();
529
530   if(!mIconified)
531   {
532     Dali::Window handle(this);
533     mVisibilityChangedSignal.Emit(handle, true);
534     Dali::Accessibility::Bridge::GetCurrentBridge()->WindowShown(handle);
535
536     WindowVisibilityObserver* observer(mAdaptor);
537     observer->OnWindowShown();
538   }
539
540   mSurface->SetFullSwapNextFrame();
541
542   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
543 }
544
545 void Window::Hide()
546 {
547   mVisible = false;
548
549   mWindowBase->Hide();
550
551   if(!mIconified)
552   {
553     Dali::Window handle(this);
554     mVisibilityChangedSignal.Emit(handle, false);
555     Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(handle);
556
557     WindowVisibilityObserver* observer(mAdaptor);
558     observer->OnWindowHidden();
559   }
560
561   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
562 }
563
564 bool Window::IsVisible() const
565 {
566   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), IsVisible(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
567   return mVisible && !mIconified;
568 }
569
570 unsigned int Window::GetSupportedAuxiliaryHintCount() const
571 {
572   return mWindowBase->GetSupportedAuxiliaryHintCount();
573 }
574
575 std::string Window::GetSupportedAuxiliaryHint(unsigned int index) const
576 {
577   return mWindowBase->GetSupportedAuxiliaryHint(index);
578 }
579
580 unsigned int Window::AddAuxiliaryHint(const std::string& hint, const std::string& value)
581 {
582   return mWindowBase->AddAuxiliaryHint(hint, value);
583 }
584
585 bool Window::RemoveAuxiliaryHint(unsigned int id)
586 {
587   return mWindowBase->RemoveAuxiliaryHint(id);
588 }
589
590 bool Window::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
591 {
592   return mWindowBase->SetAuxiliaryHintValue(id, value);
593 }
594
595 std::string Window::GetAuxiliaryHintValue(unsigned int id) const
596 {
597   return mWindowBase->GetAuxiliaryHintValue(id);
598 }
599
600 unsigned int Window::GetAuxiliaryHintId(const std::string& hint) const
601 {
602   return mWindowBase->GetAuxiliaryHintId(hint);
603 }
604
605 void Window::SetInputRegion(const Rect<int>& inputRegion)
606 {
607   Rect<int> convertRegion = RecalculateRect(inputRegion);
608
609   DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window (%p), WinId (%d), SetInputRegion, RecalculateRegion, (%d,%d), (%d x %d)\n", this, mNativeWindowId, convertRegion.x, convertRegion.y, convertRegion.width, convertRegion.height);
610
611   mWindowBase->SetInputRegion(convertRegion);
612 }
613
614 void Window::SetType(WindowType type)
615 {
616   mWindowBase->SetType(type);
617 }
618
619 WindowType Window::GetType() const
620 {
621   return mWindowBase->GetType();
622 }
623
624 WindowOperationResult Window::SetNotificationLevel(WindowNotificationLevel level)
625 {
626   WindowType type = mWindowBase->GetType();
627   if(type != WindowType::NOTIFICATION)
628   {
629     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", type);
630     return WindowOperationResult::INVALID_OPERATION;
631   }
632
633   return mWindowBase->SetNotificationLevel(level);
634 }
635
636 WindowNotificationLevel Window::GetNotificationLevel() const
637 {
638   WindowType type = mWindowBase->GetType();
639   if(type != WindowType::NOTIFICATION)
640   {
641     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", type);
642     return WindowNotificationLevel::NONE;
643   }
644
645   return mWindowBase->GetNotificationLevel();
646 }
647
648 void Window::SetOpaqueState(bool opaque)
649 {
650   mOpaqueState = opaque;
651
652   mWindowBase->SetOpaqueState(opaque);
653
654   DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque);
655 }
656
657 bool Window::IsOpaqueState() const
658 {
659   return mOpaqueState;
660 }
661
662 WindowOperationResult Window::SetScreenOffMode(WindowScreenOffMode screenOffMode)
663 {
664   return mWindowBase->SetScreenOffMode(screenOffMode);
665 }
666
667 WindowScreenOffMode Window::GetScreenOffMode() const
668 {
669   return mWindowBase->GetScreenOffMode();
670 }
671
672 WindowOperationResult Window::SetBrightness(int brightness)
673 {
674   if(brightness < 0 || brightness > 100)
675   {
676     DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness);
677     return WindowOperationResult::INVALID_OPERATION;
678   }
679
680   return mWindowBase->SetBrightness(brightness);
681 }
682
683 int Window::GetBrightness() const
684 {
685   return mWindowBase->GetBrightness();
686 }
687
688 void Window::SetSize(Dali::Window::WindowSize size)
689 {
690   PositionSize oldRect = GetPositionSize();
691
692   PositionSize newRect;
693   newRect.width  = size.GetWidth();
694   newRect.height = size.GetHeight();
695
696   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
697   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
698   {
699     mWindowSurface->MoveResize(PositionSize(oldRect.x, oldRect.y, newRect.width, newRect.height));
700
701     Uint16Pair newSize(newRect.width, newRect.height);
702
703     mWindowWidth  = newRect.width;
704     mWindowHeight = newRect.height;
705
706     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), SetSize(): (%d, %d), [%d x %d]\n", this, mNativeWindowId, mRotationAngle, oldRect.x, oldRect.y, newRect.width, newRect.height);
707
708     SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
709
710     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
711
712     Dali::Window handle(this);
713     mResizeSignal.Emit(handle, newSize);
714
715     mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
716   }
717
718   mSurface->SetFullSwapNextFrame();
719
720   Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(oldRect.x, oldRect.y, size.GetWidth(), size.GetHeight()));
721 }
722
723 Dali::Window::WindowSize Window::GetSize() const
724 {
725   return Dali::Window::WindowSize(mWindowWidth, mWindowHeight);
726 }
727
728 void Window::SetPosition(Dali::Window::WindowPosition position)
729 {
730   PositionSize oldRect = mSurface->GetPositionSize();
731   int32_t      newX    = position.GetX();
732   int32_t      newY    = position.GetY();
733
734   mWindowSurface->Move(PositionSize(newX, newY, oldRect.width, oldRect.height));
735
736   if((oldRect.x != newX) || (oldRect.y != newY))
737   {
738     Dali::Window                 handle(this);
739     Dali::Window::WindowPosition newPosition(newX, newY);
740
741     DALI_LOG_RELEASE_INFO("send moved signal with new position: %d, %d\n", newPosition.GetX(), newPosition.GetY());
742     mMovedSignal.Emit(handle, newPosition);
743   }
744
745   mSurface->SetFullSwapNextFrame();
746
747   Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(position.GetX(), position.GetY(), oldRect.width, oldRect.height));
748 }
749
750 Dali::Window::WindowPosition Window::GetPosition() const
751 {
752   PositionSize positionSize = GetPositionSize();
753   return Dali::Window::WindowPosition(positionSize.x, positionSize.y);
754 }
755
756 PositionSize Window::GetPositionSize() const
757 {
758   PositionSize positionSize = mSurface->GetPositionSize();
759   positionSize.width        = mWindowWidth;
760   positionSize.height       = mWindowHeight;
761   return positionSize;
762 }
763
764 void Window::SetPositionSize(PositionSize positionSize)
765 {
766   bool moved  = false;
767   bool resize = false;
768
769   PositionSize oldRect = GetPositionSize();
770   Dali::Window handle(this);
771
772   if((oldRect.x != positionSize.x) || (oldRect.y != positionSize.y))
773   {
774     moved = true;
775   }
776
777   if((oldRect.width != positionSize.width) || (oldRect.height != positionSize.height))
778   {
779     resize = true;
780   }
781
782   if(moved || resize)
783   {
784     mWindowSurface->MoveResize(positionSize);
785   }
786
787   // When window is moved, emit Moved Signal
788   if(moved)
789   {
790     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, positionSize.x, positionSize.y);
791     Dali::Window::WindowPosition position(positionSize.x, positionSize.y);
792     mMovedSignal.Emit(handle, position);
793   }
794
795   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
796   if(resize)
797   {
798     Uint16Pair newSize(positionSize.width, positionSize.height);
799
800     mWindowWidth  = positionSize.width;
801     mWindowHeight = positionSize.height;
802
803     SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
804
805     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
806
807     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resize signal emit [%d x %d]\n", this, mNativeWindowId, positionSize.width, positionSize.height);
808
809     mResizeSignal.Emit(handle, newSize);
810     mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
811   }
812
813   mSurface->SetFullSwapNextFrame();
814
815   Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
816 }
817
818 Dali::Layer Window::GetRootLayer() const
819 {
820   return mScene.GetRootLayer();
821 }
822
823 void Window::SetTransparency(bool transparent)
824 {
825   mWindowSurface->SetTransparency(transparent);
826 }
827
828 bool Window::GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode)
829 {
830   return mWindowBase->GrabKey(key, grabMode);
831 }
832
833 bool Window::UngrabKey(Dali::KEY key)
834 {
835   return mWindowBase->UngrabKey(key);
836 }
837
838 bool Window::GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result)
839 {
840   return mWindowBase->GrabKeyList(key, grabMode, result);
841 }
842
843 bool Window::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result)
844 {
845   return mWindowBase->UngrabKeyList(key, result);
846 }
847
848 void Window::OnIconifyChanged(bool iconified)
849 {
850   const bool   isActuallyChanged = (iconified != mIconified);
851   auto         bridge            = Dali::Accessibility::Bridge::GetCurrentBridge();
852   Dali::Window handle(this);
853
854   if(iconified)
855   {
856     mIconified = true;
857
858     if(mVisible)
859     {
860       mVisibilityChangedSignal.Emit(handle, false);
861       bridge->WindowHidden(handle);
862
863       WindowVisibilityObserver* observer(mAdaptor);
864       observer->OnWindowHidden();
865     }
866
867     if(isActuallyChanged)
868     {
869       bridge->WindowMinimized(handle);
870     }
871
872     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible);
873   }
874   else
875   {
876     mIconified = false;
877
878     if(mVisible)
879     {
880       mVisibilityChangedSignal.Emit(handle, true);
881       bridge->WindowShown(handle);
882
883       WindowVisibilityObserver* observer(mAdaptor);
884       observer->OnWindowShown();
885     }
886
887     if(isActuallyChanged)
888     {
889       bridge->WindowRestored(handle, Dali::Accessibility::WindowRestoreType::RESTORE_FROM_ICONIFY);
890     }
891
892     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible);
893   }
894
895   mSurface->SetFullSwapNextFrame();
896 }
897
898 void Window::OnMaximizeChanged(bool maximized)
899 {
900   const bool isActuallyChanged = (maximized != mMaximized);
901
902   if(isActuallyChanged)
903   {
904     auto         bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
905     Dali::Window handle(this);
906
907     if(maximized)
908     {
909       mMaximized = true;
910       bridge->WindowMaximized(handle);
911     }
912     else
913     {
914       mMaximized = false;
915       bridge->WindowRestored(handle, Dali::Accessibility::WindowRestoreType::RESTORE_FROM_MAXIMIZE);
916     }
917   }
918 }
919
920 void Window::OnFocusChanged(bool focusIn)
921 {
922   Dali::Window handle(this);
923   mFocusChangeSignal.Emit(handle, focusIn);
924
925   mSurface->SetFullSwapNextFrame();
926   auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge();
927
928   if(focusIn)
929   {
930     bridge->WindowFocused(handle);
931   }
932   else
933   {
934     bridge->WindowUnfocused(handle);
935   }
936
937   mFocused = focusIn;
938 }
939
940 void Window::OnOutputTransformed()
941 {
942   PositionSize positionSize = GetPositionSize();
943
944   SurfaceRotated(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height), mRotationAngle, mWindowBase->GetScreenRotationAngle());
945
946   mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
947   mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
948 }
949
950 void Window::OnDeleteRequest()
951 {
952   mDeleteRequestSignal.Emit();
953 }
954
955 void Window::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
956 {
957   Dali::Window handle(this);
958   mTransitionEffectEventSignal.Emit(handle, state, type);
959 }
960
961 void Window::OnKeyboardRepeatSettingsChanged()
962 {
963   Dali::Window handle(this);
964   mKeyboardRepeatSettingsChangedSignal.Emit();
965 }
966
967 void Window::OnWindowRedrawRequest()
968 {
969   mAdaptor->RenderOnce();
970 }
971
972 void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
973 {
974   bool moved  = false;
975   bool resize = false;
976
977   Dali::Window handle(this);
978
979   PositionSize oldRect = GetPositionSize();
980   PositionSize newRect = positionSize;
981
982   if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
983   {
984     moved = true;
985   }
986
987   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
988   {
989     resize = true;
990   }
991
992   if(moved || resize)
993   {
994     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), current angle (%d), position or size is updated by server , (%d, %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newRect.x, newRect.y, newRect.width, newRect.height);
995     mWindowSurface->UpdatePositionSize(positionSize);
996   }
997
998   if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
999   {
1000     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, newRect.x, newRect.y);
1001     Dali::Window::WindowPosition position(newRect.x, newRect.y);
1002     mMovedSignal.Emit(handle, position);
1003   }
1004
1005   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
1006   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
1007   {
1008     Uint16Pair newSize(newRect.width, newRect.height);
1009
1010     mWindowWidth  = newRect.width;
1011     mWindowHeight = newRect.height;
1012
1013     SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
1014
1015     mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
1016
1017     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resized signal emit [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height);
1018     mResizeSignal.Emit(handle, newSize);
1019     mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
1020   }
1021
1022   mSurface->SetFullSwapNextFrame();
1023
1024   Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
1025 }
1026
1027 void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
1028 {
1029   mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
1030   FeedTouchPoint(point, timeStamp);
1031 }
1032
1033 void Window::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
1034 {
1035   FeedWheelEvent(wheelEvent);
1036 }
1037
1038 void Window::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
1039 {
1040   mLastKeyEvent = Dali::DevelKeyEvent::New(keyEvent.keyName, keyEvent.logicalKey, keyEvent.keyString, keyEvent.keyCode, keyEvent.keyModifier, keyEvent.time, static_cast<Dali::KeyEvent::State>(keyEvent.state), keyEvent.compose, keyEvent.deviceName, keyEvent.deviceClass, keyEvent.deviceSubclass);
1041   FeedKeyEvent(keyEvent);
1042 }
1043
1044 void Window::OnRotation(const RotationEvent& rotation)
1045 {
1046   PositionSize newPositionSize(rotation.x, rotation.y, rotation.width, rotation.height);
1047
1048   mRotationAngle = rotation.angle;
1049   mWindowWidth   = rotation.width;
1050   mWindowHeight  = rotation.height;
1051
1052   mIsWindowRotating = true;
1053   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), angle(%d), Window Rotation (%d , %d) [%d x %d]\n", this, mNativeWindowId, mRotationAngle, newPositionSize.x, newPositionSize.y, mWindowWidth, mWindowHeight);
1054
1055   // Notify that the orientation is changed
1056   mOrientation->OnOrientationChange(rotation);
1057
1058   mWindowSurface->RequestRotation(mRotationAngle, newPositionSize);
1059
1060   SurfaceRotated(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight), mRotationAngle, mWindowBase->GetScreenRotationAngle());
1061
1062   mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
1063
1064   Dali::Window handle(this);
1065   mResizeSignal.Emit(handle, Dali::Window::WindowSize(mWindowWidth, mWindowHeight));
1066   mOrientationChangedSignal.Emit(handle, GetCurrentOrientation());
1067
1068   mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
1069 }
1070
1071 void Window::OnRotationFinished()
1072 {
1073   mIsWindowRotating = false;
1074   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), window rotation is finised\n", this, mNativeWindowId);
1075 }
1076
1077 void Window::OnPause()
1078 {
1079   if(mEventHandler)
1080   {
1081     mEventHandler->Pause();
1082   }
1083 }
1084
1085 void Window::OnResume()
1086 {
1087   if(mEventHandler)
1088   {
1089     mEventHandler->Resume();
1090   }
1091
1092   mSurface->SetFullSwapNextFrame();
1093 }
1094
1095 void Window::OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options)
1096 {
1097   mAuxiliaryMessageSignal.Emit(key, value, options);
1098 }
1099
1100 void Window::OnAccessibilityEnabled()
1101 {
1102   auto bridge     = Accessibility::Bridge::GetCurrentBridge();
1103   auto rootLayer  = mScene.GetRootLayer();
1104   auto accessible = Accessibility::Accessible::Get(rootLayer);
1105   bridge->AddTopLevelWindow(accessible);
1106
1107   if(!mVisible || mIconified)
1108   {
1109     return;
1110   }
1111
1112   Dali::Window handle(this);
1113   bridge->WindowShown(handle);
1114
1115   if(mFocused)
1116   {
1117     bridge->WindowFocused(handle);
1118   }
1119 }
1120
1121 void Window::OnAccessibilityDisabled()
1122 {
1123   auto bridge     = Accessibility::Bridge::GetCurrentBridge();
1124   auto rootLayer  = mScene.GetRootLayer();
1125   auto accessible = Accessibility::Accessible::Get(rootLayer);
1126   bridge->RemoveTopLevelWindow(accessible);
1127 }
1128
1129 Vector2 Window::RecalculatePosition(const Vector2& position)
1130 {
1131   Vector2 convertedPosition;
1132
1133   switch(mRotationAngle)
1134   {
1135     case 90:
1136     {
1137       convertedPosition.x = static_cast<float>(mWindowWidth) - position.y;
1138       convertedPosition.y = position.x;
1139       break;
1140     }
1141     case 180:
1142     {
1143       convertedPosition.x = static_cast<float>(mWindowWidth) - position.x;
1144       convertedPosition.y = static_cast<float>(mWindowHeight) - position.y;
1145       break;
1146     }
1147     case 270:
1148     {
1149       convertedPosition.x = position.y;
1150       convertedPosition.y = static_cast<float>(mWindowHeight) - position.x;
1151       break;
1152     }
1153     default:
1154     {
1155       convertedPosition = position;
1156       break;
1157     }
1158   }
1159   return convertedPosition;
1160 }
1161
1162 Dali::Window Window::Get(Dali::Actor actor)
1163 {
1164   Internal::Adaptor::Window* windowImpl = nullptr;
1165
1166   if(Internal::Adaptor::Adaptor::IsAvailable())
1167   {
1168     Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation(Internal::Adaptor::Adaptor::Get());
1169     windowImpl                                = dynamic_cast<Internal::Adaptor::Window*>(adaptor.GetWindow(actor));
1170     if(windowImpl)
1171     {
1172       return Dali::Window(windowImpl);
1173     }
1174   }
1175
1176   return Dali::Window();
1177 }
1178
1179 void Window::SetParent(Dali::Window& parent)
1180 {
1181   if(DALI_UNLIKELY(parent))
1182   {
1183     mParentWindow     = parent;
1184     Dali::Window self = Dali::Window(this);
1185     // check circular parent window setting
1186     if(Dali::DevelWindow::GetParent(parent) == self)
1187     {
1188       Dali::DevelWindow::Unparent(parent);
1189     }
1190     mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, false);
1191   }
1192 }
1193
1194 void Window::SetParent(Dali::Window& parent, bool belowParent)
1195 {
1196   if(DALI_UNLIKELY(parent))
1197   {
1198     mParentWindow     = parent;
1199     Dali::Window self = Dali::Window(this);
1200     // check circular parent window setting
1201     if(Dali::DevelWindow::GetParent(parent) == self)
1202     {
1203       Dali::DevelWindow::Unparent(parent);
1204     }
1205     mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, belowParent);
1206   }
1207 }
1208
1209 void Window::Unparent()
1210 {
1211   mWindowBase->SetParent(nullptr, false);
1212   mParentWindow.Reset();
1213 }
1214
1215 Dali::Window Window::GetParent()
1216 {
1217   return mParentWindow;
1218 }
1219
1220 WindowOrientation Window::GetCurrentOrientation() const
1221 {
1222   return ConvertToOrientation(mRotationAngle);
1223 }
1224
1225 int Window::GetPhysicalOrientation() const
1226 {
1227   return (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
1228 }
1229
1230 void Window::SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations)
1231 {
1232   Dali::Vector<float>::SizeType count = orientations.Count();
1233   for(Dali::Vector<float>::SizeType index = 0; index < count; ++index)
1234   {
1235     if(IsOrientationAvailable(orientations[index]) == false)
1236     {
1237       DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
1238       continue;
1239     }
1240
1241     bool found          = false;
1242     int  convertedAngle = ConvertToAngle(orientations[index]);
1243
1244     for(std::size_t i = 0; i < mAvailableAngles.size(); i++)
1245     {
1246       if(mAvailableAngles[i] == convertedAngle)
1247       {
1248         found = true;
1249         break;
1250       }
1251     }
1252
1253     if(!found)
1254     {
1255       DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle);
1256       mAvailableAngles.push_back(convertedAngle);
1257     }
1258   }
1259   SetAvailableAnlges(mAvailableAngles);
1260 }
1261
1262 int32_t Window::GetNativeId() const
1263 {
1264   return mWindowBase->GetNativeWindowId();
1265 }
1266
1267 void Window::RequestMoveToServer()
1268 {
1269   mWindowBase->RequestMoveToServer();
1270 }
1271
1272 void Window::RequestResizeToServer(WindowResizeDirection direction)
1273 {
1274   mWindowBase->RequestResizeToServer(direction);
1275 }
1276
1277 void Window::EnableFloatingMode(bool enable)
1278 {
1279   mWindowBase->EnableFloatingMode(enable);
1280 }
1281
1282 Rect<int> Window::RecalculateRect(const Rect<int>& rect)
1283 {
1284   Rect<int> newRect;
1285   int       screenWidth, screenHeight;
1286
1287   WindowSystem::GetScreenSize(screenWidth, screenHeight);
1288
1289   if(mRotationAngle == 90)
1290   {
1291     newRect.x      = rect.y;
1292     newRect.y      = screenHeight - (rect.x + rect.width);
1293     newRect.width  = rect.height;
1294     newRect.height = rect.width;
1295   }
1296   else if(mRotationAngle == 180)
1297   {
1298     newRect.x      = screenWidth - (rect.x + rect.width);
1299     newRect.y      = screenHeight - (rect.y + rect.height);
1300     newRect.width  = rect.width;
1301     newRect.height = rect.height;
1302   }
1303   else if(mRotationAngle == 270)
1304   {
1305     newRect.x      = screenWidth - (rect.y + rect.height);
1306     newRect.y      = rect.x;
1307     newRect.width  = rect.height;
1308     newRect.height = rect.width;
1309   }
1310   else
1311   {
1312     newRect.x      = rect.x;
1313     newRect.y      = rect.y;
1314     newRect.width  = rect.width;
1315     newRect.height = rect.height;
1316   }
1317   return newRect;
1318 }
1319
1320 void Window::IncludeInputRegion(const Rect<int>& inputRegion)
1321 {
1322   Rect<int> convertRegion = RecalculateRect(inputRegion);
1323
1324   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), IncludeInputRegion, RecalculateRegion, (%d,%d), (%d x %d)\n", this, mNativeWindowId, convertRegion.x, convertRegion.y, convertRegion.width, convertRegion.height);
1325   mWindowBase->IncludeInputRegion(convertRegion);
1326 }
1327
1328 void Window::ExcludeInputRegion(const Rect<int>& inputRegion)
1329 {
1330   Rect<int> convertRegion = RecalculateRect(inputRegion);
1331
1332   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), ExcludeInputRegion, RecalculateRegion, (%d,%d), (%d x %d)\n", this, mNativeWindowId, convertRegion.x, convertRegion.y, convertRegion.width, convertRegion.height);
1333   mWindowBase->ExcludeInputRegion(convertRegion);
1334 }
1335
1336 void Window::SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
1337 {
1338   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), needAcknowledgement(%d) Set needs Rotation Completed Acknowledgement\n", this, mNativeWindowId, needAcknowledgement);
1339   mWindowSurface->SetNeedsRotationCompletedAcknowledgement(needAcknowledgement);
1340   mWindowRotationAcknowledgement = needAcknowledgement;
1341 }
1342
1343 void Window::SendRotationCompletedAcknowledgement()
1344 {
1345   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SendRotationCompletedAcknowledgement(): orientation: %d, mWindowRotationAcknowledgement: %d\n", this, mNativeWindowId, mRotationAngle, mWindowRotationAcknowledgement);
1346   if(mWindowRotationAcknowledgement)
1347   {
1348     SetRotationCompletedAcknowledgement();
1349   }
1350 }
1351
1352 bool Window::IsWindowRotating() const
1353 {
1354   return mIsWindowRotating;
1355 }
1356
1357 const Dali::KeyEvent& Window::GetLastKeyEvent() const
1358 {
1359   return mLastKeyEvent;
1360 }
1361
1362 const Dali::TouchEvent& Window::GetLastTouchEvent() const
1363 {
1364   return mLastTouchEvent;
1365 }
1366
1367 } // namespace Adaptor
1368
1369 } // namespace Internal
1370
1371 } // namespace Dali