X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.h;h=97fc5758c2e166e27a9a46376f14ba517a0276ff;hb=3965f6e768fa75655906eee954e8292935a2259e;hp=fff44b760962de440e694ae7598761da537aeb01;hpb=2ee98a57619a579e1a33bbcb340bf538eee90fff;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index fff44b7..97fc575 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,23 +21,27 @@ // EXTERNAL INCLUDES #include #include +#include +#include + +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif // INTERNAL INCLUDES -#include #include -#include #include #include -#include +#include +#include namespace Dali { class Adaptor; - -namespace Integration -{ -class SystemOverlay; -} +class Actor; +class RenderSurfaceInterface; namespace Internal { @@ -48,13 +52,14 @@ class WindowRenderSurface; class WindowBase; class Window; -typedef IntrusivePtr WindowPtr; -typedef IntrusivePtr OrientationPtr; +using WindowPtr = IntrusivePtr< Window >; +using OrientationPtr = IntrusivePtr< Orientation >; +using EventHandlerPtr = IntrusivePtr< EventHandler >; /** * Window provides a surface to render onto with orientation & indicator properties. */ -class Window : public Dali::BaseObject, public IndicatorInterface::Observer, public LifeCycleObserver, public ConnectionTracker +class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker { public: typedef Dali::Window::IndicatorSignalType IndicatorSignalType; @@ -73,18 +78,6 @@ public: static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); /** - * Pass the adaptor back to the overlay. This allows the window to access Core's overlay. - * @param[in] adaptor An initialized adaptor - */ - void SetAdaptor(Dali::Adaptor& adaptor); - - /** - * Get the window surface - * @return The render surface - */ - WindowRenderSurface* GetSurface(); - - /** * @copydoc Dali::Window::ShowIndicator() */ void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ); @@ -95,11 +88,6 @@ public: void SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacity ); /** - * Set the indicator visible mode - */ - void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode ); - - /** * @copydoc Dali::Window::RotateIndicator() */ void RotateIndicator( Dali::Window::WindowOrientation orientation ); @@ -110,6 +98,12 @@ public: void SetClass( std::string name, std::string className ); /** + * @brief Gets the window class name. + * @return The class of the window + */ + std::string GetClassName() const; + + /** * @copydoc Dali::Window::Raise() */ void Raise(); @@ -125,6 +119,21 @@ public: void Activate(); /** + * @copydoc Dali::Window::GetLayerCount() + */ + uint32_t GetLayerCount() const; + + /** + * @copydoc Dali::Window::GetLayer() + */ + Dali::Layer GetLayer( uint32_t depth ) const; + + /** + * @copydoc Dali::DevelWindow::GetRenderTaskList() + */ + Dali::RenderTaskList GetRenderTaskList() const; + + /** * @copydoc Dali::Window::AddAvailableOrientation() */ void AddAvailableOrientation(Dali::Window::WindowOrientation orientation); @@ -155,16 +164,6 @@ public: Dali::Window::WindowOrientation GetPreferredOrientation(); /** - * @copydoc Dali::Window::GetDragAndDropDetector() const - */ - Dali::DragAndDropDetector GetDragAndDropDetector() const; - - /** - * @copydoc Dali::Window::GetNativeHandle() const - */ - Dali::Any GetNativeHandle() const; - - /** * @copydoc Dali::Window::SetAcceptFocus() */ void SetAcceptFocus( bool accept ); @@ -185,11 +184,6 @@ public: void Hide(); /** - * @copydoc Dali::Window::IsVisible() const - */ - bool IsVisible() const; - - /** * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount() */ unsigned int GetSupportedAuxiliaryHintCount() const; @@ -305,6 +299,11 @@ public: void SetPositionSize( PositionSize positionSize ); /** + * @copydoc Dali::Window::GetRootLayer() + */ + Dali::Layer GetRootLayer() const; + + /** * @copydoc Dali::Window::SetTransparency() */ void SetTransparency( bool transparent ); @@ -330,9 +329,21 @@ public: bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ); /** - * Called from Orientation after the Change signal has been sent + * @copydoc Dali::DevelWindow::Get() */ - void RotationDone( int orientation, int width, int height ); + static Dali::Window Get( Dali::Actor actor ); + +public: // Dali::Internal::Adaptor::SceneHolder + + /** + * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle + */ + Dali::Any GetNativeHandle() const override; + + /** + * @copydoc Dali::Internal::Adaptor::SceneHolder::IsVisible + */ + bool IsVisible() const override; private: @@ -353,28 +364,6 @@ private: void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className); /** - * Shows / hides the indicator bar. - * Handles close/open if rotation changes whilst hidden - */ - void DoShowIndicator( Dali::Window::WindowOrientation lastOrientation ); - - /** - * Close current indicator and open a connection onto the new indicator service. - * Effect may not be synchronous if waiting for an indicator update on existing connection. - */ - void DoRotateIndicator( Dali::Window::WindowOrientation orientation ); - - /** - * Change the indicator actor's rotation to match the current orientation - */ - void SetIndicatorActorRotation(); - - /** - * Set the indicator properties on the window - */ - void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ); - - /** * Called when the window becomes iconified or deiconified. */ void OnIconifyChanged( bool iconified ); @@ -394,54 +383,54 @@ private: */ void OnDeleteRequest(); +private: // Dali::Internal::Adaptor::SceneHolder + /** - * Called when the Ecore indicator event is received. + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet */ - void OnIndicatorFlicked(); - -private: // IndicatorInterface::Observer interface + void OnAdaptorSet( Dali::Adaptor& adaptor ) override; /** - * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged() + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet */ - virtual void IndicatorTypeChanged( IndicatorInterface::Type type ); + void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) override; /** - * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed() + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause */ - virtual void IndicatorClosed( IndicatorInterface* indicator); + void OnPause() override; /** - * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged() + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume */ - virtual void IndicatorVisibilityChanged( bool isVisible ); - -private: // Adaptor::Observer interface + void OnResume() override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStart() + * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition */ - virtual void OnStart(); + void RecalculateTouchPosition( Integration::Point& point ) override; + +private: // Dali::Internal::Adaptor::EventHandler::Observer /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnPause() + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint */ - virtual void OnPause(); + void OnTouchPoint( Dali::Integration::Point& point, int timeStamp ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnResume() + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent */ - virtual void OnResume(); + void OnWheelEvent( Dali::Integration::WheelEvent& wheelEvent ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStop() + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent */ - virtual void OnStop(); + void OnKeyEvent( Dali::Integration::KeyEvent& keyEvent ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnDestroy() + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation */ - virtual void OnDestroy(); + void OnRotation( const RotationEvent& rotation ) override; public: // Signals @@ -465,38 +454,61 @@ public: // Signals */ SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } + /** + * @copydoc Dali::Window::SignalEventProcessingFinished() + */ + Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); }; + + /** + * @copydoc Dali::Window::KeyEventSignal() + */ + Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }; + + /** + * @copydoc Dali::Window::KeyEventGeneratedSignal() + */ + Dali::DevelWindow::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); }; + + /** + * @copydoc Dali::Window::TouchSignal() + */ + Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }; + + /** + * @copydoc Dali::Window::WheelEventSignal() + */ + Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }; + private: - WindowRenderSurface* mSurface; + WindowRenderSurface* mWindowSurface; ///< The window rendering surface WindowBase* mWindowBase; - Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state - bool mIndicatorIsShown:1; ///< private state - bool mShowRotatedIndicatorOnClose:1; - bool mStarted:1; + std::string mName; + std::string mClassName; bool mIsTransparent:1; bool mIsFocusAcceptable:1; - bool mVisible:1; bool mIconified:1; bool mOpaqueState:1; bool mResizeEnabled:1; - std::unique_ptr< IndicatorInterface > mIndicator; - Dali::Window::WindowOrientation mIndicatorOrientation; - Dali::Window::WindowOrientation mNextIndicatorOrientation; - Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode; - Integration::SystemOverlay* mOverlay; - Adaptor* mAdaptor; - Dali::DragAndDropDetector mDragAndDropDetector; Dali::Window::Type mType; OrientationPtr mOrientation; std::vector mAvailableOrientations; Dali::Window::WindowOrientation mPreferredOrientation; + int mRotationAngle; ///< The angle of the rotation + int mWindowWidth; ///< The width of the window + int mWindowHeight; ///< The height of the window + + EventHandlerPtr mEventHandler; ///< The window events handler + // Signals - IndicatorSignalType mIndicatorVisibilityChangedSignal; - FocusSignalType mFocusChangedSignal; - ResizedSignalType mResizedSignal; - SignalType mDeleteRequestSignal; + IndicatorSignalType mIndicatorVisibilityChangedSignal; + FocusSignalType mFocusChangedSignal; + ResizedSignalType mResizedSignal; + SignalType mDeleteRequestSignal; + + }; } // namespace Adaptor