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