awtk-web support fscript ext

This commit is contained in:
lixianjing 2024-06-21 12:10:35 +08:00
parent 7b1b7bfe77
commit 4e5f2d5f4f
5 changed files with 16 additions and 3 deletions

View File

@ -2,6 +2,7 @@
2024/06/21
* 修改list_view悬浮和自动隐藏的属性的描述和实际不相符的问题(感谢智明提供补丁)
* awtk-web支持fscript扩展
2024/06/19
* 增加函数tk\_str\_case\_start\_with/tk\_str\_case\_end\_with

View File

@ -17,6 +17,14 @@
#include "tkc/endian.h"
#include "tkc/fscript.h"
#ifdef AWTK_WEB
/*AWTK_WEB 不支持下面函数*/
#define htonl(n) n
#define ntohl(n) n
#define htons(n) n
#define ntohs(n) n
#endif/*AWTK_WEB*/
static ret_t func_is_little_endian(fscript_t* fscript, fscript_args_t* args, value_t* result) {
FSCRIPT_FUNC_CHECK(args->size == 0, RET_BAD_PARAMS);
value_set_bool(result, is_little_endian());

View File

@ -30,7 +30,7 @@ BEGIN_C_DECLS
*/
ret_t fscript_ext_init(void);
#if defined(LINUX) || defined(WINDOWS) || defined(MACOS) || defined(ANDROID) || defined(IOS)
#if defined(LINUX) || defined(WINDOWS) || defined(MACOS) || defined(ANDROID) || defined(IOS) || defined(AWTK_WEB)
#define WITH_FSCRIPT_EXT 1
#define FSCRIPT_WITH_CRC 1

View File

@ -21,6 +21,7 @@
static ret_t func_iostream_serial_create(fscript_t* fscript, fscript_args_t* args,
value_t* result) {
#ifndef AWTK_WEB
int baudrate = 115200;
tk_object_t* obj = NULL;
const char* devname = NULL;
@ -70,8 +71,10 @@ static ret_t func_iostream_serial_create(fscript_t* fscript, fscript_args_t* arg
result->free_handle = TRUE;
tk_iostream_serial_config(TK_IOSTREAM(obj), baudrate, bytesize, parity, stopbits, flowcontrol);
return RET_OK;
#else
return RET_NOT_IMPL;
#endif
}
FACTORY_TABLE_BEGIN(s_ext_iostream_serial)

View File

@ -26,6 +26,7 @@ AWKT_SVG_FILES=glob.glob(AWTK_SRC_DIR+'/svg/*.c')
AWKT_APP_CONF_FILES=glob.glob(AWTK_SRC_DIR+'/conf_io/*.c')
AWKT_UBJSON_FILES=glob.glob(AWTK_SRC_DIR+'/ubjson/*.c')
AWKT_CSV_FILES=glob.glob(AWTK_SRC_DIR+'/csv/*.c')
AWKT_FSCRIPT_EXT_FILES=glob.glob(AWTK_SRC_DIR+'/fscript_ext/*.c')
AWKT_STREAMS_FILES=glob.glob(AWTK_SRC_DIR+'/streams/file/*.c') + glob.glob(AWTK_SRC_DIR+'/streams/mem/*.c')
AWKT_CLIPBOARD_FILES=glob.glob(AWTK_SRC_DIR+'/clip_board/clip_board_default.c')
AWKT_WIDGET_ANIMATORS_FILES=glob.glob(AWTK_SRC_DIR+'/widget_animators/*.c')
@ -40,7 +41,7 @@ NATIVE_WINDOW_FILES=glob.glob(AWTK_SRC_DIR+'/native_window/native_window_raw.c')
WINDOW_MANAGER_FILES=glob.glob(AWTK_SRC_DIR+'/window_manager/window_manager_default.c')
GRAPHIC_BUFFER_FILES=glob.glob(AWTK_SRC_DIR+'/graphic_buffer/graphic_buffer_default.c')
COMMON_FILES=AWKT_TKC_FILES + AWKT_BASE_FILES + AWKT_WIDGETS_FILES + AWKT_EXT_WIDGETS_FILES + AWKT_UILOADER_FILES + AWKT_LAYOUTERS_FILES + AWKT_SVG_FILES + AWKT_APP_CONF_FILES + AWKT_WIDGET_ANIMATORS_FILES + AWKT_WINDOW_ANIMATORS_FILES + AWKT_DIALOG_HIGHLIGHTERS_FILES + AWKT_CLIPBOARD_FILES + AWKT_FONT_GLOBAL_FILES + AWKT_INPUT_METHOD_FILES + NATIVE_WINDOW_FILES + WINDOW_MANAGER_FILES + GRAPHIC_BUFFER_FILES + AWKT_UBJSON_FILES + AWKT_CSV_FILES + AWKT_STREAMS_FILES;
COMMON_FILES=AWKT_TKC_FILES + AWKT_BASE_FILES + AWKT_WIDGETS_FILES + AWKT_EXT_WIDGETS_FILES + AWKT_UILOADER_FILES + AWKT_LAYOUTERS_FILES + AWKT_SVG_FILES + AWKT_APP_CONF_FILES + AWKT_WIDGET_ANIMATORS_FILES + AWKT_WINDOW_ANIMATORS_FILES + AWKT_DIALOG_HIGHLIGHTERS_FILES + AWKT_CLIPBOARD_FILES + AWKT_FONT_GLOBAL_FILES + AWKT_INPUT_METHOD_FILES + NATIVE_WINDOW_FILES + WINDOW_MANAGER_FILES + GRAPHIC_BUFFER_FILES + AWKT_UBJSON_FILES + AWKT_CSV_FILES + AWKT_STREAMS_FILES + AWKT_FSCRIPT_EXT_FILES;
INFER_FILES=COMMON_FILES
WEB_FILES=COMMON_FILES + AWKT_XML_FILES + AWKT_ROMFS_FILES + AWKT_DESIGNER_SUPPORT_FILES