1 /* 2 * Copyright (c) 2020-2021 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 distingush 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 * execute timer callback directly for previewer 107 */ 108 #define SYNC_TIMER_CALLBACK 109 110 /** 111 * support storage API for JS 112 */ 113 #define FEATURE_MODULE_STORAGE 1 114 115 /** 116 * localization module 117 */ 118 #define FEATURE_LOCALIZATION_MODULE 1 119 120 #define FEATURE_CUSTOM_ENTRY_PAGE 1 121 122 /** 123 * module require test 124 */ 125 #ifdef ENABLE_MODULE_REQUIRE_TEST 126 #error "must keep the global configuration unique" 127 #else 128 #define ENABLE_MODULE_REQUIRE_TEST 1 129 #endif 130 131 /** 132 * define the max length of user's console log 133 */ 134 #ifndef CONSOLE_LOG_LINE_MAX_LENGTH 135 #define CONSOLE_LOG_LINE_MAX_LENGTH (96) 136 #endif 137 138 /** 139 * enable Canvas component Feature API on simulator 140 */ 141 #ifndef FEATURE_COMPONENT_CANVAS 142 #define FEATURE_COMPONENT_CANVAS 1 143 #endif 144 145 #if (FEATURE_COMPONENT_QRCODE == 1) 146 #error "must keep the global configuration unique" 147 #else 148 #define FEATURE_COMPONENT_QRCODE 1 149 #endif 150 151 #ifdef _WIN32 152 // support memory analysis, only on win 153 #define SIMULATOR_MEMORY_ANALYSIS 154 #endif 155 156 #ifdef _WIN32 157 #define PROFILER_ENABLE_FLAG_FILE "..\\profiler_enable" 158 #ifdef SIMULATOR_MEMORY_ANALYSIS 159 #define MEM_PROC_ENABLE_FLAG_FILE "..\\memproc_enable" 160 #define MEM_LOG_FILE_PATH "..\\mem.txt" 161 #define MEM_BACK_UP_LOG_FILE_PREFIX "..\\" 162 #endif // SIMULATOR_MEMORY_ANALYSIS 163 #else 164 // path format is different on linux or apple with windows 165 #define PROFILER_ENABLE_FLAG_FILE "~/profiler_enable" 166 #endif 167 168 /** 169 * Rotation API feature 170 */ 171 #if (ENABLE_ROTATE_INPUT == 1) 172 // low layer supports 173 #ifndef FEATURE_ROTATION_API 174 #define FEATURE_ROTATION_API 1 175 #endif 176 #endif // (ENABLE_ROTATE_INPUT == 1) 177 178 #endif // OHOS_ACELITE_CONFIG_H 179