diff --git a/CMakeLists.txt b/CMakeLists.txt index 9014475b8f7c1924aec6b2a4e8662c5f09fc091e..9faf34fd7c3b00c10889950742eb46bc25d7713e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,13 +25,13 @@ add_compile_options(-fpermissive -Wno-narrowing) set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") set(ACE_LITE_INNERKITS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../interfaces/innerkits/builtin") set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") -set(JSFWK_INNERKITS_BUILTIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../foundation/ace/interfaces/innerkits/builtin") +set(JSFWK_INNERKITS_BUILTIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../foundation/ace/interfaces/innerkits/builtin") set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") -set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../foundation/graphic/lite") -set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") -set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/developer_tools_lite/graphic_tool/simulator") -set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") +set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../foundation/graphic/lite") +set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../third_party") +set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../tools/developer_tools_lite/graphic_tool/simulator") set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") +set(UTILS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../../utils/native/lite") # add definitions # temporarily set, when ui and graphic unifid, this can be removed @@ -84,7 +84,7 @@ include_directories( ${THIRTY_PATH}/jerryscript/jerry-port/default/include ${THIRTY_PATH}/freetype/include ${JSFWK_SIMULATOR_PATH}/config - ${JS_API_PATH}/timer + ${UTILS_PATH}/timer_task/include ${AAFWK_PATH}/frameworks/abilitymgr_lite/include) # source files diff --git a/src/core/context/js_ability_impl.h b/src/core/context/js_ability_impl.h index 6ae1677c35022fb6fadfad0b9d833f6013411dbc..5385476432452860cdfde616ccb4d8a78291d354 100755 --- a/src/core/context/js_ability_impl.h +++ b/src/core/context/js_ability_impl.h @@ -37,8 +37,8 @@ public: */ JSAbilityImpl() : appContext_(nullptr), - abilityModel_(UNDEFINED), - nativeElement_(UNDEFINED), + abilityModel_(0), + nativeElement_(0), rendered_(false), isEnvInit_(false), router_(nullptr) diff --git a/src/core/modules/ohos_module_config.h b/src/core/modules/ohos_module_config.h index eb394dea22a7843e958e78498c68ae0fedbc81ab..ea61b7fa34cd18ffe1b97b336b206477295f82ae 100755 --- a/src/core/modules/ohos_module_config.h +++ b/src/core/modules/ohos_module_config.h @@ -43,6 +43,27 @@ extern void InitNativeApiKv(JSIValue exports); extern void InitDeviceModule(JSIValue exports); #endif +#ifdef FEATURE_MODULE_GEO +extern void InitLocationModule(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_SENSOR +extern void InitVibratorModule(JSIValue exports); +extern void InitSensorModule(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_BRIGHTNESS +extern void InitBrightnessModule(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_BATTERY +extern void InitBatteryModule(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_CONFIGURATION +extern void InitLocaleModule(JSIValue exports); +#endif + // Config information for built-in JS modules of OHOS platform const Module OHOS_MODULES[] = { #ifdef ENABLE_MODULE_REQUIRE_TEST @@ -65,6 +86,22 @@ const Module OHOS_MODULES[] = { #ifdef FEATURE_MODULE_DEVICE {"device", InitDeviceModule}, #endif +#ifdef FEATURE_MODULE_GEO + {"geolocation", InitLocationModule}, +#endif +#ifdef FEATURE_MODULE_SENSOR + {"vibrator", InitVibratorModule}, + {"sensor", InitSensorModule}, +#endif +#ifdef FEATURE_MODULE_BRIGHTNESS + {"brightness", InitBrightnessModule}, +#endif +#ifdef FEATURE_MODULE_BATTERY + {"battery", InitBatteryModule}, +#endif +#ifdef FEATURE_MODULE_CONFIGURATION + {"configuration", InitLocaleModule}, +#endif }; } // namespace ACELite } // namespace OHOS diff --git a/targets/simulator/win/acelite_config.h b/targets/simulator/win/acelite_config.h index 1a1c7141057cf9cc04aaa351ba587cc413d7aa23..a178abd4f95da592a653911e0ab18163039d4926 100755 --- a/targets/simulator/win/acelite_config.h +++ b/targets/simulator/win/acelite_config.h @@ -57,6 +57,22 @@ * support sensor API for JS */ #define FEATURE_MODULE_SENSOR + +/** + * support brightness API for JS + */ +#define FEATURE_MODULE_BRIGHTNESS + +/** + * support battery API for JS + */ +#define FEATURE_MODULE_BATTERY + +/** + * support configuration API for JS + */ +#define FEATURE_MODULE_CONFIGURATION + /** * timer module */ @@ -72,11 +88,6 @@ */ #define FEATURE_LOCALIZATION_MODULE -/** - * support config for product JS modules - */ -#define FEATURE_PRODUCT_MODULE - /** * module require test */