#define DALI_INTERNAL_ADAPTOR_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.
#include <dali/integration-api/render-controller.h>
// 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>
-
+#include <dali/integration-api/scene.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+#include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
+#include <dali/integration-api/adaptor-framework/trigger-event-factory.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
#include <dali/internal/graphics/common/graphics-interface.h>
-
#include <dali/internal/legacy/common/tizen-platform-abstraction.h>
-#include <dali/internal/adaptor/common/adaptor-internal-services.h>
-#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/network/common/socket-factory.h>
#include <dali/internal/system/common/core-event-interface.h>
-#include <dali/internal/window-system/common/damage-observer.h>
-#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <dali/internal/system/common/environment-options.h>
#include <dali/internal/system/common/kernel-trace.h>
#include <dali/internal/system/common/system-trace.h>
-#include <dali/integration-api/trigger-event-factory.h>
-#include <dali/internal/network/common/socket-factory.h>
-
+#include <dali/internal/window-system/common/damage-observer.h>
+#include <dali/internal/window-system/common/window-visibility-observer.h>
namespace Dali
{
{
class DisplayConnection;
class GraphicsFactory;
-class GestureManager;
class GlImplementation;
class GlSyncImplementation;
class ThreadController;
class LifeCycleObserver;
class ObjectProfiler;
class SceneHolder;
+class ConfigurationManager;
/**
* Implementation of the Adaptor class.
{
public:
- typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType;
+ using AdaptorSignalType = Dali::Adaptor::AdaptorSignalType;
+ using WindowCreatedSignalType = Dali::Adaptor::WindowCreatedSignalType;
- typedef Uint16Pair SurfaceSize; ///< Surface size type
+ using SurfaceSize = Uint16Pair; ///< Surface size type
/**
* Creates a New Adaptor
* @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::Integration::SceneHolder* childWindow,
+ virtual bool AddWindow( Dali::Integration::SceneHolder childWindow,
const std::string& childWindowName,
const std::string& childWindowClassName,
- const bool& childWindowMode );
+ bool childWindowMode );
/**
* Removes an existing Window instance from the Adaptor
*/
Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
+ /**
+ * @copydoc Dali::Adaptor::GetWindows()
+ */
+ Dali::WindowContainer GetWindows() const;
+
+ /**
+ * @copydoc Dali::Adaptor::GetSceneHolders()
+ */
+ Dali::SceneHolderList GetSceneHolders() const;
+
public:
/**
void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
/**
- * @copydoc Dali::Adaptor::SetUseHardwareVSync()
- */
- void SetUseHardwareVSync(bool useHardware);
-
- /**
* Return the PlatformAbstraction.
* @return The PlatformAbstraction.
*/
Any GetNativeWindowHandle();
/**
+ * @brief Retrieve native window handle that the given actor is added to.
+ *
+ * @param[in] actor The actor
+ * @return native window handle
+ */
+ Any GetNativeWindowHandle( Dali::Actor actor );
+
+ /**
* Get the native display associated with the graphics backend
*
* @return A handle to the native display
void GetAppId( std::string& appId );
/**
- * Informs core the surface size has changed
+ * @copydoc Dali::Adaptor::SurfaceResizePrepare
*/
void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
/**
- * Informs ThreadController the surface size has changed
+ * @copydoc Dali::Adaptor::SurfaceResizeComplete
*/
void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
*/
void UnregisterProcessor( Integration::Processor& processor );
+ /**
+ * Check MultipleWindow is supported
+ */
+ bool IsMultipleWindowSupported() const;
+
+ /**
+ * @brief Checks whether the windows are being rendered in the render thread.
+ *
+ * @return true if the windows are being rendered in the render thread, or false if not.
+ */
+ bool IsRenderingWindows() const;
+
public: //AdaptorInternalServices
/**
virtual TriggerEventInterface& GetProcessCoreEventsTrigger();
/**
- * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventFactoryInterface()
- */
- virtual TriggerEventFactoryInterface& GetTriggerEventFactoryInterface();
-
- /**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetSocketFactoryInterface()
*/
virtual SocketFactoryInterface& GetSocketFactoryInterface();
virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
/**
- * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface()
- */
- virtual VSyncMonitorInterface* GetVSyncMonitorInterface();
-
- /**
* @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetPerformanceInterface()
*/
virtual PerformanceInterface* GetPerformanceInterface();
*/
virtual TraceInterface& GetSystemTraceInterface();
+ /**
+ * copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetWindowContainerInterface()
+ */
+ virtual void GetWindowContainerInterface( WindowContainer& windows );
+
public: // Signals
/**
return mLanguageChangedSignal;
}
+ /**
+ * @copydoc Dali::Adaptor::WindowCreatedSignal
+ */
+ WindowCreatedSignalType& WindowCreatedSignal()
+ {
+ return mWindowCreatedSignal;
+ }
+
public: // From Dali::Internal::Adaptor::CoreEventInterface
/**
*/
virtual void RequestProcessEventsOnIdle( bool forceProcess );
-private: // From Dali::Internal::Adaptor::WindowVisibilityObserver
+public: // From Dali::Internal::Adaptor::WindowVisibilityObserver
/**
* Called when the window becomes fully or partially visible.
enum State
{
- READY, ///< Initial state before Adaptor::Start is called.
- RUNNING, ///< Adaptor is running.
- PAUSED, ///< Adaptor has been paused.
- PAUSED_WHILE_HIDDEN, ///< Adaptor is paused while window is hidden (& cannot be resumed until window is shown).
- STOPPED, ///< Adaptor has been stopped.
+ READY, ///< Initial state before Adaptor::Start is called.
+ RUNNING, ///< Adaptor is running.
+ PAUSED, ///< Adaptor has been paused.
+ PAUSED_WHILE_HIDDEN, ///< Adaptor is paused while window is hidden (& cannot be resumed until window is shown).
+ PAUSED_WHILE_INITIALIZING, ///< Adaptor is paused while application is initializing.
+ STOPPED, ///< Adaptor has been stopped.
};
- using SceneHolderPtr = IntrusivePtr< Dali::Internal::Adaptor::SceneHolder >;
- using WindowContainer = std::vector<SceneHolderPtr>;
+ // There is no weak handle for BaseHandle in DALi, but we can't ref count the window here,
+ // so we have to store the raw pointer.
+ using WindowContainer = std::vector<Dali::Internal::Adaptor::SceneHolder*>;
using ObserverContainer = std::vector<LifeCycleObserver*>;
private: // Data
AdaptorSignalType mResizedSignal; ///< Resized signal.
AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal.
+ WindowCreatedSignalType mWindowCreatedSignal; ///< Window created signal.
Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance.
State mState; ///< Current state of the adaptor
Dali::Integration::Core* mCore; ///< Dali Core
ThreadController* mThreadController; ///< Controls the threads
- VSyncMonitor* mVSyncMonitor; ///< Monitors VSync events
GraphicsInterface* mGraphics; ///< Graphics interface
Dali::DisplayConnection* mDisplayConnection; ///< Display connection
WindowContainer mWindows; ///< A container of all the Windows that are currently created
+ std::unique_ptr<ConfigurationManager> mConfigurationManager; ///< Configuration manager
+
TizenPlatform::TizenPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction
CallbackManager* mCallbackManager; ///< Used to install callbacks
PerformanceInterface* mPerformanceInterface; ///< Performance interface
KernelTrace mKernelTracer; ///< Kernel tracer
SystemTrace mSystemTracer; ///< System tracer
- TriggerEventFactory mTriggerEventFactory; ///< Trigger event factory
ObjectProfiler* mObjectProfiler; ///< Tracks object lifetime for profiling
SocketFactory mSocketFactory; ///< Socket factory
const bool mEnvironmentOptionsOwned:1; ///< Whether we own the EnvironmentOptions (and thus, need to delete it)
- bool mUseRemoteSurface; ///< whether the remoteSurface is used or not
+ bool mUseRemoteSurface:1; ///< whether the remoteSurface is used or not
public:
inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) { return *adaptor.mImpl; }