Added UIThreadLoader to GLIB framework
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/actors/layer.h>
23 #include <dali/public-api/adaptor-framework/window-enumerations.h>
24 #include <dali/public-api/events/touch-event.h>
25 #include <dali/public-api/object/base-object.h>
26 #include <dali/public-api/object/property-array.h>
27 #include <dali/public-api/object/ref-object.h>
28
29 // INTERNAL INCLUDES
30 #include <dali/devel-api/adaptor-framework/window-devel.h>
31 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
32 #include <dali/internal/adaptor/common/adaptor-impl.h>
33 #include <dali/internal/window-system/common/event-handler.h>
34 #include <dali/public-api/adaptor-framework/key-grab.h>
35 #include <dali/public-api/adaptor-framework/window.h>
36
37 namespace Dali
38 {
39 class Adaptor;
40 class Actor;
41 class RenderSurfaceInterface;
42
43 namespace Internal
44 {
45 namespace Adaptor
46 {
47 class Orientation;
48 class WindowRenderSurface;
49 class WindowBase;
50
51 class Window;
52 using WindowPtr             = IntrusivePtr<Window>;
53 using OrientationPtr        = IntrusivePtr<Orientation>;
54 using MouseInOutEventPtr    = IntrusivePtr<Dali::DevelWindow::MouseInOutEvent>;
55 using MouseRelativeEventPtr = IntrusivePtr<Dali::DevelWindow::MouseRelativeEvent>;
56 using EventHandlerPtr       = IntrusivePtr<EventHandler>;
57
58 /**
59  * Window provides a surface to render onto with orientation & indicator properties.
60  */
61 class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker
62 {
63 public:
64   typedef Dali::Window::FocusChangeSignalType                        FocusChangeSignalType;
65   typedef Dali::Window::ResizeSignalType                             ResizeSignalType;
66   typedef Dali::DevelWindow::VisibilityChangedSignalType             VisibilityChangedSignalType;
67   typedef Dali::DevelWindow::TransitionEffectEventSignalType         TransitionEffectEventSignalType;
68   typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType;
69   typedef Dali::DevelWindow::AuxiliaryMessageSignalType              AuxiliaryMessageSignalType;
70   typedef Dali::DevelWindow::AccessibilityHighlightSignalType        AccessibilityHighlightSignalType;
71   typedef Dali::DevelWindow::MovedSignalType                         MovedSignalType;
72   typedef Dali::DevelWindow::OrientationChangedSignalType            OrientationChangedSignalType;
73   typedef Dali::DevelWindow::MouseInOutEventSignalType               MouseInOutEventSignalType;
74   typedef Dali::DevelWindow::MouseRelativeEventSignalType            MouseRelativeEventSignalType;
75   typedef Dali::DevelWindow::MoveCompletedSignalType                 MoveCompletedSignalType;
76   typedef Dali::DevelWindow::ResizeCompletedSignalType               ResizeCompletedSignalType;
77   typedef Dali::DevelWindow::InsetsChangedSignalType                 InsetsChangedSignalType;
78   typedef Dali::DevelWindow::PointerConstraintsSignalType            PointerConstraintsSignalType;
79   typedef Signal<void()>                                             SignalType;
80
81   /**
82    * @brief Create a new Window. This should only be called once by the Application class
83    * @param[in] name The window title
84    * @param[in] className The window class name
85    * @param[in] windowData The window data
86    * @return A newly allocated Window
87    */
88   static Window* New(const std::string& name, const std::string& className, const WindowData& windowData);
89
90   /**
91    * @brief Create a new Window. This should only be called once by the Application class
92    * @param[in] surface The surface used to render on.
93    * @param[in] name The window title
94    * @param[in] className The window class name
95    * @param[in] windowData The window data
96    * @return A newly allocated Window
97    */
98   static Window* New(Any surface, const std::string& name, const std::string& className, const WindowData& windowData);
99
100   /**
101    * @copydoc Dali::Window::SetClass()
102    */
103   void SetClass(std::string name, std::string className);
104
105   /**
106    * @brief Gets the window class name.
107    * @return The class of the window
108    */
109   std::string GetClassName() const;
110
111   /**
112    * @copydoc Dali::Window::Raise()
113    */
114   void Raise();
115
116   /**
117    * @copydoc Dali::Window::Lower()
118    */
119   void Lower();
120
121   /**
122    * @copydoc Dali::Window::Activate()
123    */
124   void Activate();
125
126   /**
127    * @copydoc Dali::DevelWindow::Maximize()
128    */
129   void Maximize(bool maximize);
130
131   /**
132    * @copydoc Dali::DevelWindow::IsMaximized()
133    */
134   bool IsMaximized() const;
135
136   /**
137    * @copydoc Dali::DevelWindow::SetMaximumSize()
138    */
139   void SetMaximumSize(Dali::Window::WindowSize size);
140
141   /**
142    * @copydoc Dali::DevelWindow::Minimize()
143    */
144   void Minimize(bool minimize);
145
146   /**
147    * @copydoc Dali::DevelWindow::IsMinimized()
148    */
149   bool IsMinimized() const;
150
151   /**
152    * @copydoc Dali::DevelWindow::SetMimimumSize()
153    */
154   void SetMimimumSize(Dali::Window::WindowSize size);
155
156   /**
157    * @copydoc Dali::Window::GetLayerCount()
158    */
159   uint32_t GetLayerCount() const;
160
161   /**
162    * @copydoc Dali::Window::GetLayer()
163    */
164   Dali::Layer GetLayer(uint32_t depth) const;
165
166   /**
167    * @copydoc Dali::Window::KeepRendering()
168    */
169   void KeepRendering(float durationSeconds);
170
171   /**
172    * @copydoc Dali::Window::SetPartialUpdateEnabled()
173    */
174   void SetPartialUpdateEnabled(bool enabled);
175
176   /**
177    * @copydoc Dali::Window::IsPartialUpdateEnabled()
178    */
179   bool IsPartialUpdateEnabled() const;
180
181   /**
182    * @brief Get window resource ID assigned by window manager
183    * @return The resource ID of the window
184    */
185   std::string GetNativeResourceId() const;
186
187   /**
188    * @copydoc Dali::Window::AddAvailableOrientation()
189    */
190   void AddAvailableOrientation(WindowOrientation orientation);
191
192   /**
193    * @copydoc Dali::Window::RemoveAvailableOrientation()
194    */
195   void RemoveAvailableOrientation(WindowOrientation orientation);
196
197   /**
198    * @copydoc Dali::Window::SetPreferredOrientation()
199    */
200   void SetPreferredOrientation(WindowOrientation orientation);
201
202   /**
203    * @copydoc Dali::Window::GetPreferredOrientation()
204    */
205   WindowOrientation GetPreferredOrientation();
206
207   /**
208    * @copydoc Dali::Window::SetAcceptFocus()
209    */
210   void SetAcceptFocus(bool accept);
211
212   /**
213    * @copydoc Dali::Window::IsFocusAcceptable()
214    */
215   bool IsFocusAcceptable() const;
216
217   /**
218    * @copydoc Dali::Window::Show()
219    */
220   void Show();
221
222   /**
223    * @copydoc Dali::Window::Hide()
224    */
225   void Hide();
226
227   /**
228    * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount()
229    */
230   unsigned int GetSupportedAuxiliaryHintCount() const;
231
232   /**
233    * @copydoc Dali::Window::GetSupportedAuxiliaryHint()
234    */
235   std::string GetSupportedAuxiliaryHint(unsigned int index) const;
236
237   /**
238    * @copydoc Dali::Window::AddAuxiliaryHint()
239    */
240   unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value);
241
242   /**
243    * @copydoc Dali::Window::RemoveAuxiliaryHint()
244    */
245   bool RemoveAuxiliaryHint(unsigned int id);
246
247   /**
248    * @copydoc Dali::Window::SetAuxiliaryHintValue()
249    */
250   bool SetAuxiliaryHintValue(unsigned int id, const std::string& value);
251
252   /**
253    * @copydoc Dali::Window::GetAuxiliaryHintValue()
254    */
255   std::string GetAuxiliaryHintValue(unsigned int id) const;
256
257   /**
258    * @copydoc Dali::Window::GetAuxiliaryHintId()
259    */
260   unsigned int GetAuxiliaryHintId(const std::string& hint) const;
261
262   /**
263    * @copydoc Dali::Window::SetInputRegion()
264    */
265   void SetInputRegion(const Rect<int>& inputRegion);
266
267   /**
268    * @copydoc Dali::Window::SetType()
269    */
270   void SetType(WindowType type);
271
272   /**
273    * @copydoc Dali::Window::GetType() const
274    */
275   WindowType GetType() const;
276
277   /**
278    * @copydoc Dali::Window::SetNotificationLevel()
279    */
280   WindowOperationResult SetNotificationLevel(WindowNotificationLevel level);
281
282   /**
283    * @copydoc Dali::Window::GetNotificationLevel()
284    */
285   WindowNotificationLevel GetNotificationLevel() const;
286
287   /**
288    * @copydoc Dali::Window::SetOpaqueState()
289    */
290   void SetOpaqueState(bool opaque);
291
292   /**
293    * @copydoc Dali::Window::IsOpaqueState()
294    */
295   bool IsOpaqueState() const;
296
297   /**
298    * @copydoc Dali::Window::SetScreenOffMode()
299    */
300   WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode);
301
302   /**
303    * @copydoc Dali::Window::GetScreenOffMode()
304    */
305   WindowScreenOffMode GetScreenOffMode() const;
306
307   /**
308    * @copydoc Dali::Window::SetBrightness()
309    */
310   WindowOperationResult SetBrightness(int brightness);
311
312   /**
313    * @copydoc Dali::Window::GetBrightness()
314    */
315   int GetBrightness() const;
316
317   /**
318    * @copydoc Dali::Window::SetSize()
319    */
320   void SetSize(Dali::Window::WindowSize size);
321
322   /**
323    * @copydoc Dali::Window::GetSize()
324    */
325   Dali::Window::WindowSize GetSize() const;
326
327   /**
328    * @copydoc Dali::Window::SetPosition()
329    */
330   void SetPosition(Dali::Window::WindowPosition position);
331
332   /**
333    * @copydoc Dali::Window::GetPosition()
334    */
335   Dali::Window::WindowPosition GetPosition() const;
336
337   /**
338    * @copydoc Dali::DevelWindow::SetPositionSize()
339    */
340   void SetPositionSize(PositionSize positionSize);
341
342   /**
343    * @copydoc Dali::DevelWindow::GetPositionSize()
344    */
345   PositionSize GetPositionSize() const;
346
347   /**
348    * @copydoc Dali::Window::SetLayout()
349    */
350   void SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan);
351
352   /**
353    * @copydoc Dali::Window::GetRootLayer()
354    */
355   Dali::Layer GetRootLayer() const;
356
357   /**
358    * @copydoc Dali::Window::SetTransparency()
359    */
360   void SetTransparency(bool transparent);
361
362   /**
363    * @copydoc Dali::KeyGrab::GrabKey()
364    */
365   bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode);
366
367   /**
368    * @copydoc Dali::KeyGrab::UngrabKey()
369    */
370   bool UngrabKey(Dali::KEY key);
371
372   /**
373    * @copydoc Dali::KeyGrab::GrabKeyList()
374    */
375   bool GrabKeyList(const Dali::Vector<Dali::KEY>& key, const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode, Dali::Vector<bool>& result);
376
377   /**
378    * @copydoc Dali::KeyGrab::UngrabKeyList()
379    */
380   bool UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali::Vector<bool>& result);
381
382   /**
383    * @copydoc Dali::DevelWindow::Get()
384    */
385   static Dali::Window Get(Dali::Actor actor);
386
387   /**
388    * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent)
389    */
390   void SetParent(Dali::Window& parent);
391
392   /**
393    * @copydoc Dali::DevelWindow::SetParent(Window window, Window parent, bool belowParent)
394    */
395   void SetParent(Dali::Window& parent, bool belowParent);
396
397   /**
398    * @copydoc Dali::DevelWindow::Unparent()
399    */
400   void Unparent();
401
402   /**
403    * @copydoc Dali::DevelWindow::GetParent()
404    */
405   Dali::Window GetParent();
406
407   /**
408    * @copydoc Dali::DevelWindow::GetCurrentOrientation()
409    */
410   WindowOrientation GetCurrentOrientation() const;
411
412   /**
413    * @copydoc Dali::DevelWindow::GetPhysicalOrientation()
414    */
415   int GetPhysicalOrientation() const;
416
417   /**
418    * @copydoc Dali::DevelWindow::SetAvailableOrientations()
419    */
420   void SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations);
421
422   /**
423    * @copydoc Dali::DevelWindow::SetPositionSizeWithOrientation()
424    */
425   void SetPositionSizeWithOrientation(PositionSize positionSize, WindowOrientation orientation);
426
427   /**
428    * @brief Emit the accessibility highlight signal.
429    * The highlight indicates that it is an object to interact with the user regardless of focus.
430    * After setting the highlight on the object, you can do things that the object can do, such as
431    * giving or losing focus.
432    *
433    * @param[in] highlight If window needs to grab or clear highlight.
434    */
435   void EmitAccessibilityHighlightSignal(bool highlight);
436
437   /**
438    * @brief Sets the render notification trigger to call when render thread is completed a frame
439    *
440    * @param[in] renderNotification to use
441    */
442   void SetRenderNotification(TriggerEventInterface* renderNotification);
443
444 public: // Dali::Internal::Adaptor::SceneHolder
445   /**
446    * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
447    */
448   Dali::Any GetNativeHandle() const override;
449
450   /**
451    * @copydoc Dali::Internal::Adaptor::SceneHolder::IsVisible
452    */
453   bool IsVisible() const override;
454
455   /**
456    * @copydoc Dali::DevelWindow::GetNativeId()
457    */
458   int32_t GetNativeId() const;
459
460   /**
461    * @copydoc Dali::DevelWindow::RequestMoveToServer()
462    */
463   void RequestMoveToServer();
464
465   /**
466    * @copydoc Dali::DevelWindow::RequestResizeToServer()
467    */
468   void RequestResizeToServer(WindowResizeDirection direction);
469
470   /**
471    * @copydoc Dali::DevelWindow::EnableFloatingMode()
472    */
473   void EnableFloatingMode(bool enable);
474
475   /**
476    * @copydoc Dali::DevelWindow::IsFloatingModeEnabled()
477    */
478   bool IsFloatingModeEnabled();
479
480   /**
481    * @copydoc Dali::DevelWindow::IncludeInputRegion()
482    */
483   void IncludeInputRegion(const Rect<int>& inputRegion);
484
485   /**
486    * @copydoc Dali::DevelWindow::ExcludeInputRegion()
487    */
488   void ExcludeInputRegion(const Rect<int>& inputRegion);
489
490   /**
491    * @copydoc Dali::DevelWindow::SetNeedsRotationCompletedAcknowledgement()
492    */
493   void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement);
494
495   /**
496    * @copydoc Dali::DevelWindow::SendRotationCompletedAcknowledgement()
497    */
498   void SendRotationCompletedAcknowledgement();
499
500   /**
501    * @copydoc Dali::DevelWindow::IsWindowRotating()
502    */
503   bool IsWindowRotating() const;
504
505   /**
506    * @copydoc Dali::DevelWindow::GetLastKeyEvent()
507    */
508   const Dali::KeyEvent& GetLastKeyEvent() const;
509
510   /**
511    * @copydoc Dali::DevelWindow::GetLastTouchEvent()
512    */
513   const Dali::TouchEvent& GetLastTouchEvent() const;
514
515   /**
516    * @copydoc Dali::DevelWindow::PointerConstraintsLock()
517    */
518   bool PointerConstraintsLock();
519
520   /**
521    * @copydoc Dali::DevelWindow::PointerConstraintsUnlock()
522    */
523   bool PointerConstraintsUnlock();
524
525   /**
526    * @copydoc Dali::DevelWindow::LockedPointerRegionSet()
527    */
528   void LockedPointerRegionSet(int32_t x, int32_t y, int32_t width, int32_t height);
529
530   /**
531    * @copydoc Dali::DevelWindow::LockedPointerCursorPositionHintSet()
532    */
533   void LockedPointerCursorPositionHintSet(int32_t x, int32_t y);
534
535   /**
536    * @copydoc Dali::DevelWindow::PointerWarp()
537    */
538   bool PointerWarp(int32_t x, int32_t y);
539
540   /**
541    * @copydoc Dali::DevelWindow::CursorVisibleSet()
542    */
543   void CursorVisibleSet(bool visible);
544
545   /**
546    * @copydoc Dali::DevelWindow::KeyboardGrab()
547    */
548   bool KeyboardGrab(Device::Subclass::Type deviceSubclass);
549
550   /**
551    * @copydoc Dali::DevelWindow::KeyboardUnGrab()
552    */
553   bool KeyboardUnGrab();
554
555 private:
556   /**
557    * @brief Enumeration for orietation mode.
558    * The Orientation Mode is related to screen size.
559    * If screen width is longer than height, the Orientation Mode will have LANDSCAPE.
560    * Otherwise screen width is shorter than height or same, the Orientation Mode will have PORTRAIT.
561    */
562   enum class OrientationMode
563   {
564     PORTRAIT = 0,
565     LANDSCAPE
566   };
567
568   /**
569    * Private constructor.
570    * @sa Window::New()
571    */
572   Window();
573
574   /**
575    * Destructor
576    */
577   ~Window() override;
578
579   /**
580    * Second stage initialization
581    */
582   void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, WindowType type);
583
584   /**
585    * Called when the window becomes iconified or deiconified.
586    */
587   void OnIconifyChanged(bool iconified);
588
589   /**
590    * Called when the window becomes maximized or unmaximized.
591    */
592   void OnMaximizeChanged(bool maximized);
593
594   /**
595    * Called when the window focus is changed.
596    */
597   void OnFocusChanged(bool focusIn);
598
599   /**
600    * Called when the output is transformed.
601    */
602   void OnOutputTransformed();
603
604   /**
605    * Called when the window receives a delete request.
606    */
607   void OnDeleteRequest();
608
609   /**
610    * Called when the window receives a Transition effect-start/end event.
611    */
612   void OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type);
613
614   /**
615    * @brief Called when window receives a keyboard repeat event.
616    */
617   void OnKeyboardRepeatSettingsChanged();
618
619   /**
620    * @brief Called when the window redraw is requested.
621    */
622   void OnWindowRedrawRequest();
623
624   /**
625    * @brief Called when the window's geometry data is changed by display server or client.
626    * It is based on configure noification event.
627    *
628    * @param[in] positionSize the updated window's position and size.
629    */
630   void OnUpdatePositionSize(Dali::PositionSize& positionSize);
631
632   /**
633    * @brief Called when display server sent the auxiliary message.
634    *
635    * @param[in] key the auxiliary message's key.
636    * @param[in] value the auxiliary message's value.
637    * @param[in] options the auxiliary message's options. This is the list of string.
638    */
639   void OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options);
640
641   /**
642    * @brief Called when Accessibility is enabled.
643    *
644    * This method is to register the window to accessibility bridge.
645    */
646   void OnAccessibilityEnabled();
647
648   /**
649    * @brief Called when Accessibility is disabled.
650    *
651    * This method is to remove the window from accessibility bridge.
652    */
653   void OnAccessibilityDisabled();
654
655   /**
656    * Called when the window rotation is finished.
657    *
658    * This signal is emmit when window rotation is finisehd and WindowRotationCompleted() is called.
659    */
660   void OnRotationFinished();
661
662   /**
663    * @brief Called when the mouse in or out event is received.
664    * @param[in] mouseInOutEvent the mouse event
665    */
666   void OnMouseInOutEvent(const Dali::DevelWindow::MouseInOutEvent& mouseInOutEvent);
667
668   /**
669    * @brief Called when the mouse relative event is received.
670    * @param[in] mouseRelativeEvent the mouse event
671    */
672   void OnMouseRelativeEvent(const Dali::DevelWindow::MouseRelativeEvent& mouseRelativeEvent);
673
674   /**
675    * @brief Called when the pointer is locked/unlocked
676    *
677    * @param[in] position The x, y coordinate relative to window where event happened
678    * @param[in] locked The status whether pointer is locked/unlocked
679    * @param[in] confined The status whether pointer is confined/unconfined
680    */
681   void OnPointerConstraints(const Dali::Int32Pair& position, bool locked, bool confined);
682
683   /**
684    * @brief Called when the window is moved by display server.
685    *
686    * @param[in] position the moved window's position.
687    */
688   void OnMoveCompleted(Dali::Window::WindowPosition& position);
689
690   /**
691    * @brief Called when the window is resized by display server.
692    *
693    * @param[in] positionSize the resized window's size.
694    */
695   void OnResizeCompleted(Dali::Window::WindowSize& size);
696
697   /**
698    * @brief Set available orientation to window base.
699    */
700   void SetAvailableAnlges(const std::vector<int>& angles);
701
702   /**
703    * @brief Convert from window orientation to angle using OrientationMode.
704    */
705   int ConvertToAngle(WindowOrientation orientation);
706
707   /**
708    * @brief Convert from angle to window orientation using OrientationMode.
709    */
710   WindowOrientation ConvertToOrientation(int angle) const;
711
712   /**
713    * @brief Check available window orientation for Available orientation.
714    */
715   bool IsOrientationAvailable(WindowOrientation orientation) const;
716
717   /**
718    * @brief Sets user geometry flag when window's geometry is changed.
719    * Window is created with screen size or not.
720    * If window is created with screen size or the geometry is changed by user,
721    * client should inform to server setting user.geometry flag
722    */
723   void SetUserGeometryPolicy();
724
725   /**
726    * @brief Called when window insets are changed by appearing or disappearing indicator, virtual keyboard, or clipboard.
727    *
728    * @param[in] partType the type of the part that occurs the window insets change.
729    * @param[in] partState the state of the part that occurs the window insets change.
730    * @param[in] insets the extents value of window insets.
731    */
732   void OnInsetsChanged(WindowInsetsPartType partType, WindowInsetsPartState partState, const Extents& insets);
733
734 private: // Dali::Internal::Adaptor::SceneHolder
735   /**
736    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
737    */
738   void OnAdaptorSet(Dali::Adaptor& adaptor) override;
739
740   /**
741    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
742    */
743   void OnSurfaceSet(Dali::RenderSurfaceInterface* surface) override;
744
745   /**
746    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
747    */
748   void OnPause() override;
749
750   /**
751    * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
752    */
753   void OnResume() override;
754
755   /**
756    * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculatePosition
757    */
758   Vector2 RecalculatePosition(const Vector2& position) override;
759
760 private: // Dali::Internal::Adaptor::EventHandler::Observer
761   /**
762    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
763    */
764   void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
765
766   /**
767    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
768    */
769   void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
770
771   /**
772    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
773    */
774   void OnKeyEvent(Dali::Integration::KeyEvent& keyEvent) override;
775
776   /**
777    * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
778    */
779   void OnRotation(const RotationEvent& rotation) override;
780
781 public: // Signals
782   /**
783    * @copydoc Dali::Window::FocusChangeSignal()
784    */
785   FocusChangeSignalType& FocusChangeSignal()
786   {
787     return mFocusChangeSignal;
788   }
789
790   /**
791    * @copydoc Dali::Window::ResizedSignal()
792    */
793   ResizeSignalType& ResizeSignal()
794   {
795     return mResizeSignal;
796   }
797
798   /**
799    * This signal is emitted when the window is requesting to be deleted
800    */
801   SignalType& DeleteRequestSignal()
802   {
803     return mDeleteRequestSignal;
804   }
805
806   /**
807    * @copydoc Dali::DevelWindow::VisibilityChangedSignal()
808    */
809   VisibilityChangedSignalType& VisibilityChangedSignal()
810   {
811     return mVisibilityChangedSignal;
812   }
813
814   /**
815    * @copydoc Dali::Window::SignalEventProcessingFinished()
816    */
817   Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal()
818   {
819     return mScene.EventProcessingFinishedSignal();
820   }
821
822   /**
823    * @copydoc Dali::DevelWindow::TransitionEffectEventSignal()
824    */
825   TransitionEffectEventSignalType& TransitionEffectEventSignal()
826   {
827     return mTransitionEffectEventSignal;
828   }
829
830   /**
831    * @copydoc Dali::DevelWindow::KeyboardRepeatSettingsChangedSignal()
832    */
833   KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal()
834   {
835     return mKeyboardRepeatSettingsChangedSignal;
836   }
837
838   /**
839    * @copydoc Dali::DevelWindow::AuxiliaryMessageSignal()
840    */
841   AuxiliaryMessageSignalType& AuxiliaryMessageSignal()
842   {
843     return mAuxiliaryMessageSignal;
844   }
845
846   /**
847    * @copydoc Dali::DevelWindow::AccessibilityHighlightSignal()
848    */
849   AccessibilityHighlightSignalType& AccessibilityHighlightSignal()
850   {
851     return mAccessibilityHighlightSignal;
852   }
853
854   /**
855    * @copydoc Dali::DevelWindow::MovedSignal()
856    */
857   MovedSignalType& MovedSignal()
858   {
859     return mMovedSignal;
860   }
861
862   /**
863    * @copydoc Dali::DevelWindow::OrientationChangedSignal()
864    */
865   OrientationChangedSignalType& OrientationChangedSignal()
866   {
867     return mOrientationChangedSignal;
868   }
869
870   /**
871    * @copydoc Dali::DevelWindow::MouseInOutEventSignal()
872    */
873   MouseInOutEventSignalType& MouseInOutEventSignal()
874   {
875     return mMouseInOutEventSignal;
876   }
877
878   /**
879    * @copydoc Dali::DevelWindow::MouseRelativeEventSignal()
880    */
881   MouseRelativeEventSignalType& MouseRelativeEventSignal()
882   {
883     return mMouseRelativeEventSignal;
884   }
885
886   /**
887    * @copydoc Dali::DevelWindow::PointerConstraintsSignal()
888    */
889   PointerConstraintsSignalType& PointerConstraintsSignal()
890   {
891     return mPointerConstraintsSignal;
892   }
893
894   /**
895    * @copydoc Dali::DevelWindow::MoveCompletedSignal()
896    */
897   MoveCompletedSignalType& MoveCompletedSignal()
898   {
899     return mMoveCompletedSignal;
900   }
901
902   /**
903    * @copydoc Dali::DevelWindow::ResizeCompletedSignal()
904    */
905   ResizeCompletedSignalType& ResizeCompletedSignal()
906   {
907     return mResizeCompletedSignal;
908   }
909
910   /**
911    * @copydoc Dali::DevelWindow::InsetsChangedSignal()
912    */
913   InsetsChangedSignalType& InsetsChangedSignal()
914   {
915     return mInsetsChangedSignal;
916   }
917
918 private:
919   WindowRenderSurface* mWindowSurface; ///< The window rendering surface
920   WindowBase*          mWindowBase;
921   std::string          mName;
922   std::string          mClassName;
923   Dali::Window         mParentWindow;
924
925   OrientationPtr   mOrientation;
926   std::vector<int> mAvailableAngles;
927   int              mPreferredAngle;
928
929   int mRotationAngle;  ///< The angle of the rotation
930   int mWindowWidth;    ///< The width of the window
931   int mWindowHeight;   ///< The height of the window
932   int mNativeWindowId; ///< The Native Window Id
933
934   EventHandlerPtr mEventHandler;    ///< The window events handler
935   OrientationMode mOrientationMode; ///< The physical screen mode is portrait or landscape
936
937   // Signals
938   SignalType                              mDeleteRequestSignal;
939   FocusChangeSignalType                   mFocusChangeSignal;
940   ResizeSignalType                        mResizeSignal;
941   VisibilityChangedSignalType             mVisibilityChangedSignal;
942   TransitionEffectEventSignalType         mTransitionEffectEventSignal;
943   KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal;
944   AuxiliaryMessageSignalType              mAuxiliaryMessageSignal;
945   AccessibilityHighlightSignalType        mAccessibilityHighlightSignal;
946   MovedSignalType                         mMovedSignal;
947   OrientationChangedSignalType            mOrientationChangedSignal;
948   MouseInOutEventSignalType               mMouseInOutEventSignal;
949   MouseRelativeEventSignalType            mMouseRelativeEventSignal;
950   MoveCompletedSignalType                 mMoveCompletedSignal;
951   ResizeCompletedSignalType               mResizeCompletedSignal;
952   InsetsChangedSignalType                 mInsetsChangedSignal;
953   PointerConstraintsSignalType            mPointerConstraintsSignal;
954
955   Dali::KeyEvent   mLastKeyEvent;
956   Dali::TouchEvent mLastTouchEvent;
957
958   bool mIsTransparent : 1;
959   bool mIsFocusAcceptable : 1;
960   bool mIconified : 1;
961   bool mMaximized : 1;
962   bool mOpaqueState : 1;
963   bool mWindowRotationAcknowledgement : 1;
964   bool mFocused : 1;
965   bool mIsWindowRotating : 1;      ///< The window rotating flag.
966   bool mIsEnabledUserGeometry : 1; ///< The user geometry enable flag.
967 };
968
969 } // namespace Adaptor
970 } // namespace Internal
971
972 // Helpers for public-api forwarding methods
973
974 inline Internal::Adaptor::Window& GetImplementation(Dali::Window& window)
975 {
976   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
977   BaseObject& object = window.GetBaseObject();
978   return static_cast<Internal::Adaptor::Window&>(object);
979 }
980
981 inline const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window)
982 {
983   DALI_ASSERT_ALWAYS(window && "Window handle is empty");
984   const BaseObject& object = window.GetBaseObject();
985   return static_cast<const Internal::Adaptor::Window&>(object);
986 }
987
988 } // namespace Dali
989
990 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H