add fscript_ext

This commit is contained in:
lixianjing 2021-01-03 12:00:55 +08:00
parent f68eaf21cc
commit 0c7843798f
3 changed files with 67 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "base/window_manager.h"
#include "base/widget_factory.h"
#include "base/assets_manager.h"
#include "fscript_ext/fscript_ext.h"
#ifdef WITH_DATA_READER_WRITER
#include "tkc/data_reader_factory.h"
@ -153,6 +154,7 @@ ret_t tk_init_internal(void) {
s_ui_thread_id = tk_thread_self();
fscript_global_init();
fscript_ext_init();
#ifdef WITH_DATA_READER_WRITER
data_writer_factory_set(data_writer_factory_create());
data_reader_factory_set(data_reader_factory_create());

View File

@ -0,0 +1,30 @@
/**
* File: fscript_ext.h
* Author: AWTK Develop Team
* Brief: ext functions for fscript
*
* Copyright (c) 2020 - 2021 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
*/
/**
* History:
* ================================================================
* 2021-01-03 Li XianJing <lixianjing@zlg.cn> created
*
*/
#include "fscript_ext/fscript_math.h"
#if defined(LINUX) || defined(WINDOWS) || defined(MACOS) || defined(ANDROID) || defined(IOS)
#define FSCRIPT_WITH_MATH 1
#endif/*PC*/
ret_t fscript_ext_init(void) {
#ifdef FSCRIPT_WITH_MATH
fscript_math_register();
#endif/*FSCRIPT_WITH_MATH*/
return RET_OK;
}

View File

@ -0,0 +1,35 @@
/**
* File: fscript_ext.h
* Author: AWTK Develop Team
* Brief: ext functions for fscript
*
* Copyright (c) 2020 - 2021 Guangzhou ZHIYUAN Electronics Co.,Ltd.
*
*/
/**
* History:
* ================================================================
* 2021-01-03 Li XianJing <lixianjing@zlg.cn> created
*
*/
#ifndef TK_FSCRIPT_EXT_H
#define TK_FSCRIPT_EXT_H
#include "tkc/str.h"
#include "tkc/object.h"
BEGIN_C_DECLS
/**
* @method fscript_ext_init
*
*
* @return {ret_t} RET_OK表示成功
*/
ret_t fscript_ext_init(void);
END_C_DECLS
#endif /*TK_FSCRIPT_EXT_H*/