Merge "Add to request Relayout when connected to Stage" into devel/master
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-adaptor-impl.h
1 #ifndef __DALI_TOOLKIT_ADAPTOR_IMPL_H__
2 #define __DALI_TOOLKIT_ADAPTOR_IMPL_H__
3
4 /*
5  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 #include <dali/integration-api/adaptors/render-surface.h>
22
23 namespace Dali
24 {
25 class EglInterface;
26 class DisplayConnection;
27 class ThreadSynchronizationInterface;
28
29 namespace Internal
30 {
31
32 namespace Adaptor
33 {
34
35 class GraphicsInterface;
36
37 } // namespace Adaptor
38
39 } // namespace Internal
40
41 namespace Integration
42 {
43
44 class GlAbstraction;
45
46 } // namespace Integration
47
48 class TestRenderSurface : public RenderSurface
49 {
50 public:
51   virtual PositionSize GetPositionSize() const { PositionSize size; return size; }
52
53   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) { dpiHorizontal = dpiVertical = 96; }
54
55   virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) {};
56
57   virtual void CreateSurface() {}
58
59   virtual void DestroySurface() {}
60
61   virtual bool ReplaceGraphicsSurface() { return false; }
62
63   virtual void MoveResize( Dali::PositionSize positionSize ) {}
64
65   virtual void SetViewMode( ViewMode viewMode ) {}
66
67   virtual void StartRender() {}
68
69   virtual bool PreRender( bool resizingSurface ) { return false; }
70
71   virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {}
72
73   virtual void StopRender() {}
74
75   virtual void ReleaseLock() {}
76
77   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) {}
78
79   virtual RenderSurface::Type GetSurfaceType() { return RenderSurface::WINDOW_RENDER_SURFACE; }
80 };
81
82 namespace Internal
83 {
84 namespace Adaptor
85 {
86
87 class Adaptor: public BaseObject
88 {
89 public:
90   static Dali::Adaptor& Get();
91   Adaptor();
92   ~Adaptor();
93
94 public:
95   static Dali::RenderSurface& GetSurface();
96   static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
97   static bool mAvailable;
98   static Vector<CallbackBase*> mCallbacks;
99 };
100
101 } // namespace Adaptor
102 } // namespace Internal
103 } // namespace Dali
104
105 #endif // __DALI_TOOLKIT_ADAPTOR_IMPL_H__