1 #ifndef __DALI_TEST_APPLICATION_H__
2 #define __DALI_TEST_APPLICATION_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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
11 // http://floralicense.org/license/
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.
21 #include <test-platform-abstraction.h>
22 #include "test-gesture-manager.h"
23 #include "test-gl-sync-abstraction.h"
24 #include "test-gl-abstraction.h"
25 #include "test-render-controller.h"
26 #include <dali/public-api/common/dali-common.h>
31 class DALI_IMPORT_API TestApplication : public ConnectionTracker
35 // Default values derived from H2 device.
36 static const unsigned int DEFAULT_SURFACE_WIDTH = 480;
37 static const unsigned int DEFAULT_SURFACE_HEIGHT = 800;
40 static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
41 static constexpr float DEFAULT_VERTICAL_DPI = 217.0f;
43 static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
44 static const float DEFAULT_VERTICAL_DPI = 217.0f;
47 static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
49 TestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
50 size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
51 float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
52 float verticalDpi = DEFAULT_VERTICAL_DPI );
54 TestApplication( bool initialize,
55 size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
56 size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
57 float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
58 float verticalDpi = DEFAULT_VERTICAL_DPI );
61 virtual ~TestApplication();
62 static void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message);
63 Dali::Integration::Core& GetCore();
64 TestPlatformAbstraction& GetPlatform();
65 TestRenderController& GetRenderController();
66 TestGlAbstraction& GetGlAbstraction();
67 TestGlSyncAbstraction& GetGlSyncAbstraction();
68 TestGestureManager& GetGestureManager();
69 void ProcessEvent(const Integration::Event& event);
70 void SendNotification();
71 void SetSurfaceWidth( unsigned int width, unsigned height );
72 bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
73 unsigned int GetUpdateStatus();
74 bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
79 TestPlatformAbstraction mPlatformAbstraction;
80 TestRenderController mRenderController;
81 TestGlAbstraction mGlAbstraction;
82 TestGlSyncAbstraction mGlSyncAbstraction;
83 TestGestureManager mGestureManager;
85 Integration::UpdateStatus mStatus;
86 Integration::RenderStatus mRenderStatus;
88 Integration::Core* mCore;
90 unsigned int mSurfaceWidth;
91 unsigned int mSurfaceHeight;