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