X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fcommon%2Fadaptor-impl.h;h=f48f29e47dfb9207de8c61e81437ea6408c35cf7;hb=422667d3df334499df2778b973a0a92515c53c0a;hp=7b1ddbd02562c50e69fa0c76fe66f827cfc9b7d5;hpb=c432d327b0bd173c6fee439624aab6889dab6b95;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/common/adaptor-impl.h b/adaptors/common/adaptor-impl.h index 7b1ddbd..f48f29e 100644 --- a/adaptors/common/adaptor-impl.h +++ b/adaptors/common/adaptor-impl.h @@ -2,7 +2,7 @@ #define __DALI_INTERNAL_ADAPTOR_IMPL_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -19,24 +19,20 @@ */ // EXTERNAL INCLUDES -#include -#include -#include - -// INTERNAL INCLUDES #include #include #include +#include #include +// INTERNAL INCLUDES #include #include #include #include -#include #include -#include +#include #include #include #include @@ -44,11 +40,16 @@ #include #include #include +#include #include +#include namespace Dali { +class RenderSurface; +class Window; + namespace Integration { class Core; @@ -65,8 +66,7 @@ class EglFactory; class GestureManager; class GlImplementation; class GlSyncImplementation; -class RenderSurface; -class UpdateRenderController; +class ThreadController; class TriggerEvent; class CallbackManager; class FeedbackPluginProxy; @@ -88,19 +88,29 @@ class Adaptor : public Integration::RenderController, { public: - typedef Dali::Adaptor::AdaptorSignalV2 AdaptorSignalV2; + typedef Dali::Adaptor::AdaptorSignalType AdaptorSignalType; + + /** + * Creates a New Adaptor + * @param[in] nativeWindow Native 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, + Dali::Configuration::ContextLoss configuration, + EnvironmentOptions* environmentOptions ); /** * Creates a New 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] baseLayout The base layout that the application has been written for - * @param[in] configuration The context loss configuration ( to choose resource discard policy ) + * @param[in] nativeWindow native 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( RenderSurface* surface, - const DeviceLayout& baseLayout, - Dali::Configuration::ContextLoss configuration ); + static Dali::Adaptor* New( Dali::Window window, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions ); /** * 2-step initialisation, this should be called after creating an adaptor instance. @@ -122,6 +132,11 @@ public: */ static bool IsAvailable(); + /** + * @copydoc Dali::Core::SceneCreated(); + */ + void SceneCreated(); + public: // AdaptorInternalServices implementation /** * @copydoc Dali::Adaptor::Start() @@ -144,39 +159,39 @@ public: // AdaptorInternalServices implementation virtual void Stop(); /** - * @copydoc Dali::EventFeeder::FeedTouchPoint() + * @copydoc Dali::Adaptor::ContextLost() */ - virtual void FeedTouchPoint( TouchPoint& point, int timeStamp ); + virtual void ContextLost(); /** - * @copydoc Dali::EventFeeder::FeedWheelEvent() + * @copydoc Dali::Adaptor::ContextRegained() */ - virtual void FeedWheelEvent( MouseWheelEvent& wheelEvent ); + virtual void ContextRegained(); /** - * @copydoc Dali::EventFeeder::FeedKeyEvent() + * @copydoc Dali::EventFeeder::FeedTouchPoint() */ - virtual void FeedKeyEvent( KeyEvent& keyEvent ); + virtual void FeedTouchPoint( TouchPoint& point, int timeStamp ); /** - * @copydoc AdaptorInterface::MoveResize() + * @copydoc Dali::EventFeeder::FeedWheelEvent() */ - virtual bool MoveResize( const PositionSize& positionSize ); + virtual void FeedWheelEvent( WheelEvent& wheelEvent ); /** - * @copydoc AdaptorInterface::SurfaceResized() + * @copydoc Dali::EventFeeder::FeedKeyEvent() */ - virtual void SurfaceResized( const PositionSize& positionSize ); + virtual void FeedKeyEvent( KeyEvent& keyEvent ); /** * @copydoc AdaptorInterface::ReplaceSurface() */ - virtual void ReplaceSurface( Dali::RenderSurface& surface ); + virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface ); /** * @copydoc Dali::Adaptor::GetSurface() */ - virtual Dali::RenderSurface& GetSurface() const; + virtual RenderSurface& GetSurface() const; /** * @copydoc Dali::Adaptor::ReleaseSurfaceLock() @@ -193,12 +208,12 @@ public: // AdaptorInternalServices implementation /** * @copydoc Dali::Adaptor::AddIdle() */ - virtual bool AddIdle( boost::function callBack ); + virtual bool AddIdle( CallbackBase* callback ); /** - * @copydoc Internal::Framework::CallFromMainLoop() + * @copydoc Dali::Adaptor::RemoveIdle() */ - virtual bool CallFromMainLoop(boost::function callBack); + virtual void RemoveIdle( CallbackBase* callback ); public: @@ -218,14 +233,6 @@ public: void SetUseHardwareVSync(bool useHardware); /** - * Overrides DPI. - * Primarily for host/simulation testing - * @param[in] hDpi The Horizontal DPI - * @param[in] vDpi The Vertical DPI - */ - void SetDpi(size_t hDpi, size_t vDpi); - - /** * @return reference to EglFactory class */ EglFactory& GetEGLFactory() const; @@ -269,6 +276,19 @@ public: */ void SetMinimumPinchDistance(float distance); + /** + * Gets native window handle + * + * @return native window handle + */ + Any GetNativeWindowHandle(); + + /** + * Sets use remote surface for eglSurface output + * @param[in] useRemoteSurface True if the remote surface is used + */ + void SetUseRemoteSurface(bool useRemoteSurface); + public: /** @@ -296,10 +316,35 @@ public: void RequestUpdateOnce(); /** + * Request adaptor to update indicator's height + */ + void IndicatorSizeChanged(int height); + + /** + * @copydoc Dali::Adaptor::NotifySceneCreated() + */ + void NotifySceneCreated(); + + /** * @copydoc Dali::Adaptor::NotifyLanguageChanged() */ void NotifyLanguageChanged(); + /** + * Gets AppId of current application + */ + void GetAppId( std::string& appId ); + + /** + * Informs core the surface size has changed + */ + void SurfaceResizePrepare( Dali::Adaptor::SurfaceSize surfaceSize ); + + /** + * Informs ThreadController the surface size has changed + */ + void SurfaceResizeComplete( Dali::Adaptor::SurfaceSize surfaceSize ); + public: //AdaptorInternalServices /** @@ -320,7 +365,7 @@ public: //AdaptorInternalServices /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventInterface() */ - virtual TriggerEventInterface& GetTriggerEventInterface(); + virtual TriggerEventInterface& GetProcessCoreEventsTrigger(); /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetTriggerEventFactoryInterface() @@ -328,6 +373,11 @@ public: //AdaptorInternalServices virtual TriggerEventFactoryInterface& GetTriggerEventFactoryInterface(); /** + * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetSocketFactoryInterface() + */ + virtual SocketFactoryInterface& GetSocketFactoryInterface(); + + /** * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface() */ virtual RenderSurface* GetRenderSurfaceInterface(); @@ -345,7 +395,12 @@ public: //AdaptorInternalServices /** * copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetKernelTraceInterface() */ - virtual KernelTraceInterface& GetKernelTraceInterface(); + virtual TraceInterface& GetKernelTraceInterface(); + + /** + * copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetSystemTraceInterface() + */ + virtual TraceInterface& GetSystemTraceInterface(); public: // Stereoscopy @@ -374,17 +429,17 @@ public: // Signals /** * @copydoc Dali::Adaptor::SignalResized */ - AdaptorSignalV2& ResizedSignal() + AdaptorSignalType& ResizedSignal() { - return mResizedSignalV2; + return mResizedSignal; } /** * @copydoc Dali::Adaptor::LanguageChangedSignal */ - AdaptorSignalV2& LanguageChangedSignal() + AdaptorSignalType& LanguageChangedSignal() { - return mLanguageChangedSignalV2; + return mLanguageChangedSignal; } private: // From Dali::Internal::Adaptor::CoreEventInterface @@ -440,37 +495,39 @@ private: private: /** - * Helper to parse log options + * Assigns the render surface to the adaptor + * */ - void ParseEnvironmentOptions(); + void SetSurface(RenderSurface *surface); /** - * Informs core the surface size has changed + * called after surface is created */ - void SurfaceSizeChanged(const PositionSize& positionSize); + void SurfaceInitialized(); /** - * Assigns the render surface to the adaptor - * + * Sends an notification message from main loop idle handler */ - void SetSurface(Dali::RenderSurface *surface); + void ProcessCoreEventsFromIdle(); /** - * Sends an notification message from main loop idle handler + * Gets path for data/resource storage. + * @param[out] path Path for data/resource storage */ - void ProcessCoreEventsFromIdle(); + void GetDataStoragePath(std::string& path); private: /** * Constructor - * @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] baseLayout The base layout that the application has been written for + * @param[in] nativeWindow native 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( Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout ); + Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions ); private: // Types @@ -487,40 +544,42 @@ private: // Types private: // Data - AdaptorSignalV2 mResizedSignalV2; ///< Resized signal. - AdaptorSignalV2 mLanguageChangedSignalV2; ///< Language changed signal. + AdaptorSignalType mResizedSignal; ///< Resized signal. + AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal. Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance. State mState; ///< Current state of the adaptor Dali::Integration::Core* mCore; ///< Dali Core - UpdateRenderController* mUpdateRenderController; ///< Controls update/render threads + ThreadController* mThreadController; ///< Controls the threads VSyncMonitor* mVSyncMonitor; ///< Monitors VSync events GlImplementation* mGLES; ///< GL implementation GlSyncImplementation* mGlSync; ///< GL Sync implementation EglFactory* mEglFactory; ///< EGL Factory + Any mNativeWindow; ///< window identifier RenderSurface* mSurface; ///< Current surface - SlpPlatform::SlpPlatformAbstraction* mPlatformAbstraction; ///< Platform abstraction + 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 - TriggerEvent* mNotificationTrigger; ///< Notification event trigger + TriggerEventInterface* mNotificationTrigger; ///< Notification event trigger GestureManager* mGestureManager; ///< Gesture manager - size_t mHDpi; ///< Override horizontal DPI - size_t mVDpi; ///< Override vertical DPI 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 - DeviceLayout mBaseLayout; ///< The base layout of the application - EnvironmentOptions mEnvironmentOptions; ///< environment options + EnvironmentOptions* mEnvironmentOptions; ///< environment options 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 public: inline static Adaptor& GetImplementation(Dali::Adaptor& adaptor) {return *adaptor.mImpl;} };