!460 ace_engine_lite 支持 LiteOS-M,并且可以通过产品配置开关

Merge pull request !460 from SimonLi/master
This commit is contained in:
openharmony_ci
2021-12-02 06:37:38 +00:00
committed by Gitee
119 changed files with 773 additions and 585 deletions
+1
View File
@@ -35,6 +35,7 @@ ace_lite_include_dirs = [
"//utils/native/lite/include",
"${aafwk_lite_path}/interfaces/kits/ability_lite",
"${aafwk_lite_path}/interfaces/kits/want_lite",
"${aafwk_lite_path}/frameworks/abilitymgr_lite/include",
"${aafwk_lite_path}/interfaces/innerkits/abilitymgr_lite",
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
"${appexecfwk_lite_path}/utils/bundle_lite",
+44 -23
View File
@@ -25,25 +25,35 @@ lite_component("jsfwk") {
config("ace_lite_config") {
include_dirs = ace_lite_include_dirs
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "liteos_m") {
include_dirs += [ "targets/liteos_a" ]
} else if (ohos_kernel_type == "linux") {
include_dirs += [ "targets/linux" ]
}
cflags_cc = [ "-std=c++14" ]
ldflags = [ "-lstdc++" ]
ldflags += [ "-lpthread" ]
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
if (ohos_kernel_type == "liteos_m") {
ldflags += [ "-lposix" ]
} else {
ldflags += [ "-lpthread" ]
ldflags += [ "-Wl,-rpath-link=$ohos_root_path/$root_out_dir" ]
}
}
shared_library("ace_lite") {
configs -= [ "//build/lite/config:language_cpp" ]
cflags = [ "-Wall" ]
cflags_cc = cflags
configs += [ ":ace_lite_config" ]
public_configs = configs
lite_library("ace_lite") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
}
deps = [ "targets" ]
public_configs = [ ":ace_lite_config" ]
sources = ace_lite_sources
if (ohos_kernel_type == "liteos_m") {
sources -= [
"$ACE_LITE_PATH/src/core/context/ace_ability.cpp",
"$ACE_LITE_PATH/src/core/modules/dfx_module.cpp",
]
}
public_deps = [
"$ACE_LITE_COMMON_PATH:ace_common_lite",
@@ -51,19 +61,30 @@ shared_library("ace_lite") {
"$NATIVE_ENGINE_PATH:ace_native_engine_lite",
"//base/global/i18n_lite/frameworks/i18n:global_i18n",
"//base/global/resmgr_lite/frameworks/resmgr_lite:global_resmgr",
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/graphic/surface:lite_surface",
"//foundation/graphic/ui:lite_ui",
"//foundation/multimedia/camera_lite/frameworks:camera_lite",
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
"//third_party/jerryscript/jerry-ext:jerry-ext_shared",
"//third_party/jerryscript/jerry-libm:jerry-libm_shared",
"//third_party/jerryscript/jerry-port/default:jerry-port-default_shared",
"//utils/native/lite/timer_task:ace_kit_timer",
]
if (ohos_kernel_type == "liteos_m") {
public_deps += [
"//build/lite/config/component/cJSON:cjson_static",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/jerryscript:jerry_engine",
]
} else {
public_deps += [
"//build/lite/config/component/cJSON:cjson_shared",
"//foundation/graphic/surface:lite_surface",
"//foundation/multimedia/camera_lite/frameworks:camera_lite",
"//foundation/multimedia/media_lite/frameworks/player_lite:player_lite",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
"//third_party/jerryscript/jerry-ext:jerry-ext_shared",
"//third_party/jerryscript/jerry-libm:jerry-libm_shared",
"//third_party/jerryscript/jerry-port/default:jerry-port-default_shared",
]
}
defines = []
if (ohos_build_type == "debug") {
@@ -73,7 +94,7 @@ shared_library("ace_lite") {
}
if (LOSCFG_TEST_JS_BUILD) {
defines += [ "JSFWK_TEST" ]
defines += [ "JSFWK_TEST=1" ]
}
if (enable_ohos_appexecfwk_feature_ability == true) {
Regular → Executable
+13 -7
View File
@@ -22,7 +22,13 @@ lite_component("ace_common_lite") {
features = [ ":ace_common" ]
}
shared_library("ace_common") {
lite_library("ace_common") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
}
include_dirs = [
"$ace_common_root/log",
"$ace_common_root/memory",
@@ -32,11 +38,6 @@ shared_library("ace_common") {
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//third_party/bounds_checking_function/include",
]
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "liteos_m") {
include_dirs += [ "$ace_target_root/liteos_a" ]
} else if (ohos_kernel_type == "linux") {
include_dirs += [ "$ace_target_root/linux" ]
}
cflags = [ "-Wall" ]
cflags_cc = cflags
@@ -49,5 +50,10 @@ shared_library("ace_common") {
"$ace_common_root/memory/memory_heap.cpp",
]
public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
if (ohos_kernel_type == "liteos_m") {
deps = [ "//third_party/bounds_checking_function:libsec_static" ]
} else {
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
deps += [ "$ace_target_root" ]
}
+1 -1
View File
@@ -16,7 +16,7 @@
#include "ace_log.h"
#include <stdarg.h>
#include <stdio.h>
#ifdef TARGET_SIMULATOR
#if (TARGET_SIMULATOR == 1)
#include <string>
namespace OHOS {
+6 -6
View File
@@ -18,21 +18,21 @@
#include "acelite_config.h"
#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) && defined(FEATURE_ACELITE_MC_LOG_PRINTF)
#if ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) && (FEATURE_ACELITE_MC_LOG_PRINTF == 1))
#error Only one marco can be defined
#elif defined(FEATURE_ACELITE_HI_LOG_PRINTF) && defined(TARGET_SIMULATOR)
#elif ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) && (TARGET_SIMULATOR == 1))
#error Only one marco can be defined
#elif defined(FEATURE_ACELITE_MC_LOG_PRINTF) && defined(TARGET_SIMULATOR)
#elif ((FEATURE_ACELITE_MC_LOG_PRINTF == 1) && (TARGET_SIMULATOR == 1))
#error Only one macro can be defined
#endif
#if defined(FEATURE_ACELITE_HI_LOG_PRINTF)
#if (FEATURE_ACELITE_HI_LOG_PRINTF == 1)
#undef LOG_DOMAIN
#undef LOG_TAG
#define LOG_DOMAIN 0xD003900
#define LOG_TAG "ACE"
#include "hilog/log.h"
#elif defined(FEATURE_ACELITE_MC_LOG_PRINTF)
#elif (FEATURE_ACELITE_MC_LOG_PRINTF == 1)
#include "hilog/log.h"
#ifndef HILOG_DEBUG
#define HILOG_DEBUG(mod, format, ...)
@@ -52,7 +52,7 @@
#ifndef HILOG_RACE
#define HILOG_RACE(mod, format, ...)
#endif
#elif (defined(TARGET_SIMULATOR))
#elif (TARGET_SIMULATOR == 1)
namespace OHOS {
namespace ACELite {
typedef enum { HILOG_MODULE_ACE = 1 } HiLogModuleType;
+1 -1
View File
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#if (defined(OHOS_ACELITE_PRODUCT_WATCH) || (defined(FEATURE_CUSTOM_ENTRY_PAGE)))
#if ((OHOS_ACELITE_PRODUCT_WATCH == 1) || (FEATURE_CUSTOM_ENTRY_PAGE == 1))
#include "memory_heap.h"
namespace OHOS {
+1 -1
View File
@@ -59,7 +59,7 @@
*
* Default: 0 on real device and 1 on PC simulator
*/
#ifdef TARGET_SIMULATOR
#if (TARGET_SIMULATOR == 1)
#define ENGINE_DEBUGGER 1
#else
#define ENGINE_DEBUGGER 0
+1 -1
View File
@@ -133,7 +133,7 @@ public:
void ReleaseJSContext();
private:
#if ENABLED(ENGINE_DEBUGGER)
#ifdef JS_ENGINE_EXTERNAL_CONTEXT
#if (JS_ENGINE_EXTERNAL_CONTEXT == 1)
void *engineContext_ = nullptr;
#endif // JS_ENGINE_EXTERNAL_CONTEXT
bool debuggerStarted_ = false;
@@ -16,7 +16,7 @@
#ifndef OHOS_ACELITE_VIDEO_PANEL_IMAGE_RES_H
#define OHOS_ACELITE_VIDEO_PANEL_IMAGE_RES_H
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include "gfx_utils/image_info.h"
namespace OHOS {
+28 -16
View File
@@ -22,7 +22,15 @@ lite_component("ace_module_manager_lite") {
features = [ ":ace_module_manager" ]
}
shared_library("ace_module_manager") {
lite_library("ace_module_manager") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
cflags = [ "-Wall" ]
cflags_cc = cflags
}
include_dirs = [
"$ace_frameworks_root/common/log",
"$ace_frameworks_root/common/utils",
@@ -34,27 +42,31 @@ shared_library("ace_module_manager") {
"//third_party/jerryscript/jerry-core/include",
"//third_party/bounds_checking_function/include",
]
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "liteos_m") {
include_dirs += [ "$ace_target_root/liteos_a" ]
} else if (ohos_kernel_type == "linux") {
include_dirs += [ "$ace_target_root/linux" ]
}
cflags = [ "-Wall" ]
cflags_cc = cflags
deps = [ "$ace_target_root" ]
sources = [ "$ace_frameworks_root/module_manager/module_manager.cpp" ]
public_deps = [
"$ace_frameworks_root/common:ace_common_lite",
"$ace_frameworks_root/native_engine:ace_native_engine_lite",
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite/js/builtin:capability_api",
"//base/powermgr/battery_lite/frameworks/js:ace_battery_kits",
"//base/security/huks/frameworks/crypto_lite/js/builtin:ace_kit_cipher",
"//foundation/communication/netstack/frameworks/js/builtin:http_lite_shared",
"//foundation/multimedia/media_lite/interfaces/kits/player_lite/js/builtin:audio_lite_api",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
"//utils/native/lite/js/builtin:ace_utils_kits",
]
if (ohos_kernel_type == "liteos_m") {
public_deps += [
"//foundation/graphic/ui:ui",
"//third_party/bounds_checking_function:libsec_static",
"//third_party/jerryscript:jerry_engine",
]
} else {
public_deps += [
"${appexecfwk_lite_path}/interfaces/kits/bundle_lite/js/builtin:capability_api",
"//base/powermgr/battery_lite/frameworks/js:ace_battery_kits",
"//base/security/huks/frameworks/crypto_lite/js/builtin:ace_kit_cipher",
"//foundation/communication/netstack/frameworks/js/builtin:http_lite_shared",
"//foundation/multimedia/media_lite/interfaces/kits/player_lite/js/builtin:audio_lite_api",
"//third_party/bounds_checking_function:libsec_shared",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
]
}
}
+3 -3
View File
@@ -39,14 +39,14 @@ JSIValue ModuleManager::RequireModule(const char * const moduleName)
if (!strcmp(category, CATEGORY_SYSTEM) || !strcmp(category, CATEGORY_OHOS)) {
uint16_t moduleCount = sizeof(OHOS_MODULES) / sizeof(Module);
moduleObj = GetModuleObject(name, OHOS_MODULES, moduleCount, requiredSystemModules);
#ifdef FEATURE_PRODUCT_MODULE
#if (FEATURE_PRODUCT_MODULE == 1)
if ((JSI::ValueIsUndefined(moduleObj)) && (productModulesGetter_ != nullptr)) {
uint16_t prodModCount;
const Module* prodModules = productModulesGetter_(prodModCount);
moduleObj = GetModuleObject(name, prodModules, prodModCount, requiredSystemModules);
}
#endif // FEATURE_PRODUCT_MODULE
#ifdef FEATURE_PRIVATE_MODULE
#if (FEATURE_PRIVATE_MODULE == 1)
if ((JSI::ValueIsUndefined(moduleObj)) && (privateModulesGetter_ != nullptr)) {
const char * const bundleName = (bundleNameGetter_ != nullptr) ? bundleNameGetter_() : nullptr;
moduleObj = GetModuleObject(name, nullptr, 0, requiredSystemModules, bundleName);
@@ -149,7 +149,7 @@ JSIValue ModuleManager::GetModuleObject(const char * const moduleName, const Mod
}
}
}
#ifdef FEATURE_PRIVATE_MODULE
#if (FEATURE_PRIVATE_MODULE == 1)
else {
uint16_t count;
const PrivateModule *privateModules =
+28 -28
View File
@@ -21,108 +21,108 @@
namespace OHOS {
namespace ACELite {
#ifdef ENABLE_MODULE_REQUIRE_TEST
#if (ENABLE_MODULE_REQUIRE_TEST == 1)
extern void InitSampleModule(JSIValue exports);
#endif
extern void InitRouterModule(JSIValue exports);
extern void InitAppModule(JSIValue exports);
#ifdef FEATURE_SUPPORT_HTTP
#if (FEATURE_SUPPORT_HTTP == 1)
extern void InitFetchModule(JSIValue exports);
#endif // FEATURE_SUPPORT_HTTP
#ifdef FEATURE_MODULE_AUDIO
#if (FEATURE_MODULE_AUDIO == 1)
extern void InitAudioModule(JSIValue exports);
#endif // FEATURE_MODULE_AUDIO
#ifdef FEATURE_ACELITE_DFX_MODULE
#if (FEATURE_ACELITE_DFX_MODULE == 1)
extern void InitDfxModule(JSIValue exports);
#endif // FEATURE_ACELITE_DFX_MODULE
#ifdef ENABLE_MODULE_CIPHER
#if (ENABLE_MODULE_CIPHER == 1)
extern void InitCipherModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
extern void InitDialogModule(JSIValue exports);
#endif // FEATURE_MODULE_DIALOG
#ifdef FEATURE_MODULE_STORAGE
#if (FEATURE_MODULE_STORAGE == 1)
extern void InitNativeApiFs(JSIValue exports);
extern void InitNativeApiKv(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_DEVICE
#if (FEATURE_MODULE_DEVICE == 1)
extern void InitDeviceModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_GEO
#if (FEATURE_MODULE_GEO == 1)
extern void InitLocationModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_SENSOR
#if (FEATURE_MODULE_SENSOR == 1)
extern void InitVibratorModule(JSIValue exports);
extern void InitSensorModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_BRIGHTNESS
#if (FEATURE_MODULE_BRIGHTNESS == 1)
extern void InitBrightnessModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_BATTERY
#if (FEATURE_MODULE_BATTERY == 1)
extern void InitBatteryModule(JSIValue exports);
#endif
#ifdef FEATURE_MODULE_CONFIGURATION
#if (FEATURE_MODULE_CONFIGURATION == 1)
extern void InitLocaleModule(JSIValue exports);
#endif
#ifdef FEATURE_ACELITE_SYSTEM_CAPABILITY
#if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1)
extern void InitCapabilityModule(JSIValue exports);
#endif
// Config information for built-in JS modules of OHOS platform
const Module OHOS_MODULES[] = {
#ifdef ENABLE_MODULE_REQUIRE_TEST
#if (ENABLE_MODULE_REQUIRE_TEST == 1)
{"sample", InitSampleModule},
#endif
{"app", InitAppModule},
#ifdef FEATURE_SUPPORT_HTTP
#if (FEATURE_SUPPORT_HTTP == 1)
{"fetch", InitFetchModule},
#endif // FEATURE_SUPPORT_HTTP
#ifdef FEATURE_MODULE_AUDIO
#if (FEATURE_MODULE_AUDIO == 1)
{"audio", InitAudioModule},
#endif // FEATURE_MODULE_AUDIO
#ifdef FEATURE_ACELITE_DFX_MODULE
#if (FEATURE_ACELITE_DFX_MODULE == 1)
{"dfx", InitDfxModule},
#endif // FEATURE_ACELITE_DFX_MODULE
{"router", InitRouterModule},
#ifdef ENABLE_MODULE_CIPHER
#if (ENABLE_MODULE_CIPHER == 1)
{"cipher", InitCipherModule},
#endif
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
{"prompt", InitDialogModule},
#endif // FEATURE_MODULE_DIALOG
#ifdef FEATURE_MODULE_STORAGE
#if (FEATURE_MODULE_STORAGE == 1)
{"file", InitNativeApiFs},
{"storage", InitNativeApiKv},
#endif
#ifdef FEATURE_MODULE_DEVICE
#if (FEATURE_MODULE_DEVICE == 1)
{"device", InitDeviceModule},
#endif
#ifdef FEATURE_MODULE_GEO
#if (FEATURE_MODULE_GEO == 1)
{"geolocation", InitLocationModule},
#endif
#ifdef FEATURE_MODULE_SENSOR
#if (FEATURE_MODULE_SENSOR == 1)
{"vibrator", InitVibratorModule},
{"sensor", InitSensorModule},
#endif
#ifdef FEATURE_MODULE_BRIGHTNESS
#if (FEATURE_MODULE_BRIGHTNESS == 1)
{"brightness", InitBrightnessModule},
#endif
#ifdef FEATURE_MODULE_BATTERY
#if (FEATURE_MODULE_BATTERY == 1)
{"battery", InitBatteryModule},
#endif
#ifdef FEATURE_MODULE_CONFIGURATION
#if (FEATURE_MODULE_CONFIGURATION == 1)
{"configuration", InitLocaleModule},
#endif
#ifdef FEATURE_ACELITE_SYSTEM_CAPABILITY
#if (FEATURE_ACELITE_SYSTEM_CAPABILITY == 1)
{"capability", InitCapabilityModule},
#endif
};
+19 -10
View File
@@ -23,7 +23,13 @@ lite_component("ace_native_engine_lite") {
features = [ ":ace_native_engine" ]
}
shared_library("ace_native_engine") {
lite_library("ace_native_engine") {
if (ohos_kernel_type == "liteos_m") {
target_type = "static_library"
} else {
target_type = "shared_library"
}
include_dirs = [
"$ace_common_root/log",
"$ace_common_root/memory",
@@ -33,11 +39,8 @@ shared_library("ace_native_engine") {
"//base/hiviewdfx/hilog_lite/interfaces/native/kits",
"//third_party/jerryscript/jerry-core/include",
]
if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "liteos_m") {
include_dirs += [ "$ace_target_root/liteos_a" ]
} else if (ohos_kernel_type == "linux") {
include_dirs += [ "$ace_target_root/linux" ]
}
deps = [ "$ace_target_root" ]
cflags = [ "-Wall" ]
cflags_cc = cflags
@@ -48,8 +51,14 @@ shared_library("ace_native_engine") {
"$native_engine_root/jsi/jsi.cpp",
]
public_deps = [
"$ace_common_root:ace_common_lite",
"//third_party/jerryscript/jerry-core:jerry-core_shared",
]
public_deps = [ "$ace_common_root:ace_common_lite" ]
if (ohos_kernel_type == "liteos_m") {
public_deps += [
"//foundation/graphic/ui:ui",
"//third_party/jerryscript:jerry_engine",
]
} else {
public_deps += [ "//third_party/jerryscript/jerry-core:jerry-core_shared" ]
}
}
+5 -5
View File
@@ -16,7 +16,7 @@
#include "message_queue_utils.h"
#include "ace_log.h"
#include "acelite_config.h"
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
#include "cmsis_os2.h"
#endif
@@ -28,7 +28,7 @@ QueueHandler MessageQueueUtils::CreateMessageQueue(uint32_t capacity, uint32_t m
HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:CreateMessageQueue parameters invalid!");
return nullptr;
}
#if (defined(__LINUX__) || defined(__LITEOS__))
#if (defined(__LINUX__) || defined(__LITEOS_A__))
HILOG_WARN(HILOG_MODULE_ACE, "todo call linux createMessageQueue interface here!");
return nullptr;
#else
@@ -43,7 +43,7 @@ int8_t MessageQueueUtils::DeleteMessageQueue(QueueHandler handler)
HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:DeleteMessageQueue parameters invalid!");
return MSGQ_FAIL;
}
#if (defined(__LINUX__) || defined(__LITEOS__))
#if (defined(__LINUX__) || defined(__LITEOS_A__))
HILOG_WARN(HILOG_MODULE_ACE, "todo call linux deleteMessageQueue interface here!");
return MSGQ_FAIL;
#else
@@ -62,7 +62,7 @@ int8_t MessageQueueUtils::PutMessage(QueueHandler handler, const void* msgPtr, u
HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:PutMessage parameters invalid!");
return MSGQ_FAIL;
}
#if (defined(__LINUX__) || defined(__LITEOS__))
#if (defined(__LINUX__) || defined(__LITEOS_A__))
HILOG_WARN(HILOG_MODULE_ACE, "todo call linux putmsg interface here!");
return MSGQ_FAIL;
#else
@@ -82,7 +82,7 @@ int8_t MessageQueueUtils::GetMessage(QueueHandler handler, void* msgPtr, uint32_
HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:GetMessage parameters invalid!");
return MSGQ_FAIL;
}
#if (defined(__LINUX__) || defined(__LITEOS__))
#if (defined(__LINUX__) || defined(__LITEOS_A__))
HILOG_WARN(HILOG_MODULE_ACE, "todo call linux getmsg interface here!");
return MSGQ_FAIL;
#else
@@ -17,14 +17,14 @@
#define OHOS_ACELITE_JSI_INTERNAL_H
#include "jsi_config.h"
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
#include "jerryscript.h"
#endif
/**
* Macros for conversions between jsi-values and jerry-values.
*/
#if defined (ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
#define AS_JERRY_VALUE(jsiValue) (jerry_value_t)(uintptr_t) jsiValue
#define AS_JLENGTH_VALUE(jsiValue) (jerry_length_t)(uintptr_t) jsiValue
#define AS_JSI_VALUE(jValue) (JSIValue)(uintptr_t) jValue
@@ -33,7 +33,7 @@
/**
* A convenience macro to create jerry-values.
*/
#if defined (ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
#define JERRY_CREATE(var, create) jerry_value_t var = (create);
#endif
+59 -59
View File
@@ -16,7 +16,7 @@
#include <cstdarg>
#include <cstring>
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
#include "securec.h"
#endif // OHOS_ACELITE_PRODUCT_WATCH
#include "ace_log.h"
@@ -27,7 +27,7 @@ namespace OHOS {
namespace ACELite {
JSIValue JSI::GetGlobalObject()
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_get_global_object());
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetGlobalObject has not been implemented in this js engine!");
@@ -37,7 +37,7 @@ JSIValue JSI::GetGlobalObject()
JSIValue JSI::CreateObject()
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_object());
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateObject has not been implemented in this js engine!");
@@ -51,7 +51,7 @@ void JSI::SetProperty(JSIValue object, JSIValue key, JSIValue value)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetProperty failed!");
return;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jObject = AS_JERRY_VALUE(object);
jerry_value_t jKey = AS_JERRY_VALUE(key);
jerry_value_t jVal = AS_JERRY_VALUE(value);
@@ -68,7 +68,7 @@ void JSI::SetNamedProperty(JSIValue object, const char * const propName, JSIValu
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedProperty failed!");
return;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jKey = jerry_create_string((const jerry_char_t *)propName);
SetProperty(object, AS_JSI_VALUE(jKey), value);
jerry_release_value(jKey);
@@ -121,7 +121,7 @@ void JSI::SetStringPropertyWithBufferSize(JSIValue object, const char * const pr
ReleaseValue(strValue);
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
/**
* @brief: CreateJerryFuncHelper is used to create jerry function
* along with JSI::CreateFunction, for internal use only.
@@ -166,7 +166,7 @@ JSIValue JSI::CreateFunction(JSIFunctionHandler handler)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateFunction failed!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jFunc = jerry_create_external_function(CreateJerryFuncHelper);
void *nativePointer = reinterpret_cast<void *>(handler);
jerry_set_object_native_pointer(jFunc, nativePointer, nullptr);
@@ -182,7 +182,7 @@ JSIValue JSI::CreateString(const char * const str)
if (str == nullptr) {
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_string(reinterpret_cast<const jerry_char_t *>(str)));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateString has not been implemented in this js engine!");
@@ -195,7 +195,7 @@ JSIValue JSI::CreateStringWithBufferSize(const char * const str, size_t size)
if (str == nullptr) {
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_string_sz(reinterpret_cast<const jerry_char_t *>(str), size));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateStringWithBufferSize has not been implemented in this js engine!");
@@ -205,7 +205,7 @@ JSIValue JSI::CreateStringWithBufferSize(const char * const str, size_t size)
JSIValue JSI::CreateUndefined()
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_undefined());
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateUndefined has not been implemented in this js engine!");
@@ -215,7 +215,7 @@ JSIValue JSI::CreateUndefined()
bool JSI::ValueIsFunction(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_function(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsFunction has not been implemented in this js engine!");
@@ -225,7 +225,7 @@ bool JSI::ValueIsFunction(JSIValue value)
bool JSI::ValueIsUndefined(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_undefined(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsUndefined has not been implemented in this js engine!");
@@ -235,7 +235,7 @@ bool JSI::ValueIsUndefined(JSIValue value)
bool JSI::ValueIsNumber(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_number(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsNumber has not been implemented in this js engine!");
@@ -245,7 +245,7 @@ bool JSI::ValueIsNumber(JSIValue value)
bool JSI::ValueIsString(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_string(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsString has not been implemented in this js engine!");
@@ -255,7 +255,7 @@ bool JSI::ValueIsString(JSIValue value)
bool JSI::ValueIsBoolean(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_boolean(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsBoolean has not been implemented in this js engine!");
@@ -265,7 +265,7 @@ bool JSI::ValueIsBoolean(JSIValue value)
bool JSI::ValueIsNull(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_null(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsNull has not been implemented in this js engine!");
@@ -275,7 +275,7 @@ bool JSI::ValueIsNull(JSIValue value)
bool JSI::ValueIsObject(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_object(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsObject has not been implemented in this js engine!");
@@ -285,7 +285,7 @@ bool JSI::ValueIsObject(JSIValue value)
bool JSI::ValueIsError(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_error(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsError has not been implemented in this js engine!");
@@ -299,7 +299,7 @@ char *JSI::JsonStringify(JSIValue value)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonStringify failed!");
return nullptr;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t stringified = jerry_json_stringify(AS_JERRY_VALUE(value));
char *res = ValueToString(AS_JSI_VALUE(stringified));
jerry_release_value(stringified);
@@ -316,7 +316,7 @@ JSIValue JSI::JsonParse(const char * const str)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonParse failed!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = jerry_json_parse(reinterpret_cast<const jerry_char_t *>(str), strlen(str));
return AS_JSI_VALUE(jVal);
#else
@@ -331,7 +331,7 @@ JSIValue JSI::GetProperty(JSIValue object, JSIValue key)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetProperty failed!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jObject = AS_JERRY_VALUE(object);
jerry_value_t jKey = AS_JERRY_VALUE(key);
return AS_JSI_VALUE(jerry_get_property(jObject, jKey));
@@ -347,7 +347,7 @@ JSIValue JSI::GetNamedProperty(JSIValue object, const char * const propName)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetNamedProperty failed!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jKey = jerry_create_string(reinterpret_cast<const jerry_char_t *>(propName));
JSIValue result = GetProperty(object, AS_JSI_VALUE(jKey));
jerry_release_value(jKey);
@@ -408,7 +408,7 @@ char *JSI::GetStringPropertyWithBufferSize(JSIValue object, const char * const p
void JSI::ReleaseValue(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
if (value != ARGS_END) {
jerry_release_value(AS_JERRY_VALUE(value));
}
@@ -431,7 +431,7 @@ void JSI::CallFunction(JSIValue funcObj, JSIValue thisVal, const JSIValue *argv,
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CallFunction failed!");
return;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jFunc = AS_JERRY_VALUE(funcObj);
jerry_value_t jThis = AS_JERRY_VALUE(thisVal);
if ((argv == nullptr) || argc == 0) {
@@ -465,7 +465,7 @@ void JSI::CallFunction(JSIValue funcObj, JSIValue thisVal, const JSIValue *argv,
JSIValue JSI::CreateNumber(double value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_number(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNumber has not been implemented in this js engine!");
@@ -475,7 +475,7 @@ JSIValue JSI::CreateNumber(double value)
JSIValue JSI::CreateNumberNaN()
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_number_nan());
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNumberNan has not been implemented in this js engine!");
@@ -483,7 +483,7 @@ JSIValue JSI::CreateNumberNaN()
#endif
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
static jerry_error_t GetJerryErrorType(JsiErrorType jsiType)
{
jerry_error_t jerryType;
@@ -556,7 +556,7 @@ JSIValue JSI::CreateError(JsiErrorType type, const char * const errorMsg)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateError parameters invalid!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_error_t jerryType = GetJerryErrorType(type);
jerry_value_t jError = jerry_create_error(jerryType, reinterpret_cast<const jerry_char_t *>(errorMsg));
return AS_JSI_VALUE(jError);
@@ -571,7 +571,7 @@ JsiErrorType JSI::GetErrorType(JSIValue errorValue)
if (!ValueIsError(errorValue)) {
return JsiErrorType::JSI_ERROR_INVALID;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jError = AS_JERRY_VALUE(errorValue);
jerry_error_t jerryType = jerry_get_error_type(jError);
return GetJsiErrorType(jerryType);
@@ -583,7 +583,7 @@ JsiErrorType JSI::GetErrorType(JSIValue errorValue)
JSIValue JSI::CreateBoolean(bool value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_boolean(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateBoolean has not been implemented in this js engine!");
@@ -593,7 +593,7 @@ JSIValue JSI::CreateBoolean(bool value)
JSIValue JSI::CreateNull()
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_null());
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNull has not been implemented in this js engine!");
@@ -601,10 +601,10 @@ JSIValue JSI::CreateNull()
#endif
}
#if defined(JS_FWK_SYMBOL)
#if (JS_FWK_SYMBOL == 1)
JSIValue JSI::CreateSymbol(JSIValue description)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jDsc = AS_JERRY_VALUE(description);
return AS_JSI_VALUE(jerry_create_symbol(jDsc));
#else
@@ -615,7 +615,7 @@ JSIValue JSI::CreateSymbol(JSIValue description)
bool JSI::ValueIsSymbol(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_symbol(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsSymbol has not been implemented in this js engine!");
@@ -626,7 +626,7 @@ bool JSI::ValueIsSymbol(JSIValue value)
JSIValue JSI::CreateArray(uint32_t length)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return AS_JSI_VALUE(jerry_create_array(length));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateArray has not been implemented in this js engine!");
@@ -636,7 +636,7 @@ JSIValue JSI::CreateArray(uint32_t length)
bool JSI::SetPropertyByIndex(JSIValue object, uint32_t index, JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jObject = AS_JERRY_VALUE(object);
jerry_value_t jVal = AS_JERRY_VALUE(value);
@@ -655,7 +655,7 @@ bool JSI::SetPropertyByIndex(JSIValue object, uint32_t index, JSIValue value)
char *JSI::ValueToString(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
char *result = nullptr;
jerry_value_t jVal = AS_JERRY_VALUE(value);
if (!jerry_value_is_string(jVal)) {
@@ -698,7 +698,7 @@ char *JSI::ValueToString(JSIValue value)
char *JSI::ValueToStringWithBufferSize(JSIValue value, size_t &size)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
auto jVal = AS_JERRY_VALUE(value);
if (!jerry_value_is_string(jVal)) {
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToStringWithBufferSize params invalid!");
@@ -737,7 +737,7 @@ char *JSI::ValueToStringWithBufferSize(JSIValue value, size_t &size)
double JSI::ValueToNumber(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(value);
if (!jerry_value_is_number(jVal)) {
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToNumber params invalid!");
@@ -752,7 +752,7 @@ double JSI::ValueToNumber(JSIValue value)
bool JSI::ValueToBoolean(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(value);
if (!jerry_value_is_boolean(jVal)) {
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToBoolean params invalid!");
@@ -767,7 +767,7 @@ bool JSI::ValueToBoolean(JSIValue value)
uint32_t JSI::GetArrayLength(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(value);
if (!jerry_value_is_array(jVal)) {
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayLength params invalid!");
@@ -782,7 +782,7 @@ uint32_t JSI::GetArrayLength(JSIValue value)
JSIValue JSI::GetPropertyByIndex(JSIValue object, uint32_t index)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(object);
return AS_JSI_VALUE(jerry_get_property_by_index(jVal, index));
#else
@@ -797,7 +797,7 @@ JSIValue JSI::GetObjectKeys(JSIValue object)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetObjectKeys failed!");
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(object);
return AS_JSI_VALUE(jerry_get_object_keys(jVal));
#else
@@ -808,7 +808,7 @@ JSIValue JSI::GetObjectKeys(JSIValue object)
bool JSI::GetJSHeapStatus(JSHeapStatus &heapStatus)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_heap_stats_t stats = {0};
if (!jerry_get_memory_stats(&stats)) {
return false;
@@ -825,7 +825,7 @@ bool JSI::GetJSHeapStatus(JSHeapStatus &heapStatus)
bool JSI::ValueIsArray(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_array(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsArray has not been implemented in this js engine!");
@@ -835,7 +835,7 @@ bool JSI::ValueIsArray(JSIValue value)
JSIValue JSI::AcquireValue(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(value);
return AS_JSI_VALUE(jerry_acquire_value(jVal));
#else
@@ -861,7 +861,7 @@ void JSI::SetOnDestroy(JSIValue object, NativeCallback callback)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetOnDestroy failed!");
return;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
void *nativePtr = reinterpret_cast<void *>(callback);
jerry_set_object_native_pointer(AS_JERRY_VALUE(object), nativePtr, nullptr);
#else
@@ -897,7 +897,7 @@ void JSI::SetNamedPointer(JSIValue object, const char * const name, JsiCallback
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedPointer failed!");
return;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
JSIValue funObj = JSI::CreateObject();
void *nativePtr = reinterpret_cast<void *>(callback);
jerry_set_object_native_pointer(AS_JERRY_VALUE(funObj), nativePtr, nullptr);
@@ -908,8 +908,8 @@ void JSI::SetNamedPointer(JSIValue object, const char * const name, JsiCallback
#endif
}
#if defined(JS_FWK_TYPEDARRAY)
#if defined(ENABLE_JERRY)
#if (JS_FWK_TYPEDARRAY == 1)
#if (ENABLE_JERRY == 1)
// Helper function for JSI TypedArray type convert
TypedArrayType GetJsiArrayType(jerry_typedarray_type_t jerryType)
{
@@ -960,7 +960,7 @@ uint8_t *JSI::GetTypedArrayInfo(JSIValue typedArray,
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetTypedArrayInfo failed!");
return nullptr;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(typedArray);
jerry_typedarray_type_t jType = jerry_get_typedarray_type(jVal);
type = GetJsiArrayType(jType);
@@ -980,7 +980,7 @@ uint8_t *JSI::GetTypedArrayInfo(JSIValue typedArray,
#endif
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
// Helper function for jerry TypedArray type convert
jerry_typedarray_type_t GetJerryArrayType(TypedArrayType jsiType)
{
@@ -1023,7 +1023,7 @@ jerry_typedarray_type_t GetJerryArrayType(TypedArrayType jsiType)
JSIValue JSI::CreateTypedArray(TypedArrayType type, size_t length, JSIValue arrayBuffer, size_t byteOffset)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_typedarray_type_t jType = GetJerryArrayType(type);
jerry_value_t jArrayBuffer = AS_JERRY_VALUE(arrayBuffer);
jerry_value_t jVal = jerry_create_typedarray_for_arraybuffer_sz(jType, jArrayBuffer, (jerry_length_t)byteOffset,
@@ -1041,7 +1041,7 @@ uint8_t *JSI::GetArrayBufferInfo(JSIValue arrayBuffer, size_t &byteLength)
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayBufferInfo failed!");
return nullptr;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = AS_JERRY_VALUE(arrayBuffer);
jerry_length_t len = jerry_get_arraybuffer_byte_length(jVal);
@@ -1058,7 +1058,7 @@ JSIValue JSI::CreateArrayBuffer(size_t byteLength, uint8_t *&buffPtr)
if (byteLength == 0) {
return CreateUndefined();
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t jVal = jerry_create_arraybuffer((jerry_length_t)byteLength);
buffPtr = jerry_get_arraybuffer_pointer(jVal);
return AS_JSI_VALUE(jVal);
@@ -1070,7 +1070,7 @@ JSIValue JSI::CreateArrayBuffer(size_t byteLength, uint8_t *&buffPtr)
bool JSI::ValueIsArrayBuffer(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_arraybuffer(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsArrayBuffer has not been implemented in this js engine!");
@@ -1080,7 +1080,7 @@ bool JSI::ValueIsArrayBuffer(JSIValue value)
bool JSI::ValueIsTypedArray(JSIValue value)
{
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
return jerry_value_is_typedarray(AS_JERRY_VALUE(value));
#else
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsTypedArray has not been implemented in this js engine!");
@@ -1095,7 +1095,7 @@ bool JSI::DefineProperty(JSIValue object, JSIValue propName, JSPropertyDescripto
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineProperty failed!");
return false;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_property_descriptor_t jerryDesc;
jerry_init_property_descriptor_fields(&jerryDesc);
@@ -1130,7 +1130,7 @@ bool JSI::DefineNamedProperty(JSIValue object, const char * const propNameStr, J
HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineNamedProperty failed!");
return false;
}
#if defined(ENABLE_JERRY)
#if (ENABLE_JERRY == 1)
jerry_value_t propName = jerry_create_string(reinterpret_cast<const jerry_char_t *>(propNameStr));
bool res = DefineProperty(object, AS_JSI_VALUE(propName), descriptor);
jerry_release_value(propName);
+3 -3
View File
@@ -14,7 +14,7 @@
*/
#include "ace_lock.h"
#if (defined(__LITEOS_M__) || defined(OHOS_ACELITE_PRODUCT_WATCH))
#if (defined(__LITEOS_M__) || (OHOS_ACELITE_PRODUCT_WATCH == 1))
#include "los_task.h"
#endif
@@ -62,7 +62,7 @@ AutoLockGuard::AutoLockGuard(LockType &lock) : lock_(lock)
{
#if (defined(__LINUX__) || defined(__LITEOS_A__))
lock_.Lock();
#elif (defined(__LITEOS_M__) || defined(OHOS_ACELITE_PRODUCT_WATCH))
#elif (defined(__LITEOS_M__) || (OHOS_ACELITE_PRODUCT_WATCH == 1))
LOS_TaskLock();
#else
(void)lock_;
@@ -73,7 +73,7 @@ AutoLockGuard::~AutoLockGuard()
{
#if (defined(__LINUX__) || defined(__LITEOS_A__))
lock_.Unlock();
#elif (defined(__LITEOS_M__) || defined(OHOS_ACELITE_PRODUCT_WATCH))
#elif (defined(__LITEOS_M__) || (OHOS_ACELITE_PRODUCT_WATCH == 1))
LOS_TaskUnlock();
#endif
}
+1 -1
View File
@@ -15,7 +15,7 @@
#include "dft_impl.h"
#if (defined(OHOS_ACELITE_PRODUCT_WATCH)||(defined(FEATURE_CUSTOM_ENTRY_PAGE)))
#if ((OHOS_ACELITE_PRODUCT_WATCH == 1) || (FEATURE_CUSTOM_ENTRY_PAGE == 1))
#include "ace_log.h"
#include "js_app_context.h"
@@ -81,7 +81,7 @@ void Debugger::FlushOutput()
fflush(stdout);
}
#ifdef JS_ENGINE_EXTERNAL_CONTEXT
#if (JS_ENGINE_EXTERNAL_CONTEXT == 1)
static void *AllocEngineContext(size_t size, void *cbDataP)
{
(void)(cbDataP);
@@ -91,7 +91,7 @@ static void *AllocEngineContext(size_t size, void *cbDataP)
void Debugger::SetupJSContext()
{
#ifdef JS_ENGINE_EXTERNAL_CONTEXT
#if (JS_ENGINE_EXTERNAL_CONTEXT == 1)
if (engineContext_ != nullptr) {
// do not repeat the setup process
return;
@@ -112,7 +112,7 @@ void Debugger::SetupJSContext()
void Debugger::ReleaseJSContext()
{
#ifdef JS_ENGINE_EXTERNAL_CONTEXT
#if (JS_ENGINE_EXTERNAL_CONTEXT == 1)
if (engineContext_ == nullptr) {
return;
}
+6 -6
View File
@@ -39,7 +39,7 @@
#include "securec.h"
#include "task_manager.h"
#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENSIZE_SPECIFIED))
#if ((defined __LITEOS__) || (defined __linux__) || (SCREENSIZE_SPECIFIED == 1))
#include <screen.h>
#endif
@@ -585,7 +585,7 @@ int32_t GetFileSize(const char * const filePath)
static int32_t OpenFileInternal(const char * const orgFullPath, bool binary = false)
{
const char *path = orgFullPath;
#ifndef QT_SIMULATOR
#if (QT_SIMULATOR != 1)
#ifndef __LITEOS_M__ // no path canonicalization on M core
char fullPath[PATH_MAX + 1] = {0};
#if ((defined(__WIN32)) || (defined(__WIN64)))
@@ -1097,7 +1097,7 @@ struct JSPageSpecific jsPageSpecific;
uint16_t GetHorizontalResolution()
{
// SCREENSIZE_SPECIFIED is temporarily set, when ui and graphic unifid, this can be removed
#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENSIZE_SPECIFIED))
#if ((defined __LITEOS__) || (defined __linux__) || (SCREENSIZE_SPECIFIED == 1))
return Screen::GetInstance().GetWidth();
#else
uint16_t horizontalResolution = 454;
@@ -1109,7 +1109,7 @@ uint16_t GetHorizontalResolution()
uint16_t GetVerticalResolution()
{
#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENSIZE_SPECIFIED))
#if ((defined __LITEOS__) || (defined __linux__) || (SCREENSIZE_SPECIFIED == 1))
return Screen::GetInstance().GetHeight();
#else
uint16_t horizontalResolution = 454;
@@ -1178,7 +1178,7 @@ void ExpandImagePathMem(char *&imagePath, const int16_t dotPos, const int16_t su
imagePath = newImagePath;
}
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
void CureImagePath(char *&imagePath)
{
if (imagePath == nullptr) {
@@ -1264,7 +1264,7 @@ const char *ParseImageSrc(jerry_value_t source)
char *imageSrc = JsAppContext::GetInstance()->GetResourcePath(rawSrc);
ace_free(rawSrc);
rawSrc = nullptr;
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
CureImagePath(imageSrc);
#endif // OHOS_ACELITE_PRODUCT_WATCH
return imageSrc;
+4 -4
View File
@@ -105,13 +105,13 @@ constexpr uint32_t TEXT_BLUE_COLOR_MASK = 0x0000ff;
constexpr int RED_COLOR_START_BIT = 16;
constexpr int GREEN_COLOR_START_BIT = 8;
constexpr char ATTR_SRC[] = "src"; // image-animator
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
constexpr char CLOCK_HAND_IS_IMAGE[] = "isImage";
constexpr char COMMON_STYLE_OPACITY[] = "opacity";
constexpr char COMMON_STYLE_COLOR[] = "color";
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
constexpr uint8_t DEFAULT_FONT_SIZE = 30;
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
constexpr uint8_t DEFAULT_FONT_LETTERSPACE = 2;
#endif // FEATURE_COMPONENT_CANVAS
constexpr char DEFAULT_FONT_FAMILY[] = DEFAULT_VECTOR_FONT_FILENAME;
@@ -158,7 +158,7 @@ constexpr char TRANSITION_TRANSFORM_Y[] = "translateY";
constexpr char CONSTRUCTOR_VIEW_MODEL[] = "ViewModel";
constexpr char CONSTRUCTOR_ABILITY_SLICE[] = "AbilitySlice";
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
constexpr char FUNC_ROTATION_NAME[] = "rotation";
constexpr char ATTR_NAME_FOCUS[] = "focus";
#endif // FEATURE_ROTATION_API
@@ -280,7 +280,7 @@ JSValue CallWithRootAbilitySlice(JSValue func);
JSValue CreateWatcher(JSValue getter, JSHandler handler, JSValue options);
void ExpandImagePathMem(char *&imagePath, const int16_t dotPos, const int16_t suffixLen, const int16_t imagePathLen);
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
void CureImagePath(char *&imagePath);
#endif // OHOS_ACELITE_PRODUCT_WATCH
const char *ParseImageSrc(jerry_value_t source);
+39 -39
View File
@@ -26,20 +26,20 @@ namespace ACELite {
#endif // KEYWORD
// Replace the struct keys.h "KEYWORD" sector for init
#if defined(ENABLE_KEY)
#if (ENABLE_KEY == 1)
#define KEYWORD(enumkey, keystr) {#keystr, K_##enumkey, static_cast<uint8_t>(strlen(#enumkey))},
#else // ENABLE_KEY
#define KEYWORD(enumkey, keystr) {K_##enumkey, static_cast<uint8_t>(strlen(#enumkey))},
#endif // ENABLE_KEY
static const struct {
#if defined(ENABLE_KEY)
#if (ENABLE_KEY == 1)
const char * const key;
#endif
const uint16_t ID;
const uint8_t LENGTH;
} G_KEYWORD_INFO[KEYWORDS_MAX] = {
#if defined(ENABLE_KEY)
#if (ENABLE_KEY == 1)
{"UNKNOWN", K_UNKNOWN, static_cast<uint8_t>(strlen("UNKNOWN"))},
#else // ENABLE_KEY
{K_UNKNOWN, static_cast<uint8_t>(strlen("UNKNOWN"))},
@@ -69,7 +69,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "lignItems")) {
return K_ALIGN_ITEMS;
}
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
if (!strcmp(s, "nalog-clock")) {
return K_ANALOG_CLOCK;
}
@@ -95,7 +95,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "rc")) {
return K_ARC;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "utoplay")) {
return K_AUTOPLAY;
}
@@ -149,12 +149,12 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
}
break;
case 'c':
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
if (!strcmp(s, "amera")) {
return K_CAMERA;
}
#endif // FEATURE_COMPONENT_CAMERA
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
if (!strcmp(s, "anvas")) {
return K_CANVAS;
}
@@ -177,7 +177,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "olumn-reverse")) {
return K_COLUMN_REVERSE;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "ontrols")) {
return K_CONTROLS;
}
@@ -200,7 +200,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "lip")) {
return K_CLIP;
}
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
if (!strcmp(s, "lock-hand")) {
return K_CLOCK_HAND;
}
@@ -216,12 +216,12 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "atasets")) {
return K_DATASETS;
}
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "ay")) {
return K_DAY;
}
#endif
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
if (!strcmp(s, "ate")) {
return K_DATE;
}
@@ -255,16 +255,16 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "llipsis")) {
return K_ELLIPSIS;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
if (!strcmp(s, "nd")) {
return K_END;
}
#endif // FEATURE_COMPONENT_DATE_PICKER
#if (defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO))
#if ((FEATURE_COMPONENT_CAMERA == 1) || (FEATURE_COMPONENT_VIDEO == 1))
if (!strcmp(s, "rror")) {
return K_ERROR;
}
#endif // defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO)
#endif // ((FEATURE_COMPONENT_CAMERA == 1) || (FEATURE_COMPONENT_VIDEO == 1))
if (!strcmp(s, "xpand")) {
return K_EXPAND;
}
@@ -282,7 +282,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "ixedsize")) {
return K_FIXED_SIZE;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "inish")) {
return K_FINISH;
}
@@ -316,12 +316,12 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "eight")) {
return K_HEIGHT;
}
#if (defined(FEATURE_COMPONENT_ANALOG_CLOCK)) || (defined(FEATURE_DATE_FORMAT))
#if ((FEATURE_COMPONENT_ANALOG_CLOCK == 1) || (FEATURE_DATE_FORMAT == 1))
if (!strcmp(s, "our")) {
return K_HOUR;
}
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "our12")) {
return K_HOUR12;
}
@@ -393,7 +393,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "oop")) {
return K_LOOP;
}
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "ong")) {
return K_LONG;
}
@@ -427,12 +427,12 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "ini")) {
return K_MINI;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "uted")) {
return K_MUTED;
}
#endif // FEATURE_COMPONENT_VIDEO
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
if (!strcmp(s, "inimumFractionDigits")) {
return K_MINIMUMFRACTIONDIGITS;
}
@@ -440,7 +440,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
return K_MAXIMUMFRACTIONDIGITS;
}
#endif
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "inute")) {
return K_MINUTE;
}
@@ -456,7 +456,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "one")) {
return K_NONE;
}
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "umeric")) {
return K_NUMERIC;
}
@@ -489,7 +489,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "addingTop")) {
return K_PADDING_TOP;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "ause")) {
return K_PAUSE;
}
@@ -500,7 +500,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "icker-view")) {
return K_PICKER_VIEW;
}
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
if (!strcmp(s, "ivotX")) {
return K_PIVOT_X;
}
@@ -508,7 +508,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
return K_PIVOT_Y;
}
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "repared")) {
return K_PREPARED;
}
@@ -517,7 +517,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
return K_PROGRESS;
}
break;
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
case 'q':
if (!strcmp(s, "rcode")) {
return K_QRCODE;
@@ -569,12 +569,12 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "crollstart")) {
return K_SCROLLSTART;
}
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
if (!strcmp(s, "ec")) {
return K_SEC;
}
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "eeked")) {
return K_SEEKED;
}
@@ -597,7 +597,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "how")) {
return K_SHOW;
}
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "hort")) {
return K_SHORT;
}
@@ -623,11 +623,11 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "top")) {
return K_STOP;
}
#if (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO))
#if ((FEATURE_COMPONENT_DATE_PICKER == 1) || (FEATURE_COMPONENT_VIDEO == 1))
if (!strcmp(s, "tart")) {
return K_START;
}
#endif // (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO)
#endif // ((FEATURE_COMPONENT_DATE_PICKER == 1) || (FEATURE_COMPONENT_VIDEO == 1))
if (!strcmp(s, "tartAngle")) {
return K_START_ANGLE;
}
@@ -637,7 +637,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "trokeWidth")) {
return K_STROKE_WIDTH;
}
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
if (!strcmp(s, "tyle")) {
return K_STYLE;
}
@@ -653,7 +653,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
}
break;
case 't':
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
if (!strcmp(s, "ab-bar")) {
return K_TAB_BAR;
}
@@ -667,7 +667,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "ime")) {
return K_TIME;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "imeupdate")) {
return K_TIME_UPDATE;
}
@@ -710,14 +710,14 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "extOverflow")) {
return K_TEXT_OVERFLOW;
}
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
if (!strcmp(s, "ype")) {
return K_TYPE;
}
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
break;
case 'u':
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
if (!strcmp(s, "seGrouping")) {
return K_USEGROUP;
}
@@ -730,7 +730,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
if (!strcmp(s, "ertical")) {
return K_VERTICAL;
}
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
if (!strcmp(s, "ideo")) {
return K_VIDEO;
}
@@ -745,7 +745,7 @@ uint16_t KeyParser::ParseKeyId(const char *s, const size_t len)
}
break;
case '2':
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
if (!strcmp(s, "-digit")) {
return K_DIGIT2;
}
@@ -781,7 +781,7 @@ const char *KeyParser::GetKeyById(uint16_t id)
if (!IsKeyValid(id)) {
return "UNKNOWN";
}
#if defined(ENABLE_KEY)
#if (ENABLE_KEY == 1)
return G_KEYWORD_INFO[id].key;
#else
return "UNKNOWN";
+33 -33
View File
@@ -38,7 +38,7 @@ enum {
// Reused by the struct begin
// Sample:KEYWORD(enum_string, real-key-string)
KEYWORD(ALIGN_ITEMS, alignItems) // layout style
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
KEYWORD(ANALOG_CLOCK, analog-clock) // tag name
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
KEYWORD(ANIMATION_DELAY, animationDelay) // animation delay
@@ -48,7 +48,7 @@ enum {
KEYWORD(ANIMATION_NAME, animationName) // animation name
KEYWORD(ANIMATION_TIMING_FUNCTION, animationTimingFunction) // animation timing function
KEYWORD(ARC, arc) // circle progress
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(AUTOPLAY, autoplay) // video component autoplay attribute
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(BACKGROUND_COLOR, backgroundColor) // chart line color
@@ -66,10 +66,10 @@ enum {
KEYWORD(BORDER_TOP_WIDTH, borderTopWidth) // common style border top width
KEYWORD(BORDER_WIDTH, borderWidth) // common style, horizon progress style
KEYWORD(BREAK, break) // text overflow type
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
KEYWORD(CAMERA, camera) // camera component
#endif // FEATURE_COMPONENT_CAMERA
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
KEYWORD(CANVAS, canvas) // tag name
#endif // FEATURE_COMPONENT_CANVAS
KEYWORD(CENTER, center) // text align type
@@ -81,22 +81,22 @@ enum {
KEYWORD(CLICK, click) // click event listener
KEYWORD(CLIP, clip) // text overflow type
KEYWORD(CHART, chart) // tag name
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
KEYWORD(CLOCK_HAND, clock-hand) // tag name
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
KEYWORD(COLOR, color) // text style type, rectangular clock-hand fill color, horizon progress style
KEYWORD(COLUMN, column) // layout style
KEYWORD(COLUMN_REVERSE, column-reverse) // layout style
KEYWORD(CONTAIN, contain) // image component contain
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(CONTROLS, controls) // video component controls attribute
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(COVER, cover) // image component cover
KEYWORD(DATASETS, datasets) // chart data
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
KEYWORD(DATE, date) // picker-view attr value
#endif // FEATURE_COMPONENT_DATE_PICKER
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(DAY, day)
KEYWORD(DIGIT2, digit2)
#endif
@@ -109,15 +109,15 @@ enum {
KEYWORD(EASE_IN_OUT, ease-in-out) // animation time function value
KEYWORD(EASE_OUT, ease-out) // animation time function value
KEYWORD(ELLIPSIS, ellipsis) // text overflow type
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
KEYWORD(END, end) // date picker-view attr
#endif // FEATURE_COMPONENT_DATE_PICKER
#if (defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO))
#if ((FEATURE_COMPONENT_CAMERA == 1) || (FEATURE_COMPONENT_VIDEO == 1))
KEYWORD(ERROR, error) // camera component error event
#endif // FEATURE_COMPONENT_CAMERA
KEYWORD(EXPAND, expand) // text overflow type
KEYWORD(FALSE, false) // common attributes
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(FINISH, finish) // video component finish event tag
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(FILL, fill) // image component fill
@@ -132,10 +132,10 @@ enum {
KEYWORD(FONT_FAMILY, fontFamily) // text style type
KEYWORD(FORWARDS, forwards) // animation fill value
KEYWORD(HEIGHT, height) // common attributes
#if (defined(FEATURE_COMPONENT_ANALOG_CLOCK)) || (defined(FEATURE_DATE_FORMAT))
#if ((FEATURE_COMPONENT_ANALOG_CLOCK == 1) || (FEATURE_DATE_FORMAT == 1))
KEYWORD(HOUR, hour) // analog-clock hour
#endif // FEATURE_COMPONENT_ANALOG_CLOCK FEATURE_DATE_FORMAT
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(HOUR12, hour12)
#endif
KEYWORD(ID, id) // common attributes
@@ -157,7 +157,7 @@ enum {
KEYWORD(LINE_HEIGHT, lineHeight) // text style type
KEYWORD(LIST, list) // list tag name
KEYWORD(LIST_ITEM, list-item) // list-item tag name
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(LONG, long)
#endif
KEYWORD(LONGPRESS, longpress) // long progress event listener
@@ -171,16 +171,16 @@ enum {
KEYWORD(MAX, max) // common attributes
KEYWORD(MIN, min) // common attributes, analog-clock minute
KEYWORD(MINI, mini) // text font size type
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(MINUTE, minute)
KEYWORD(MONTH, month)
#endif
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(MUTED, muted) // video component muted attribute
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(NAME, name) // the attribute name
KEYWORD(NONE, none) // animation fill value
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(NUMERIC, numeric)
#endif
KEYWORD(OBJECT_FIT, objectFit) // image component object-fit
@@ -194,21 +194,21 @@ enum {
KEYWORD(PERCENT, percent)
KEYWORD(PICKER_VIEW, picker-view) // tag name
KEYWORD(REF, ref) // common attribute
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(PREPARED, prepared) // video component prepared event
#endif // FEATURE_COMPONENT_VIDEO
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
KEYWORD(PIVOT_X, pivotX) // clock-hand pivot-x
KEYWORD(PIVOT_Y, pivotY) // clock-hand pivot-y
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
KEYWORD(PROGRESS, progress) // progress tag name
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
KEYWORD(QRCODE, qrcode) // qrcode tag name
#endif
KEYWORD(RADIO, radio) // the type in input
KEYWORD(RADIUS, radius) // circle progress radius
KEYWORD(RANGE, range) // picker-view attr
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(PAUSE, pause) // video component pause event tag
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(REVERSE, reverse) // image-animator attribute
@@ -221,13 +221,13 @@ enum {
KEYWORD(SCROLLDELAY, scrolldelay) // marquee scroll delay
KEYWORD(SCROLLEND, scrollend) // scroll end event listener
KEYWORD(SCROLLSTART, scrollstart) // scroll start event listener
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
KEYWORD(SEC, sec) // analog-clock second
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(SECOND, second)
#endif
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(SEEKING, seeking) // // video component seeking event tag
KEYWORD(SEEKED, seeked) // // video component seeked event tag
#endif // FEATURE_COMPONENT_VIDEO
@@ -235,7 +235,7 @@ enum {
KEYWORD(SELECTED_COLOR, selectedColor) // picker-view style
KEYWORD(SELECTED_FONT_FAMILY, selectedFontFamily) // picker-view style
KEYWORD(SELECTED_FONT_SIZE, selectedFontSize) // picker-view style
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(SHORT, short)
#endif
KEYWORD(SHOW, show)
@@ -247,16 +247,16 @@ enum {
KEYWORD(STACK, stack) // tag name
KEYWORD(STANDARD, standard) // text font size type
KEYWORD(STOP, stop) // image-animator stop event, video component end event tag
#if (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO))
#if ((FEATURE_COMPONENT_DATE_PICKER == 1) || (FEATURE_COMPONENT_VIDEO == 1))
KEYWORD(START, start) // date picker-view attr, video component start event tag
#endif // (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO)
#endif // ((FEATURE_COMPONENT_DATE_PICKER == 1) || (FEATURE_COMPONENT_VIDEO == 1))
KEYWORD(START_ANGLE, startAngle) // circle progress start angle
KEYWORD(STEP, step)
KEYWORD(STROKE_WIDTH, strokeWidth) // horizon/arc progress style
KEYWORD(SWIPE, swipe) // swipe event listener
KEYWORD(SWIPER, swiper) // tag name
KEYWORD(SWITCH, switch) // tag name
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
KEYWORD(TAB_BAR, tab-bar) // tag name
KEYWORD(TAB_CONTENT, tab-content) // tag name
KEYWORD(TABS, tabs) // tag name
@@ -265,7 +265,7 @@ enum {
KEYWORD(TEXT_ALIGN, textAlign) // text style type
KEYWORD(TEXT_OVERFLOW, textOverflow) // text style type
KEYWORD(TIME, time) // picker-view attr value
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(TIME_UPDATE, timeupdate) // video component timeupdate event tag
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(TOP, top)
@@ -279,21 +279,21 @@ enum {
KEYWORD(TRANSLATE_X, translateX) // animation transform x
KEYWORD(TRANSLATE_Y, translateY) // animation transform y
KEYWORD(TRUE, true) // common attributes
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
KEYWORD(TYPE, type) // clock-hand type
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
KEYWORD(VALUE, value) // common attributes
KEYWORD(VERTICAL, vertical) // swiper attr vertical
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
KEYWORD(VIDEO, video) // video tag name
#endif // FEATURE_COMPONENT_VIDEO
KEYWORD(WIDTH, width) // common attributes
KEYWORD(WRAP, wrap) // flex wrap
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
KEYWORD(WEEKDAY, weekday)
KEYWORD(YEAR, year)
#endif
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
KEYWORD(STYLE, style)
KEYWORD(USEGROUP, useGroup)
KEYWORD(MINIMUMFRACTIONDIGITS, minimumFractionDigits)
+1 -1
View File
@@ -14,7 +14,7 @@
*/
#include "locale_util.h"
#ifdef FEATURE_INTL_MODULE
#if (FEATURE_INTL_MODULE == 1)
#include "ace_log.h"
#include "global.h"
#include "js_fwk_common.h"
+1 -1
View File
@@ -16,7 +16,7 @@
#ifndef OHOS_ACELITE_LOCALE_UTIL_H
#define OHOS_ACELITE_LOCALE_UTIL_H
#include "acelite_config.h"
#ifdef FEATURE_INTL_MODULE
#if (FEATURE_INTL_MODULE == 1)
#include "locale_info.h"
#include "non_copyable.h"
namespace OHOS {
+1 -1
View File
@@ -161,7 +161,7 @@ void ProductAdapter::RegTEHandlers(const TEHandlingHooks &teHandlingHooks)
// read the global value directly here.
TEDispatchingResult ProductAdapter::DispatchTEMessage()
{
#ifdef OHOS_ACELITE_PRODUCT_WATCH // only some specific products support TE dispatching
#if (OHOS_ACELITE_PRODUCT_WATCH == 1) // only some specific products support TE dispatching
if (!g_isRenderTickAcceptable) {
return TEDispatchingResult::REFUSED;
}
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
#include "ace_log.h"
#include "analog_clock_component.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
#include "component.h"
#include "non_copyable.h"
@@ -14,7 +14,7 @@
*/
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
#include "camera_component.h"
#include <climits>
@@ -17,7 +17,7 @@
#define OHOS_ACELITE_CAMERA_COMPONENT_H
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
#include "component.h"
#include "camera_kit.h"
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
#include "canvas_component.h"
#include "js_fwk_common.h"
#include "product_adapter.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
#include "component.h"
#include "non_copyable.h"
#include "ui_canvas.h"
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
#include "ace_log.h"
#include "ace_mem_base.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
#include "component.h"
#include "non_copyable.h"
+4 -4
View File
@@ -202,7 +202,7 @@ void Component::Release()
{
// detach self from fatal handler monitoring
FatalHandler::GetInstance().DetachComponentNode(this);
#ifdef FEATURE_LAZY_LOADING_MODULE
#if (FEATURE_LAZY_LOADING_MODULE == 1)
// detach from lazy pending list
JsAppContext *context = JsAppContext::GetInstance();
LazyLoadManager *lazyLoadManager = const_cast<LazyLoadManager *>(context->GetLazyLoadManager());
@@ -1097,7 +1097,7 @@ void Component::ParseAttrs()
if (freeze_) {
newAttrValue = JSFunction::Call(attrValue, viewModel_, nullptr, 0);
} else {
#ifdef FEATURE_LAZY_LOADING_MODULE
#if (FEATURE_LAZY_LOADING_MODULE == 1)
newAttrValue = CallJSFunction(attrValue, viewModel_, nullptr, 0);
JsAppContext *context = JsAppContext::GetInstance();
LazyLoadManager *lazyLoadManager = const_cast<LazyLoadManager *>(context->GetLazyLoadManager());
@@ -1922,7 +1922,7 @@ bool Component::HandleBackgroundImg(const AppStyleItem &styleItem, char *&presse
filePath = nullptr;
return result;
}
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
// convert .png/jpeg/bmp to .bin subfix
CureImagePath(imagePath);
#endif // OHOS_ACELITE_PRODUCT_WATCH
@@ -1944,7 +1944,7 @@ bool Component::HandleBackgroundImg(const AppStyleItem &styleItem, char *&presse
return result;
}
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
jerry_value_t Component::HandleRotationRequest(const jerry_value_t func,
const jerry_value_t dom,
const jerry_value_t args[],
+1 -1
View File
@@ -469,7 +469,7 @@ protected:
*/
bool HandleBackgroundImg(const AppStyleItem &styleItem, char *&pressedImage, char *&normalImage) const;
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
/**
* @brief the rotation API handling function, the child component can register it for rotation API supporting
* @param func function object
@@ -17,14 +17,14 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
#include "analog_clock_component.h"
#include "clock_hand_component.h"
#endif // FEATURE_COMPONENT_ANALOG_CLOCK
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
#include "camera_component.h"
#endif // FEATURE_COMPONENT_CAMERA
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
#include "canvas_component.h"
#endif // FEATURE_COMPONENT_CANVAS
#include "chart_component.h"
@@ -45,14 +45,14 @@
#include "marquee_component.h"
#include "non_copyable.h"
#include "picker_view_component.h"
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
#include "qrcode_component.h"
#endif
#include "slider_component.h"
#include "stack_component.h"
#include "swiper_component.h"
#include "switch_component.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "tab_bar_component.h"
#include "tab_content_component.h"
#include "tabs_component.h"
@@ -80,12 +80,12 @@ public:
Component* component;
switch (componentNameId) {
#ifdef FEATURE_COMPONENT_CAMERA
#if (FEATURE_COMPONENT_CAMERA == 1)
case K_CAMERA:
component = new CameraComponent(options, children, styleManager);
break;
#endif
#ifdef FEATURE_COMPONENT_CANVAS
#if (FEATURE_COMPONENT_CANVAS == 1)
case K_CANVAS:
component = new CanvasComponent(options, children, styleManager);
break;
@@ -112,7 +112,7 @@ public:
}
break;
}
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
case K_TAB_BAR:
component = new TabBarComponent(options, children, styleManager);
break;
@@ -141,7 +141,7 @@ public:
case K_LIST_ITEM:
component = new DivComponent(options, children, styleManager);
break;
#ifdef FEATURE_COMPONENT_ANALOG_CLOCK
#if (FEATURE_COMPONENT_ANALOG_CLOCK == 1)
case K_CLOCK_HAND:
component = new ClockHandComponent(options, children, styleManager);
break;
@@ -170,12 +170,12 @@ public:
case K_PICKER_VIEW:
component = new PickerViewComponent(options, children, styleManager);
break;
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
case K_QRCODE:
component = new QrcodeComponent(options, children, styleManager);
break;
#endif // FEATURE_COMPONENT_QRCODE
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
case K_VIDEO:
component = new VideoComponent(options, children, styleManager);
break;
@@ -30,7 +30,7 @@ ListComponent::ListComponent(JSValue options, JSValue children, AppStyleManager
{
SetComponentName(K_LIST);
RegisterNamedFunction(FUNC_SCROLLTO, ListScrollTo);
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
RegisterNamedFunction(FUNC_ROTATION_NAME, HandleRotationRequest);
#endif // FEATURE_ROTATION_API
}
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include "panel_view.h"
#include "graphic_config.h"
+1 -1
View File
@@ -16,7 +16,7 @@
#define OHOS_ACELITE_PANEL_VIEW_H
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include "ace_log.h"
#include "flex_layout.h"
@@ -29,7 +29,7 @@
namespace OHOS {
namespace ACELite {
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
void DatePickerListener::OnDatePickerStoped(UIDatePicker &picker)
{
if (!jerry_value_is_function(dateCallback_)) {
@@ -94,7 +94,7 @@ PickerViewComponent::PickerViewComponent(jerry_value_t options, jerry_value_t ch
pTextArray_(nullptr),
textArraySize_(0),
textPickerListener_(nullptr),
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
dateSelected_(nullptr),
dateStart_(nullptr),
dateEnd_(nullptr),
@@ -105,7 +105,7 @@ PickerViewComponent::PickerViewComponent(jerry_value_t options, jerry_value_t ch
{
SetComponentName(K_PICKER_VIEW);
fontSize_ = ProductAdapter::GetDefaultFontSize();
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
RegisterNamedFunction(FUNC_ROTATION_NAME, HandleRotationRequest);
#endif // FEATURE_ROTATION_API
}
@@ -123,7 +123,7 @@ bool PickerViewComponent::CreateNativeViews()
result = CreateTimePicker();
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case PickerType::DATE: {
result = CreateDatePicker();
break;
@@ -190,7 +190,7 @@ bool PickerViewComponent::CreateTimePicker()
return true;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
bool PickerViewComponent::CreateDatePicker()
{
UIDatePicker *uiDatePicker = new UIDatePicker();
@@ -248,7 +248,7 @@ void PickerViewComponent::ReleaseNativeViews()
ACE_FREE(fontFamily_);
ACE_FREE(selectedFontFamily_);
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
// free date picker resources
if (datePickerListener_ != nullptr) {
delete datePickerListener_;
@@ -285,7 +285,7 @@ void PickerViewComponent::PostUpdate(uint16_t attrKeyId)
switch (attrKeyId) {
case K_SELECTED:
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case K_START:
case K_END:
#endif // FEATURE_COMPONENT_DATE_PICKER
@@ -334,7 +334,7 @@ void PickerViewComponent::UpdatePickerStyles() const
timePicker->SetTextColor(color_, selectedColor_);
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case PickerType::DATE: {
uint8_t fontId = font->GetFontId(fontFamily_, fontSize_);
uint8_t selectedFontId = font->GetFontId(selectedFontFamily_, selectedFontSize_);
@@ -367,7 +367,7 @@ void PickerViewComponent::UpdatePickerAttrs() const
}
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case PickerType::DATE: {
UIDatePicker *datePicker = reinterpret_cast<UIDatePicker *>(pickerView_);
if (dateStart_ != nullptr) {
@@ -401,7 +401,7 @@ bool PickerViewComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t
}
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case K_START: {
if (pickerType_ == PickerType::DATE) {
ACE_FREE(dateStart_);
@@ -514,7 +514,7 @@ PickerViewComponent::PickerType PickerViewComponent::GetPickerType() const
case K_TIME:
type = PickerType::TIME;
break;
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case K_DATE:
type = PickerType::DATE;
break;
@@ -540,7 +540,7 @@ bool PickerViewComponent::SetPickerSelected(jerry_value_t selectedValue)
timeSelected_ = MallocStringOf(selectedValue);
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case PickerType::DATE: {
ACE_FREE(dateSelected_);
dateSelected_ = MallocStringOf(selectedValue);
@@ -572,7 +572,7 @@ void PickerViewComponent::SetPickerListener(jerry_value_t funcValue) const
}
break;
}
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
case PickerType::DATE: {
if (datePickerListener_ != nullptr) {
UIDatePicker *datePicker = reinterpret_cast<UIDatePicker *>(pickerView_);
@@ -19,7 +19,7 @@
#include "acelite_config.h"
#include "component.h"
#include "non_copyable.h"
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
#include "ui_date_picker.h"
#endif // FEATURE_COMPONENT_DATE_PICKER
#include "ui_time_picker.h"
@@ -30,7 +30,7 @@ static constexpr char TEXT_PICKER_NEW_VALUE[] = "newValue";
static constexpr char TEXT_PICKER_NEW_SELECTED[] = "newSelected";
static constexpr char TIME_PICKER_HOUR[] = "hour";
static constexpr char TIME_PICKER_MINUTE[] = "minute";
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
static constexpr char DATE_PICKER_YEAR[] = "year";
static constexpr char DATE_PICKER_MONTH[] = "month";
static constexpr char DATE_PICKER_DAY[] = "day";
@@ -92,7 +92,7 @@ private:
jerry_value_t timeCallback_;
};
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
/**
* @brief listener class for date picker onchange event.
*/
@@ -147,7 +147,7 @@ protected:
UNKNOWN,
TEXT,
TIME,
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
DATE,
#endif // FEATURE_COMPONENT_DATE_PICKER
TYPE_MAX
@@ -158,7 +158,7 @@ private:
PickerType GetPickerType() const;
bool CreateTextPicker();
bool CreateTimePicker();
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
bool CreateDatePicker();
#endif // FEATURE_COMPONENT_DATE_PICKER
bool SetPickerSelected(jerry_value_t selectedValue);
@@ -184,7 +184,7 @@ private:
uint16_t textArraySize_;
TextPickerListener* textPickerListener_;
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
// date picker-view attributes
char* dateSelected_;
char* dateStart_;
@@ -14,7 +14,7 @@
*/
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
#include "qrcode_component.h"
#include "ace_log.h"
#include "ace_mem_base.h"
@@ -16,7 +16,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_QRCODE
#if (FEATURE_COMPONENT_QRCODE == 1)
#include "component.h"
#include "key_parser.h"
#include "non_copyable.h"
@@ -30,7 +30,7 @@ SliderComponent::SliderComponent(jerry_value_t options, jerry_value_t children,
direction_(UISlider::Direction::DIR_LEFT_TO_RIGHT)
{
SetComponentName(K_SLIDER);
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
RegisterNamedFunction(FUNC_ROTATION_NAME, HandleRotationRequest);
#endif // FEATURE_ROTATION_API
}
@@ -29,7 +29,7 @@ SwiperComponent::SwiperComponent(jerry_value_t options, jerry_value_t children,
{
SetComponentName(K_SWIPER);
swiperView_.SetLoopState(true);
#ifdef FEATURE_ROTATION_API
#if (FEATURE_ROTATION_API == 1)
RegisterNamedFunction(FUNC_ROTATION_NAME, HandleRotationRequest);
#endif // FEATURE_ROTATION_API
}
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "js_fwk_common.h"
#include "key_parser.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "component.h"
#include "non_copyable.h"
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "js_fwk_common.h"
#include "keys.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "component.h"
#include "non_copyable.h"
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "ace_log.h"
#include "keys.h"
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_TABS
#if (FEATURE_COMPONENT_TABS == 1)
#include "component.h"
#include "non_copyable.h"
@@ -310,4 +310,4 @@ unittest("js_frameworks_test_canvas") {
"canvas_tdd_test.cpp",
]
deps = ace_test_deps
}
}
@@ -20,7 +20,7 @@
#include "root_view.h"
#include "stylemgr/app_style_item.h"
#include "stylemgr/app_style_manager.h"
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
#include "ui_date_picker.h"
#endif
#include "ui_picker.h"
@@ -137,7 +137,7 @@ void PickerViewTddTest::ComponentPickerviewAttributeSetTest001()
EXPECT_TRUE(pickerComponent != nullptr);
UIPicker* textPicker = reinterpret_cast<UIPicker *>(pickerComponent->GetComponentRootView());
UITimePicker* timePicker = reinterpret_cast<UITimePicker *>(pickerComponent->GetComponentRootView());
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
UIDatePicker* datePicker = reinterpret_cast<UIDatePicker *>(pickerComponent->GetComponentRootView());
#endif
@@ -145,7 +145,7 @@ void PickerViewTddTest::ComponentPickerviewAttributeSetTest001()
* @tc.expected: step1. native picker object is nullptr
*/
if (!textPicker && !timePicker
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
&& !datePicker
#endif
) {
@@ -154,7 +154,7 @@ void PickerViewTddTest::ComponentPickerviewAttributeSetTest001()
printf("ComponentPickerviewAttributeSetTest001 fail\n");
}
EXPECT_TRUE((textPicker == nullptr) && (timePicker == nullptr)
#ifdef FEATURE_COMPONENT_DATE_PICKER
#if (FEATURE_COMPONENT_DATE_PICKER == 1)
&& (datePicker != nullptr)
#endif
);
@@ -13,13 +13,13 @@
* limitations under the License.
*/
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include "video_component.h"
#include "ace_log.h"
#include "key_parser.h"
#include "keys.h"
#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
#if (FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC == 1)
#include <sys/prctl.h>
#include "ace_ability.h"
#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
@@ -32,7 +32,7 @@ const char * const VideoComponent::FUNC_SET_CURRENT_TIME = "setCurrentTime";
const char * const VideoComponent::FUNC_SET_Volume = "setVolume";
List<Component *> VideoComponent::componentNodes_;
#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
#if (FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC == 1)
pthread_mutex_t VideoComponent::updateLock_ = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t VideoComponent::updateCondition_ = PTHREAD_COND_INITIALIZER;
#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYN
@@ -457,7 +457,7 @@ void VideoComponent::SetComponentReleasingFlag(bool releasing)
isReleasing_ = releasing;
}
#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
#if (FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC == 1)
bool VideoComponent::PrepareProgressUpdatingThread()
{
int ret = pthread_mutex_init(&updateLock_, nullptr);
@@ -16,8 +16,8 @@
#define OHOS_ACELITE_VIDEO_COMPONENT_H
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
#if (FEATURE_COMPONENT_VIDEO == 1)
#if (FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC == 1)
#include <pthread.h>
#include <unistd.h>
#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
@@ -384,7 +384,7 @@ private:
bool isPlaying_;
bool isReleasing_;
bool isUpdatingHandlerQuited_;
#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
#if (FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC == 1)
static pthread_mutex_t updateLock_;
static pthread_cond_t updateCondition_;
#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC
@@ -16,7 +16,7 @@
#define OHOS_ACELITE_VIDEO_STATE_CALLBACK_H
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include <cstdint>
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "acelite_config.h"
#ifdef FEATURE_COMPONENT_VIDEO
#if (FEATURE_COMPONENT_VIDEO == 1)
#include "video_view.h"
#include "video_state_callback.h"
+1 -1
View File
@@ -22,7 +22,7 @@
#include "ability_loader.h"
#include "js_ability.h"
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
#error AceAbility only be used for L1 upper
#endif
@@ -16,7 +16,7 @@
#include "ace_event_error_code.h"
#include "product_adapter.h"
#ifdef FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT
#if (FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT == 1)
namespace OHOS {
namespace ACELite {
EventErrorCodePrint *EventErrorCodePrint::GetInstance()
@@ -18,7 +18,7 @@
#include "acelite_config.h"
#if defined(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT)
#if (FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT == 1)
#include "ace_event_id.h"
#include "memory_heap.h"
#include "non_copyable.h"
@@ -35,7 +35,7 @@
#define ACE_ERROR_CODE_PRINT(info2, rfu)
#endif // ENABLED(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT)
#if defined(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT)
#if (FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT == 1)
namespace OHOS {
namespace ACELite {
class EventErrorCodePrint final : public MemoryHeap {
@@ -17,7 +17,7 @@
#include "ace_event_error_code.h"
#include "ace_log.h"
#include "async_task_manager.h"
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
#include "cmsis_os2.h"
#endif // OHOS_ACELITE_PRODUCT_WATCH
#include "jerryscript-port-default.h"
@@ -52,7 +52,7 @@ bool FatalHandler::IsAppExitingWrapper()
static void HandleFatal(int errorCode)
{
#ifdef FEATURE_FATAL_ERROR_HANDLING
#if (FEATURE_FATAL_ERROR_HANDLING == 1)
HILOG_ERROR(HILOG_MODULE_ACE, "hitted by fatal error[%{public}d]", errorCode);
if (FatalHandler::GetInstance().IsFatalErrorHitted()) {
// fatal hitted again during one fatal handing, return to avoid dead loop
@@ -69,7 +69,7 @@ static void HandleFatal(int errorCode)
const uint32_t sleepTime = 3000;
uint8_t maxRetryCount = 20;
while (maxRetryCount > 0) {
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
osDelay(sleepTime);
#endif // OHOS_ACELITE_PRODUCT_WATCH
maxRetryCount--;
@@ -177,7 +177,7 @@ void FatalHandler::ResetRendering()
TaskManager::GetInstance()->ResetTaskHandlerMutex();
SetTEHandlingFlag(false);
}
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
ProductAdapter::NotifyRenderEnd();
#endif
}
+9 -9
View File
@@ -20,7 +20,7 @@
#include "ace_log.h"
#include "acelite_config.h"
#include "async_task_manager.h"
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
#include "dft_impl.h"
#endif // OHOS_ACELITE_PRODUCT_WATCH
#include "fatal_handler.h"
@@ -49,21 +49,21 @@ static JSAbilityImpl *CastAbilityImpl(void *abilityImpl)
static void DumpNativeMemoryUsage()
{
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
NativeMemInfo memInfo;
ProductAdapter::GetNativeMemInfo(&memInfo);
HILOG_DEBUG(HILOG_MODULE_ACE, "available free size: %{public}d", memInfo.freeSize);
#endif // OHOS_ACELITE_PRODUCT_WATCH
}
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
extern "C" void RestoreSystemWrapper(const char *crashMessage);
#endif
JSAbility::~JSAbility()
{
// check the status
if (jsAbilityImpl_ != nullptr) {
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
// the JSAbility instance can only be destroied after transfering the app to DESTROY state
RestoreSystemWrapper("AMS is deleting app task but without normal lifecycle transition!");
#endif
@@ -93,7 +93,7 @@ void JSAbility::Launch(const char * const abilityPath, const char * const bundle
HILOG_INFO(HILOG_MODULE_ACE, "LIFECYCLE: JS Ability is launching");
#ifndef MOCK_JS_ASYNC_WORK
#if (MOCK_JS_ASYNC_WORK != 1)
JsAsyncWork::SetFatalHandleFunc(FatalHandler::IsErrorHittedWrapper, FatalHandler::IsAppExitingWrapper);
#endif
#if (defined(__LINUX__) || defined(__LITEOS_A__))
@@ -110,7 +110,7 @@ void JSAbility::Launch(const char * const abilityPath, const char * const bundle
// mark the flag in advance to make sure we can take over render tick as soon as possible
ProductAdapter::UpdateRenderTickAcceptable(true);
JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_);
#ifndef MOCK_JS_ASYNC_WORK
#if (MOCK_JS_ASYNC_WORK != 1)
// simulator uses the self-implementation for async work, this interface is not included
JsAsyncWork::SetEnvStatus(true);
#endif
@@ -160,7 +160,7 @@ void JSAbility::TransferToDestroy()
return;
}
#ifndef MOCK_JS_ASYNC_WORK
#if (MOCK_JS_ASYNC_WORK != 1)
// simulator uses the self-implementation for async work, this interface is not included
JsAsyncWork::SetEnvStatus(false);
#endif
@@ -173,12 +173,12 @@ void JSAbility::TransferToDestroy()
ProductAdapter::UpdateRenderTickAcceptable(false);
FatalHandler::GetInstance().ResetRendering();
FatalHandler::GetInstance().SetExitingFlag(false);
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
if (ProductAdapter::SetScreenOnVisible(false) == false) {
HILOG_ERROR(HILOG_MODULE_ACE, "Fail to recover screen visible property");
}
#endif
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
JsAsyncWork::SetAppQueueHandler(nullptr);
DftImpl::GetInstance()->RegisterPageReplaced(nullptr);
#endif // OHOS_ACELITE_PRODUCT_WATCH
@@ -16,10 +16,10 @@
#include "js_app_context.h"
#include "ace_event_error_code.h"
#include "ace_log.h"
#if (defined(__LINUX__) || defined(__LITEOS__))
#if (defined(__LINUX__) || defined(__LITEOS_A__))
#include "ace_ability.h"
#endif
#ifdef FEATURE_API_VERSION
#if (FEATURE_API_VERSION == 1)
#include "bundle_manager.h"
#endif // FEATURE_API_VERSION
#include "component_factory.h"
@@ -33,7 +33,7 @@
#include "string_util.h"
#include "task_manager.h"
#include "ui_view_group.h"
#ifndef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH != 1)
#include "ability_env.h"
#endif
@@ -314,7 +314,7 @@ char *JsAppContext::GetResourcePath(const char *uri) const
HILOG_ERROR(HILOG_MODULE_ACE, "fail to get resource path.");
return nullptr;
}
#ifdef OHOS_ACELITE_PRODUCT_WATCH
#if (OHOS_ACELITE_PRODUCT_WATCH == 1)
// no GetDataPath API provided on watch, contact the path by the product configuration insteadly
char *relocatedPath = ProcessResourcePathByConfiguration(size, path);
#else
@@ -362,7 +362,7 @@ char *JsAppContext::ProcessResourcePathByConfiguration(size_t origUriLength, con
void JsAppContext::LoadApiVersion()
{
#ifdef FEATURE_API_VERSION
#if (FEATURE_API_VERSION == 1)
BundleInfo bundle = {0};
uint8_t retCode = GetBundleInfo(currentBundleName_, false, &bundle);
if (retCode != 0) {
@@ -35,7 +35,8 @@
#include "presets/version_module.h"
#include "product_adapter.h"
#include "system_info.h"
#ifdef JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED
#if (JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED == 1)
extern "C" {
#include "generate-bytecode.h"
}
@@ -64,17 +65,17 @@ void JsAppEnvironment::LoadAceBuiltInModules() const
void JsAppEnvironment::InitJsFramework() const
{
START_TRACING(ENGINE_INIT);
#ifdef JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED
#if (JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED == 1)
js_task_context_init();
#endif
#ifndef JERRY_PORTING_DEPENDENCY
#if (JERRY_PORTING_DEPENDENCY == 0)
Srand((unsigned)jerry_port_get_current_time());
#endif
Debugger::GetInstance().SetupJSContext();
jerry_init(JERRY_INIT_EMPTY);
STOP_TRACING();
START_TRACING(FWK_INIT);
#ifdef JSFWK_TEST
#if (JSFWK_TEST == 1)
jerry_value_t globalThis = jerry_get_global_object();
jerry_release_value(jerryx_set_property_str(globalThis, "globalThis", globalThis));
jerry_release_value(globalThis);
@@ -126,7 +127,7 @@ void JsAppEnvironment::Cleanup()
jerry_cleanup();
// free the external JS context, only can be called after clean up engine
Debugger::GetInstance().ReleaseJSContext();
#ifdef JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED
#if (JS_ENGINE_STATIC_MULTI_CONTEXTS_ENABLED == 1)
jerry_port_default_remove_current_context_record();
#endif
}
+15 -15
View File
@@ -21,11 +21,11 @@
#include "js_async_work.h"
#include "js_fwk_common.h"
#include "key_parser.h"
#if defined(FEATURE_ACELITE_MC_JS_PROFILER)
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
#include <fcntl.h>
#include "los_tick.h"
#include "unistd.h"
#elif defined(FEATURE_ACELITE_JS_PROFILER)
#elif (FEATURE_ACELITE_JS_PROFILER == 1)
#include <sys/time.h>
#else
#include <time.h>
@@ -40,7 +40,7 @@ namespace ACELite {
*/
static bool g_isFirst = true;
#if defined(FEATURE_ACELITE_MC_JS_PROFILER)
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
static uint16_t g_profiler_msg_index = 0;
#else
static constexpr uint8_t PHASE_NAME_LENGTH = 50;
@@ -60,7 +60,7 @@ struct ProfilerPhase {
* NOTE: Keep this array sync with PerformanceTag definations
*/
static const ProfilerPhase g_profilerPhaseConfig[] = {
#if defined(FEATURE_ACELITE_MC_JS_PROFILER)
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
// id, parent
{P_UNKNOWN, P_UNKNOWN},
{LAUNCH, P_UNKNOWN},
@@ -157,7 +157,7 @@ static const ProfilerPhase g_profilerPhaseConfig[] = {
#endif
};
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
JSProfiler::JSProfiler() : data_(nullptr), dataCount_(0), traceIdSlot_(0), enabled_(false), msg_(nullptr) {}
#else
JSProfiler::JSProfiler() : data_(nullptr), dataCount_(0), traceIdSlot_(0), enabled_(false) {}
@@ -176,7 +176,7 @@ JSProfiler *JSProfiler::GetInstance()
bool JSProfiler::IsEnabled()
{
bool isEnabled = enabled_ && (data_ != nullptr);
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
isEnabled = isEnabled && (msg_ != nullptr);
#endif
return isEnabled;
@@ -193,7 +193,7 @@ void JSProfiler::PrepareDataBuffer()
HILOG_ERROR(HILOG_MODULE_ACE, "malloc performance data buffer failed");
return;
}
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
msg_ = static_cast<ProfilerMsg *>(ace_malloc(PROFILER_MSG_LENGTH * sizeof(ProfilerMsg)));
if (msg_ == nullptr) {
HILOG_ERROR(HILOG_MODULE_ACE, "malloc performance data buffer failed");
@@ -205,7 +205,7 @@ void JSProfiler::PrepareDataBuffer()
ResetData();
}
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
void JSProfiler::FlushProfilerMsg(void *data)
{
if (data == nullptr) {
@@ -255,7 +255,7 @@ void JSProfiler::FlushProfilerMsg(void *data)
void JSProfiler::Release()
{
ACE_FREE(data_);
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
ACE_FREE(msg_);
#endif
}
@@ -270,7 +270,7 @@ void JSProfiler::ResetData()
}
}
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
if (msg_) {
if (memset_s(msg_, (PROFILER_MSG_LENGTH * sizeof(ProfilerMsg)), 0,
(PROFILER_MSG_LENGTH * sizeof(ProfilerMsg))) != 0) {
@@ -351,7 +351,7 @@ void JSProfiler::Output()
// for too many round details, we just print out bigger than 0 items to save the log IO band width
continue;
}
#if defined(FEATURE_ACELITE_MC_JS_PROFILER)
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
if (g_profiler_msg_index == 0) {
if ((data.label != LAUNCH) && (data.label != ROUTER_REPLACE)) {
continue;
@@ -381,7 +381,7 @@ void JSProfiler::Output()
g_profilerPhaseConfig[g_profilerPhaseConfig[data.label].parentPhase].phaseName);
#endif
}
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
JsAsyncWork::DispatchAsyncWork(FlushProfilerMsg, this);
#else
// reset all records after output to trace
@@ -391,10 +391,10 @@ void JSProfiler::Output()
uint64_t JSProfiler::GetCurrentClockTick() const
{
#if defined(FEATURE_ACELITE_MC_JS_PROFILER)
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
// real device
return LOS_TickCountGet(); // count in clock ticks, usually is ms
#elif defined(FEATURE_ACELITE_JS_PROFILER)
#elif (FEATURE_ACELITE_JS_PROFILER == 1)
const uint32_t unit = 1000;
// ipcamera
struct timeval timeVal;
@@ -414,7 +414,7 @@ uint64_t JSProfiler::CalculateElapsedTime(uint64_t start, uint64_t end) const
}
uint64_t interval = end - start;
#if defined(FEATURE_ACELITE_MC_JS_PROFILER) || defined(FEATURE_ACELITE_JS_PROFILER)
#if ((FEATURE_ACELITE_MC_JS_PROFILER == 1) || (FEATURE_ACELITE_JS_PROFILER == 1))
// real device
return interval;
#else
+3 -3
View File
@@ -120,7 +120,7 @@ struct PerformanceData {
uint8_t component;
};
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
static constexpr uint8_t MSG_LENGTH = 20;
struct ProfilerMsg {
@@ -157,7 +157,7 @@ public:
*/
void Release();
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
/**
* @brief Flush output to file.
*/
@@ -236,7 +236,7 @@ private:
uint16_t dataCount_ = 0;
uint16_t traceIdSlot_ = 0;
bool enabled_ = false;
#ifdef FEATURE_ACELITE_MC_JS_PROFILER
#if (FEATURE_ACELITE_MC_JS_PROFILER == 1)
static constexpr uint8_t PROFILER_MSG_LENGTH = 128;
static constexpr uint8_t TEXT_LENGTH = 30;
ProfilerMsg *msg_ = nullptr;
@@ -15,7 +15,7 @@
#include "acelite_config.h"
#ifdef FEATURE_TIMER_MODULE
#if (FEATURE_TIMER_MODULE == 1)
#include "js_timer_list.h"
#include "presets/timer_module.h"
#include "ace_mem_base.h"
+1 -1
View File
@@ -19,7 +19,7 @@
#include "acelite_config.h"
#ifdef FEATURE_TIMER_MODULE
#if (FEATURE_TIMER_MODULE == 1)
#include <jerryscript.h>
#include <cstdint>
#include "memory_heap.h"
+1 -1
View File
@@ -14,7 +14,7 @@
*/
#include "acelite_config.h"
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
#include "ace_log.h"
#include "js_async_work.h"
#include "js_dialog.h"
+1 -1
View File
@@ -17,7 +17,7 @@
#define OHOS_ACELITE_JS_DIALOG_H
#include "acelite_config.h"
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
#include "jsi.h"
#include "js_fwk_common.h"
#include "non_copyable.h"
+3 -3
View File
@@ -16,7 +16,7 @@
#include "app_module.h"
#include "ace_log.h"
#include "js_app_context.h"
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
#include "js_async_work.h"
#include "product_adapter.h"
#endif
@@ -28,7 +28,7 @@ const char * const AppModule::KEY_APP_NAME = "appName";
const char * const AppModule::KEY_VERSION_NAME = "versionName";
const char * const AppModule::KEY_VERSION_CODE = "versionCode";
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
const char * const AppModule::SCREEN_ON_VISIBLE_KEY = "visible";
const char * const AppModule::SCREEN_ON_VISIBLE_DATA = "data";
const char * const AppModule::SCREEN_ON_VISIBLE_CODE = "code";
@@ -128,7 +128,7 @@ JSIValue AppModule::Terminate(const JSIValue thisVal, const JSIValue *args, uint
return JSI::CreateUndefined();
}
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
JSIValue AppModule::ScreenOnVisible(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum)
{
JSIValue undefValue = JSI::CreateUndefined();
+3 -3
View File
@@ -30,7 +30,7 @@ public:
~AppModule() = default;
static JSIValue GetInfo(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);
static JSIValue Terminate(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
static JSIValue ScreenOnVisible(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);
#endif
@@ -42,7 +42,7 @@ private:
static cJSON* ReadManifest();
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
static const char * const SCREEN_ON_VISIBLE_KEY;
static const char * const SCREEN_ON_VISIBLE_DATA;
static const char * const SCREEN_ON_VISIBLE_CODE;
@@ -61,7 +61,7 @@ void InitAppModule(JSIValue exports)
{
JSI::SetModuleAPI(exports, "getInfo", AppModule::GetInfo);
JSI::SetModuleAPI(exports, "terminate", AppModule::Terminate);
#ifdef FEATURE_SCREEN_ON_VISIBLE
#if (FEATURE_SCREEN_ON_VISIBLE == 1)
JSI::SetModuleAPI(exports, "screenOnVisible", AppModule::ScreenOnVisible);
#endif
}
+5 -5
View File
@@ -18,7 +18,7 @@
#include "ui_dump_dom_tree.h"
#ifdef FEATURE_ACELITE_MC_DFX_MODULE
#include "ui_snapshot.h"
#elif defined(FEATURE_ACELITE_LITE_DFX_MODULE)
#elif (FEATURE_ACELITE_LITE_DFX_MODULE == 1)
#ifdef __LITEOS_A__
#include "ability_env.h"
#endif
@@ -77,7 +77,7 @@ bool DfxModule::IsEventInjectorRegistered(EventDataType type)
return true;
}
#ifdef FEATURE_ACELITE_DFX_MODULE
#if (FEATURE_ACELITE_DFX_MODULE == 1)
JSIValue DfxModule::Screenshot(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum)
{
#ifdef FEATURE_ACELITE_MC_DFX_MODULE
@@ -88,7 +88,7 @@ JSIValue DfxModule::Screenshot(const JSIValue thisVal, const JSIValue *args, uin
retVal = JSI::CreateBoolean(false);
}
return retVal;
#elif defined(FEATURE_ACELITE_LITE_DFX_MODULE)
#elif (FEATURE_ACELITE_LITE_DFX_MODULE == 1)
JSIValue retVal = JSI::CreateBoolean(true);
#ifdef __LITEOS_A__
const char * const savingPath = GetDataPath();
@@ -120,7 +120,7 @@ JSIValue DfxModule::DumpDomTree(const JSIValue thisVal, const JSIValue *args, ui
}
char *viewId = GetDomViewId(args);
#ifdef FEATURE_ACELITE_LITE_DFX_MODULE
#if (FEATURE_ACELITE_LITE_DFX_MODULE == 1)
#ifdef __LITEOS_A__
const char * const savingPath = GetDataPath();
#else
@@ -136,7 +136,7 @@ JSIValue DfxModule::DumpDomTree(const JSIValue thisVal, const JSIValue *args, ui
retVal = JSI::CreateBoolean(true);
}
#ifdef FEATURE_ACELITE_LITE_DFX_MODULE
#if (FEATURE_ACELITE_LITE_DFX_MODULE == 1)
if (path != nullptr) {
ace_free(path);
}
+2 -2
View File
@@ -26,7 +26,7 @@ namespace ACELite {
class DfxModule final : public MemoryHeap {
public:
ACE_DISALLOW_COPY_AND_MOVE(DfxModule);
#ifdef FEATURE_ACELITE_DFX_MODULE
#if (FEATURE_ACELITE_DFX_MODULE == 1)
static JSIValue Screenshot(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);
#endif
static JSIValue InjectEvent(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum);
@@ -49,7 +49,7 @@ private:
void InitDfxModule(JSIValue exports)
{
#ifdef FEATURE_ACELITE_DFX_MODULE
#if (FEATURE_ACELITE_DFX_MODULE == 1)
JSI::SetModuleAPI(exports, "screenshotToFile", DfxModule::Screenshot);
#endif // FEATURE_ACELITE_DFX_MODULE
JSI::SetModuleAPI(exports, "injectEvent", DfxModule::InjectEvent);
@@ -14,7 +14,7 @@
*/
#include "acelite_config.h"
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
#include "dialog_module.h"
#include "ace_log.h"
#include "js_profiler.h"
+1 -1
View File
@@ -17,7 +17,7 @@
#define OHOS_ACELITE_DIALOG_MODULE_H
#include "acelite_config.h"
#ifdef FEATURE_MODULE_DIALOG
#if (FEATURE_MODULE_DIALOG == 1)
#include "jsi.h"
#include "js_fwk_common.h"
#include "non_copyable.h"
@@ -14,7 +14,7 @@
*/
#include "cjson_parser.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include "ace_log.h"
#include "global.h"
#include "js_fwk_common.h"
@@ -16,7 +16,7 @@
#define OHOS_ACELITE_CJSON_PARSER_H
#include "acelite_config.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include <cJSON.h>
#include <jerryscript.h>
#ifdef __LITEOS_A__
@@ -16,7 +16,7 @@
#include "console_log_impl.h"
#if ENABLED(CONSOLE_LOG_OUTPUT)
#include "js_app_environment.h"
#ifdef FEATURE_USER_MC_LOG_PRINTF
#if (FEATURE_USER_MC_LOG_PRINTF == 1)
#include "product_adapter.h"
#endif // FEATURE_USER_MC_LOG_PRINTF
#ifdef FEATURE_ACELITE_HI_LOG_PRINTF
@@ -143,7 +143,7 @@ void LogString(const LogLevel logLevel, const char * const str)
if (str == nullptr) {
return;
}
#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) || defined(FEATURE_USER_MC_LOG_PRINTF)
#if ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) || (FEATURE_USER_MC_LOG_PRINTF == 1))
size_t strLength = strlen(str);
for (size_t i = 0; i < strLength; i++) {
LogChar(str[i], logLevel, false);
@@ -169,7 +169,7 @@ void LogChar(char c, const LogLevel logLevel, bool endFlag)
if (c == '\n' || !endFlag) {
// this is the newline during the console log, need to append the loglevel prefix,
// example: console.log("aa\nbb");
#if !defined(FEATURE_ACELITE_HI_LOG_PRINTF) && !defined(FEATURE_USER_MC_LOG_PRINTF)
#if ((FEATURE_ACELITE_HI_LOG_PRINTF != 1) && (FEATURE_USER_MC_LOG_PRINTF != 1))
Output(logLevel, "\n", 1); // hilog will trace our the line separator directly
#endif
if (!endFlag) {
@@ -205,7 +205,7 @@ static void OutputToHiLog(const LogLevel logLevel, const char * const str)
break;
}
}
#elif defined(FEATURE_USER_MC_LOG_PRINTF)
#elif (FEATURE_USER_MC_LOG_PRINTF == 1)
static void OutputToHiLog(const LogLevel logLevel, const char * const str)
{
switch (logLevel) {
@@ -247,7 +247,7 @@ void Output(const LogLevel logLevel, const char * const str, const uint8_t lengt
}
(void)length;
Debugger::GetInstance().Output(str);
#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) || defined(FEATURE_USER_MC_LOG_PRINTF)
#if ((FEATURE_ACELITE_HI_LOG_PRINTF == 1) || (FEATURE_USER_MC_LOG_PRINTF == 1))
OutputToHiLog(logLevel, str);
#endif
#ifdef TDD_ASSERTIONS
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "date_time_format_module.h"
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
#include <cstring>
#include "ace_log.h"
#include "locale_util.h"
@@ -17,7 +17,7 @@
#define OHOS_ACELITE_DATE_TIME_FORMAT_MODULE_H
#include "acelite_config.h"
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
#include "js_fwk_common.h"
#include "date_time_format.h"
namespace OHOS {
@@ -14,7 +14,7 @@
*/
#include "feature_ability_module.h"
#ifdef FEATURE_FEATURE_ABILITY_MODULE
#if (FEATURE_FEATURE_ABILITY_MODULE == 1)
#include "ace_event_error_code.h"
#include "ace_log.h"
#include "fatal_handler.h"
@@ -19,7 +19,7 @@
#include "acelite_config.h"
#include "non_copyable.h"
#ifdef FEATURE_FEATURE_ABILITY_MODULE
#if (FEATURE_FEATURE_ABILITY_MODULE == 1)
#include "ability_kit.h"
#include "presets/preset_module.h"
namespace OHOS {
@@ -201,14 +201,14 @@ public:
~FeaAbilityModule() = default;
static void Load()
{
#ifdef FEATURE_FEATURE_ABILITY_MODULE
#if (FEATURE_FEATURE_ABILITY_MODULE == 1)
FeatureAbilityModule featureAbilityModule;
featureAbilityModule.Init();
#endif
}
static void Release()
{
#ifdef FEATURE_FEATURE_ABILITY_MODULE
#if (FEATURE_FEATURE_ABILITY_MODULE == 1)
FeatureAbilityModule::Release();
#endif
}
@@ -14,7 +14,7 @@
*/
#include "intl_module.h"
#ifdef FEATURE_INTL_MODULE
#if (FEATURE_INTL_MODULE == 1)
#include "ace_log.h"
#include "date_time_format_module.h"
#include "global.h"
@@ -27,10 +27,10 @@ void IntlModule::Init()
{
jerry_value_t globalObj = jerry_get_global_object();
jerry_value_t baseObj = jerry_create_object();
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
NumberFormatModule::Init(baseObj);
#endif
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
DateTimeFormatModule::Init(baseObj);
#endif
JerrySetNamedProperty(globalObj, "Intl", baseObj);
@@ -16,7 +16,7 @@
#ifndef OHOS_ACELITE_INTL_MODULE_H
#define OHOS_ACELITE_INTL_MODULE_H
#include "acelite_config.h"
#ifdef FEATURE_INTL_MODULE
#if (FEATURE_INTL_MODULE == 1)
#include "js_fwk_common.h"
#include "non_copyable.h"
#include "locale_info.h"
@@ -55,7 +55,7 @@ public:
static void Load()
{
#ifdef FEATURE_INTL_MODULE
#if (FEATURE_INTL_MODULE == 1)
IntlModule *intlModule = IntlModule::GetInstance();
intlModule->Init();
#endif
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "jstest_module.h"
#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH))
#if ((JSFWK_TEST == 1) && (OHOS_ACELITE_PRODUCT_WATCH == 1))
#include <stdlib.h>
#include "ace_mem_base.h"
#include "test_fwk.h"
@@ -17,7 +17,7 @@
#include "acelite_config.h"
#include "non_copyable.h"
#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH))
#if ((JSFWK_TEST == 1) && (OHOS_ACELITE_PRODUCT_WATCH == 1))
#include "presets/preset_module.h"
namespace OHOS {
namespace ACELite {
@@ -57,7 +57,7 @@ public:
~JsTestModule() = default;
static void Load()
{
#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH))
#if ((JSFWK_TEST == 1) && (OHOS_ACELITE_PRODUCT_WATCH == 1))
JSTestModule jsTestModule;
jsTestModule.Init();
#endif
@@ -15,7 +15,7 @@
#include "localization_module.h"
#include "ace_event_error_code.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include "ace_log.h"
#include "js_fwk_common.h"
#include <stdlib.h>
@@ -17,7 +17,7 @@
#include "acelite_config.h"
#include "non_copyable.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include "cjson_parser.h"
#include "presets/preset_module.h"
namespace OHOS {
@@ -85,14 +85,14 @@ public:
~LocalModule() = default;
static void Load()
{
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
LocalizationModule *localizationModule = LocalizationModule::GetInstance();
localizationModule->Init();
#endif
}
static void Clear()
{
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
LocalizationModule *localization = LocalizationModule::GetInstance();
localization->Clear();
#endif
@@ -15,7 +15,7 @@
#include "number_format_module.h"
#include "ace_log.h"
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
#include "locale_util.h"
#include "string.h"
#include "key_parser.h"
@@ -17,7 +17,7 @@
#define OHOS_ACELITE_NUMBER_FORMAT_MODEL_H
#include "acelite_config.h"
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
#include "gfx_utils/list.h"
#include "js_fwk_common.h"
#include "number_format.h"
@@ -56,8 +56,8 @@ unittest("js_frameworks_test_localization") {
output_dir = test_output_root
configs = [ "$ace_lite_root/test:test_common_config" ]
sources = [
"$ace_lite_root/test/moduletest/common/basic_tdd_test.cpp",
"common/localization_module_tdd_test.cpp"
]
"$ace_lite_root/test/moduletest/common/basic_tdd_test.cpp",
"common/localization_module_tdd_test.cpp",
]
deps = ace_test_deps
}
}
@@ -14,7 +14,7 @@
*/
#include "date_time_module_tdd_test.h"
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
#include "global.h"
#include "js_app_context.h"
#include "js_app_environment.h"
@@ -22,7 +22,7 @@
#endif
#include "acelite_config.h"
#ifdef FEATURE_DATE_FORMAT
#if (FEATURE_DATE_FORMAT == 1)
#include "test_common.h"
#include "js_fwk_common.h"
namespace OHOS {
@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "localization_module_tdd_test.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include "ace_log.h"
#include "global.h"
#include "js_app_context.h"
@@ -23,7 +23,7 @@ namespace OHOS {
namespace ACELite {
void LocalizationModuleTddTest::SetUp()
{
#ifdef TARGET_SIMULATOR
#if (TARGET_SIMULATOR == 1)
constexpr char testAppPath[] = "..\\moduletest\\unittest";
#elif defined(__linux__)
constexpr char testAppPath[] = "/storage/data";
@@ -15,7 +15,7 @@
#ifndef LOCALIZATION_MODULE_TEST_H
#define LOCALIZATION_MODULE_TEST_H
#include "acelite_config.h"
#ifdef FEATURE_LOCALIZATION_MODULE
#if (FEATURE_LOCALIZATION_MODULE == 1)
#include "basic_tdd_test.h"
#include "test_common.h"
#include "js_fwk_common.h"
@@ -14,7 +14,7 @@
*/
#include "number_format_module_tdd_test.h"
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
#include "global.h"
#include "js_app_context.h"
#include "js_app_environment.h"
@@ -22,7 +22,7 @@
#endif
#include "acelite_config.h"
#ifdef FEATURE_NUMBER_FORMAT
#if (FEATURE_NUMBER_FORMAT == 1)
#include "test_common.h"
#include "js_fwk_common.h"
namespace OHOS {
@@ -14,7 +14,7 @@
*/
#include "timer_module.h"
#ifdef FEATURE_TIMER_MODULE
#if (FEATURE_TIMER_MODULE == 1)
#include <cstdint>
#include <string.h>
#include "ace_log.h"

Some files were not shown because too many files have changed in this diff Show More