X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor-impl.h;h=edd2e40efa5e481c83d107d582ba944de5272036;hb=aa72090722323a2372f2a8ce6c3eac9eb9ec1197;hp=428680cb546fc9793bc343619a38c855dea863cb;hpb=8999300d7e1382d64455e0089d012521758cf143;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index 428680c..edd2e40 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_ADAPTOR_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. @@ -28,6 +28,14 @@ // INTERNAL INCLUDES #include +#include + +#ifdef DALI_ADAPTOR_COMPILATION +#include +#else +#include +#endif + #include #include @@ -37,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +57,6 @@ namespace Dali { class RenderSurfaceInterface; -class Window; namespace Integration { @@ -66,7 +72,6 @@ namespace Adaptor { class DisplayConnection; class GraphicsFactory; -class EventHandler; class GestureManager; class GlImplementation; class GlSyncImplementation; @@ -75,11 +80,11 @@ class TriggerEvent; class CallbackManager; class FeedbackPluginProxy; class FeedbackController; -class RotationObserver; class VSyncMonitor; class PerformanceInterface; class LifeCycleObserver; class ObjectProfiler; +class SceneHolder; /** * Implementation of the Adaptor class. @@ -98,32 +103,32 @@ public: /** * Creates a New Adaptor - * @param[in] nativeWindow Native window handle + * @param[in] window The window handle * @param[in] surface A render surface can be one of the following * - Pixmap, adaptor will use existing Pixmap to draw on to * - Window, adaptor will use existing Window to draw on to * @param[in] configuration The context loss configuration ( to choose resource discard policy ) * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ - static Dali::Adaptor* New( Any nativeWindow, + static Dali::Adaptor* New( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface* surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); /** * Creates a New Adaptor - * @param[in] nativeWindow native window handle + * @param[in] window The window handle * @param[in] configuration The context loss configuration ( to choose resource discard policy ) * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ - static Dali::Adaptor* New( Dali::Window window, + static Dali::Adaptor* New( Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); /** * Creates a New Adaptor * @param[in] graphicsFactory A factory that creates the graphics interface - * @param[in] nativeWindow Native window handle + * @param[in] window The window handle * @param[in] surface A render surface can be one of the following * - Pixmap, adaptor will use existing Pixmap to draw on to * - Window, adaptor will use existing Window to draw on to @@ -131,7 +136,7 @@ public: * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ static Dali::Adaptor* New( GraphicsFactory& graphicsFactory, - Any nativeWindow, + Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface* surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); @@ -139,12 +144,12 @@ public: /** * Creates a New Adaptor * @param[in] graphicsFactory A factory that creates the graphics interface - * @param[in] nativeWindow native window handle + * @param[in] window The window handle * @param[in] configuration The context loss configuration ( to choose resource discard policy ) * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ static Dali::Adaptor* New( GraphicsFactory& graphicsFactory, - Dali::Window window, + Dali::Integration::SceneHolder window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); @@ -222,9 +227,9 @@ public: // AdaptorInternalServices implementation virtual void FeedKeyEvent( KeyEvent& keyEvent ); /** - * @copydoc AdaptorInterface::ReplaceSurface() + * @copydoc Dali::Adaptor::ReplaceSurface() */ - virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface ); + virtual void ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface ); /** * @copydoc Dali::Adaptor::GetSurface() @@ -255,7 +260,7 @@ public: // AdaptorInternalServices implementation * @param[in] childWindowClassName The class name that the child window belongs to * @param[in] childWindowMode The mode of the child window */ - virtual bool AddWindow( Dali::Window* childWindow, + virtual bool AddWindow( Dali::Integration::SceneHolder* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode ); @@ -264,7 +269,7 @@ public: // AdaptorInternalServices implementation * Removes an existing Window instance from the Adaptor * @param[in] window The Window instance */ - virtual bool RemoveWindow( Dali::Window* childWindow ); + virtual bool RemoveWindow( Dali::Integration::SceneHolder* childWindow ); /** * Removes an existing Window instance from the Adaptor @@ -287,7 +292,15 @@ public: // AdaptorInternalServices implementation * Removes an existing Window instance from the Adaptor * @param[in] childWindow The Window instance */ - bool RemoveWindow( Dali::Internal::Adaptor::Window* childWindow ); + bool RemoveWindow( Dali::Internal::Adaptor::SceneHolder* childWindow ); + + /** + * @brief Retrieve the window that the given actor is added to. + * + * @param[in] actor The actor + * @return The window the actor is added to or a null pointer if the actor is not added to any widnow. + */ + Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor ); public: @@ -313,33 +326,12 @@ public: Integration::PlatformAbstraction& GetPlatformAbstraction() const; /** - * Sets the Drag & Drop Listener. - * @param[in] detector The detector to send Drag & Drop events to. - */ - void SetDragAndDropDetector( DragAndDropDetectorPtr detector ); - - /** - * Sets a rotation observer, or set to NULL to remove. - * @pre Adaptor::Start() has been called ( to create EventHandler ) - * @param[in] observer The observer to listen for window rotation events - */ - void SetRotationObserver( RotationObserver* observer ); - - /** * Destroy the TtsPlayer of specific mode. * @param[in] mode The mode of TtsPlayer to destroy */ void DestroyTtsPlayer(Dali::TtsPlayer::Mode mode); /** - * @brief Sets minimum distance in pixels that the fingers must move towards/away from each other in order to - * trigger a pinch gesture - * - * @param[in] distance The minimum pinch distance in pixels - */ - void SetMinimumPinchDistance(float distance); - - /** * Gets native window handle * * @return native window handle @@ -511,17 +503,19 @@ public: // Signals return mLanguageChangedSignal; } -private: // From Dali::Internal::Adaptor::CoreEventInterface +public: // From Dali::Internal::Adaptor::CoreEventInterface /** - * @copydoc Dali::Internal::Adaptor::CoreEventInterface::QueueCoreEvent() + * @copydoc Dali::Internal::Adaptor:CoreEventInterface:::ProcessCoreEvents() */ - virtual void QueueCoreEvent(const Dali::Integration::Event& event); + virtual void ProcessCoreEvents(); + +private: // From Dali::Internal::Adaptor::CoreEventInterface /** - * @copydoc Dali::Internal::Adaptor:CoreEventInterface:::ProcessCoreEvents() + * @copydoc Dali::Internal::Adaptor::CoreEventInterface::QueueCoreEvent() */ - virtual void ProcessCoreEvents(); + virtual void QueueCoreEvent(const Dali::Integration::Event& event); private: // From Dali::Integration::RenderController @@ -609,14 +603,14 @@ private: /** * Constructor - * @param[in] nativeWindow native window handle + * @param[in] window window handle * @param[in] adaptor The public adaptor * @param[in] surface A render surface can be one of the following * - Pixmap, adaptor will use existing Pixmap to draw on to * - Window, adaptor will use existing Window to draw on to * @param[in] environmentOptions A pointer to the environment options. If NULL then one is created. */ - Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions ); + Adaptor( Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions ); private: // Types @@ -629,21 +623,9 @@ private: // Types STOPPED, ///< Adaptor has been stopped. }; - // A structure to encapsulate each Window instance for the Adaptor to track them - typedef struct WindowPane - { - Dali::Window* instance; ///< Window object - std::string window_name; ///< Name (title)_of the window - std::string class_name; ///< Class name that the window belongs to - bool window_mode; ///< Display mode of the window - Any nativeWindow; ///< window identifier - uint32_t id; ///< unique Window ID - Dali::RenderSurfaceInterface* surface; ///< The surface the Window is bound to - } WindowPane; - - typedef std::vector WindowFrames; - - typedef std::vector ObserverContainer; + using SceneHolderPtr = IntrusivePtr< Dali::Internal::Adaptor::SceneHolder >; + using WindowContainer = std::vector; + using ObserverContainer = std::vector; private: // Data @@ -658,21 +640,17 @@ private: // Data GraphicsInterface* mGraphics; ///< Graphics interface Dali::DisplayConnection* mDisplayConnection; ///< Display connection - WindowFrames mWindowFrame; ///< A container of all the Windows that are currently created + WindowContainer mWindows; ///< A container of all the Windows that are currently created TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction - EventHandler* mEventHandler; ///< event handler CallbackManager* mCallbackManager; ///< Used to install callbacks bool mNotificationOnIdleInstalled; ///< whether the idle handler is installed to send an notification event TriggerEventInterface* mNotificationTrigger; ///< Notification event trigger - GestureManager* mGestureManager; ///< Gesture manager FeedbackPluginProxy* mDaliFeedbackPlugin; ///< Used to access feedback support FeedbackController* mFeedbackController; ///< Plays feedback effects for Dali-Toolkit UI Controls. Dali::TtsPlayer mTtsPlayers[Dali::TtsPlayer::MODE_NUM]; ///< Provides TTS support ObserverContainer mObservers; ///< A list of adaptor observer pointers - DragAndDropDetectorPtr mDragAndDropDetector; ///< The Drag & Drop detector - RotationObserver* mDeferredRotationObserver; ///< deferred Rotation observer needs event handler EnvironmentOptions* mEnvironmentOptions; ///< environment options PerformanceInterface* mPerformanceInterface; ///< Performance interface KernelTrace mKernelTracer; ///< Kernel tracer