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