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