#define DALI_INTERNAL_STAGE_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 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/devel-api/common/stage.h>
-#include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/vector4.h>
#include <dali/devel-api/common/stage-devel.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/internal/common/owner-pointer.h>
#include <dali/internal/event/actors/layer-impl.h>
#include <dali/internal/event/common/object-registry-impl.h>
#include <dali/internal/event/common/stage-def.h>
#include <dali/internal/event/render-tasks/render-task-defaults.h>
-#include <dali/internal/update/manager/update-manager.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
+#include <dali/internal/update/manager/update-manager.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/ref-object.h>
namespace Dali
{
-
struct Vector2;
namespace Integration
namespace Internal
{
-
namespace SceneGraph
{
class UpdateManager;
class Stage : public BaseObject, public RenderTaskDefaults, public Integration::ContextNotifierInterface, public ConnectionTracker
{
public:
-
/**
* Create the stage
* @param[in] updateManager
*/
- static StagePtr New( SceneGraph::UpdateManager& updateManager );
+ static StagePtr New(SceneGraph::UpdateManager& updateManager);
/**
* Initialize the stage.
* @param[in] scene The default scene (for main window).
*/
- void Initialize( Scene& scene );
+ void Initialize(Scene& scene);
/**
* @copydoc Dali::Stage::GetCurrent()
/**
* @copydoc Dali::Stage::Add()
*/
- void Add( Actor& actor );
+ void Add(Actor& actor);
/**
* @copydoc Dali::Stage::Remove()
*/
- void Remove( Actor& actor );
+ void Remove(Actor& actor);
/**
* Returns the size of the Stage in pixels as a Vector.
* From RenderTaskDefaults; retrieve the default root actor.
* @return The default root actor.
*/
- virtual Actor& GetDefaultRootActor();
+ Actor& GetDefaultRootActor() override;
/**
* From RenderTaskDefaults; retrieve the default camera actor.
* @return The default camera actor.
*/
- virtual CameraActor& GetDefaultCameraActor();
+ CameraActor& GetDefaultCameraActor() override;
// Layers
/**
* @copydoc Dali::Stage::GetLayer()
*/
- Dali::Layer GetLayer( uint32_t depth ) const;
+ Dali::Layer GetLayer(uint32_t depth) const;
/**
* @copydoc Dali::Stage::GetRootLayer()
/**
* @copydoc Dali::Stage::KeepRendering()
*/
- void KeepRendering( float durationSeconds );
+ void KeepRendering(float durationSeconds);
/**
* @copydoc Dali::DevelStage::SetRenderingBehavior()
*/
- void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
+ void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
/**
* @copydoc Dali::DevelStage::GetRenderingBehavior()
/**
* Callback for Internal::Scene KeyEventSignal signal
*/
- void OnKeyEvent( const Dali::KeyEvent& event );
-
- /**
- * Callback for Internal::Scene TouchedEventSignal signal
- */
- void OnTouchedEvent( const Dali::TouchEvent& touch );
+ void OnKeyEvent(const Dali::KeyEvent& event);
/**
- * Callback for Internal::Scene TouchSignal signal
+ * Callback for Internal::Scene TouchedSignal signal
*/
- void OnTouchEvent( const Dali::TouchData& touch );
+ void OnTouchEvent(const Dali::TouchEvent& touch);
/**
* Callback for Internal::Scene WheelEventSignal signal
*/
- void OnWheelEvent( const Dali::WheelEvent& event );
+ void OnWheelEvent(const Dali::WheelEvent& event);
/**
* Used by the EventProcessor to emit key event signals.
/**
* Emits the touched signal.
- * @param[in] touchEvent The touch event details (Old API).
* @param[in] touch The touch event details.
*/
- void EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch );
+ void EmitTouchedSignal(const Dali::TouchEvent& touch);
/**
* Used by the EventProcessor to emit wheel event signals.
* @param[in] event The wheel event.
*/
- void EmitWheelEventSignal( const WheelEvent& event );
+ void EmitWheelEventSignal(const WheelEvent& event);
/**
* Emits the scene created.
/**
* @copydoc Dali::Stage::TouchedSignal()
*/
- Dali::Stage::TouchedSignalType& TouchedSignal();
-
- /**
- * @copydoc Dali::Stage::TouchSignal()
- */
- Dali::Stage::TouchSignalType& TouchSignal();
+ Dali::Stage::TouchEventSignalType& TouchedSignal();
/**
* @copydoc Dali::Stage::WheelEventSignal()
/**
* @copydoc Dali::DevelStage::AddFrameCallback()
*/
- void AddFrameCallback( FrameCallbackInterface& frameCallback, Actor& rootActor );
+ void AddFrameCallback(FrameCallbackInterface& frameCallback, Actor& rootActor);
/**
* @copydoc Dali::DevelStage::RemoveFrameCallback()
*/
- void RemoveFrameCallback( FrameCallbackInterface& frameCallback );
+ void RemoveFrameCallback(FrameCallbackInterface& frameCallback);
/**
* Connects a callback function with the object's signals.
* @return True if the signal was connected.
* @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
*/
- static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+ static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
private: // Implementation of ContextNotificationInterface:
-
/**
* @copydoc Dali::Integration::NotifyContextLost();
*/
- virtual void NotifyContextLost();
+ void NotifyContextLost() override;
/**
* @copydoc Dali::Integration::NotifyContextRegained();
*/
- virtual void NotifyContextRegained();
+ void NotifyContextRegained() override;
private:
-
/**
* Protected constructor; see also Stage::New()
*/
- Stage( SceneGraph::UpdateManager& updateManager );
+ Stage(SceneGraph::UpdateManager& updateManager);
/**
* A reference counted object may only be deleted by calling Unreference()
*/
- virtual ~Stage();
+ ~Stage() override;
private:
-
SceneGraph::UpdateManager& mUpdateManager;
IntrusivePtr<Scene> mScene;
// The key event signal
- Dali::Stage::KeyEventSignalType mKeyEventSignal;
- Dali::DevelStage::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
+ Dali::Stage::KeyEventSignalType mKeyEventSignal;
+ Dali::DevelStage::KeyEventGeneratedSignalType mKeyEventGeneratedSignal;
// The event processing finished signal
- Dali::Stage::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
+ Dali::Stage::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
- // The touched signals
- Dali::Stage::TouchedSignalType mTouchedSignal;
- Dali::Stage::TouchSignalType mTouchSignal;
+ // The touched signal
+ Dali::Stage::TouchEventSignalType mTouchedSignal;
// The wheel event signal
- Dali::Stage::WheelEventSignalType mWheelEventSignal;
+ Dali::Stage::WheelEventSignalType mWheelEventSignal;
Dali::Stage::ContextStatusSignal mContextLostSignal;
Dali::Stage::ContextStatusSignal mContextRegainedSignal;
inline Internal::Stage& GetImplementation(Dali::Stage& stage)
{
- DALI_ASSERT_ALWAYS( stage && "Stage handle is empty" );
+ DALI_ASSERT_ALWAYS(stage && "Stage handle is empty");
BaseObject& handle = stage.GetBaseObject();
inline const Internal::Stage& GetImplementation(const Dali::Stage& stage)
{
- DALI_ASSERT_ALWAYS( stage && "Stage handle is empty" );
+ DALI_ASSERT_ALWAYS(stage && "Stage handle is empty");
const BaseObject& handle = stage.GetBaseObject();