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