#include <dali/public-api/object/base-object.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/render-tasks/render-task-list.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
// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/lifecycle-observer.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/window-system/common/indicator-interface.h>
#include <dali/public-api/adaptor-framework/window.h>
#include <dali/public-api/adaptor-framework/key-grab.h>
-#include <dali/devel-api/adaptor-framework/drag-and-drop-detector.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
namespace Dali
{
class Adaptor;
class Actor;
+class RenderSurfaceInterface;
namespace Internal
{
namespace Adaptor
{
+class EventHandler;
class Orientation;
+class RotationObserver;
class WindowRenderSurface;
class WindowBase;
class Window;
-typedef IntrusivePtr<Window> WindowPtr;
-typedef IntrusivePtr<Orientation> OrientationPtr;
+using WindowPtr = IntrusivePtr< Window >;
+using OrientationPtr = IntrusivePtr< Orientation >;
+using EventHandlerPtr = IntrusivePtr< EventHandler >;
/**
* Window provides a surface to render onto with orientation & indicator properties.
*/
-class Window : public Dali::BaseObject, public IndicatorInterface::Observer, public LifeCycleObserver, public ConnectionTracker
+class Window : public Dali::Internal::Adaptor::SceneHolder, public ConnectionTracker
{
public:
typedef Dali::Window::IndicatorSignalType IndicatorSignalType;
static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
/**
- * Pass the adaptor back to the overlay. This allows the window to access Core's overlay.
- * @param[in] adaptor An initialized adaptor
- */
- void SetAdaptor(Dali::Adaptor& adaptor);
-
- /**
- * Get the window surface
- * @return The render surface
- */
- WindowRenderSurface* GetSurface();
-
- /**
* @copydoc Dali::Window::ShowIndicator()
*/
void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode );
void SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacity );
/**
- * Set the indicator visible mode
- */
- void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode );
-
- /**
* @copydoc Dali::Window::RotateIndicator()
*/
void RotateIndicator( Dali::Window::WindowOrientation orientation );
void SetClass( std::string name, std::string className );
/**
+ * @brief Gets the window class name.
+ * @return The class of the window
+ */
+ std::string GetClassName() const;
+
+ /**
* @copydoc Dali::Window::Raise()
*/
void Raise();
void Activate();
/**
- * @copydoc Dali::Window::Add()
- */
- void Add( Dali::Actor actor );
-
- /**
- * @copydoc Dali::Window::Remove()
- */
- void Remove( Dali::Actor remove );
-
- /**
- * @copydoc Dali::Window::SetBackgroundColor()
- */
- void SetBackgroundColor(Vector4 color);
-
- /**
- * @copydoc Dali::Window::GetBackgroundColor()
- */
- Vector4 GetBackgroundColor() const;
-
- /**
- * @copydoc Dali::Window::GetRootLayer()
- */
- Dali::Layer GetRootLayer() const;
-
- /**
* @copydoc Dali::Window::GetLayerCount()
*/
uint32_t GetLayerCount() const;
Dali::Window::WindowOrientation GetPreferredOrientation();
/**
- * @copydoc Dali::Window::GetDragAndDropDetector() const
- */
- Dali::DragAndDropDetector GetDragAndDropDetector() const;
-
- /**
- * @copydoc Dali::Window::GetNativeHandle() const
- */
- Dali::Any GetNativeHandle() const;
-
- /**
* @copydoc Dali::Window::SetAcceptFocus()
*/
void SetAcceptFocus( bool accept );
void Hide();
/**
- * @copydoc Dali::Window::IsVisible() const
- */
- bool IsVisible() const;
-
- /**
* @copydoc Dali::Window::GetSupportedAuxiliaryHintCount()
*/
unsigned int GetSupportedAuxiliaryHintCount() const;
void SetPositionSize( PositionSize positionSize );
/**
+ * @copydoc Dali::Window::GetRootLayer()
+ */
+ Dali::Layer GetRootLayer() const;
+
+ /**
* @copydoc Dali::Window::SetTransparency()
*/
void SetTransparency( bool transparent );
void RotationDone( int orientation, int width, int height );
/**
- * @brief Retrieves the unique ID of the window.
- * @return The ID
+ * Set the rotation observer (note, some adaptors may not have a rotation observer)
+ * @param[in] observer The rotation observer
+ * @return If the rotation observer is set
*/
- uint32_t GetId() const;
-
-private:
+ bool SetRotationObserver( RotationObserver* observer );
/**
- * Private constructor.
- * @sa Window::New()
+ * @copydoc Dali::DevelWindow::Get()
*/
- Window();
+ static Dali::Window Get( Dali::Actor actor );
- /**
- * Destructor
- */
- virtual ~Window();
+public: // Dali::Internal::Adaptor::SceneHolder
/**
- * Second stage initialization
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::GetNativeHandle
*/
- void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
+ Dali::Any GetNativeHandle() const override;
/**
- * Shows / hides the indicator bar.
- * Handles close/open if rotation changes whilst hidden
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::IsVisible
*/
- void DoShowIndicator( Dali::Window::WindowOrientation lastOrientation );
+ bool IsVisible() const override;
+
+private:
/**
- * Close current indicator and open a connection onto the new indicator service.
- * Effect may not be synchronous if waiting for an indicator update on existing connection.
+ * Private constructor.
+ * @sa Window::New()
*/
- void DoRotateIndicator( Dali::Window::WindowOrientation orientation );
+ Window();
/**
- * Change the indicator actor's rotation to match the current orientation
+ * Destructor
*/
- void SetIndicatorActorRotation();
+ virtual ~Window();
/**
- * Set the indicator properties on the window
+ * Second stage initialization
*/
- void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation );
+ void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
/**
* Called when the window becomes iconified or deiconified.
*/
void OnDeleteRequest();
- /**
- * Called when the Ecore indicator event is received.
- */
- void OnIndicatorFlicked();
-
-private: // IndicatorInterface::Observer interface
+private: // Dali::Internal::Adaptor::SceneHolder
/**
- * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorTypeChanged()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedTouchPoint
*/
- virtual void IndicatorTypeChanged( IndicatorInterface::Type type );
+ void FeedTouchPoint( TouchPoint& point, int timeStamp ) override;
/**
- * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorClosed()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedWheelEvent
*/
- virtual void IndicatorClosed( IndicatorInterface* indicator);
+ void FeedWheelEvent( WheelEvent& wheelEvent ) override;
/**
- * @copydoc Dali::Internal::Adaptor::IndicatorInterface::Observer::IndicatorVisibilityChanged()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::FeedKeyEvent
*/
- virtual void IndicatorVisibilityChanged( bool isVisible );
-
-private: // Adaptor::Observer interface
+ void FeedKeyEvent( KeyEvent& keyEvent ) override;
/**
- * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStart()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::OnAdaptorSet
*/
- virtual void OnStart();
+ void OnAdaptorSet( Dali::Adaptor& adaptor ) override;
/**
- * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnPause()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::OnSurfaceSet
*/
- virtual void OnPause();
+ void OnSurfaceSet( Dali::RenderSurfaceInterface* surface ) override;
/**
- * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnResume()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::OnPause
*/
- virtual void OnResume();
+ void OnPause() override;
/**
- * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnStop()
+ * @copydoc Dali::Internal::Adaptor::SceneHolder::OnResume
*/
- virtual void OnStop();
-
- /**
- * @copydoc Dali::Internal::Adaptor::Adaptor::Observer::OnDestroy()
- */
- virtual void OnDestroy();
+ void OnResume() override;
public: // Signals
*/
SignalType& DeleteRequestSignal() { return mDeleteRequestSignal; }
+ /**
+ * @copydoc Dali::Window::SignalEventProcessingFinished()
+ */
+ Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); };
+
+ /**
+ * @copydoc Dali::Window::KeyEventSignal()
+ */
+ Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); };
+
+ /**
+ * @copydoc Dali::Window::TouchSignal()
+ */
+ Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); };
+
+ /**
+ * @copydoc Dali::Window::WheelEventSignal()
+ */
+ Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); };
+
private:
- static uint32_t mWindowCounter; ///< A counter to track the window creation
- uint32_t mId; ///< A unique ID to identify the window starting from 0
- std::unique_ptr< WindowRenderSurface > mSurface;
- Dali::Integration::Scene mScene;
+ WindowRenderSurface* mWindowSurface; ///< The window rendering surface
WindowBase* mWindowBase;
- Dali::Window::IndicatorVisibleMode mIndicatorVisible; ///< public state
- bool mIndicatorIsShown:1; ///< private state
- bool mShowRotatedIndicatorOnClose:1;
- bool mStarted:1;
+ std::string mName;
+ std::string mClassName;
bool mIsTransparent:1;
bool mIsFocusAcceptable:1;
- bool mVisible:1;
bool mIconified:1;
bool mOpaqueState:1;
bool mResizeEnabled:1;
- std::unique_ptr< IndicatorInterface > mIndicator;
- Dali::Window::WindowOrientation mIndicatorOrientation;
- Dali::Window::WindowOrientation mNextIndicatorOrientation;
- Dali::Window::IndicatorBgOpacity mIndicatorOpacityMode;
- Adaptor* mAdaptor;
- Dali::DragAndDropDetector mDragAndDropDetector;
Dali::Window::Type mType;
OrientationPtr mOrientation;
std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
Dali::Window::WindowOrientation mPreferredOrientation;
- Vector4 mBackgroundColor;
+ EventHandlerPtr mEventHandler; ///< The window events handler
// Signals
- IndicatorSignalType mIndicatorVisibilityChangedSignal;
- FocusSignalType mFocusChangedSignal;
- ResizedSignalType mResizedSignal;
- SignalType mDeleteRequestSignal;
+ IndicatorSignalType mIndicatorVisibilityChangedSignal;
+ FocusSignalType mFocusChangedSignal;
+ ResizedSignalType mResizedSignal;
+ SignalType mDeleteRequestSignal;
+
+
};
} // namespace Adaptor