[Tizen] Add InsetsChangedSignal to WindowBaseEcoreWl2
[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
62 } // unnamed namespace
63
64 Window* Window::New(const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
65 {
66   Any surface;
67   return Window::New(surface, positionSize, name, className, type, isTransparent);
68 }
69
70 Window* Window::New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, Dali::WindowType type, bool isTransparent)
71 {
72   Window* window         = new Window();
73   window->mIsTransparent = isTransparent;
74   window->Initialize(surface, positionSize, name, className, type);
75   return window;
76 }
77
78 Window::Window()
79 : mWindowSurface(nullptr),
80   mWindowBase(),
81   mParentWindow(NULL),
82   mPreferredAngle(static_cast<int>(WindowOrientation::NO_ORIENTATION_PREFERENCE)),
83   mRotationAngle(0),
84   mWindowWidth(0),
85   mWindowHeight(0),
86   mNativeWindowId(-1),
87   mOrientationMode(Internal::Adaptor::Window::OrientationMode::PORTRAIT),
88   mDeleteRequestSignal(),
89   mFocusChangeSignal(),
90   mResizeSignal(),
91   mVisibilityChangedSignal(),
92   mTransitionEffectEventSignal(),
93   mKeyboardRepeatSettingsChangedSignal(),
94   mAuxiliaryMessageSignal(),
95   mMovedSignal(),
96   mOrientationChangedSignal(),
97   mMouseInOutEventSignal(),
98   mMoveCompletedSignal(),
99   mResizeCompletedSignal(),
100   mInsetsChangedSignal(),
101   mLastKeyEvent(),
102   mLastTouchEvent(),
103   mIsTransparent(false),
104   mIsFocusAcceptable(true),
105   mIconified(false),
106   mOpaqueState(false),
107   mWindowRotationAcknowledgement(false),
108   mFocused(false),
109   mIsWindowRotating(false)
110 {
111 }
112
113 Window::~Window()
114 {
115   if(mScene)
116   {
117     auto bridge     = Accessibility::Bridge::GetCurrentBridge();
118     auto rootLayer  = mScene.GetRootLayer();
119     auto accessible = Accessibility::Accessible::Get(rootLayer);
120     bridge->RemoveTopLevelWindow(accessible);
121     // Related to multi-window case. This is called for default window and non-default window, but it is effective for non-default window.
122     bridge->Emit(accessible, Accessibility::WindowEvent::DESTROY);
123   }
124
125   if(DALI_LIKELY(mAdaptor))
126   {
127     mAdaptor->RemoveWindow(this);
128   }
129
130   if(mEventHandler)
131   {
132     mEventHandler->RemoveObserver(*this);
133   }
134 }
135
136 void Window::Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type)
137 {
138   // Create a window render surface
139   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
140   mSurface                  = renderSurfaceFactory->CreateWindowRenderSurface(positionSize, surface, mIsTransparent);
141   mWindowSurface            = static_cast<WindowRenderSurface*>(mSurface.get());
142
143   // Get a window base
144   mWindowBase = mWindowSurface->GetWindowBase();
145
146   // Set Window Type
147   mWindowBase->SetType(type);
148
149   // Initialize for Ime window type
150   if(type == WindowType::IME)
151   {
152     mWindowBase->InitializeIme();
153     mWindowSurface->InitializeImeSurface();
154   }
155
156   // Connect signals
157   mWindowBase->IconifyChangedSignal().Connect(this, &Window::OnIconifyChanged);
158   mWindowBase->FocusChangedSignal().Connect(this, &Window::OnFocusChanged);
159   mWindowBase->DeleteRequestSignal().Connect(this, &Window::OnDeleteRequest);
160   mWindowBase->TransitionEffectEventSignal().Connect(this, &Window::OnTransitionEffectEvent);
161   mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect(this, &Window::OnKeyboardRepeatSettingsChanged);
162   mWindowBase->WindowRedrawRequestSignal().Connect(this, &Window::OnWindowRedrawRequest);
163   mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
164   mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
165   mWindowBase->MouseInOutEventSignal().Connect(this, &Window::OnMouseInOutEvent);
166   mWindowBase->MoveCompletedSignal().Connect(this, &Window::OnMoveCompleted);
167   mWindowBase->ResizeCompletedSignal().Connect(this, &Window::OnResizeCompleted);
168
169   mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
170   mWindowSurface->RotationFinishedSignal().Connect(this, &Window::OnRotationFinished);
171
172   mWindowBase->InsetsChangedSignal().Connect(this, &Window::OnInsetsChanged);
173
174   AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
175
176   SetClass(name, className);
177
178   mOrientation = Orientation::New(this);
179
180   // Get OrientationMode
181   int screenWidth, screenHeight;
182   WindowSystem::GetScreenSize(screenWidth, screenHeight);
183   if(screenWidth > screenHeight)
184   {
185     mOrientationMode = Internal::Adaptor::Window::OrientationMode::LANDSCAPE;
186   }
187   else
188   {
189     mOrientationMode = Internal::Adaptor::Window::OrientationMode::PORTRAIT;
190   }
191
192   if(positionSize.width <= 0 || positionSize.height <= 0)
193   {
194     mWindowWidth  = screenWidth;
195     mWindowHeight = screenHeight;
196   }
197   else
198   {
199     mWindowWidth  = positionSize.width;
200     mWindowHeight = positionSize.height;
201   }
202
203   // For Debugging
204   mNativeWindowId = mWindowBase->GetNativeWindowId();
205 }
206
207 void Window::SetRenderNotification(TriggerEventInterface* renderNotification)
208 {
209   if(!mWindowSurface)
210   {
211     return;
212   }
213
214   mWindowSurface->SetRenderNotification(renderNotification);
215 }
216
217 void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
218 {
219   mEventHandler = EventHandlerPtr(new EventHandler(mWindowSurface->GetWindowBase(), *mAdaptor));
220   mEventHandler->AddObserver(*this);
221
222   // Add Window to bridge for ATSPI
223   auto bridge = Accessibility::Bridge::GetCurrentBridge();
224   if(bridge->IsUp())
225   {
226     auto rootLayer  = mScene.GetRootLayer();
227     auto accessible = Accessibility::Accessible::Get(rootLayer);
228     bridge->AddTopLevelWindow(accessible);
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 Dali::RenderTaskList Window::GetRenderTaskList() const
328 {
329   return mScene.GetRenderTaskList();
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->MoveResize(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   if(iconified)
857   {
858     mIconified = true;
859
860     if(mVisible)
861     {
862       Dali::Window handle(this);
863       mVisibilityChangedSignal.Emit(handle, false);
864       Dali::Accessibility::Bridge::GetCurrentBridge()->WindowHidden(handle);
865
866       if(DALI_LIKELY(mAdaptor))
867       {
868         WindowVisibilityObserver* observer(mAdaptor);
869         observer->OnWindowHidden();
870       }
871     }
872
873     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible);
874   }
875   else
876   {
877     mIconified = false;
878
879     if(mVisible)
880     {
881       Dali::Window handle(this);
882       mVisibilityChangedSignal.Emit(handle, true);
883       Dali::Accessibility::Bridge::GetCurrentBridge()->WindowShown(handle);
884
885       if(DALI_LIKELY(mAdaptor))
886       {
887         WindowVisibilityObserver* observer(mAdaptor);
888         observer->OnWindowShown();
889       }
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::OnFocusChanged(bool focusIn)
899 {
900   Dali::Window handle(this);
901   mFocusChangeSignal.Emit(handle, focusIn);
902
903   mSurface->SetFullSwapNextFrame();
904
905   if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
906   {
907     if(focusIn)
908     {
909       bridge->WindowFocused(handle);
910     }
911     else
912     {
913       bridge->WindowUnfocused(handle);
914     }
915   }
916   mFocused = focusIn;
917 }
918
919 void Window::OnOutputTransformed()
920 {
921   PositionSize positionSize = GetPositionSize();
922
923   SurfaceRotated(static_cast<float>(positionSize.width), static_cast<float>(positionSize.height), mRotationAngle, mWindowBase->GetScreenRotationAngle());
924
925   if(DALI_LIKELY(mAdaptor))
926   {
927     mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
928     mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(positionSize.width, positionSize.height));
929   }
930 }
931
932 void Window::OnDeleteRequest()
933 {
934   mDeleteRequestSignal.Emit();
935 }
936
937 void Window::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
938 {
939   Dali::Window handle(this);
940   mTransitionEffectEventSignal.Emit(handle, state, type);
941 }
942
943 void Window::OnKeyboardRepeatSettingsChanged()
944 {
945   Dali::Window handle(this);
946   mKeyboardRepeatSettingsChangedSignal.Emit();
947 }
948
949 void Window::OnWindowRedrawRequest()
950 {
951   if(DALI_LIKELY(mAdaptor))
952   {
953     mAdaptor->RenderOnce();
954   }
955 }
956
957 void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
958 {
959   bool moved  = false;
960   bool resize = false;
961
962   Dali::Window handle(this);
963
964   PositionSize oldRect = GetPositionSize();
965   PositionSize newRect = positionSize;
966
967   if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
968   {
969     moved = true;
970   }
971
972   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
973   {
974     resize = true;
975   }
976
977   if(moved || resize)
978   {
979     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);
980     mWindowSurface->UpdatePositionSize(positionSize);
981   }
982
983   if((oldRect.x != newRect.x) || (oldRect.y != newRect.y))
984   {
985     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Moved signal emit (%d, %d)\n", this, mNativeWindowId, newRect.x, newRect.y);
986     Dali::Window::WindowPosition position(newRect.x, newRect.y);
987     mMovedSignal.Emit(handle, position);
988   }
989
990   // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
991   if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
992   {
993     Uint16Pair newSize(newRect.width, newRect.height);
994
995     mWindowWidth  = newRect.width;
996     mWindowHeight = newRect.height;
997
998     SurfaceResized(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight));
999
1000     if(DALI_LIKELY(mAdaptor))
1001     {
1002       mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
1003     }
1004
1005     DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Resized signal emit [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height);
1006     mResizeSignal.Emit(handle, newSize);
1007     if(DALI_LIKELY(mAdaptor))
1008     {
1009       mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
1010     }
1011   }
1012
1013   mSurface->SetFullSwapNextFrame();
1014
1015   if(DALI_LIKELY(mScene))
1016   {
1017     Dali::Accessibility::Accessible::Get(mScene.GetRootLayer())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
1018   }
1019 }
1020
1021 void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
1022 {
1023   mLastTouchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
1024   FeedTouchPoint(point, timeStamp);
1025 }
1026
1027 void Window::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
1028 {
1029   FeedWheelEvent(wheelEvent);
1030 }
1031
1032 void Window::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
1033 {
1034   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);
1035   FeedKeyEvent(keyEvent);
1036 }
1037
1038 void Window::OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent)
1039 {
1040   Dali::Window handle(this);
1041
1042   mMouseInOutEventSignal.Emit(handle, mouseInOutEvent);
1043 }
1044
1045 void Window::OnRotation(const RotationEvent& rotation)
1046 {
1047   PositionSize newPositionSize(rotation.x, rotation.y, rotation.width, rotation.height);
1048
1049   mRotationAngle = rotation.angle;
1050   mWindowWidth   = rotation.width;
1051   mWindowHeight  = rotation.height;
1052
1053   mIsWindowRotating = true;
1054   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);
1055
1056   // Notify that the orientation is changed
1057   mOrientation->OnOrientationChange(rotation);
1058
1059   mWindowSurface->RequestRotation(mRotationAngle, newPositionSize);
1060
1061   SurfaceRotated(static_cast<float>(mWindowWidth), static_cast<float>(mWindowHeight), mRotationAngle, mWindowBase->GetScreenRotationAngle());
1062
1063   if(DALI_LIKELY(mAdaptor))
1064   {
1065     mAdaptor->SurfaceResizePrepare(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
1066   }
1067
1068   Dali::Window handle(this);
1069   mResizeSignal.Emit(handle, Dali::Window::WindowSize(mWindowWidth, mWindowHeight));
1070   mOrientationChangedSignal.Emit(handle, GetCurrentOrientation());
1071
1072   if(DALI_LIKELY(mAdaptor))
1073   {
1074     mAdaptor->SurfaceResizeComplete(mSurface.get(), Adaptor::SurfaceSize(mWindowWidth, mWindowHeight));
1075   }
1076 }
1077
1078 void Window::OnRotationFinished()
1079 {
1080   mIsWindowRotating = false;
1081   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), window rotation is finised\n", this, mNativeWindowId);
1082 }
1083
1084 void Window::OnPause()
1085 {
1086   if(mEventHandler)
1087   {
1088     mEventHandler->Pause();
1089   }
1090 }
1091
1092 void Window::OnResume()
1093 {
1094   if(mEventHandler)
1095   {
1096     mEventHandler->Resume();
1097   }
1098
1099   mSurface->SetFullSwapNextFrame();
1100 }
1101
1102 void Window::OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options)
1103 {
1104   mAuxiliaryMessageSignal.Emit(key, value, options);
1105 }
1106
1107 void Window::OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets)
1108 {
1109   mInsetsChangedSignal.Emit(partType, partState, insets);
1110 }
1111
1112 void Window::OnAccessibilityEnabled()
1113 {
1114   auto bridge     = Accessibility::Bridge::GetCurrentBridge();
1115   auto rootLayer  = mScene.GetRootLayer();
1116   auto accessible = Accessibility::Accessible::Get(rootLayer);
1117   bridge->AddTopLevelWindow(accessible);
1118
1119   if(!mVisible || mIconified)
1120   {
1121     return;
1122   }
1123
1124   Dali::Window handle(this);
1125   bridge->WindowShown(handle);
1126
1127   if(mFocused)
1128   {
1129     bridge->WindowFocused(handle);
1130   }
1131 }
1132
1133 void Window::OnAccessibilityDisabled()
1134 {
1135   auto bridge     = Accessibility::Bridge::GetCurrentBridge();
1136   auto rootLayer  = mScene.GetRootLayer();
1137   auto accessible = Accessibility::Accessible::Get(rootLayer);
1138   bridge->RemoveTopLevelWindow(accessible);
1139 }
1140
1141 void Window::OnMoveCompleted(Dali::Window::WindowPosition& position)
1142 {
1143   Dali::Window handle(this);
1144   mMoveCompletedSignal.Emit(handle, position);
1145 }
1146
1147 void Window::OnResizeCompleted(Dali::Window::WindowSize& size)
1148 {
1149   Dali::Window handle(this);
1150   mResizeCompletedSignal.Emit(handle, size);
1151 }
1152
1153 Vector2 Window::RecalculatePosition(const Vector2& position)
1154 {
1155   Vector2 convertedPosition;
1156
1157   switch(mRotationAngle)
1158   {
1159     case 90:
1160     {
1161       convertedPosition.x = static_cast<float>(mWindowWidth) - position.y;
1162       convertedPosition.y = position.x;
1163       break;
1164     }
1165     case 180:
1166     {
1167       convertedPosition.x = static_cast<float>(mWindowWidth) - position.x;
1168       convertedPosition.y = static_cast<float>(mWindowHeight) - position.y;
1169       break;
1170     }
1171     case 270:
1172     {
1173       convertedPosition.x = position.y;
1174       convertedPosition.y = static_cast<float>(mWindowHeight) - position.x;
1175       break;
1176     }
1177     default:
1178     {
1179       convertedPosition = position;
1180       break;
1181     }
1182   }
1183   return convertedPosition;
1184 }
1185
1186 Dali::Window Window::Get(Dali::Actor actor)
1187 {
1188   Internal::Adaptor::Window* windowImpl = nullptr;
1189
1190   if(Internal::Adaptor::Adaptor::IsAvailable())
1191   {
1192     Dali::Internal::Adaptor::Adaptor& adaptor = Internal::Adaptor::Adaptor::GetImplementation(Internal::Adaptor::Adaptor::Get());
1193     windowImpl                                = dynamic_cast<Internal::Adaptor::Window*>(adaptor.GetWindow(actor));
1194     if(windowImpl)
1195     {
1196       return Dali::Window(windowImpl);
1197     }
1198   }
1199
1200   return Dali::Window();
1201 }
1202
1203 void Window::SetParent(Dali::Window& parent)
1204 {
1205   if(DALI_UNLIKELY(parent))
1206   {
1207     mParentWindow     = parent;
1208     Dali::Window self = Dali::Window(this);
1209     // check circular parent window setting
1210     if(Dali::DevelWindow::GetParent(parent) == self)
1211     {
1212       Dali::DevelWindow::Unparent(parent);
1213     }
1214     mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, false);
1215   }
1216 }
1217
1218 void Window::SetParent(Dali::Window& parent, bool belowParent)
1219 {
1220   if(DALI_UNLIKELY(parent))
1221   {
1222     mParentWindow     = parent;
1223     Dali::Window self = Dali::Window(this);
1224     // check circular parent window setting
1225     if(Dali::DevelWindow::GetParent(parent) == self)
1226     {
1227       Dali::DevelWindow::Unparent(parent);
1228     }
1229     mWindowBase->SetParent(GetImplementation(mParentWindow).mWindowBase, belowParent);
1230   }
1231 }
1232
1233 void Window::Unparent()
1234 {
1235   mWindowBase->SetParent(nullptr, false);
1236   mParentWindow.Reset();
1237 }
1238
1239 Dali::Window Window::GetParent()
1240 {
1241   return mParentWindow;
1242 }
1243
1244 WindowOrientation Window::GetCurrentOrientation() const
1245 {
1246   return ConvertToOrientation(mRotationAngle);
1247 }
1248
1249 int Window::GetPhysicalOrientation() const
1250 {
1251   return (mRotationAngle + mWindowBase->GetScreenRotationAngle()) % 360;
1252 }
1253
1254 void Window::SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations)
1255 {
1256   Dali::Vector<float>::SizeType count = orientations.Count();
1257   for(Dali::Vector<float>::SizeType index = 0; index < count; ++index)
1258   {
1259     if(IsOrientationAvailable(orientations[index]) == false)
1260     {
1261       DALI_LOG_ERROR("Window::SetAvailableOrientations, invalid orientation: %d\n", orientations[index]);
1262       continue;
1263     }
1264
1265     bool found          = false;
1266     int  convertedAngle = ConvertToAngle(orientations[index]);
1267
1268     for(std::size_t i = 0; i < mAvailableAngles.size(); i++)
1269     {
1270       if(mAvailableAngles[i] == convertedAngle)
1271       {
1272         found = true;
1273         break;
1274       }
1275     }
1276
1277     if(!found)
1278     {
1279       DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, convertedAngle);
1280       mAvailableAngles.push_back(convertedAngle);
1281     }
1282   }
1283   SetAvailableAnlges(mAvailableAngles);
1284 }
1285
1286 int32_t Window::GetNativeId() const
1287 {
1288   return mWindowBase->GetNativeWindowId();
1289 }
1290
1291 void Window::RequestMoveToServer()
1292 {
1293   mWindowBase->RequestMoveToServer();
1294 }
1295
1296 void Window::RequestResizeToServer(WindowResizeDirection direction)
1297 {
1298   mWindowBase->RequestResizeToServer(direction);
1299 }
1300
1301 void Window::EnableFloatingMode(bool enable)
1302 {
1303   mWindowBase->EnableFloatingMode(enable);
1304 }
1305
1306 bool Window::IsFloatingModeEnabled()
1307 {
1308   return mWindowBase->IsFloatingModeEnabled();
1309 }
1310
1311 void Window::IncludeInputRegion(const Rect<int>& inputRegion)
1312 {
1313   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);
1314   mWindowBase->IncludeInputRegion(inputRegion);
1315 }
1316
1317 void Window::ExcludeInputRegion(const Rect<int>& inputRegion)
1318 {
1319   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);
1320   mWindowBase->ExcludeInputRegion(inputRegion);
1321 }
1322
1323 void Window::SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
1324 {
1325   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), needAcknowledgement(%d) Set needs Rotation Completed Acknowledgement\n", this, mNativeWindowId, needAcknowledgement);
1326   mWindowSurface->SetNeedsRotationCompletedAcknowledgement(needAcknowledgement);
1327   mWindowRotationAcknowledgement = needAcknowledgement;
1328 }
1329
1330 void Window::SendRotationCompletedAcknowledgement()
1331 {
1332   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SendRotationCompletedAcknowledgement(): orientation: %d, mWindowRotationAcknowledgement: %d\n", this, mNativeWindowId, mRotationAngle, mWindowRotationAcknowledgement);
1333   if(mWindowRotationAcknowledgement)
1334   {
1335     SetRotationCompletedAcknowledgement();
1336   }
1337 }
1338
1339 bool Window::IsWindowRotating() const
1340 {
1341   return mIsWindowRotating;
1342 }
1343
1344 const Dali::KeyEvent& Window::GetLastKeyEvent() const
1345 {
1346   return mLastKeyEvent;
1347 }
1348
1349 const Dali::TouchEvent& Window::GetLastTouchEvent() const
1350 {
1351   return mLastTouchEvent;
1352 }
1353
1354 } // namespace Adaptor
1355
1356 } // namespace Internal
1357
1358 } // namespace Dali