#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.
// INTERNAL INCLUDES
#include <dali/integration-api/adaptor.h>
+#include <dali/integration-api/scene.h>
+
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/scene-holder-impl.h>
+#else
+#include <dali/integration-api/adaptors/scene-holder-impl.h>
+#endif
+
#include <dali/public-api/adaptor-framework/tts-player.h>
#include <dali/devel-api/adaptor-framework/clipboard.h>
namespace Dali
{
-class RenderSurface;
-class Window;
+class RenderSurfaceInterface;
namespace Integration
{
{
class DisplayConnection;
class GraphicsFactory;
-class EventHandler;
class GestureManager;
class GlImplementation;
class GlSyncImplementation;
class CallbackManager;
class FeedbackPluginProxy;
class FeedbackController;
-class RotationObserver;
class VSyncMonitor;
class PerformanceInterface;
class LifeCycleObserver;
class ObjectProfiler;
+class SceneHolder;
/**
* Implementation of the Adaptor class.
/**
* 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,
- RenderSurface* surface,
+ 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
* @param[in] environmentOptions A pointer to the environment options. If NULL then one is created.
*/
static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
- Any nativeWindow,
- RenderSurface* surface,
+ Dali::Integration::SceneHolder window,
+ Dali::RenderSurfaceInterface* surface,
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] 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 );
virtual void FeedKeyEvent( KeyEvent& keyEvent );
/**
- * @copydoc AdaptorInterface::ReplaceSurface()
+ * @copydoc Dali::Adaptor::ReplaceSurface()
*/
- virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
+ virtual void ReplaceSurface( Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface& surface );
/**
* @copydoc Dali::Adaptor::GetSurface()
*/
- virtual RenderSurface& GetSurface() const;
+ virtual Dali::RenderSurfaceInterface& GetSurface() const;
/**
* @copydoc Dali::Adaptor::ReleaseSurfaceLock()
* @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 );
* 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
*/
void SetPreRenderCallback( CallbackBase* callback );
+ /**
+ * Removes an existing Window instance from the Adaptor
+ * @param[in] childWindow The Window instance
+ */
+ bool RemoveWindow( Dali::Internal::Adaptor::SceneHolder* childWindow );
+
public:
/**
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 RequestUpdateOnce();
/**
- * Request adaptor to update indicator's height
- */
- void IndicatorSizeChanged(int height);
-
- /**
* @copydoc Dali::Adaptor::NotifySceneCreated()
*/
void NotifySceneCreated();
/**
* Informs core the surface size has changed
*/
- void SurfaceResizePrepare( SurfaceSize surfaceSize );
+ void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
/**
* Informs ThreadController the surface size has changed
*/
- void SurfaceResizeComplete( SurfaceSize surfaceSize );
+ void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
/**
* Sets layout direction of root by system language
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface()
*/
- virtual RenderSurface* GetRenderSurfaceInterface();
+ virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
/**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface()
return mLanguageChangedSignal;
}
+ /**
+ * Gets the gesture manager.
+ * @return The GestureManager
+ */
+ GestureManager* GetGestureManager() const
+ {
+ return mGestureManager;
+ }
+
private: // From Dali::Internal::Adaptor::CoreEventInterface
/**
* Assigns the render surface to the adaptor
*
*/
- void SetSurface(RenderSurface *surface);
+ void SetSurface(Dali::RenderSurfaceInterface *surface);
/**
* called after surface is created
/**
* 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, RenderSurface* surface, EnvironmentOptions* environmentOptions );
+ Adaptor( Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
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
- RenderSurface* surface; ///< The surface the Window is bound to
- } WindowPane;
-
- typedef std::vector<WindowPane> WindowFrames;
-
- typedef std::vector<LifeCycleObserver*> ObserverContainer;
+ using SceneHolderPtr = IntrusivePtr< Dali::Internal::Adaptor::SceneHolder >;
+ using WindowContainer = std::vector<SceneHolderPtr>;
+ using ObserverContainer = std::vector<LifeCycleObserver*>;
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
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