1 /*
2  * Copyright (c) 2020-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef OHOS_ACELITE_CONFIG_H
16 #define OHOS_ACELITE_CONFIG_H
17 
18 // some features depend on the low layer configuration
19 #include "graphic_config.h"
20 
21 /**
22  * ================================================================================================
23  *                 config for win simulator
24  * ================================================================================================
25  */
26 #define OHOS_ACELITE_SIMULATOR_WIN // NOTE: DO NOT use this macro directly
27 
28 #ifndef JSFWK_TEST
29 #define JSFWK_TEST 1
30 #endif
31 
32 /**
33  * The macro is used to distinguish the real device and simulator.
34  */
35 #ifndef TARGET_SIMULATOR
36 #define TARGET_SIMULATOR 1
37 #endif
38 
39 /**
40  * Compile all test entry for hmf
41  */
42 #ifdef FEATURE_TEST_IMPLEMENTATION
43 #error "must keep the global configuration unique"
44 #else
45 #define FEATURE_TEST_IMPLEMENTATION 1
46 #endif
47 
48 /**
49  * enable FeatureAbility API
50  */
51 #define FEATURE_FEATURE_ABILITY_MODULE 1
52 
53 /**
54  * support device API for JS
55  */
56 #define FEATURE_MODULE_DEVICE 1
57 
58 #if defined(LITEWEARABLE_SUPPORTED) && LITEWEARABLE_SUPPORTED
59 /**
60  * support geo location API for JS
61  */
62 #define FEATURE_MODULE_GEO 1
63 
64 /**
65  * support sensor API for JS
66  */
67 #define FEATURE_MODULE_SENSOR 1
68 
69 /**
70  * support brightness API for JS
71  */
72 #define FEATURE_MODULE_BRIGHTNESS 1
73 
74 #else
75 /**
76  * support geo location API for JS
77  */
78 #define FEATURE_MODULE_GEO 0
79 
80 /**
81  * support sensor API for JS
82  */
83 #define FEATURE_MODULE_SENSOR 0
84 
85 /**
86  * support brightness API for JS
87  */
88 #define FEATURE_MODULE_BRIGHTNESS 0
89 #endif // LITEWEARABLE_SUPPORTED
90 /**
91  * support battery API for JS
92  */
93 #define FEATURE_MODULE_BATTERY 1
94 
95 /**
96  * support configuration API for JS
97  */
98 #define FEATURE_MODULE_CONFIGURATION 1
99 
100 /**
101  * timer module
102  */
103 #define FEATURE_TIMER_MODULE 1
104 
105 /**
106  * syscap module
107  */
108 #define FEATURE_SYSCAP_MODULE 0
109 
110 /**
111  * execute timer callback directly for previewer
112  */
113 #define SYNC_TIMER_CALLBACK
114 
115 /**
116  * support storage API for JS
117  */
118 #define FEATURE_MODULE_STORAGE 1
119 
120 /**
121  * localization module
122  */
123 #define FEATURE_LOCALIZATION_MODULE 1
124 
125 #define FEATURE_CUSTOM_ENTRY_PAGE 1
126 
127 /**
128  * module require test
129  */
130 #ifdef ENABLE_MODULE_REQUIRE_TEST
131 #error "must keep the global configuration unique"
132 #else
133 #define ENABLE_MODULE_REQUIRE_TEST 1
134 #endif
135 
136 /**
137  * define the max length of user's console log
138  */
139 #ifndef CONSOLE_LOG_LINE_MAX_LENGTH
140 #define CONSOLE_LOG_LINE_MAX_LENGTH (96)
141 #endif
142 
143 /**
144  * enable Canvas component Feature API on simulator
145  */
146 #ifndef FEATURE_COMPONENT_CANVAS
147 #define FEATURE_COMPONENT_CANVAS 1
148 #endif
149 
150 /**
151  * enable edittext component Feature
152  */
153 #ifndef FEATURE_COMPONENT_EDITTEXT
154 #define FEATURE_COMPONENT_EDITTEXT 1
155 #endif
156 
157 #if (FEATURE_COMPONENT_QRCODE == 1)
158 #error "must keep the global configuration unique"
159 #else
160 #define FEATURE_COMPONENT_QRCODE 1
161 #endif
162 
163 #ifdef _WIN32
164 // support memory analysis, only on win
165 #define SIMULATOR_MEMORY_ANALYSIS
166 #endif
167 
168 #ifdef _WIN32
169 #define PROFILER_ENABLE_FLAG_FILE "..\\profiler_enable"
170 #ifdef SIMULATOR_MEMORY_ANALYSIS
171 #define MEM_PROC_ENABLE_FLAG_FILE "..\\memproc_enable"
172 #define MEM_LOG_FILE_PATH "..\\mem.txt"
173 #define MEM_BACK_UP_LOG_FILE_PREFIX "..\\"
174 #endif // SIMULATOR_MEMORY_ANALYSIS
175 #else
176 // path format is different on linux or apple with windows
177 #define PROFILER_ENABLE_FLAG_FILE "~/profiler_enable"
178 #endif
179 
180 /**
181  * Rotation API feature
182  */
183 #if (ENABLE_ROTATE_INPUT == 1)
184 // low layer supports
185 #ifndef FEATURE_ROTATION_API
186 #define FEATURE_ROTATION_API 1
187 #endif
188 #endif // (ENABLE_ROTATE_INPUT == 1)
189 
190 #endif // OHOS_ACELITE_CONFIG_H
191