X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.h;h=5bc3bb9287e9351f0bbdf9c4a25cc1938b28910c;hb=d6f38dadcefb4a766c84094cd099fa758fadb176;hp=7fd04f96d4da25a4ac05a70d8921ebe1e7b4621e;hpb=59a3be8c04d5cc6b941b268bb69704fa8c34f408;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 old mode 100644 new mode 100755 index 7fd04f9..5bc3bb9 --- 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) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -23,18 +23,14 @@ #include #include #include - -#ifdef DALI_ADAPTOR_COMPILATION -#include -#else -#include -#endif +#include // INTERNAL INCLUDES -#include #include #include #include +#include +#include #include namespace Dali @@ -62,13 +58,16 @@ using EventHandlerPtr = IntrusivePtr< EventHandler >; 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 Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType; 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,19 +77,15 @@ public: static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); /** - * @copydoc Dali::Window::ShowIndicator() - */ - void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode ); - - /** - * @copydoc Dali::Window::SetIndicatorBgOpacity() - */ - void SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacity ); - - /** - * @copydoc Dali::Window::RotateIndicator() + * @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 */ - void RotateIndicator( Dali::Window::WindowOrientation orientation ); + static Window* New(Any surface, const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false); /** * @copydoc Dali::Window::SetClass() @@ -144,16 +139,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); @@ -333,6 +318,36 @@ public: */ static Dali::Window Get( Dali::Actor actor ); + /** + * @copydoc Dali::DevelWindow::SetParent() + */ + 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 ); + + /** + * @copydoc Dali::DevelWindow::SetDamagedAreas() + */ + void SetDamagedAreas(std::vector>& areas); + public: // Dali::Internal::Adaptor::SceneHolder /** @@ -345,9 +360,26 @@ public: // Dali::Internal::Adaptor::SceneHolder */ bool IsVisible() const override; + /** + * @copydoc Dali::DevelWindow::GetNativeId() + */ + int32_t GetNativeId() const; + 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() */ @@ -361,7 +393,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. @@ -383,6 +415,36 @@ private: */ void OnDeleteRequest(); + /** + * Called when the window receives a Transition effect-start/end event. + */ + void OnTransitionEffectEvent( DevelWindow::EffectState state, DevelWindow::EffectType type ); + + /** + * @brief Called when window receives a keyboard repeat event. + */ + void OnKeyboardRepeatSettingsChanged(); + + /** + * @brief Set available orientation to window base. + */ + void SetAvailableAnlges( const std::vector< int >& angles ); + + /** + * @brief Convert from window orientation to angle using OrientationMode. + */ + int ConvertToAngle( Dali::Window::WindowOrientation orientation ); + + /** + * @brief Convert from angle to window orientation using OrientationMode. + */ + 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 /** @@ -435,19 +497,18 @@ private: // Dali::Internal::Adaptor::EventHandler::Observer public: // Signals /** - * The user should connect to this signal to get a timing when indicator was shown / hidden. + * @copydoc Dali::Window::FocusChangeSignal() */ - IndicatorSignalType& IndicatorVisibilityChangedSignal() { return mIndicatorVisibilityChangedSignal; } - + FocusChangeSignalType& FocusChangeSignal() { return mFocusChangeSignal; } /** - * @copydoc Dali::Window::FocusChangedSignal() + * @copydoc Dali::Window::ResizedSignal() */ - FocusSignalType& FocusChangedSignal() { return mFocusChangedSignal; } + ResizedSignalType& ResizedSignal() { return mResizedSignal; } /** * @copydoc Dali::Window::ResizedSignal() */ - ResizedSignalType& ResizedSignal() { return mResizedSignal; } + ResizeSignalType& ResizeSignal() { return mResizeSignal; } /** * This signal is emitted when the window is requesting to be deleted @@ -455,24 +516,24 @@ public: // Signals SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; } /** - * @copydoc Dali::Window::SignalEventProcessingFinished() + * @copydoc Dali::DevelWindow::VisibilityChangedSignal() */ - Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); }; + VisibilityChangedSignalType& VisibilityChangedSignal() { return mVisibilityChangedSignal; } /** - * @copydoc Dali::Window::KeyEventSignal() + * @copydoc Dali::Window::SignalEventProcessingFinished() */ - Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); }; + Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); } /** - * @copydoc Dali::Window::TouchSignal() - */ - Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }; + * @copydoc Dali::DevelWindow::TransitionEffectEventSignal() + */ + TransitionEffectEventSignalType& TransitionEffectEventSignal() { return mTransitionEffectEventSignal; } /** - * @copydoc Dali::Window::WheelEventSignal() + * @copydoc Dali::DevelWindow::KeyboardRepeatSettingsChangedSignal() */ - Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }; + KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal() { return mKeyboardRepeatSettingsChangedSignal; } private: @@ -486,10 +547,11 @@ private: bool mOpaqueState:1; bool mResizeEnabled:1; Dali::Window::Type mType; + Dali::Window mParentWindow; - OrientationPtr mOrientation; - std::vector mAvailableOrientations; - Dali::Window::WindowOrientation mPreferredOrientation; + OrientationPtr mOrientation; + std::vector< int > mAvailableAngles; + int mPreferredAngle; int mRotationAngle; ///< The angle of the rotation int mWindowWidth; ///< The width of the window @@ -497,13 +559,18 @@ private: EventHandlerPtr mEventHandler; ///< The window events handler - // Signals - IndicatorSignalType mIndicatorVisibilityChangedSignal; - FocusSignalType mFocusChangedSignal; - ResizedSignalType mResizedSignal; - SignalType mDeleteRequestSignal; + OrientationMode mOrientationMode; + int mNativeWindowId; ///< The Native Window Id + // Signals + ResizedSignalType mResizedSignal; + SignalType mDeleteRequestSignal; + FocusChangeSignalType mFocusChangeSignal; + ResizeSignalType mResizeSignal; + VisibilityChangedSignalType mVisibilityChangedSignal; + TransitionEffectEventSignalType mTransitionEffectEventSignal; + KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; }; } // namespace Adaptor