Dali 3D User Interface Engine
test-application.h
Go to the documentation of this file.
1 #ifndef __DALI_TEST_APPLICATION_H__
2 #define __DALI_TEST_APPLICATION_H__
3 
4 /*
5  * Copyright (c) 2014 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 // INTERNAL INCLUDES
23 #include "test-gesture-manager.h"
25 #include "test-gl-abstraction.h"
26 #include "test-render-controller.h"
29 
30 namespace Dali
31 {
32 
34 {
35 public:
36 
37  // Default values derived from H2 device.
38  static const unsigned int DEFAULT_SURFACE_WIDTH = 480;
39  static const unsigned int DEFAULT_SURFACE_HEIGHT = 800;
40 
41 #ifdef _CPP11
42  static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
43  static constexpr float DEFAULT_VERTICAL_DPI = 217.0f;
44 #else
45  static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
46  static const float DEFAULT_VERTICAL_DPI = 217.0f;
47 #endif
48 
49  static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
50 
51  TestApplication( size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
52  size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
53  float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
54  float verticalDpi = DEFAULT_VERTICAL_DPI,
56 
57  TestApplication( bool initialize,
58  size_t surfaceWidth = DEFAULT_SURFACE_WIDTH,
59  size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
60  float horizontalDpi = DEFAULT_HORIZONTAL_DPI,
61  float verticalDpi = DEFAULT_VERTICAL_DPI,
63 
64  void Initialize();
65  virtual ~TestApplication();
66  static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
67  Dali::Integration::Core& GetCore();
68  TestPlatformAbstraction& GetPlatform();
69  TestRenderController& GetRenderController();
70  TestGlAbstraction& GetGlAbstraction();
71  TestGlSyncAbstraction& GetGlSyncAbstraction();
72  TestGestureManager& GetGestureManager();
73  void ProcessEvent(const Integration::Event& event);
74  void SendNotification();
75  void SetSurfaceWidth( unsigned int width, unsigned height );
76  bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
77  unsigned int GetUpdateStatus();
78  bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
79  bool RenderOnly( );
80  void ResetContext();
81  bool GetRenderNeedsUpdate();
82  bool GetRenderHasRendered();
83 
84 private:
85  void DoUpdate( unsigned int intervalMilliseconds );
86 
87 protected:
93 
96 
98 
99  unsigned int mSurfaceWidth;
100  unsigned int mSurfaceHeight;
101  unsigned int mFrame;
102 
104  unsigned int mLastVSyncTime;
106 };
107 
108 } // Dali
109 
110 #endif
Dali Docs Home
Read more about Dali