X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.h;h=0d4a4e10e689b38e97d2a13e9575ee1837ee074c;hb=6e77f2f2c059b23e19ee8387397192431a88232a;hp=3dd82d7d0ffa4bc89d66d54848162df44797ed24;hpb=e4b2c8c6447fd947245d10cf14481d1fb8788a26;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 3dd82d7..0d4a4e1 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -23,17 +23,15 @@ #include #include #include - -#ifdef DALI_ADAPTOR_COMPILATION -#include -#else -#include -#endif +#include // INTERNAL INCLUDES #include #include #include +#include +#include +#include namespace Dali { @@ -45,9 +43,7 @@ namespace Internal { namespace Adaptor { -class EventHandler; class Orientation; -class RotationObserver; class WindowRenderSurface; class WindowBase; @@ -59,16 +55,20 @@ using EventHandlerPtr = IntrusivePtr< EventHandler >; /** * Window provides a surface to render onto with orientation & indicator properties. */ -class Window : public Dali::Internal::Adaptor::SceneHolder, public ConnectionTracker +class Window : public Dali::Internal::Adaptor::SceneHolder, public EventHandler::Observer, public ConnectionTracker { public: typedef Dali::Window::IndicatorSignalType IndicatorSignalType; typedef Dali::Window::FocusSignalType FocusSignalType; typedef Dali::Window::ResizedSignalType ResizedSignalType; + typedef Dali::Window::FocusChangeSignalType FocusChangeSignalType; + typedef Dali::Window::ResizeSignalType ResizeSignalType; + typedef Dali::DevelWindow::VisibilityChangedSignalType VisibilityChangedSignalType; + typedef Dali::DevelWindow::TransitionEffectEventSignalType TransitionEffectEventSignalType; typedef Signal< void () > SignalType; /** - * Create a new Window. This should only be called once by the Application class + * @brief Create a new Window. This should only be called once by the Application class * @param[in] positionSize The position and size of the window * @param[in] name The window title * @param[in] className The window class name @@ -78,6 +78,17 @@ public: static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); /** + * @brief Create a new Window. This should only be called once by the Application class + * @param[in] surface The surface used to render on. + * @param[in] positionSize The position and size of the window + * @param[in] name The window title + * @param[in] className The window class name + * @param[in] isTransparent Whether window is transparent + * @return A newly allocated Window + */ + static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); + + /** * @copydoc Dali::Window::ShowIndicator() */ void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ); @@ -129,6 +140,11 @@ public: 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); @@ -139,16 +155,6 @@ public: void RemoveAvailableOrientation(Dali::Window::WindowOrientation orientation); /** - * @copydoc Dali::Window::SetAvailableOrientations() - */ - void SetAvailableOrientations(const std::vector& orientations); - - /** - * @copydoc Dali::Window::GetAvailableOrientations() - */ - const std::vector& GetAvailableOrientations(); - - /** * @copydoc Dali::Window::SetPreferredOrientation() */ void SetPreferredOrientation(Dali::Window::WindowOrientation orientation); @@ -324,16 +330,34 @@ 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 ); /** - * Set the rotation observer (note, some adaptors may not have a rotation observer) - * @param[in] observer The rotation observer - * @return If the rotation observer is set + * @copydoc Dali::DevelWindow::SetParent() */ - bool SetRotationObserver( RotationObserver* observer ); + void SetParent( Dali::Window& parent ); + + /** + * @copydoc Dali::DevelWindow::Unparent() + */ + void Unparent(); + + /** + * @copydoc Dali::DevelWindow::GetParent() + */ + Dali::Window GetParent(); + + /** + * @copydoc Dali::DevelWindow::GetCurrentOrientation() + */ + Dali::Window::WindowOrientation GetCurrentOrientation() const; + + /** + * @copydoc Dali::DevelWindow::SetAvailableOrientations() + */ + void SetAvailableOrientations( const Dali::Vector& orientations ); public: // Dali::Internal::Adaptor::SceneHolder @@ -350,6 +374,18 @@ public: // Dali::Internal::Adaptor::SceneHolder private: /** + * @brief Enumeration for orietation mode. + * The Orientation Mode is related to screen size. + * If screen width is longer than height, the Orientation Mode will have LANDSCAPE. + * Otherwise screen width is shorter than height or same, the Orientation Mode will have PORTRAIT. + */ + enum class OrientationMode + { + PORTRAIT = 0, + LANDSCAPE + }; + + /** * Private constructor. * @sa Window::New() */ @@ -363,7 +399,7 @@ private: /** * Second stage initialization */ - void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className); + void Initialize(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className); /** * Called when the window becomes iconified or deiconified. @@ -385,22 +421,32 @@ private: */ void OnDeleteRequest(); -private: // Dali::Internal::Adaptor::SceneHolder + /** + * Called when the window receives a Transition effect-start/end event. + */ + void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type ); /** - * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedTouchPoint + * @brief Set available orientation to window base. */ - void FeedTouchPoint( TouchPoint& point, int timeStamp ) override; + void SetAvailableAnlges( const std::vector< int >& angles ); /** - * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedWheelEvent + * @brief Convert from window orientation to angle using OrientationMode. */ - void FeedWheelEvent( WheelEvent& wheelEvent ) override; + int ConvertToAngle( Dali::Window::WindowOrientation orientation ); /** - * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedKeyEvent + * @brief Convert from angle to window orientation using OrientationMode. */ - void FeedKeyEvent( KeyEvent& keyEvent ) override; + Dali::Window::WindowOrientation ConvertToOrientation( int angle ) const; + + /** + * @brief Check available window orientation for Available orientation. + */ + bool IsOrientationAvailable( Dali::Window::WindowOrientation orientation ) const; + +private: // Dali::Internal::Adaptor::SceneHolder /** * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet @@ -422,6 +468,33 @@ private: // Dali::Internal::Adaptor::SceneHolder */ void OnResume() override; + /** + * @copydoc Dali::Internal::Adaptor::SceneHolder::RecalculateTouchPosition + */ + void RecalculateTouchPosition( Integration::Point& point ) override; + +private: // Dali::Internal::Adaptor::EventHandler::Observer + + /** + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint + */ + void OnTouchPoint( Dali::Integration::Point& point, int timeStamp ) override; + + /** + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent + */ + void OnWheelEvent( Dali::Integration::WheelEvent& wheelEvent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent + */ + void OnKeyEvent( Dali::Integration::KeyEvent& keyEvent ) override; + + /** + * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation + */ + void OnRotation( const RotationEvent& rotation ) override; + public: // Signals /** @@ -435,34 +508,38 @@ public: // Signals FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; } /** + * @copydoc Dali::Window::WindowFocusChangedSignal() + */ + FocusChangeSignalType& FocusChangeSignal() { return mFocusChangeSignal; } + /** * @copydoc Dali::Window::ResizedSignal() */ ResizedSignalType& ResizedSignal() { return mResizedSignal; } /** - * This signal is emitted when the window is requesting to be deleted + * @copydoc Dali::Window::ResizedSignal() */ - SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } + ResizeSignalType& ResizeSignal() { return mResizeSignal; } /** - * @copydoc Dali::Window::SignalEventProcessingFinished() + * This signal is emitted when the window is requesting to be deleted */ - Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); }; + SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } /** - * @copydoc Dali::Window::KeyEventSignal() + * @copydoc Dali::DevelWindow::VisibilityChangedSignal() */ - Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }; + VisibilityChangedSignalType& VisibilityChangedSignal() { return mVisibilityChangedSignal; } /** - * @copydoc Dali::Window::TouchSignal() - */ - Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }; + * @copydoc Dali::Window::SignalEventProcessingFinished() + */ + Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); } /** - * @copydoc Dali::Window::WheelEventSignal() + * @copydoc Dali::DevelWindow::TransitionEffectEventSignal() */ - Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }; + TransitionEffectEventSignalType& TransitionEffectEventSignal() { return mTransitionEffectEventSignal; } private: @@ -476,20 +553,31 @@ private: bool mOpaqueState:1; bool mResizeEnabled:1; Dali::Window::Type mType; + Dali::Window mParentWindow; + + OrientationPtr mOrientation; + std::vector< int > mAvailableAngles; + int mPreferredAngle; - 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 + OrientationMode mOrientationMode; + + int mNativeWindowId; ///< The Native Window Id + // Signals IndicatorSignalType mIndicatorVisibilityChangedSignal; FocusSignalType mFocusChangedSignal; ResizedSignalType mResizedSignal; SignalType mDeleteRequestSignal; - - + FocusChangeSignalType mFocusChangeSignal; + ResizeSignalType mResizeSignal; + VisibilityChangedSignalType mVisibilityChangedSignal; + TransitionEffectEventSignalType mTransitionEffectEventSignal; }; } // namespace Adaptor