X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fintegration-api%2Fscene-holder-impl.h;h=2e44aa21f3bee1ae8dee0b18e2c7c28a60f03162;hb=819c4738b2f54c49e0299f7ff04d9b46e817aa78;hp=d720f7fa06601bc36f161ac48ee760e8c5f2bef2;hpb=34aec01c5e704ac218b08d007426da6f941b801e;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/integration-api/scene-holder-impl.h b/dali/integration-api/scene-holder-impl.h index d720f7f..2e44aa2 100644 --- a/dali/integration-api/scene-holder-impl.h +++ b/dali/integration-api/scene-holder-impl.h @@ -20,21 +20,23 @@ // EXTERNAL INCLUDES #include +#include #include #include - -// INTERNAL INCLUDES -#include #include +#include +#include +#include +// INTERNAL INCLUDES #ifdef DALI_ADAPTOR_COMPILATION #include +#include #else #include +#include #endif -#include - namespace Dali { @@ -50,6 +52,9 @@ namespace Integration { class Scene; +struct Point; +struct KeyEvent; +struct WheelEvent; } @@ -59,13 +64,14 @@ namespace Internal namespace Adaptor { +class Adaptor; class SceneHolder; using SceneHolderPtr = IntrusivePtr< SceneHolder >; /** * @brief SceneHolder creates a Scene for rendering. */ -class SceneHolder : public BaseObject +class DALI_ADAPTOR_API SceneHolder : public BaseObject { public: @@ -110,6 +116,11 @@ public: void SetSurface( Dali::RenderSurfaceInterface* surface ); /** + * @brief Called when the surface set is resized. + */ + void SurfaceResized( bool forceUpdate ); + + /** * @brief Get the render surface * @return The render surface */ @@ -124,7 +135,7 @@ public: /** * @copydoc Dali::Integration::SceneHolder::SetBackgroundColor */ - void SetBackgroundColor( Dali::Vector4 color ); + void SetBackgroundColor( const Dali::Vector4& color ); /** * @copydoc Dali::Integration::SceneHolder::GetBackgroundColor @@ -141,35 +152,60 @@ public: */ void Resume(); -public: // The following methods can be overridden if required + /** + * @copydoc Dali::Integration::SceneHolder::FeedTouchPoint + */ + void FeedTouchPoint( Dali::Integration::Point& point, int timeStamp ); /** - * @brief Returns whether the Scene is visible or not. - * @return True if the Scene is visible, false otherwise. + * @copydoc Dali::Integration::SceneHolder::FeedWheelEvent */ - virtual bool IsVisible() const; + void FeedWheelEvent( Dali::Integration::WheelEvent& wheelEvent ); -public: // The following methods must be overridden + /** + * @copydoc Dali::Integration::SceneHolder::FeedKeyEvent + */ + void FeedKeyEvent( Dali::Integration::KeyEvent& keyEvent ); /** - * @copydoc Dali::Integration::SceneHolder::GetNativeHandle + * @copydoc Dali::Integration::SceneHolder::Get() */ - virtual Dali::Any GetNativeHandle() const = 0; + static Dali::Integration::SceneHolder Get( Dali::Actor actor ); /** - * @copydoc Dali::Integration::SceneHolder::FeedTouchPoint + * @copydoc Dali::Integration::SceneHolder::KeyEventSignal() */ - virtual void FeedTouchPoint( Dali::TouchPoint& point, int timeStamp ) = 0; + Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); } /** - * @copydoc Dali::Integration::SceneHolder::FeedWheelEvent + * @copydoc Dali::Integration::SceneHolder::KeyEventGeneratedSignal() */ - virtual void FeedWheelEvent( Dali::WheelEvent& wheelEvent ) = 0; + Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); } /** - * @copydoc Dali::Integration::SceneHolder::FeedKeyEvent + * @copydoc Dali::Integration::SceneHolder::TouchSignal() + */ + Dali::Integration::SceneHolder::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); } + + /** + * @copydoc Dali::Integration::SceneHolder::WheelEventSignal() + */ + Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); } + +public: // The following methods can be overridden if required + + /** + * @brief Returns whether the Scene is visible or not. + * @return True if the Scene is visible, false otherwise. + */ + virtual bool IsVisible() const; + +public: // The following methods must be overridden + + /** + * @copydoc Dali::Integration::SceneHolder::GetNativeHandle */ - virtual void FeedKeyEvent( Dali::KeyEvent& keyEvent ) = 0; + virtual Dali::Any GetNativeHandle() const = 0; protected: @@ -211,6 +247,19 @@ private: // The following methods can be overridden if required */ virtual void OnResume() {}; + /** + * Recalculate the touch position if required + * @param[in,out] point The touch point + */ + virtual void RecalculateTouchPosition( Integration::Point& point ) {}; + +private: + + /** + * Resets the event handling. + */ + void Reset(); + private: static uint32_t mSceneHolderCounter; ///< A counter to track the SceneHolder creation @@ -227,6 +276,8 @@ protected: std::unique_ptr< Dali::RenderSurfaceInterface > mSurface; ///< The window rendering surface Adaptor* mAdaptor; ///< The adaptor + Dali::Integration::TouchEventCombiner mCombiner; ///< Combines multi-touch events. + bool mAdaptorStarted:1; ///< Whether the adaptor has started or not bool mVisible:1; ///< Whether the scene is visible or not };