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