Add post processor
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-adaptor-impl.h
index ee60af1..4970dc4 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_ADAPTOR_IMPL_H__
-#define __DALI_TOOLKIT_ADAPTOR_IMPL_H__
+#ifndef DALI_TOOLKIT_ADAPTOR_IMPL_H
+#define DALI_TOOLKIT_ADAPTOR_IMPL_H
 
 /*
- * Copyright (c) 2016 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.
  *
  */
 
-#include <dali/integration-api/adaptors/render-surface.h>
+#include <dali/integration-api/adaptor-framework/render-surface-interface.h>
 
 namespace Dali
 {
 class EglInterface;
 class DisplayConnection;
 class ThreadSynchronizationInterface;
+class Window;
+class TestApplication;
+
+namespace Integration
+{
+class Scene;
+}
+
+using WindowContainer = std::vector<Window>;
 
 namespace Internal
 {
@@ -33,6 +42,7 @@ namespace Adaptor
 {
 
 class GraphicsInterface;
+class SceneHolder;
 
 } // namespace Adaptor
 
@@ -45,61 +55,59 @@ class GlAbstraction;
 
 } // namespace Integration
 
-class TestRenderSurface : public RenderSurface
+namespace Internal
+{
+namespace Adaptor
 {
-public:
-  virtual PositionSize GetPositionSize() const { PositionSize size; return size; }
-
-  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
-
-  virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) {};
-
-  virtual void CreateSurface() {}
-
-  virtual void DestroySurface() {}
-
-  virtual bool ReplaceGraphicsSurface() { return false; }
 
-  virtual void MoveResize( Dali::PositionSize positionSize ) {}
+class Adaptor
+{
+public:
+  static Dali::Adaptor& New();
+  static Dali::Adaptor& Get();
+  Adaptor();
+  ~Adaptor();
 
-  virtual void SetViewMode( ViewMode viewMode ) {}
+  void Start( Dali::Window window );
 
-  virtual void StartRender() {}
+  bool AddIdle( CallbackBase* callback, bool hasReturnValue );
+  void RemoveIdle( CallbackBase* callback );
+  void RunIdles();
 
-  virtual bool PreRender( bool resizingSurface ) { return false; }
+  static Integration::Scene GetScene( Dali::Window window );
 
-  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {}
+  Dali::RenderSurfaceInterface& GetSurface();
+  Dali::WindowContainer GetWindows();
+  Dali::SceneHolderList GetSceneHolders();
 
-  virtual void StopRender() {}
+  Dali::Internal::Adaptor::SceneHolder* GetWindow( Dali::Actor& actor );
+  void AddWindow( Internal::Adaptor::SceneHolder* window );
+  void RemoveWindow( Internal::Adaptor::SceneHolder* window );
 
-  virtual void ReleaseLock() {}
+  void RegisterProcessor( Integration::Processor& processor, bool postProcessor = false);
+  void UnregisterProcessor( Integration::Processor& processor, bool postProcessor = false);
 
-  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {}
+  void SetApplication( Dali::TestApplication& testApplication );
 
-  virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; }
-};
+  Dali::Adaptor::AdaptorSignalType& ResizedSignal();
+  Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal();
+  Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal();
 
-namespace Internal
-{
-namespace Adaptor
-{
+  static Adaptor& GetImpl( Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
+  static const Adaptor& GetImpl( const Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
 
-class Adaptor: public BaseObject
-{
-public:
-  static Dali::Adaptor& Get();
-  Adaptor();
-  ~Adaptor();
+private:
 
-public:
-  static Dali::RenderSurface& GetSurface();
-  static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
-  static bool mAvailable;
-  static Vector<CallbackBase*> mCallbacks;
+  Vector<CallbackBase*> mCallbacks;
+  std::vector<Internal::Adaptor::SceneHolder*> mWindows;
+  Dali::Adaptor::AdaptorSignalType mResizedSignal;
+  Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal;
+  Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal;
+  TestApplication* mTestApplication;
 };
 
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_ADAPTOR_IMPL_H__
+#endif // DALI_TOOLKIT_ADAPTOR_IMPL_H