X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-impl.h;h=1249b3e4baa5128e453998fd93fd7fac821873d3;hb=6e876b904e69dc4a74993c5dfc443e321daade20;hp=eb7d87332f3543f44f836f0a87f0ecaef15f4198;hpb=4bed468b4aedad38cf79cf2375c0446846ea711d;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 eb7d873..1249b3e 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -23,36 +23,43 @@ #include #include #include -#include + +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif // INTERNAL INCLUDES -#include -#include #include #include -#include +#include namespace Dali { class Adaptor; class Actor; +class RenderSurfaceInterface; namespace Internal { namespace Adaptor { +class EventHandler; class Orientation; +class RotationObserver; 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 LifeCycleObserver, public ConnectionTracker +class Window : public Dali::Internal::Adaptor::SceneHolder, public ConnectionTracker { public: typedef Dali::Window::IndicatorSignalType IndicatorSignalType; @@ -71,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 ); @@ -103,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(); @@ -118,31 +119,6 @@ public: void Activate(); /** - * @copydoc Dali::Window::Add() - */ - void Add( Dali::Actor actor ); - - /** - * @copydoc Dali::Window::Remove() - */ - void Remove( Dali::Actor remove ); - - /** - * @copydoc Dali::Window::SetBackgroundColor() - */ - void SetBackgroundColor(Vector4 color); - - /** - * @copydoc Dali::Window::GetBackgroundColor() - */ - Vector4 GetBackgroundColor() const; - - /** - * @copydoc Dali::Window::GetRootLayer() - */ - Dali::Layer GetRootLayer() const; - - /** * @copydoc Dali::Window::GetLayerCount() */ uint32_t GetLayerCount() const; @@ -183,16 +159,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 ); @@ -213,11 +179,6 @@ public: void Hide(); /** - * @copydoc Dali::Window::IsVisible() const - */ - bool IsVisible() const; - - /** * @copydoc Dali::Window::GetSupportedAuxiliaryHintCount() */ unsigned int GetSupportedAuxiliaryHintCount() const; @@ -333,6 +294,11 @@ public: void SetPositionSize( PositionSize positionSize ); /** + * @copydoc Dali::Window::GetRootLayer() + */ + Dali::Layer GetRootLayer() const; + + /** * @copydoc Dali::Window::SetTransparency() */ void SetTransparency( bool transparent ); @@ -363,10 +329,28 @@ public: void RotationDone( int orientation, int width, int height ); /** - * @brief Retrieves the unique ID of the window. - * @return The ID + * 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 + */ + bool SetRotationObserver( RotationObserver* observer ); + + /** + * @copydoc Dali::DevelWindow::Get() */ - uint32_t GetId() const; + 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: @@ -406,32 +390,42 @@ private: */ void OnDeleteRequest(); -private: // Adaptor::Observer interface +private: // Dali::Internal::Adaptor::SceneHolder /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStart() + * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedTouchPoint */ - virtual void OnStart(); + void FeedTouchPoint( TouchPoint& point, int timeStamp ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnPause() + * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedWheelEvent */ - virtual void OnPause(); + void FeedWheelEvent( WheelEvent& wheelEvent ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnResume() + * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedKeyEvent */ - virtual void OnResume(); + void FeedKeyEvent( KeyEvent& keyEvent ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStop() + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet */ - virtual void OnStop(); + void OnAdaptorSet( Dali::Adaptor& adaptor ) override; /** - * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnDestroy() + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet */ - virtual void OnDestroy(); + void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) override; + + /** + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause + */ + void OnPause() override; + + /** + * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume + */ + void OnResume() override; public: // Signals @@ -455,35 +449,52 @@ 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::TouchSignal() + */ + Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); }; + + /** + * @copydoc Dali::Window::WheelEventSignal() + */ + Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); }; + private: - static uint32_t mWindowCounter; ///< A counter to track the window creation - uint32_t mId; ///< A unique ID to identify the window starting from 0 - std::unique_ptr< WindowRenderSurface > mSurface; - Dali::Integration::Scene mScene; + WindowRenderSurface* mWindowSurface; ///< The window rendering surface WindowBase* mWindowBase; - 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; - Adaptor* mAdaptor; - Dali::DragAndDropDetector mDragAndDropDetector; Dali::Window::Type mType; OrientationPtr mOrientation; std::vector mAvailableOrientations; Dali::Window::WindowOrientation mPreferredOrientation; - Vector4 mBackgroundColor; + 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