X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fstage-impl.h;h=f8299a84d6c9e810af4ae796c69b75848f885105;hb=55827866fcb8c7ee47581ac4335a3390472090e8;hp=7ff94ba31b53188865a1740ed74eeedd8c41aef6;hpb=af9100d2cfdd582fcd5702d3394c9c4936072d8e;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/stage-impl.h b/dali/internal/event/common/stage-impl.h index 7ff94ba..f8299a8 100644 --- a/dali/internal/event/common/stage-impl.h +++ b/dali/internal/event/common/stage-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_STAGE_H__ -#define __DALI_INTERNAL_STAGE_H__ +#ifndef DALI_INTERNAL_STAGE_H +#define DALI_INTERNAL_STAGE_H /* - * Copyright (c) 2017 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. @@ -19,10 +19,13 @@ */ // INTERNAL INCLUDES -#include #include -#include +#include #include +#include +#include +#include +#include #include #include #include @@ -31,11 +34,7 @@ #include #include #include -#include -#include -#include -#include -#include +#include namespace Dali { @@ -44,7 +43,6 @@ struct Vector2; namespace Integration { -class SystemOverlay; class RenderController; } @@ -60,40 +58,28 @@ class AnimationPlaylist; class PropertyNotificationManager; class Layer; class LayerList; -class SystemOverlay; class CameraActor; class RenderTaskList; +class Scene; /** * Implementation of Stage */ -class Stage : public BaseObject, public RenderTaskDefaults, public Integration::ContextNotifierInterface, public EventThreadServices +class Stage : public BaseObject, public RenderTaskDefaults, public Integration::ContextNotifierInterface, public ConnectionTracker { public: /** * Create the stage - * @param[in] playlist for animations - * @param[in] propertyNotificationManager * @param[in] updateManager - * @param[in] notificationManager - * @param[in] renderController */ - static StagePtr New( AnimationPlaylist& playlist, - PropertyNotificationManager& propertyNotificationManager, - SceneGraph::UpdateManager& updateManager, - NotificationManager& notificationManager, - Integration::RenderController& renderController ); + static StagePtr New( SceneGraph::UpdateManager& updateManager ); /** * Initialize the stage. + * @param[in] scene The default scene (for main window). */ - void Initialize(); - - /** - * Uninitialize the stage. - */ - void Uninitialize(); + void Initialize( Scene& scene ); /** * @copydoc Dali::Stage::GetCurrent() @@ -117,18 +103,6 @@ public: */ Layer& GetRootActor(); - /** - * Returns the animation playlist. - * @return reference to the animation playlist. - */ - AnimationPlaylist& GetAnimationPlaylist(); - - /** - * Returns the property notification manager. - * @return reference to the property notification manager. - */ - PropertyNotificationManager& GetPropertyNotificationManager(); - // Root actor accessors /** @@ -142,22 +116,6 @@ public: void Remove( Actor& actor ); /** - * Used to calculate the size of the stage and indirectly, the root actor. - * @param [in] width The new surface width. - * @param [in] height The new surface height. - */ - void SurfaceResized( float width, float height ); - - /** - * Sets the top margin size. - * Available stage size is reduced by this size. - * The stage is located below the size at the top of the display - * initial size is zero before it is assigned - * @param[in] margin margin size - */ - void SetTopMargin( unsigned int margin ); - - /** * Returns the size of the Stage in pixels as a Vector. * The x component will be the width of the Stage in pixels * The y component will be the height of the Stage in pixels @@ -171,16 +129,6 @@ public: RenderTaskList& GetRenderTaskList() const; /** - * Create a default camera actor - */ - void CreateDefaultCameraActor(); - - /** - * Set position of default camera for current stage size - */ - void SetDefaultCameraPosition(); - - /** * From RenderTaskDefaults; retrieve the default root actor. * @return The default root actor. */ @@ -197,12 +145,12 @@ public: /** * @copydoc Dali::Stage::GetLayerCount() */ - unsigned int GetLayerCount() const; + uint32_t GetLayerCount() const; /** * @copydoc Dali::Stage::GetLayer() */ - Dali::Layer GetLayer( unsigned int depth ) const; + Dali::Layer GetLayer( uint32_t depth ) const; /** * @copydoc Dali::Stage::GetRootLayer() @@ -215,94 +163,62 @@ public: */ LayerList& GetLayerList(); - // System-level overlay actors - - /** - * @copydoc Dali::Integration::Core::GetSystemOverlay() - */ - Integration::SystemOverlay& GetSystemOverlay(); - - /** - * Retrieve the internal implementation of the SystemOverlay. - * @return The implementation, or NULL if this has never been requested from Integration API. - */ - SystemOverlay* GetSystemOverlayInternal(); - - // Stereoscopy + // Misc /** - * @copydoc Dali::Integration::Core::SetViewMode() + * @copydoc Dali::Stage::SetBackgroundColor */ - void SetViewMode( ViewMode viewMode ); + void SetBackgroundColor(Vector4 color); /** - * @copydoc Dali::Integration::Core::GetViewMode() + * @copydoc Dali::Stage::GetBackgroundColor */ - ViewMode GetViewMode() const; + Vector4 GetBackgroundColor() const; /** - * @copydoc Dali::Integration::Core::SetStereoBase() + * @copydoc Dali::Stage::GetDpi */ - void SetStereoBase( float stereoBase ); + Vector2 GetDpi() const; /** - * @copydoc Dali::Integration::Core::GetStereoBase() + * @copydoc Dali::Stage::KeepRendering() */ - float GetStereoBase() const; - - // Keyboard stuff + void KeepRendering( float durationSeconds ); /** - * As one virtual keyboard per stage, the stage will hold a pointer to the Actor currently - * set to receive keyboard input. - * @param[in] actor to receive keyboard input + * @copydoc Dali::DevelStage::SetRenderingBehavior() */ - void SetKeyboardFocusActor( Actor* actor ); + void SetRenderingBehavior( DevelStage::Rendering renderingBehavior ); /** - * Get the actor that is currently set to receive keyboard inputs - * @return Pointer to the actor set to receive keyboard inputs. + * @copydoc Dali::DevelStage::GetRenderingBehavior() */ - Actor* GetKeyboardFocusActor() const; + DevelStage::Rendering GetRenderingBehavior() const; /** - * Removes the given actor from keyboard focus so it will no longer receive key events from keyboard. - * @param [in] actor which should be removed from focus. + * Callback for Internal::Scene EventProcessingFinished signal */ - void RemoveActorFromKeyFocus( Actor* actor ); - - // Misc + void OnEventProcessingFinished(); /** - * @copydoc Dali::Stage::SetBackgroundColor + * Callback for Internal::Scene KeyEventSignal signal */ - void SetBackgroundColor(Vector4 color); + void OnKeyEvent( const Dali::KeyEvent& event ); /** - * @copydoc Dali::Stage::GetBackgroundColor + * Callback for Internal::Scene TouchedEventSignal signal */ - Vector4 GetBackgroundColor() const; + void OnTouchedEvent( const Dali::TouchEvent& touch ); /** - * @copydoc Dali::Stage::GetDpi + * Callback for Internal::Scene TouchSignal signal */ - Vector2 GetDpi() const; + void OnTouchEvent( const Dali::TouchData& touch ); /** - * Sets horizontal and vertical pixels per inch value that is used by the display - * @param[in] dpi Horizontal and vertical dpi value + * Callback for Internal::Scene WheelEventSignal signal */ - void SetDpi( Vector2 dpi ); - - NotificationManager& GetNotificationManager() - { - return mNotificationManager; - } - - /** - * @copydoc Dali::Stage::KeepRendering() - */ - void KeepRendering( float durationSeconds ); + void OnWheelEvent( const Dali::WheelEvent& event ); /** * Used by the EventProcessor to emit key event signals. @@ -388,6 +304,16 @@ public: Dali::DevelStage::KeyEventGeneratedSignalType& KeyEventGeneratedSignal(); /** + * @copydoc Dali::DevelStage::AddFrameCallback() + */ + void AddFrameCallback( FrameCallbackInterface& frameCallback, Actor& rootActor ); + + /** + * @copydoc Dali::DevelStage::RemoveFrameCallback() + */ + void RemoveFrameCallback( FrameCallbackInterface& frameCallback ); + + /** * Connects a callback function with the object's signals. * @param[in] object The object providing the signal. * @param[in] tracker Used to disconnect the signal. @@ -410,69 +336,12 @@ private: // Implementation of ContextNotificationInterface: */ virtual void NotifyContextRegained(); -public: // Implementation of EventThreadServices - - /** - * @copydoc EventThreadServices::RegisterObject - */ - virtual void RegisterObject( BaseObject* object); - - /** - * @copydoc EventThreadServices::UnregisterObject - */ - virtual void UnregisterObject( BaseObject* object); - - /** - * @copydoc EventThreadServices::GetUpdateManager - */ - virtual SceneGraph::UpdateManager& GetUpdateManager(); - - /** - * @copydoc EventThreadServices::GetRenderController - */ - virtual Integration::RenderController& GetRenderController(); - - /** - * @copydoc EventThreadServices::ReserveMessageSlot - */ - virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene ); - - /** - * @copydoc EventThreadServices::GetEventBufferIndex - */ - virtual BufferIndex GetEventBufferIndex() const; - - /** - * @copydoc EventThreadServices::ForceNextUpdate - */ - virtual void ForceNextUpdate(); - - /** - * @copydoc EventThreadServices::IsNextUpdateForced - */ - virtual bool IsNextUpdateForced(); - - /** - * Request that the depth tree is rebuilt - */ - void RequestRebuildDepthTree(); - - /** - * Rebuilds the depth tree at the end of the event frame if - * it was requested this frame. - */ - void RebuildDepthTree(); - private: /** * Protected constructor; see also Stage::New() */ - Stage( AnimationPlaylist& playlist, - PropertyNotificationManager& propertyNotificationManager, - SceneGraph::UpdateManager& updateManager, - NotificationManager& notificationManager, - Integration::RenderController& renderController ); + Stage( SceneGraph::UpdateManager& updateManager ); /** * A reference counted object may only be deleted by calling Unreference() @@ -481,52 +350,9 @@ private: private: - // For 'Fire and forget' animation support - AnimationPlaylist& mAnimationPlaylist; - - PropertyNotificationManager& mPropertyNotificationManager; - SceneGraph::UpdateManager& mUpdateManager; - NotificationManager& mNotificationManager; - - Integration::RenderController& mRenderController; - - // The stage-size may be less than surface-size (reduced by top-margin) - Vector2 mSize; - Vector2 mSurfaceSize; - - // Cached for public GetBackgroundColor() - Vector4 mBackgroundColor; - - LayerPtr mRootLayer; - - // Ordered list of currently on-stage layers - OwnerPointer mLayerList; - - IntrusivePtr mDefaultCamera; - - ViewMode mViewMode; - float mStereoBase; - - unsigned int mTopMargin; - Vector2 mDpi; - - // The object registry - ObjectRegistryPtr mObjectRegistry; - - // The list of render-tasks - IntrusivePtr mRenderTaskList; - - Dali::RenderTask mRightRenderTask; - IntrusivePtr mRightCamera; - Dali::RenderTask mLeftRenderTask; - IntrusivePtr mLeftCamera; - - Integration::SystemOverlay* mSystemOverlay; ///< SystemOverlay stage access - - bool mDepthTreeDirty; ///< True if the depth tree needs recalculating - bool mForceNextUpdate; ///< True if the next rendering is really required. + IntrusivePtr mScene; // The key event signal Dali::Stage::KeyEventSignalType mKeyEventSignal; @@ -546,6 +372,8 @@ private: Dali::Stage::ContextStatusSignal mContextRegainedSignal; Dali::Stage::SceneCreatedSignalType mSceneCreatedSignal; + + DevelStage::Rendering mRenderingBehavior; ///< The rendering behavior }; } // namespace Internal @@ -572,4 +400,4 @@ inline const Internal::Stage& GetImplementation(const Dali::Stage& stage) } // namespace Dali -#endif // __DALI_INTERNAL_STAGE_H__ +#endif // DALI_INTERNAL_STAGE_H