From 1cdfcd21084a440b01d36689a03c09e2e0a2a8be Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sat, 7 Nov 2020 16:12:01 +0800 Subject: [PATCH] improve docs --- docs/faq.md | 16 + tools/idl_gen/idl.json | 69992 +++++++++++++++++++-------------------- 2 files changed, 35012 insertions(+), 34996 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index f6a44afad..6f0bf2ff3 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -273,3 +273,19 @@ ret_t locale_info_change(locale_info_t* locale_info, const char* language, const ``` design/default/styles/keyboard.xml ``` + +#### 21.如何处理:Cannot find module 'glob' + +一般来说,执行下面的命令即可: + +``` +npm install -g glob +``` + + +在Linux/MacOS上,有时仍然出现错误,可以通过下面的命令,设置NODE_PATH环境变量: + + +``` +export NODE_PATH="$(npm root -g)" +``` diff --git a/tools/idl_gen/idl.json b/tools/idl_gen/idl.json index df22e7a04..7aa5c9f5a 100644 --- a/tools/idl_gen/idl.json +++ b/tools/idl_gen/idl.json @@ -133,368 +133,6 @@ }, "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建rect对象。\n\n> 主要供脚本语言使用。", - "name": "rect_create", - "return": { - "type": "rect_t*", - "desc": "rect对象。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "rect", - "desc": "rect对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置rect对象的xywh。\n\n> 主要供脚本语言使用。", - "name": "rect_set", - "return": { - "type": "rect_t*", - "desc": "rect对象。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "rect", - "desc": "rect对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为rect对象。\n\n> 供脚本语言使用。", - "name": "rect_cast", - "return": { - "type": "rect_t*", - "desc": "rect对象。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "r", - "desc": "rect对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "销毁rect对象。\n\n> 主要供脚本语言使用。", - "name": "rect_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "r", - "desc": "rect对象。" - }, - { - "type": "float_t", - "name": "scale", - "desc": "缩放比例。" - } - ], - "annotation": {}, - "desc": "缩放rect对象。", - "name": "rect_scale", - "return": { - "type": "rect_t*", - "desc": "返回rect对象。" - } - }, - { - "params": [ - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": {}, - "desc": "初始化rect对象。", - "name": "rect_init", - "return": { - "type": "rect_t", - "desc": "返回rect对象。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "dst_r", - "desc": "rect对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "rect对象。" - } - ], - "annotation": {}, - "desc": "合并两个rect对象。", - "name": "rect_merge", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "r", - "desc": "rect对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - } - ], - "annotation": {}, - "desc": "判断指定的点在rect范围内。", - "name": "rect_contains", - "return": { - "type": "bool_t", - "desc": "返回在rect范围内。" - } - }, - { - "params": [ - { - "type": "rect_t*", - "name": "r", - "desc": "rect对象。" - } - ], - "annotation": {}, - "desc": "确保rect在指定的大小范围内。", - "name": "rect_fix", - "return": { - "type": "rect_t", - "desc": "返回修复之后的rect对象。" - } - }, - { - "params": [ - { - "type": "const rect_t*", - "name": "r1", - "desc": "rect对象。" - }, - { - "type": "const rect_t*", - "name": "r2", - "desc": "rect对象。" - } - ], - "annotation": {}, - "desc": "求两个rect的交集。", - "name": "rect_intersect", - "return": { - "type": "rect_t", - "desc": "返回交集。" - } - } - ], - "events": [], - "properties": [ - { - "name": "x", - "desc": "x坐标。", - "type": "xy_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "y", - "desc": "y坐标。", - "type": "xy_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "w", - "desc": "宽度。", - "type": "wh_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "h", - "desc": "高度。", - "type": "wh_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/rect.h", - "desc": "矩形。包括一个x坐标、y坐标、宽度和高度。", - "name": "rect_t", - "order": -10, - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "x", - "desc": "x坐标。", - "type": "float_t", - "annotation": { - "readable": true - } - }, - { - "name": "y", - "desc": "y坐标。", - "type": "float_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/rect.h", - "desc": "点(浮点数)。包括一个x坐标和一个y坐标。", - "name": "pointf_t", - "order": -10, - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "x", - "desc": "x坐标。", - "type": "xy_t", - "annotation": { - "readable": true - } - }, - { - "name": "y", - "desc": "y坐标。", - "type": "xy_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/rect.h", - "desc": "点。包括一个x坐标和一个y坐标。", - "name": "point_t", - "annotation": { - "scriptable": true - }, - "order": -10, - "level": 1 - }, { "type": "class", "methods": [ @@ -1009,6 +647,368 @@ }, "level": 1 }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "x", + "desc": "x坐标。", + "type": "xy_t", + "annotation": { + "readable": true + } + }, + { + "name": "y", + "desc": "y坐标。", + "type": "xy_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/rect.h", + "desc": "点。包括一个x坐标和一个y坐标。", + "name": "point_t", + "annotation": { + "scriptable": true + }, + "order": -10, + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "x", + "desc": "x坐标。", + "type": "float_t", + "annotation": { + "readable": true + } + }, + { + "name": "y", + "desc": "y坐标。", + "type": "float_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/rect.h", + "desc": "点(浮点数)。包括一个x坐标和一个y坐标。", + "name": "pointf_t", + "order": -10, + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建rect对象。\n\n> 主要供脚本语言使用。", + "name": "rect_create", + "return": { + "type": "rect_t*", + "desc": "rect对象。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "rect", + "desc": "rect对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置rect对象的xywh。\n\n> 主要供脚本语言使用。", + "name": "rect_set", + "return": { + "type": "rect_t*", + "desc": "rect对象。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "rect", + "desc": "rect对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为rect对象。\n\n> 供脚本语言使用。", + "name": "rect_cast", + "return": { + "type": "rect_t*", + "desc": "rect对象。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "r", + "desc": "rect对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "销毁rect对象。\n\n> 主要供脚本语言使用。", + "name": "rect_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "r", + "desc": "rect对象。" + }, + { + "type": "float_t", + "name": "scale", + "desc": "缩放比例。" + } + ], + "annotation": {}, + "desc": "缩放rect对象。", + "name": "rect_scale", + "return": { + "type": "rect_t*", + "desc": "返回rect对象。" + } + }, + { + "params": [ + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": {}, + "desc": "初始化rect对象。", + "name": "rect_init", + "return": { + "type": "rect_t", + "desc": "返回rect对象。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "dst_r", + "desc": "rect对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "rect对象。" + } + ], + "annotation": {}, + "desc": "合并两个rect对象。", + "name": "rect_merge", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "r", + "desc": "rect对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + } + ], + "annotation": {}, + "desc": "判断指定的点在rect范围内。", + "name": "rect_contains", + "return": { + "type": "bool_t", + "desc": "返回在rect范围内。" + } + }, + { + "params": [ + { + "type": "rect_t*", + "name": "r", + "desc": "rect对象。" + } + ], + "annotation": {}, + "desc": "确保rect在指定的大小范围内。", + "name": "rect_fix", + "return": { + "type": "rect_t", + "desc": "返回修复之后的rect对象。" + } + }, + { + "params": [ + { + "type": "const rect_t*", + "name": "r1", + "desc": "rect对象。" + }, + { + "type": "const rect_t*", + "name": "r2", + "desc": "rect对象。" + } + ], + "annotation": {}, + "desc": "求两个rect的交集。", + "name": "rect_intersect", + "return": { + "type": "rect_t", + "desc": "返回交集。" + } + } + ], + "events": [], + "properties": [ + { + "name": "x", + "desc": "x坐标。", + "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "y", + "desc": "y坐标。", + "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "w", + "desc": "宽度。", + "type": "wh_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "h", + "desc": "高度。", + "type": "wh_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/rect.h", + "desc": "矩形。包括一个x坐标、y坐标、宽度和高度。", + "name": "rect_t", + "order": -10, + "annotation": { + "scriptable": true + }, + "level": 1 + }, { "type": "class", "methods": [ @@ -1435,6 +1435,990 @@ }, "level": 1 }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "引用计数减1。引用计数为0时,销毁对象。", + "name": "object_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "引用计数加1。", + "name": "object_ref", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "clone对象。", + "name": "object_clone", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "const object_vtable_t*", + "name": "vt", + "desc": "虚函数表。" + } + ], + "annotation": {}, + "desc": "创建对象。\n\n> 仅供子类调用。", + "name": "object_create", + "return": { + "type": "ret_t", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象的类型名称。", + "name": "object_get_type", + "return": { + "type": "const char*", + "desc": "返回对象的类型名称。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象的描述信息。", + "name": "object_get_desc", + "return": { + "type": "const char*", + "desc": "返回对象的描述信息。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象占用内存的大小。", + "name": "object_get_size", + "return": { + "type": "uint32_t", + "desc": "返回对象占用内存的大小。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "判断对象是否是集合。", + "name": "object_is_collection", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是集合,否则不是。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "对象的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置对象的名称。", + "name": "object_set_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "object_t*", + "name": "other", + "desc": "比较的object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "比较两个对象。", + "name": "object_compare", + "return": { + "type": "int", + "desc": "返回比较结果。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的值。", + "name": "object_get_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的字符串类型的值。", + "name": "object_get_prop_str", + "return": { + "type": "const char*", + "desc": "返回指定属性的字符串类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的指针类型的值。", + "name": "object_get_prop_pointer", + "return": { + "type": "void*", + "desc": "返回指定属性的指针类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的object类型的值。", + "name": "object_get_prop_object", + "return": { + "type": "object_t*", + "desc": "返回指定属性的object类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的整数类型的值。", + "name": "object_get_prop_int", + "return": { + "type": "int32_t", + "desc": "返回指定属性的整数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的bool类型的值。", + "name": "object_get_prop_bool", + "return": { + "type": "bool_t", + "desc": "返回指定属性的bool类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "float_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的浮点数类型的值。", + "name": "object_get_prop_float", + "return": { + "type": "float_t", + "desc": "返回指定属性的浮点数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "删除指定属性。", + "name": "object_remove_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "value_t*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的值。", + "name": "object_set_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "const char*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的字符串类型的值。", + "name": "object_set_prop_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "void*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": {}, + "desc": "设置指定属性的指针类型的值。", + "name": "object_set_prop_pointer", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "object_t*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的object类型的值。", + "name": "object_set_prop_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的整数类型的值。", + "name": "object_set_prop_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "bool_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的bool类型的值。", + "name": "object_set_prop_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "float_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的浮点数类型的值。", + "name": "object_set_prop_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "目标对象。" + }, + { + "type": "object_t*", + "name": "src", + "desc": "源对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "拷贝指定的属性。", + "name": "object_copy_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "tk_visit_t", + "name": "on_prop", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数上下文。" + } + ], + "annotation": {}, + "desc": "遍历所有属性。", + "name": "object_foreach_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "检查是否存在指定的属性。", + "name": "object_has_prop", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则表示不存在。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "expr", + "desc": "表达式。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回计算结果。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "计算一个表达式,表达式中引用的变量从prop中获取。", + "name": "object_eval", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "命令的名称。" + }, + { + "type": "const char*", + "name": "args", + "desc": "命令的参数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "检查是否可以执行指定的命令。", + "name": "object_can_exec", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示可以执行,否则表示不可以执行。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "命令的名称。" + }, + { + "type": "const char*", + "name": "args", + "desc": "命令的参数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "执行指定的命令。", + "name": "object_exec", + "alias": "execute", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "触发EVT_PROPS_CHANGED事件。", + "name": "object_notify_changed", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path,各级之间用.分隔。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回属性的值。" + } + ], + "annotation": {}, + "desc": "获取指定path属性的值。", + "name": "object_get_prop_by_path", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的字符串类型的值。", + "name": "object_get_prop_str_by_path", + "return": { + "type": "const char*", + "desc": "返回指定属性的字符串类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的指针类型的值。", + "name": "object_get_prop_pointer_by_path", + "return": { + "type": "void*", + "desc": "返回指定属性的指针类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的object类型的值。", + "name": "object_get_prop_object_by_path", + "return": { + "type": "object_t*", + "desc": "返回指定属性的object类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的整数类型的值。", + "name": "object_get_prop_int_by_path", + "return": { + "type": "int32_t", + "desc": "返回指定属性的整数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的bool类型的值。", + "name": "object_get_prop_bool_by_path", + "return": { + "type": "bool_t", + "desc": "返回指定属性的bool类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "float_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的浮点数类型的值。", + "name": "object_get_prop_float_by_path", + "return": { + "type": "float_t", + "desc": "返回指定属性的浮点数类型的值。" + } + } + ], + "events": [], + "properties": [ + { + "name": "ref_count", + "desc": "引用计数。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "name", + "desc": "对象的名称。", + "type": "char*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/object.h", + "desc": "对象接口。", + "name": "object_t", + "order": -9, + "parent": "emitter_t", + "annotation": { + "scriptable": true + }, + "level": 2 + }, { "type": "class", "methods": [ @@ -2501,990 +3485,6 @@ }, "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "引用计数减1。引用计数为0时,销毁对象。", - "name": "object_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "引用计数加1。", - "name": "object_ref", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "clone对象。", - "name": "object_clone", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "const object_vtable_t*", - "name": "vt", - "desc": "虚函数表。" - } - ], - "annotation": {}, - "desc": "创建对象。\n\n> 仅供子类调用。", - "name": "object_create", - "return": { - "type": "ret_t", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象的类型名称。", - "name": "object_get_type", - "return": { - "type": "const char*", - "desc": "返回对象的类型名称。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象的描述信息。", - "name": "object_get_desc", - "return": { - "type": "const char*", - "desc": "返回对象的描述信息。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象占用内存的大小。", - "name": "object_get_size", - "return": { - "type": "uint32_t", - "desc": "返回对象占用内存的大小。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "判断对象是否是集合。", - "name": "object_is_collection", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是集合,否则不是。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "对象的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置对象的名称。", - "name": "object_set_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "object_t*", - "name": "other", - "desc": "比较的object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "比较两个对象。", - "name": "object_compare", - "return": { - "type": "int", - "desc": "返回比较结果。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "返回属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的值。", - "name": "object_get_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的字符串类型的值。", - "name": "object_get_prop_str", - "return": { - "type": "const char*", - "desc": "返回指定属性的字符串类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的指针类型的值。", - "name": "object_get_prop_pointer", - "return": { - "type": "void*", - "desc": "返回指定属性的指针类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的object类型的值。", - "name": "object_get_prop_object", - "return": { - "type": "object_t*", - "desc": "返回指定属性的object类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "int32_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的整数类型的值。", - "name": "object_get_prop_int", - "return": { - "type": "int32_t", - "desc": "返回指定属性的整数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "bool_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的bool类型的值。", - "name": "object_get_prop_bool", - "return": { - "type": "bool_t", - "desc": "返回指定属性的bool类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "float_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的浮点数类型的值。", - "name": "object_get_prop_float", - "return": { - "type": "float_t", - "desc": "返回指定属性的浮点数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "删除指定属性。", - "name": "object_remove_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "value_t*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的值。", - "name": "object_set_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "const char*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的字符串类型的值。", - "name": "object_set_prop_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "void*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": {}, - "desc": "设置指定属性的指针类型的值。", - "name": "object_set_prop_pointer", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "object_t*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的object类型的值。", - "name": "object_set_prop_object", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的整数类型的值。", - "name": "object_set_prop_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "bool_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的bool类型的值。", - "name": "object_set_prop_bool", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "float_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的浮点数类型的值。", - "name": "object_set_prop_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "目标对象。" - }, - { - "type": "object_t*", - "name": "src", - "desc": "源对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "拷贝指定的属性。", - "name": "object_copy_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "tk_visit_t", - "name": "on_prop", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数上下文。" - } - ], - "annotation": {}, - "desc": "遍历所有属性。", - "name": "object_foreach_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查是否存在指定的属性。", - "name": "object_has_prop", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则表示不存在。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "expr", - "desc": "表达式。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "返回计算结果。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "计算一个表达式,表达式中引用的变量从prop中获取。", - "name": "object_eval", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "命令的名称。" - }, - { - "type": "const char*", - "name": "args", - "desc": "命令的参数。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查是否可以执行指定的命令。", - "name": "object_can_exec", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示可以执行,否则表示不可以执行。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "命令的名称。" - }, - { - "type": "const char*", - "name": "args", - "desc": "命令的参数。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "执行指定的命令。", - "name": "object_exec", - "alias": "execute", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "触发EVT_PROPS_CHANGED事件。", - "name": "object_notify_changed", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path,各级之间用.分隔。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "返回属性的值。" - } - ], - "annotation": {}, - "desc": "获取指定path属性的值。", - "name": "object_get_prop_by_path", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的字符串类型的值。", - "name": "object_get_prop_str_by_path", - "return": { - "type": "const char*", - "desc": "返回指定属性的字符串类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的指针类型的值。", - "name": "object_get_prop_pointer_by_path", - "return": { - "type": "void*", - "desc": "返回指定属性的指针类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的object类型的值。", - "name": "object_get_prop_object_by_path", - "return": { - "type": "object_t*", - "desc": "返回指定属性的object类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "int32_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的整数类型的值。", - "name": "object_get_prop_int_by_path", - "return": { - "type": "int32_t", - "desc": "返回指定属性的整数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "bool_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的bool类型的值。", - "name": "object_get_prop_bool_by_path", - "return": { - "type": "bool_t", - "desc": "返回指定属性的bool类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "float_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的浮点数类型的值。", - "name": "object_get_prop_float_by_path", - "return": { - "type": "float_t", - "desc": "返回指定属性的浮点数类型的值。" - } - } - ], - "events": [], - "properties": [ - { - "name": "ref_count", - "desc": "引用计数。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "name", - "desc": "对象的名称。", - "type": "char*", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/object.h", - "desc": "对象接口。", - "name": "object_t", - "order": -9, - "parent": "emitter_t", - "annotation": { - "scriptable": true - }, - "level": 2 - }, { "type": "class", "methods": [ @@ -3749,6 +3749,2793 @@ }, "level": 1 }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "创建缺省的资源加载器。", + "name": "asset_loader_create", + "return": { + "type": "asset_loader_t*", + "desc": "返回loader对象。" + } + }, + { + "params": [ + { + "type": "asset_loader_t*", + "name": "loader", + "desc": "loader对象。" + }, + { + "type": "uint16_t", + "name": "type", + "desc": "资源类型。" + }, + { + "type": "uint16_t", + "name": "subtype", + "desc": "资源子类型。" + }, + { + "type": "const char*", + "name": "path", + "desc": "路径。" + }, + { + "type": "const char*", + "name": "name", + "desc": "名称。" + } + ], + "annotation": {}, + "desc": "加载指定的资源。", + "name": "asset_loader_load", + "return": { + "type": "asset_info_t*", + "desc": "返回资源对象(由调用者销毁)。" + } + }, + { + "params": [ + { + "type": "asset_loader_t*", + "name": "loader", + "desc": "loader对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "资源是路径。" + } + ], + "annotation": {}, + "desc": "判断指定资源是否存在。\n。", + "name": "asset_loader_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则不存在。" + } + }, + { + "params": [ + { + "type": "asset_loader_t*", + "name": "loader", + "desc": "loader对象。" + } + ], + "annotation": {}, + "desc": "销毁loader对象。", + "name": "asset_loader_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "base/asset_loader.h", + "desc": "资源加载器接口。", + "name": "asset_loader_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "获取缺省资源管理器。", + "name": "assets_manager", + "alias": "assets_manager_instance", + "return": { + "type": "assets_manager_t*", + "desc": "返回asset manager对象。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + } + ], + "annotation": {}, + "desc": "设置缺省资源管理器。", + "name": "assets_manager_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "init_nr", + "desc": "预先分配资源的个数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建资源管理器。", + "name": "assets_manager_create", + "return": { + "type": "assets_manager_t*", + "desc": "返回asset manager对象。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "uint32_t", + "name": "init_nr", + "desc": "预先分配资源的个数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化资源管理器。", + "name": "assets_manager_init", + "return": { + "type": "assets_manager_t*", + "desc": "返回asset manager对象。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + } + ], + "annotation": {}, + "desc": "获取资源所在的目录(其下目录结构请参考demos)。", + "name": "assets_manager_get_res_root", + "return": { + "type": "const char*", + "desc": "返回资源所在的目录。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "const char*", + "name": "res_root", + "desc": "资源所在的目录。" + } + ], + "annotation": {}, + "desc": "设置资源所在的目录(其下目录结构请参考demos)。", + "name": "assets_manager_set_res_root", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "const char*", + "name": "theme", + "desc": "主题名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置当前的主题。", + "name": "assets_manager_set_theme", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "system_info_t*", + "name": "system_info", + "desc": "system_info对象。。" + } + ], + "annotation": {}, + "desc": "设置system_info对象。", + "name": "assets_manager_set_system_info", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "locale_info_t*", + "name": "locale_info", + "desc": "locale_info对象。。" + } + ], + "annotation": {}, + "desc": "设置locale_info对象。", + "name": "assets_manager_set_locale_info", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_info_t", + "name": "info", + "desc": "待增加的资源。" + } + ], + "annotation": {}, + "desc": "向资源管理器中增加一个资源。", + "name": "assets_manager_add", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "待增加的资源的名字。" + }, + { + "type": "uint16_t", + "name": "type", + "desc": "待增加的资源的主类型枚举。" + }, + { + "type": "uint16_t", + "name": "subtype", + "desc": "待增加的资源的子类型枚举。" + }, + { + "type": "uint8_t*", + "name": "buff", + "desc": "待增加的资源的data数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "待增加的资源的data数据长度。" + } + ], + "annotation": {}, + "desc": "向资源管理器中增加一个资源data。", + "name": "assets_manager_add_data", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源的类型。" + }, + { + "type": "char*", + "name": "name", + "desc": "资源的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。", + "name": "assets_manager_ref", + "return": { + "type": "asset_info_t*", + "desc": "返回资源。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_info_t*", + "name": "info", + "desc": "资源。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "释放指定的资源。", + "name": "assets_manager_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源的类型。" + }, + { + "type": "char*", + "name": "name", + "desc": "资源的名称。" + } + ], + "annotation": {}, + "desc": "在资源管理器的缓存中查找指定的资源(不引用)。", + "name": "assets_manager_find_in_cache", + "return": { + "type": "asset_info_t*", + "desc": "返回资源。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源的类型。" + }, + { + "type": "char*", + "name": "name", + "desc": "资源的名称。" + } + ], + "annotation": {}, + "desc": "从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\\_FS\\_RES时才生效。", + "name": "assets_manager_load", + "return": { + "type": "asset_info_t*", + "desc": "返回资源。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源的类型。" + }, + { + "type": "char*", + "name": "name", + "desc": "资源的名称。" + } + ], + "annotation": {}, + "desc": "从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\\_FS\\_RES时才生效。", + "name": "assets_manager_preload", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_loader_t*", + "name": "loader", + "desc": "加载器(由assets manager销毁)。" + } + ], + "annotation": {}, + "desc": "设置loader。", + "name": "assets_manager_set_loader", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "assets_manager_build_asset_dir_t", + "name": "custom_build_asset_dir", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], + "annotation": {}, + "desc": "设置一个函数,该函数用于生成资源路径。\n\n> 有时我们需要优先加载用户自定义的资源,加载失败才加载系统缺省的,可用设置一个函数去实现这类功能。", + "name": "assets_manager_set_custom_build_asset_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "assets_manager_load_asset_t", + "name": "custom_load_asset", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], + "annotation": {}, + "desc": "设置一个函数,该函数用于实现自定义加载资源。\n\n> 如果不支持文件系统,开发者可以设置一个加载资源的回调函数,从flash或其它地方读取资源。", + "name": "assets_manager_set_custom_load_asset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源的类型。" + } + ], + "annotation": {}, + "desc": "清除指定类型的缓存。", + "name": "assets_manager_clear_cache", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + } + ], + "annotation": {}, + "desc": "清除全部缓存的资源。", + "name": "assets_manager_clear_all", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + } + ], + "annotation": {}, + "desc": "释放全部资源。", + "name": "assets_manager_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + } + ], + "annotation": {}, + "desc": "释放全部资源并销毁asset manager对象。", + "name": "assets_manager_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "assets_manager_t*", + "name": "am", + "desc": "asset manager对象。" + }, + { + "type": "asset_type_t", + "name": "type", + "desc": "资源类型。" + }, + { + "type": "const char*", + "name": "path", + "desc": "目录。" + } + ], + "annotation": {}, + "desc": "获取path里的资源。", + "name": "assets_manager_load_file", + "return": { + "type": "asset_info_t*", + "desc": "返回asset_info_t。" + } + } + ], + "events": [], + "properties": [], + "header": "base/assets_manager.h", + "desc": "资源管理器。\n这里的资源管理器并非Windows下的文件浏览器,而是负责对各种资源,比如字体、主题、图片、界面数据、字符串和其它数据的进行集中管理的组件。引入资源管理器的目的有以下几个:\n\n* 让上层不需要了解存储的方式。\n在没有文件系统时或者内存紧缺时,把资源转成常量数组直接编译到代码中。在有文件系统而且内存充足时,资源放在文件系统中。在有网络时,资源也可以存放在服务器上(暂未实现)。资源管理器为上层提供统一的接口,让上层而不用关心底层的存储方式。\n\n* 让上层不需要了解资源的具体格式。\n比如一个名为earth的图片,没有文件系统或内存紧缺,图片直接用位图数据格式存在ROM中,而有文件系统时,则用PNG格式存放在文件系统中。资源管理器让上层不需要关心图片的格式,访问时指定图片的名称即可(不用指定扩展名)。\n\n* 让上层不需要了解屏幕的密度。\n不同的屏幕密度下需要加载不同的图片,比如MacPro的Retina屏就需要用双倍解析度的图片,否则就出现界面模糊。AWTK以后会支持PC软件和手机软件的开发,所以资源管理器需要为此提供支持,让上层不需关心屏幕的密度。\n\n* 对资源进行内存缓存。\n不同类型的资源使用方式是不一样的,比如字体和主题加载之后会一直使用,UI文件在生成界面之后就暂时不需要了,PNG文件解码之后就只需要保留解码的位图数据即可。资源管理器配合图片管理器等其它组件实现资源的自动缓存。\n\n当从文件系统加载资源时,目录结构要求如下:\n\n```\nassets/{theme}/raw/\nfonts 字体\nimages 图片\nx1 普通密度屏幕的图片。\nx2 2倍密度屏幕的图片。\nx3 3倍密度屏幕的图片。\nxx 密度无关的图片。\nstrings 需要翻译的字符串。\nstyles 主题数据。\nui UI描述数据。\n```", + "name": "assets_manager_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "bidi 类型常量定义。", + "consts": [ + { + "desc": "自动检查。", + "name": "BIDI_TYPE_AUTO" + }, + { + "desc": "Left-To-Right letter。", + "name": "BIDI_TYPE_LTR" + }, + { + "desc": "Right-To-Left letter。", + "name": "BIDI_TYPE_RTL" + }, + { + "desc": "Left-To-Right letter Override。", + "name": "BIDI_TYPE_LRO" + }, + { + "desc": "Right-To-Left letter Override。", + "name": "BIDI_TYPE_RLO" + }, + { + "desc": "Weak Left To Right paragraph。", + "name": "BIDI_TYPE_WLTR" + }, + { + "desc": "Weak Right To Left paragraph。", + "name": "BIDI_TYPE_WRTL" + } + ], + "header": "base/bidi.h", + "name": "bidi_type_t", + "prefix": "BIDI_TYPE_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "bidi_t*", + "name": "bidi", + "desc": "bidi对象。" + }, + { + "type": "bool_t", + "name": "alloc_l2v", + "desc": "是否为positions_L_to_V分配空间。" + }, + { + "type": "bool_t", + "name": "alloc_v2l", + "desc": "是否为positions_V_to_L分配空间。" + }, + { + "type": "bidi_type_t", + "name": "type", + "desc": "类型。" + } + ], + "annotation": { + "deconstructor": true + }, + "desc": "初始化bidi对象。", + "name": "bidi_init", + "return": { + "type": "bidi_t*", + "desc": "返回bidi对象。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "类型名称(取值:rtl,ltr,auto,wrtl,wltr,lro,rlo)。" + } + ], + "annotation": { + "static": true + }, + "desc": "将bidi类型的名称转换成类型。", + "name": "bidi_type_from_name", + "return": { + "type": "bidi_t*", + "desc": "返回bidi对象。" + } + }, + { + "params": [ + { + "type": "bidi_t*", + "name": "bidi", + "desc": "bidi对象。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串的长度。" + } + ], + "annotation": {}, + "desc": "将字符串转成用于显示的字符串,输出结果放在bidi->vis_str中。", + "name": "bidi_log2vis", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "bidi_t*", + "name": "bidi", + "desc": "bidi对象。" + } + ], + "annotation": { + "deconstructor": true + }, + "desc": "释放bidi对象相关资源。", + "name": "bidi_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "vis_strx", + "desc": "用于显示的字符串(存放log2vis的结果)。", + "type": "wchar_t*", + "annotation": { + "readable": true + } + }, + { + "name": "vis_str_size", + "desc": "用于显示的字符串长度(存放log2vis的结果)。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "request_type", + "desc": "请求的类型。", + "type": "bidi_type_t", + "annotation": { + "readable": true + } + }, + { + "name": "resolved_type", + "desc": "实际的类型。", + "type": "bidi_type_t", + "annotation": { + "readable": true + } + }, + { + "name": "positions_L_to_V", + "desc": "logical位置与visual位置的映射。", + "type": "int32_t*", + "annotation": { + "readable": true + } + }, + { + "name": "positions_V_to_L", + "desc": "visual位置与logical位置的映射。", + "type": "int32_t*", + "annotation": { + "readable": true + } + } + ], + "header": "base/bidi.h", + "desc": "Unicode Bidirectional Algorithm.", + "name": "bidi_t", + "level": 1 + }, + { + "type": "enum", + "desc": "图片绘制方法常量定义。", + "consts": [ + { + "desc": "缺省显示。将图片按原大小显示在目标矩形的左上角。", + "name": "IMAGE_DRAW_DEFAULT" + }, + { + "desc": "居中显示。将图片按原大小显示在目标矩形的中央。", + "name": "IMAGE_DRAW_CENTER" + }, + { + "desc": "图标显示。同居中显示,但会根据屏幕密度调整大小。", + "name": "IMAGE_DRAW_ICON" + }, + { + "desc": "缩放显示。将图片缩放至目标矩形的大小(不保证宽高成比例)。", + "name": "IMAGE_DRAW_SCALE" + }, + { + "desc": "自动缩放显示。将图片缩放至目标矩形的宽度或高度(选取最小的比例),并居中显示。", + "name": "IMAGE_DRAW_SCALE_AUTO" + }, + { + "desc": "如果图片比目标矩形大,自动缩小显示,否则居中显示。", + "name": "IMAGE_DRAW_SCALE_DOWN" + }, + { + "desc": "宽度缩放显示。 将图片缩放至目标矩形的宽度,高度按此比例进行缩放,超出不部分不显示。", + "name": "IMAGE_DRAW_SCALE_W" + }, + { + "desc": "高度缩放显示。将图片缩放至目标矩形的高度,宽度按此比例进行缩放,超出不部分不显示。", + "name": "IMAGE_DRAW_SCALE_H" + }, + { + "desc": "平铺显示。", + "name": "IMAGE_DRAW_REPEAT" + }, + { + "desc": "水平方向平铺显示,垂直方向缩放。", + "name": "IMAGE_DRAW_REPEAT_X" + }, + { + "desc": "垂直方向平铺显示,水平方向缩放。", + "name": "IMAGE_DRAW_REPEAT_Y" + }, + { + "desc": "垂直方向平铺显示,水平方向缩放(从底部到顶部)。", + "name": "IMAGE_DRAW_REPEAT_Y_INVERSE" + }, + { + "desc": "9宫格显示。\n将图片分成等大小的9块,4个角按原大小显示在目标矩形的4个角,左右上下和中间5块分别缩放显示在对应的目标区域。", + "name": "IMAGE_DRAW_PATCH9" + }, + { + "desc": "水平方向3宫格显示,垂直方向居中显示。\n将图片在水平方向上分成等大小的3块,左右两块按原大小显示在目标矩形的左右,中间一块缩放显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_PATCH3_X" + }, + { + "desc": "垂直方向3宫格显示,水平方向居中显示。\n将图片在垂直方向上分成等大小的3块,上下两块按原大小显示在目标矩形的上下,中间一块缩放显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_PATCH3_Y" + }, + { + "desc": "水平方向3宫格显示,垂直方向缩放显示。\n将图片在水平方向上分成等大小的3块,左右两块按原大小显示在目标矩形的左右,中间一块缩放显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_PATCH3_X_SCALE_Y" + }, + { + "desc": "垂直方向3宫格显示,水平方向缩放显示。\n将图片在垂直方向上分成等大小的3块,上下两块按原大小显示在目标矩形的上下,中间一块缩放显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_PATCH3_Y_SCALE_X" + }, + { + "desc": "平铺9宫格显示。\n将图片分成4个角和5块平铺块,4个角按原大小显示在目标矩形的4个角,其余5块会平铺对应的目标区域。\n切割方法为(如下图):\n如果图片宽度为奇数,则中间一块为一列数据,如果图片宽度为偶数,则中间一块为二列数据,其他数据分为左右块\n如果图片高度为奇数,则中间一块为一行数据,如果图片高度为偶数,则中间一块为二行数据,其他数据分为上下块\n中间一块数据根据上面两条规则组成4中情况,分别是一列一行数据,一列两行数据,两列一行数据和两行两列数据", + "name": "IMAGE_DRAW_REPEAT9" + }, + { + "desc": "水平方向3宫格显示,垂直方向居中显示。\n将图片在水平方向上分成左右相等两块和中间一块,如果图片宽度为奇数,则中间一块为一列数据,如果图片宽度为偶数,则中间一块为二列数据,其他数据分为左右块。\n左右两块按原大小显示在目标矩形的左右,中间一列像素点平铺显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_REPEAT3_X" + }, + { + "desc": "垂直方向3宫格显示,水平方向居中显示。\n将图片在垂直方向上分成上下相等两块和中间一块,如果图片高度为奇数,则中间一块为一行数据,如果图片高度为偶数,则中间一块为二行数据,其他数据分为上下块\n上下两块按原大小显示在目标矩形的上下,中间一块平铺显示在目标区域中间剩余部分。", + "name": "IMAGE_DRAW_REPEAT3_Y" + } + ], + "header": "base/bitmap.h", + "name": "image_draw_type_t", + "prefix": "IMAGE_DRAW_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "w", + "desc": "离线 canvas 的宽。" + }, + { + "type": "uint32_t", + "name": "h", + "desc": "离线 canvas 的高。" + }, + { + "type": "bitmap_format_t", + "name": "format", + "desc": "离线 canvas 的格式。" + } + ], + "annotation": {}, + "desc": "创建一个离线的 canvas\n在 opengl 模式下 format 参数只能为 BITMAP_FMT_RGBA8888\n在其他模式下,离线 canvas 格式可以为 rgba,bgar,bgr565和rgb565", + "name": "canvas_offline_create", + "return": { + "type": "canvas_t*", + "desc": "成功返回 canvas ,失败返回 NULL。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "清除离线 canvas 所有数据,并把背景设置为全透明(注意:该离线 canvas 需要有透明通道)\n该函数调用前必须要先 canvas_offline_begin_draw 函数。\n该函数用来解决离线 canvas 多次绘图半透效果后导致半透效果无效的问题。", + "name": "canvas_offline_clear_canvas", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "设置离线 canvas 开始绘图", + "name": "canvas_offline_begin_draw", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "设置离线 canvas 结束绘图", + "name": "canvas_offline_end_draw", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "获取离线 canvas 的离线 bitmap。", + "name": "canvas_offline_get_bitmap", + "return": { + "type": "bitmap_t*", + "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + }, + { + "type": "bitmap_t*", + "name": "bitmap", + "desc": "新的 bitmap 对象。" + } + ], + "annotation": {}, + "desc": "把离线 canvas 的离线 bitmap 移动赋值给新的 bitmap。\n移动赋值后原来的离线 canvas 的离线 bitmap 就会被置空。\n备注:在移动赋值之前会先调用 canvas_offline_flush_bitmap 把数据回流到内存中。", + "name": "canvas_offline_bitmap_move_to_new_bitmap", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "把离线 canvas 的数据放到绑定的 bitmap 中\n该函数只有在 opengl 模式才需要调用,是否把显存中的数据回传到内存中。", + "name": "canvas_offline_flush_bitmap", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "释放离线 canvas 和离线 bitmap", + "name": "canvas_offline_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "w", + "desc": "离线 canvas 的宽。" + }, + { + "type": "uint32_t", + "name": "h", + "desc": "离线 canvas 的高。" + }, + { + "type": "bitmap_format_t", + "name": "format", + "desc": "离线 canvas 的格式。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_create", + "name": "canvas_offline_custom_create", + "export": "none", + "return": { + "type": "canvas_t*", + "desc": "成功返回 canvas ,失败返回 NULL。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_clear_canvas", + "name": "canvas_offline_custom_clear_canvas", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_begin_draw", + "name": "canvas_offline_custom_begin_draw", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_end_draw", + "name": "canvas_offline_custom_end_draw", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_get_bitmap", + "name": "canvas_offline_custom_get_bitmap", + "export": "none", + "return": { + "type": "bitmap_t*", + "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_bitmap_move_to_new_bitmap", + "name": "canvas_offline_custom_bitmap_move_to_new_bitmap", + "export": "none", + "return": { + "type": "bitmap_t*", + "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_flush_bitmap", + "name": "canvas_offline_custom_flush_bitmap", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "离线 canvas 对象。" + } + ], + "annotation": {}, + "desc": "用户自定义 canvas_offline_custom_destroy", + "name": "canvas_offline_custom_destroy", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "bitmap", + "desc": "绑定的离线 bitmap", + "type": "bitmap_t*", + "annotation": { + "readable": true + } + } + ], + "header": "base/canvas_offline.h", + "desc": "离线画布 canvas。", + "name": "canvas_offline_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "lcd_t*", + "name": "lcd", + "desc": "lcd对象。" + }, + { + "type": "font_manager_t*", + "name": "font_manager", + "desc": "字体管理器对象。" + } + ], + "annotation": {}, + "desc": "初始化,系统内部调用。", + "name": "canvas_init", + "return": { + "type": "canvas_t*", + "desc": "返回canvas对象本身。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取画布的宽度。", + "name": "canvas_get_width", + "return": { + "type": "wh_t", + "desc": "返回画布的宽度。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取画布的高度。", + "name": "canvas_get_height", + "return": { + "type": "wh_t", + "desc": "返回画布的高度。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "rect_t*", + "name": "r", + "desc": "rect对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取裁剪区。", + "name": "canvas_get_clip_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "rect对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置裁剪区。", + "name": "canvas_set_clip_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "rect对象。" + }, + { + "type": "bool_t", + "name": "translate", + "desc": "是否将裁剪区的位置加上canvas当前的偏移。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置裁剪区。", + "name": "canvas_set_clip_rect_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "color_t", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": {}, + "desc": "设置填充颜色。", + "name": "canvas_set_fill_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "color_t", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": {}, + "desc": "设置文本颜色。", + "name": "canvas_set_text_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "color_t", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": {}, + "desc": "设置线条颜色。", + "name": "canvas_set_stroke_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置填充颜色。\n\n> 供脚本语言使用。", + "name": "canvas_set_fill_color_str", + "alias": "canvas_set_fill_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置文本颜色。\n\n> 供脚本语言使用。", + "name": "canvas_set_text_color_str", + "alias": "canvas_set_text_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置线条颜色。\n\n> 供脚本语言使用。", + "name": "canvas_set_stroke_color_str", + "alias": "canvas_set_stroke_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "uint8_t", + "name": "alpha", + "desc": "alpha值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置全局alpha值。", + "name": "canvas_set_global_alpha", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "dx", + "desc": "x偏移。" + }, + { + "type": "xy_t", + "name": "dy", + "desc": "y偏移。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "平移原点坐标。", + "name": "canvas_translate", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "dx", + "desc": "x偏移。" + }, + { + "type": "xy_t", + "name": "dy", + "desc": "y偏移。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "反向平移原点坐标。", + "name": "canvas_untranslate", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "画垂直线。", + "name": "canvas_draw_vline", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "画水平线。", + "name": "canvas_draw_hline", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const point_t*", + "name": "points", + "desc": "点数组。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "点的个数。" + } + ], + "annotation": {}, + "desc": "画多个点。", + "name": "canvas_draw_points", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制矩形。", + "name": "canvas_fill_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "用填充颜色填充指定矩形。\n\n> 如果lcd的颜色格式带alpha通道,连同alpha的值一起修改。", + "name": "canvas_clear_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制矩形。", + "name": "canvas_stroke_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "字体名称。" + }, + { + "type": "font_size_t", + "name": "size", + "desc": "字体大小。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置字体。", + "name": "canvas_set_font", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "align_h_t", + "name": "align_h", + "desc": "水平对齐方式。" + }, + { + "type": "align_v_t", + "name": "align_v", + "desc": "垂直对齐方式。" + } + ], + "annotation": {}, + "desc": "设置文本对齐方式。", + "name": "canvas_set_text_align", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "字符数。" + } + ], + "annotation": {}, + "desc": "计算文本所占的宽度。", + "name": "canvas_measure_text", + "return": { + "type": "float_t", + "desc": "返回文本所占的宽度。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "获取字体的高度。", + "name": "canvas_get_font_height", + "return": { + "type": "float_t", + "desc": "返回字体的高度。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "计算文本所占的宽度。\n\n> 供脚本语言使用。", + "name": "canvas_measure_utf8", + "alias": "canvas_measure_text", + "return": { + "type": "float_t", + "desc": "返回文本所占的宽度。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "字符数。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + } + ], + "annotation": {}, + "desc": "绘制文本。", + "name": "canvas_draw_text", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制文本。\n\n> 供脚本语言使用。", + "name": "canvas_draw_utf8", + "alias": "canvas_draw_text", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "字符数。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形区域。" + } + ], + "annotation": {}, + "desc": "绘制文本。", + "name": "canvas_draw_text_in_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "字符数。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形区域。" + }, + { + "type": "const char*", + "name": "bidi_type", + "desc": "类型。" + }, + { + "type": "bool_t", + "name": "ellipses", + "desc": "如果目标宽度不够,是否显示省略号。" + } + ], + "annotation": {}, + "desc": "绘制文本(支持Unicode Bidirectional Algorithm)。", + "name": "canvas_draw_text_bidi_in_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形区域。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制文本。\n\n> 供脚本语言使用。", + "name": "canvas_draw_utf8_in_rect", + "alias": "canvas_draw_text_in_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "bitmap_t*", + "name": "img", + "desc": "图片对象。" + }, + { + "type": "xy_t", + "name": "cx", + "desc": "中心点x坐标。" + }, + { + "type": "xy_t", + "name": "cy", + "desc": "中心点y坐标。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制图标。", + "name": "canvas_draw_icon", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "bitmap_t*", + "name": "img", + "desc": "图片对象。" + }, + { + "type": "const rect_t*", + "name": "src", + "desc": "源区域。" + }, + { + "type": "const rect_t*", + "name": "dst", + "desc": "目的区域。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制图片。", + "name": "canvas_draw_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "bitmap_t*", + "name": "img", + "desc": "图片对象。" + }, + { + "type": "image_draw_type_t", + "name": "draw_type", + "desc": "绘制类型。" + }, + { + "type": "const rect_t*", + "name": "dst", + "desc": "目的区域。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制图片。", + "name": "canvas_draw_image_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "bitmap_t*", + "name": "img", + "desc": "图片对象。" + }, + { + "type": "image_draw_type_t", + "name": "draw_type", + "desc": "绘制类型。" + }, + { + "type": "const rect_t*", + "name": "src", + "desc": "源区域。" + }, + { + "type": "const rect_t*", + "name": "dst", + "desc": "目的区域。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "绘制图片。", + "name": "canvas_draw_image_ex2", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取vgcanvas对象。", + "name": "canvas_get_vgcanvas", + "return": { + "type": "vgcanvas_t*", + "desc": "返回vgcanvas对象。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为canvas对象(供脚本语言使用)。", + "name": "canvas_cast", + "return": { + "type": "canvas_t*", + "desc": "canvas对象。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "释放相关资源。", + "name": "canvas_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "bitmap_t*", + "name": "img", + "desc": "图片对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "w坐标。" + } + ], + "annotation": {}, + "desc": "在指定位置画图。", + "name": "canvas_draw_image_at", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "xy_t", + "name": "x1", + "desc": "起始点的x坐标。" + }, + { + "type": "xy_t", + "name": "y1", + "desc": "起始点的y坐标。" + }, + { + "type": "xy_t", + "name": "x2", + "desc": "结束点的x坐标。" + }, + { + "type": "xy_t", + "name": "y2", + "desc": "结束点的y坐标。" + } + ], + "annotation": {}, + "desc": "画直线。", + "name": "canvas_draw_line", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "font_manager_t*", + "name": "font_manager", + "desc": "font_manager对象。" + } + ], + "annotation": {}, + "desc": "设置canvas的font_manager对象。", + "name": "canvas_set_font_manager", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "assets_manager_t*", + "name": "assets_manager", + "desc": "assets_manager对象。" + } + ], + "annotation": {}, + "desc": "设置canvas的assets_manager对象。", + "name": "canvas_set_assets_manager", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "canvas", + "desc": "canvas对象。" + }, + { + "type": "float_t*", + "name": "ascent", + "desc": "用于返回ascent。" + }, + { + "type": "float_t*", + "name": "descent", + "desc": "用于返回descent。" + }, + { + "type": "float_t*", + "name": "line_hight", + "desc": "用于返回line height。" + } + ], + "annotation": {}, + "desc": "获取当前字体的度量信息。", + "name": "canvas_get_text_metrics", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "dirty_rect", + "desc": "脏矩形。" + }, + { + "type": "lcd_draw_mode_t", + "name": "draw_mode", + "desc": "绘制模式。" + } + ], + "annotation": {}, + "desc": "绘制开始。", + "name": "canvas_begin_frame", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形。" + }, + { + "type": "const color_t*", + "name": "color", + "desc": "颜色。" + }, + { + "type": "uint32_t", + "name": "radius", + "desc": "圆角半径。" + } + ], + "annotation": {}, + "desc": "填充区域。", + "name": "canvas_fill_rounded_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形。" + }, + { + "type": "const color_t*", + "name": "color", + "desc": "颜色。" + }, + { + "type": "uint32_t", + "name": "radius_tl", + "desc": "左上角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_tr", + "desc": "右上角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_bl", + "desc": "左下角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_br", + "desc": "右下角圆角半径。" + } + ], + "annotation": {}, + "desc": "填充区域。\n半径半径小于等于2,则表示该角为直角,如果全部角都为直角则返回RET_FAIL。(如果全是直角,该函数效率没有canvas_fill_rect函数快)\n如果各个半径都不一样的话,就是会使用vg,如果不支持vg就会返回RET_FAIL(直角的情况除外)。", + "name": "canvas_fill_rounded_rect_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形。" + }, + { + "type": "const color_t*", + "name": "color", + "desc": "颜色。" + }, + { + "type": "uint32_t", + "name": "radius", + "desc": "圆角半径。" + }, + { + "type": "uint32_t", + "name": "border_width", + "desc": "边宽。" + } + ], + "annotation": {}, + "desc": "绘制边框。", + "name": "canvas_stroke_rounded_rect", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + }, + { + "type": "const rect_t*", + "name": "r", + "desc": "矩形。" + }, + { + "type": "const color_t*", + "name": "color", + "desc": "颜色。" + }, + { + "type": "uint32_t", + "name": "radius_tl", + "desc": "左上角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_tr", + "desc": "右上角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_bl", + "desc": "左下角圆角半径。" + }, + { + "type": "uint32_t", + "name": "radius_br", + "desc": "右下角圆角半径。" + }, + { + "type": "uint32_t", + "name": "border_width", + "desc": "边宽。" + }, + { + "type": "uint32_t", + "name": "border_model", + "desc": "边框类型。" + } + ], + "annotation": {}, + "desc": "绘制边框。\n半径半径小于等于2,则表示该角为直角,如果全部角都为直角则返回RET_FAIL。(如果全是直角,该函数效率没有canvas_stroke_rect函数快)\n如果各个半径都不一样的话,就是会使用vg,如果不支持vg就会返回RET_FAIL(直角的情况除外)。", + "name": "canvas_stroke_rounded_rect_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "绘制结束。", + "name": "canvas_end_frame", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "ox", + "desc": "x坐标偏移。", + "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "oy", + "desc": "y坐标偏移。", + "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "font_name", + "desc": "当前字体名称。", + "type": "char*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "font_size", + "desc": "当前字体大小。", + "type": "uint16_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "global_alpha", + "desc": "当前全局alpha。", + "type": "uint8_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "clip_left", + "desc": "当前裁剪矩形的左边位置。", + "type": "xy_t", + "annotation": { + "readable": true + } + }, + { + "name": "clip_top", + "desc": "当前裁剪矩形的顶部位置。", + "type": "xy_t", + "annotation": { + "readable": true + } + }, + { + "name": "clip_right", + "desc": "当前裁剪矩形的右边位置。", + "type": "xy_t", + "annotation": { + "readable": true + } + }, + { + "name": "clip_bottom", + "desc": "当前裁剪矩形的底部位置。", + "type": "xy_t", + "annotation": { + "readable": true + } + }, + { + "name": "fps", + "desc": "当前的帧率。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "show_fps", + "desc": "是否显示帧率。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "text_align_v", + "desc": "文本垂直对齐方式。", + "type": "align_v_t", + "annotation": { + "readable": true + } + }, + { + "name": "text_align_h", + "desc": "文本水平对齐方式。", + "type": "align_h_t", + "annotation": { + "readable": true + } + }, + { + "name": "lcd", + "desc": "lcd对象。", + "type": "lcd_t*", + "annotation": { + "readable": true + } + }, + { + "name": "font", + "desc": "字体对象。", + "type": "font_t*", + "annotation": { + "readable": true + } + }, + { + "name": "font_manager", + "desc": "字体管理器对象。", + "type": "font_manager_t*", + "annotation": { + "readable": true + } + }, + { + "name": "assets_manager", + "desc": "资源管理器对象。", + "type": "assets_manager_t*", + "annotation": { + "readable": true + } + } + ], + "header": "base/canvas.h", + "desc": "提供基本的绘图功能和状态管理。", + "name": "canvas_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, { "type": "class", "methods": [ @@ -4743,38 +7530,6 @@ }, "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char**", - "name": "attrs", - "desc": "属性列表。" - }, - { - "type": "const char*", - "name": "attr", - "desc": "属性名。" - } - ], - "annotation": {}, - "desc": "获取属性。", - "name": "xml_builder_get_attr", - "return": { - "type": "const char*", - "desc": "返回属性的值。" - } - } - ], - "events": [], - "properties": [], - "header": "xml/xml_builder.h", - "desc": "xml builder interface", - "name": "xml_builder_t", - "level": 1 - }, { "type": "class", "methods": [ @@ -5357,1124 +8112,6 @@ }, "level": 1 }, - { - "params": [], - "annotation": { - "global": true - }, - "desc": "初始化AWTK控件。", - "name": "tk_widgets_init", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - }, - "type": "method", - "header": "widgets/widgets.h", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "动画持续时间。" - }, - { - "type": "uint32_t", - "name": "delay", - "desc": "动画执行时间。" - }, - { - "type": "easing_type_t", - "name": "easing", - "desc": "插值函数类型。" - } - ], - "annotation": {}, - "desc": "创建动画对象。", - "name": "widget_animator_scroll_create", - "return": { - "type": "widget_animator_t*", - "desc": "成功返回动画对象,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "widget_animator_t*", - "name": "animator", - "desc": "动画对象本身。" - }, - { - "type": "xy_t", - "name": "x_from", - "desc": "x起点值。" - }, - { - "type": "xy_t", - "name": "y_from", - "desc": "y起点值。" - }, - { - "type": "xy_t", - "name": "x_to", - "desc": "x终点值。" - }, - { - "type": "xy_t", - "name": "y_to", - "desc": "y终点值。" - } - ], - "annotation": {}, - "desc": "设置动画对象的参数。", - "name": "widget_animator_scroll_set_params", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "widget_animators/widget_animator_scroll.h", - "desc": "滚动控件的动画。\n本动画也可以用widget_animator_prop2实现,但滚动控件需要访问内部数据结构,出于可读性考虑保留独立实现。", - "name": "widget_animator_scroll_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "动画持续时间。" - }, - { - "type": "uint32_t", - "name": "delay", - "desc": "动画执行时间。" - }, - { - "type": "easing_type_t", - "name": "easing", - "desc": "插值函数类型。" - }, - { - "type": "const char*", - "name": "prop1_name", - "desc": "属性1的名称。" - }, - { - "type": "const char*", - "name": "prop2_name", - "desc": "属性2的名称。" - } - ], - "annotation": {}, - "desc": "创建双属性动画对象。", - "name": "widget_animator_prop2_create", - "return": { - "type": "widget_animator_t*", - "desc": "成功返回动画对象,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "widget_animator_t*", - "name": "animator", - "desc": "动画对象本身。" - }, - { - "type": "double", - "name": "from1", - "desc": "x的初值。" - }, - { - "type": "double", - "name": "from2", - "desc": "y的初值。" - }, - { - "type": "double", - "name": "to1", - "desc": "x的终值。" - }, - { - "type": "double", - "name": "to2", - "desc": "y的终值。" - } - ], - "annotation": {}, - "desc": "设置动画对象的参数。", - "name": "widget_animator_prop2_set_params", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "widget_animators/widget_animator_prop2.h", - "desc": "通过修改对象的两个指定属性形成动画效果。", - "name": "widget_animator_prop2_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "动画持续时间。" - }, - { - "type": "uint32_t", - "name": "delay", - "desc": "动画执行时间。" - }, - { - "type": "easing_type_t", - "name": "easing", - "desc": "插值函数类型。" - }, - { - "type": "const char*", - "name": "prop_name", - "desc": "属性的名称。" - } - ], - "annotation": {}, - "desc": "创建单属性动画对象。", - "name": "widget_animator_prop_create", - "return": { - "type": "widget_animator_t*", - "desc": "成功返回动画对象,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "widget_animator_t*", - "name": "animator", - "desc": "动画对象本身。" - }, - { - "type": "double", - "name": "from", - "desc": "prop起始值。" - }, - { - "type": "double", - "name": "to", - "desc": "prop结束值。" - } - ], - "annotation": {}, - "desc": "设置动画对象的参数。", - "name": "widget_animator_prop_set_params", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "widget_animators/widget_animator_prop.h", - "desc": "通过修改对象的指定属性形成动画效果。", - "name": "widget_animator_prop_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "ubjson_write_callback_t", - "name": "write", - "desc": "真正写入数据的函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "write函数的上下文。" - } - ], - "annotation": {}, - "desc": "初始化。", - "name": "ubjson_writer_init", - "return": { - "type": "ubjson_writer_t*", - "desc": "返回writer对象。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "value", - "desc": "key的名称。" - } - ], - "annotation": {}, - "desc": "写入key。", - "name": "ubjson_writer_write_key", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入null。", - "name": "ubjson_writer_write_null", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入noop。", - "name": "ubjson_writer_write_noop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入true。", - "name": "ubjson_writer_write_true", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入false。", - "name": "ubjson_writer_write_false", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入int。", - "name": "ubjson_writer_write_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "int8_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入int8。", - "name": "ubjson_writer_write_int8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "uint8_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入uint8。", - "name": "ubjson_writer_write_uint8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "int16_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入int16。", - "name": "ubjson_writer_write_int16", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入int32。", - "name": "ubjson_writer_write_int32", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "int64_t", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入int64。", - "name": "ubjson_writer_write_int64", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "float", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入float。", - "name": "ubjson_writer_write_float32", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "double", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入double。", - "name": "ubjson_writer_write_float64", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "char", - "name": "value", - "desc": "要写入的值。" - } - ], - "annotation": {}, - "desc": "写入char。", - "name": "ubjson_writer_write_char", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "value", - "desc": "要写入的字符串。" - } - ], - "annotation": {}, - "desc": "写入str。", - "name": "ubjson_writer_write_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "value", - "desc": "要写入的字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串的长度。" - } - ], - "annotation": {}, - "desc": "写入str。", - "name": "ubjson_writer_write_str_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "object_t*", - "name": "obj", - "desc": "要写入的对象。" - } - ], - "annotation": {}, - "desc": "写入obj。", - "name": "ubjson_writer_write_object", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入数组开始。\n> 即: [", - "name": "ubjson_writer_write_array_begin", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入数组结束。\n> 即: ]", - "name": "ubjson_writer_write_array_end", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入对象开始。\n> 即: {", - "name": "ubjson_writer_write_object_begin", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "写入对象结束。\n> 即:}", - "name": "ubjson_writer_write_object_end", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const void*", - "name": "data", - "desc": "数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - } - ], - "annotation": {}, - "desc": "写入二进制数据。", - "name": "ubjson_writer_write_data", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键值。" - } - ], - "annotation": {}, - "desc": "写key和对象的开始。\n\n> 即:\"key\": {", - "name": "ubjson_writer_write_kv_object_begin", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "object_t*", - "name": "value", - "desc": "对象。" - } - ], - "annotation": {}, - "desc": "写key和对象。\n\n> 即:\"key\": { object }", - "name": "ubjson_writer_write_kv_object", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和int的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "int64_t", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和int64_t的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_int64", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "float", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和float的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "double", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和double的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_double", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "bool_t", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和bool的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_bool", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "const char*", - "name": "value", - "desc": "字符串。" - } - ], - "annotation": {}, - "desc": "写入key和str的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "const char*", - "name": "value", - "desc": "字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串的长度。" - } - ], - "annotation": {}, - "desc": "写入key和str的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_str_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ubjson_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键名。" - }, - { - "type": "value_t*", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "写入key和value_t的值。\n\n> 即:\"key\": value", - "name": "ubjson_writer_write_kv_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "ubjson/ubjson_writer.h", - "desc": "ubjson writer", - "name": "ubjson_writer_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据的长度。" - }, - { - "type": "ubjson_on_key_value_t", - "name": "on_key_value", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": { - "static": true - }, - "desc": "解析ubjson数据,遇到key/value时调用提供的回调函数。", - "name": "ubjson_parse", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据的长度。" - } - ], - "annotation": { - "static": true - }, - "desc": "解析ubjson数据,生成object对象。", - "name": "ubjson_to_object", - "return": { - "type": "void*", - "desc": "返回object表示的数据。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据的长度。" - } - ], - "annotation": { - "static": true - }, - "desc": "将ubjson数据打印到控制台。", - "name": "ubjson_dump", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "ubjson/ubjson_parser.h", - "desc": "ubjson parser", - "name": "ubjson_parser_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "s", - "desc": "源字符串。" - } - ], - "annotation": { - "global": true - }, - "desc": "获取一个新的内存保存s串。", - "name": "wcs_dup", - "return": { - "type": "wchar_t*", - "desc": "返回新的字符串地址。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "s", - "desc": "串地址。" - } - ], - "annotation": { - "global": true - }, - "desc": "获取字符串长度。", - "name": "wcs_len", - "return": { - "type": "size_t", - "desc": "返回串长度'\\0'结尾。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, { "type": "class", "methods": [ @@ -7655,32 +9292,6 @@ }, "level": 1 }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "s1", - "desc": "目标串。" - }, - { - "type": "const wchar_t*", - "name": "s2", - "desc": "源串。" - } - ], - "annotation": { - "global": true - }, - "desc": "比较字符串", - "name": "wcs_cmp", - "return": { - "type": "int", - "desc": "小于0表示s1s2。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, { "type": "class", "methods": [ @@ -8325,589 +9936,6 @@ }, "level": 1 }, - { - "params": [ - { - "type": "wchar_t*", - "name": "s1", - "desc": "目标串。" - }, - { - "type": "const wchar_t*", - "name": "s2", - "desc": "源串。" - } - ], - "annotation": { - "global": true - }, - "desc": "复制字符串", - "name": "wcs_cpy", - "return": { - "type": "const wchar_t*", - "desc": "复制后的串地址。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "s", - "desc": "wchar_t*。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "wchar_t。" - } - ], - "annotation": { - "global": true - }, - "desc": "查找字符位置", - "name": "wcs_chr", - "return": { - "type": "const wchar_t*", - "desc": "返回找到c的地址。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "capacity", - "desc": "初始容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化字符串对象。", - "name": "wstr_init", - "return": { - "type": "wstr_t*", - "desc": "str对象本身。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要设置的字符串。" - } - ], - "annotation": {}, - "desc": "设置字符串。", - "name": "wstr_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "清除字符串内容。", - "name": "wstr_clear", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要设置的字符串。" - } - ], - "annotation": {}, - "desc": "设置UTF8字符串。", - "name": "wstr_set_utf8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "返回的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "text最大长度。" - } - ], - "annotation": {}, - "desc": "获取UTF8字符串。", - "name": "wstr_get_utf8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "指定的位置。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "要删除的字符数。" - } - ], - "annotation": {}, - "desc": "删除指定范围的字符。", - "name": "wstr_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "指定的位置。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "待插入的文本。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "要插入的字符数。" - } - ], - "annotation": {}, - "desc": "在指定位置插入字符串。", - "name": "wstr_insert", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要追加的字符串。" - } - ], - "annotation": {}, - "desc": "追加字符串。", - "name": "wstr_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要追加的字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "追加字符串。", - "name": "wstr_append_with_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "追加一个字符。", - "name": "wstr_push", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "删除尾部字符。", - "name": "wstr_pop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "const char*", - "name": "format", - "desc": "格式(用于snprintf格式化数值)" - }, - { - "type": "int32_t", - "name": "value", - "desc": "数值。" - } - ], - "annotation": {}, - "desc": "追加一个整数。", - "name": "wstr_push_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wstr_t*", - "name": "other", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "判断两个字符是否相同。", - "name": "wstr_equal", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示相同,否则表示不同。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "int32_t", - "name": "v", - "desc": "整数。" - } - ], - "annotation": {}, - "desc": "用整数初始化字符串。", - "name": "wstr_from_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "double", - "name": "v", - "desc": "浮点数。" - } - ], - "annotation": {}, - "desc": "用浮点数初始化字符串。", - "name": "wstr_from_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "value_t", - "name": "v", - "desc": "value。" - } - ], - "annotation": {}, - "desc": "用value初始化字符串。", - "name": "wstr_from_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "int32_t*", - "name": "v", - "desc": "用于返回整数。" - } - ], - "annotation": {}, - "desc": "将字符串转成整数。", - "name": "wstr_to_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "double*", - "name": "v", - "desc": "用于返回浮点数。" - } - ], - "annotation": {}, - "desc": "将字符串转成浮点数。", - "name": "wstr_to_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "double", - "name": "delta", - "desc": "要加上的值。" - } - ], - "annotation": {}, - "desc": "将字符串转成浮点数,加上delta,再转换回来。", - "name": "wstr_add_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "去掉浮点数小数点尾部的零。", - "name": "wstr_trim_float_zero", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "newline", - "desc": "换行符。" - } - ], - "annotation": {}, - "desc": "规范化换行符。", - "name": "wstr_normalize_newline", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "统计指定字符的个数。", - "name": "wstr_count_char", - "return": { - "type": "uint32_t", - "desc": "返回指定字符的个数。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "重置字符串为空。", - "name": "wstr_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "size", - "desc": "长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "str", - "desc": "字符串。", - "type": "wchar_t*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/wstr.h", - "desc": "可变长度的宽字符字符串。\n\n示例:\n\n```c\nwstr_t s;\nwstr_init(&s, 0);\n\nwstr_append(&s, L\"abc\");\nwstr_append(&s, L\"123\");\n\nwstr_reset(&s);\n```\n> 先调wstr\\_init进行初始化,最后调用wstr\\_reset释放内存。", - "name": "wstr_t", - "level": 1 - }, { "type": "class", "methods": [ @@ -10096,118 +11124,6 @@ "header": "base/layout.h", "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "capacity", - "desc": "容量。" - }, - { - "type": "uint32_t", - "name": "block_size", - "desc": "块的大小。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建waitable_ring_buffer对象。", - "name": "waitable_ring_buffer_create", - "return": { - "type": "waitable_ring_buffer_t*", - "desc": "waitable_ring_buffer对象。" - } - }, - { - "params": [ - { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "接收数据的buff。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "读取数据的长度(必须等于 block_size)。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "读取数据。", - "name": "waitable_ring_buffer_read", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "要写入的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据的长度(必须等于 block_size)。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "写入数据。", - "name": "waitable_ring_buffer_write", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "waitable_ring_buffer_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/waitable_ring_buffer.h", - "desc": "waitable ring buffer", - "name": "waitable_ring_buffer_t", - "level": 1 - }, { "type": "enum", "desc": "LCD绘制模式常量定义。", @@ -11602,103 +12518,6 @@ "name": "main_loop_t", "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "capacity", - "desc": "action的容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建waitable_action_queue对象。", - "name": "waitable_action_queue_create", - "return": { - "type": "waitable_action_queue_t*", - "desc": "waitable_action_queue对象。" - } - }, - { - "params": [ - { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" - }, - { - "type": "qaction_t**", - "name": "action", - "desc": "用于返回action对象。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "接收一个请求。", - "name": "waitable_action_queue_recv", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" - }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "发送一个请求。", - "name": "waitable_action_queue_send", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "waitable_action_queue_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/waitable_action_queue.h", - "desc": "waitable actionqueue", - "name": "waitable_action_queue_t", - "level": 1 - }, { "type": "class", "methods": [ @@ -12234,552 +13053,6 @@ "name": "shortcut_t", "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "获取缺省资源管理器。", - "name": "assets_manager", - "alias": "assets_manager_instance", - "return": { - "type": "assets_manager_t*", - "desc": "返回asset manager对象。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - } - ], - "annotation": {}, - "desc": "设置缺省资源管理器。", - "name": "assets_manager_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "init_nr", - "desc": "预先分配资源的个数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建资源管理器。", - "name": "assets_manager_create", - "return": { - "type": "assets_manager_t*", - "desc": "返回asset manager对象。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "uint32_t", - "name": "init_nr", - "desc": "预先分配资源的个数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化资源管理器。", - "name": "assets_manager_init", - "return": { - "type": "assets_manager_t*", - "desc": "返回asset manager对象。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - } - ], - "annotation": {}, - "desc": "获取资源所在的目录(其下目录结构请参考demos)。", - "name": "assets_manager_get_res_root", - "return": { - "type": "const char*", - "desc": "返回资源所在的目录。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "const char*", - "name": "res_root", - "desc": "资源所在的目录。" - } - ], - "annotation": {}, - "desc": "设置资源所在的目录(其下目录结构请参考demos)。", - "name": "assets_manager_set_res_root", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "const char*", - "name": "theme", - "desc": "主题名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置当前的主题。", - "name": "assets_manager_set_theme", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "system_info_t*", - "name": "system_info", - "desc": "system_info对象。。" - } - ], - "annotation": {}, - "desc": "设置system_info对象。", - "name": "assets_manager_set_system_info", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "locale_info_t*", - "name": "locale_info", - "desc": "locale_info对象。。" - } - ], - "annotation": {}, - "desc": "设置locale_info对象。", - "name": "assets_manager_set_locale_info", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_info_t", - "name": "info", - "desc": "待增加的资源。" - } - ], - "annotation": {}, - "desc": "向资源管理器中增加一个资源。", - "name": "assets_manager_add", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "待增加的资源的名字。" - }, - { - "type": "uint16_t", - "name": "type", - "desc": "待增加的资源的主类型枚举。" - }, - { - "type": "uint16_t", - "name": "subtype", - "desc": "待增加的资源的子类型枚举。" - }, - { - "type": "uint8_t*", - "name": "buff", - "desc": "待增加的资源的data数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "待增加的资源的data数据长度。" - } - ], - "annotation": {}, - "desc": "向资源管理器中增加一个资源data。", - "name": "assets_manager_add_data", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源的类型。" - }, - { - "type": "char*", - "name": "name", - "desc": "资源的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "在资源管理器的缓存中查找指定的资源并引用它,如果缓存中不存在,尝试加载该资源。", - "name": "assets_manager_ref", - "return": { - "type": "asset_info_t*", - "desc": "返回资源。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_info_t*", - "name": "info", - "desc": "资源。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "释放指定的资源。", - "name": "assets_manager_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源的类型。" - }, - { - "type": "char*", - "name": "name", - "desc": "资源的名称。" - } - ], - "annotation": {}, - "desc": "在资源管理器的缓存中查找指定的资源(不引用)。", - "name": "assets_manager_find_in_cache", - "return": { - "type": "asset_info_t*", - "desc": "返回资源。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源的类型。" - }, - { - "type": "char*", - "name": "name", - "desc": "资源的名称。" - } - ], - "annotation": {}, - "desc": "从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\\_FS\\_RES时才生效。", - "name": "assets_manager_load", - "return": { - "type": "asset_info_t*", - "desc": "返回资源。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源的类型。" - }, - { - "type": "char*", - "name": "name", - "desc": "资源的名称。" - } - ], - "annotation": {}, - "desc": "从文件系统中加载指定的资源,并缓存到内存中。在定义了宏WITH\\_FS\\_RES时才生效。", - "name": "assets_manager_preload", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_loader_t*", - "name": "loader", - "desc": "加载器(由assets manager销毁)。" - } - ], - "annotation": {}, - "desc": "设置loader。", - "name": "assets_manager_set_loader", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "assets_manager_build_asset_dir_t", - "name": "custom_build_asset_dir", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置一个函数,该函数用于生成资源路径。\n\n> 有时我们需要优先加载用户自定义的资源,加载失败才加载系统缺省的,可用设置一个函数去实现这类功能。", - "name": "assets_manager_set_custom_build_asset_dir", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "assets_manager_load_asset_t", - "name": "custom_load_asset", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置一个函数,该函数用于实现自定义加载资源。\n\n> 如果不支持文件系统,开发者可以设置一个加载资源的回调函数,从flash或其它地方读取资源。", - "name": "assets_manager_set_custom_load_asset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源的类型。" - } - ], - "annotation": {}, - "desc": "清除指定类型的缓存。", - "name": "assets_manager_clear_cache", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - } - ], - "annotation": {}, - "desc": "清除全部缓存的资源。", - "name": "assets_manager_clear_all", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - } - ], - "annotation": {}, - "desc": "释放全部资源。", - "name": "assets_manager_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - } - ], - "annotation": {}, - "desc": "释放全部资源并销毁asset manager对象。", - "name": "assets_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "assets_manager_t*", - "name": "am", - "desc": "asset manager对象。" - }, - { - "type": "asset_type_t", - "name": "type", - "desc": "资源类型。" - }, - { - "type": "const char*", - "name": "path", - "desc": "目录。" - } - ], - "annotation": {}, - "desc": "获取path里的资源。", - "name": "assets_manager_load_file", - "return": { - "type": "asset_info_t*", - "desc": "返回asset_info_t。" - } - } - ], - "events": [], - "properties": [], - "header": "base/assets_manager.h", - "desc": "资源管理器。\n这里的资源管理器并非Windows下的文件浏览器,而是负责对各种资源,比如字体、主题、图片、界面数据、字符串和其它数据的进行集中管理的组件。引入资源管理器的目的有以下几个:\n\n* 让上层不需要了解存储的方式。\n在没有文件系统时或者内存紧缺时,把资源转成常量数组直接编译到代码中。在有文件系统而且内存充足时,资源放在文件系统中。在有网络时,资源也可以存放在服务器上(暂未实现)。资源管理器为上层提供统一的接口,让上层而不用关心底层的存储方式。\n\n* 让上层不需要了解资源的具体格式。\n比如一个名为earth的图片,没有文件系统或内存紧缺,图片直接用位图数据格式存在ROM中,而有文件系统时,则用PNG格式存放在文件系统中。资源管理器让上层不需要关心图片的格式,访问时指定图片的名称即可(不用指定扩展名)。\n\n* 让上层不需要了解屏幕的密度。\n不同的屏幕密度下需要加载不同的图片,比如MacPro的Retina屏就需要用双倍解析度的图片,否则就出现界面模糊。AWTK以后会支持PC软件和手机软件的开发,所以资源管理器需要为此提供支持,让上层不需关心屏幕的密度。\n\n* 对资源进行内存缓存。\n不同类型的资源使用方式是不一样的,比如字体和主题加载之后会一直使用,UI文件在生成界面之后就暂时不需要了,PNG文件解码之后就只需要保留解码的位图数据即可。资源管理器配合图片管理器等其它组件实现资源的自动缓存。\n\n当从文件系统加载资源时,目录结构要求如下:\n\n```\nassets/{theme}/raw/\nfonts 字体\nimages 图片\nx1 普通密度屏幕的图片。\nx2 2倍密度屏幕的图片。\nx3 3倍密度屏幕的图片。\nxx 密度无关的图片。\nstrings 需要翻译的字符串。\nstyles 主题数据。\nui UI描述数据。\n```", - "name": "assets_manager_t", - "annotation": { - "scriptable": true - }, - "level": 1 - }, { "type": "class", "methods": [ @@ -12841,103 +13114,6 @@ "name": "style_factory_t", "level": 1 }, - { - "type": "enum", - "desc": "类型常量定义。", - "consts": [ - { - "desc": "无效类型。", - "name": "VALUE_TYPE_INVALID" - }, - { - "desc": "BOOL类型。", - "name": "VALUE_TYPE_BOOL" - }, - { - "desc": "int8_t类型。", - "name": "VALUE_TYPE_INT8" - }, - { - "desc": "uint8_t类型。", - "name": "VALUE_TYPE_UINT8" - }, - { - "desc": "int16_t类型。", - "name": "VALUE_TYPE_INT16" - }, - { - "desc": "uint16_t类型。", - "name": "VALUE_TYPE_UINT16" - }, - { - "desc": "int32_t类型。", - "name": "VALUE_TYPE_INT32" - }, - { - "desc": "uint32_t类型。", - "name": "VALUE_TYPE_UINT32" - }, - { - "desc": "int64_t类型。", - "name": "VALUE_TYPE_INT64" - }, - { - "desc": "uint64_t类型。", - "name": "VALUE_TYPE_UINT64" - }, - { - "desc": "void*类型。", - "name": "VALUE_TYPE_POINTER" - }, - { - "desc": "float_t类型。", - "name": "VALUE_TYPE_FLOAT" - }, - { - "desc": "float类型。", - "name": "VALUE_TYPE_FLOAT32" - }, - { - "desc": "double类型。", - "name": "VALUE_TYPE_DOUBLE" - }, - { - "desc": "char*类型。", - "name": "VALUE_TYPE_STRING" - }, - { - "desc": "wchar_t*类型。", - "name": "VALUE_TYPE_WSTRING" - }, - { - "desc": "object_t*类型。", - "name": "VALUE_TYPE_OBJECT" - }, - { - "desc": "带长度的字符串。", - "name": "VALUE_TYPE_SIZED_STRING" - }, - { - "desc": "二进制数据。", - "name": "VALUE_TYPE_BINARY" - }, - { - "desc": "二进制数据(UBJSON)。", - "name": "VALUE_TYPE_UBJSON" - }, - { - "desc": "特殊用途。", - "name": "VALUE_TYPE_TOKEN" - } - ], - "header": "tkc/value.h", - "name": "value_type_t", - "prefix": "VALUE_TYPE_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, { "type": "enum", "desc": "style常量定义。", @@ -13429,33 +13605,6 @@ "name": "suggest_words_t", "level": 1 }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "enums", - "desc": "枚举值。", - "type": "const char**", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "字符串枚举类型属性描述。", - "name": "value_desc_string_enums_t", - "level": 1 - }, { "type": "class", "methods": [], @@ -18877,65 +19026,6 @@ }, "level": 1 }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "type", - "desc": "类型。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "format", - "desc": "格式。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "flags", - "desc": "flags。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "name", - "desc": "名称。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "display_name", - "desc": "显示名称。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "desc", - "desc": "描述。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "属性描述。", - "name": "value_desc_t", - "level": 1 - }, { "params": [ { @@ -23843,116 +23933,6 @@ "name": "window_animator_t", "level": 1 }, - { - "type": "enum", - "desc": "参数描述范围常量定义。", - "consts": [ - { - "desc": "必须提供。", - "name": "ARG_DESC_FLAGS_REQUIRED" - } - ], - "header": "tkc/value_desc.h", - "name": "arg_desc_flags_t", - "prefix": "ARG_DESC_FLAGS_", - "level": 1 - }, - { - "type": "enum", - "desc": "属性描述范围常量定义。", - "consts": [ - { - "desc": "单个对象的属性。", - "name": "PROP_DESC_FLAG_OBJECT" - }, - { - "desc": "同一个类所有实例共享属性。", - "name": "PROP_DESC_FLAG_CLASS" - }, - { - "desc": "全局属性。", - "name": "PROP_DESC_FLAG_GLOBAL" - }, - { - "desc": "可读取。", - "name": "PROP_DESC_FLAG_READABLE," - }, - { - "desc": "可修改。", - "name": "PROP_DESC_FLAG_WRITBALE," - }, - { - "desc": "可配置。", - "name": "PROP_DESC_FLAG_CONFIGURABLE" - }, - { - "desc": "需要持久化。", - "name": "PROP_DESC_FLAG_PERSISTENT" - } - ], - "header": "tkc/value_desc.h", - "name": "prop_desc_flags_t", - "prefix": "PROP_DESC_FLAGS_", - "level": 1 - }, - { - "type": "enum", - "desc": "属性描述格式常量定义。", - "consts": [ - { - "desc": "无特殊格式。", - "name": "VALUE_FORMAT_TYPE_NONE" - }, - { - "desc": "16进制格式。", - "name": "VALUE_FORMAT_TYPE_HEX" - }, - { - "desc": "非负格式(用于进一步限制float/double)。", - "name": "VALUE_FORMAT_TYPE_HEX" - }, - { - "desc": "手机号码格式。", - "name": "VALUE_FORMAT_TYPE_PHONE" - }, - { - "desc": "邮件格式。", - "name": "VALUE_FORMAT_TYPE_PHONE" - }, - { - "desc": "ip4地址格式。", - "name": "VALUE_FORMAT_TYPE_IP4_ADDRESS" - }, - { - "desc": "域名格式。", - "name": "VALUE_FORMAT_TYPE_DOMAIN_NAME" - }, - { - "desc": "URL格式。", - "name": "VALUE_FORMAT_TYPE_URL" - }, - { - "desc": "JSON格式。", - "name": "VALUE_FORMAT_TYPE_JSON" - }, - { - "desc": "XML格式。", - "name": "VALUE_FORMAT_TYPE_XML" - }, - { - "desc": "UBJSON格式。", - "name": "VALUE_FORMAT_TYPE_UBJSON" - }, - { - "desc": "JS格式。", - "name": "VALUE_FORMAT_TYPE_JS" - } - ], - "header": "tkc/value_desc.h", - "name": "value_format_type_t", - "prefix": "VALUE_FORMAT_TYPE_", - "level": 1 - }, { "type": "enum", "desc": "编码名称。", @@ -24114,76 +24094,6 @@ }, "level": 1 }, - { - "type": "enum", - "desc": "属性描述类型常量定义。", - "consts": [ - { - "desc": "有符号8位整数类型。", - "name": "VALUE_DESC_TYPE_INT8" - }, - { - "desc": "无符号8位整数类型。", - "name": "VALUE_DESC_TYPE_UINT8" - }, - { - "desc": "有符号16位整数类型。", - "name": "VALUE_DESC_TYPE_INT16" - }, - { - "desc": "无符号16位整数类型。", - "name": "VALUE_DESC_TYPE_UINT16" - }, - { - "desc": "有符号32位整数类型。", - "name": "VALUE_DESC_TYPE_INT32" - }, - { - "desc": "无符号32位整数类型。", - "name": "VALUE_DESC_TYPE_UINT32" - }, - { - "desc": "有符号64位整数类型。", - "name": "VALUE_DESC_TYPE_INT64" - }, - { - "desc": "无符号64位整数类型。", - "name": "VALUE_DESC_TYPE_UINT64" - }, - { - "desc": "单精度浮点数类型。", - "name": "VALUE_DESC_TYPE_FLOAT" - }, - { - "desc": "双精度浮点数类型。", - "name": "VALUE_DESC_TYPE_DOUBLE" - }, - { - "desc": "布尔类型。", - "name": "VALUE_DESC_TYPE_BOOL" - }, - { - "desc": "字符串类型。", - "name": "VALUE_DESC_TYPE_STRING" - }, - { - "desc": "二进制类型。", - "name": "VALUE_DESC_TYPE_BINARY" - }, - { - "desc": "整数枚举类型。", - "name": "VALUE_DESC_TYPE_INT_ENUMS" - }, - { - "desc": "字符串枚举类型。", - "name": "VALUE_DESC_TYPE_STRING_ENUMS" - } - ], - "header": "tkc/value_desc.h", - "name": "value_desc_type_t", - "prefix": "VALUE_DESC_TYPE_", - "level": 1 - }, { "params": [ { @@ -24796,991 +24706,6 @@ }, "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为整形的字符串。" - } - ], - "annotation": {}, - "desc": "将字符串转换为整形。", - "name": "tk_atoi", - "return": { - "type": "int", - "desc": "返回转换后的整形。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为布尔类型的字符串。" - } - ], - "annotation": {}, - "desc": "将字符串转换为布尔类型。", - "name": "tk_atob", - "return": { - "type": "bool_t", - "desc": "返回转换后的布尔类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为浮点类型的字符串。" - } - ], - "annotation": {}, - "desc": "将字符串转换为浮点类型。", - "name": "tk_atof", - "return": { - "type": "double", - "desc": "返回转换后的浮点类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "a", - "desc": "要进行比较的第一个字符串。" - }, - { - "type": "const char*", - "name": "b", - "desc": "要进行比较的第二个字符串。" - } - ], - "annotation": {}, - "desc": "字符串比较函数。", - "name": "tk_str_cmp", - "return": { - "type": "int32_t", - "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "a", - "desc": "要进行比较的第一个字符串。" - }, - { - "type": "const char*", - "name": "b", - "desc": "要进行比较的第二个字符串。" - } - ], - "annotation": {}, - "desc": "字符串比较函数(不区分大小写)。", - "name": "tk_str_icmp", - "return": { - "type": "int32_t", - "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为整形的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为整形。", - "name": "tk_watoi", - "return": { - "type": "int", - "desc": "返回转换后的整形。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为整形的宽字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为整形。", - "name": "tk_watoi_n", - "return": { - "type": "int", - "desc": "返回转换后的整形。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为布尔类型的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为布尔类型。", - "name": "tk_watob", - "return": { - "type": "bool_t", - "desc": "返回转换后的布尔类型。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为浮点类型的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为浮点类型。", - "name": "tk_watof", - "return": { - "type": "double", - "desc": "返回转换后的浮点类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要输入的原始字符串。" - } - ], - "annotation": {}, - "desc": "跳过字符串函数,如:字符串\"hello123world\",返回的结果是\"123world\"。", - "name": "tk_skip_to_num", - "return": { - "type": "const char*", - "desc": "返回转换后的字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "保存字符串缓冲区。" - }, - { - "type": "int", - "name": "len", - "desc": "缓冲区大小。" - }, - { - "type": "int", - "name": "n", - "desc": "要转换的整形。" - } - ], - "annotation": {}, - "desc": "将整形转换为字符串。", - "name": "tk_itoa", - "return": { - "type": "const char*", - "desc": "返回字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "保存字符串缓冲区。" - }, - { - "type": "int", - "name": "len", - "desc": "缓冲区大小。" - }, - { - "type": "double", - "name": "f", - "desc": "要转换的浮点型。" - } - ], - "annotation": {}, - "desc": "将浮点型转换为字符串。", - "name": "tk_ftoa", - "return": { - "type": "const char*", - "desc": "返回字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为长整形的字符串。" - }, - { - "type": "const char**", - "name": "end", - "desc": "对类型char*的对象的引用。" - }, - { - "type": "int", - "name": "base", - "desc": "基数。" - } - ], - "annotation": {}, - "desc": "将字符串转换为长整形。", - "name": "tk_strtol", - "return": { - "type": "long", - "desc": "返回转换后的长整形。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "原字符串。" - } - ], - "annotation": {}, - "desc": "将src所指向的字符串复制到dst。", - "name": "tk_strcpy", - "return": { - "type": "char*", - "desc": "返回目标字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "原字符串。" - }, - { - "type": "size_t", - "name": "len", - "desc": "要复制的字符串个数。" - } - ], - "annotation": {}, - "desc": "将src所指向的字符串复制到dst,最多复制len个字符串,并在[len]位置添加'\\0'。\n\n> 请确保dst的长度>=(len+1)", - "name": "tk_strncpy", - "return": { - "type": "char*", - "desc": "返回目标字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "原字符串。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数。", - "name": "tk_strdup", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "原宽字符串。" - } - ], - "annotation": {}, - "desc": "宽字符串拷贝函数。", - "name": "tk_wstrdup", - "return": { - "type": "wchar_t*", - "desc": "返回指向的复制宽字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "原字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "要复制的字符串个数。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数,最多复制len个字符串。", - "name": "tk_strndup", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - } - ], - "annotation": {}, - "desc": "获取字符串的长度。str为空时返回0。", - "name": "tk_strlen", - "return": { - "type": "uint32_t", - "desc": "返回字符串的长度。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "被追加字符串。" - }, - { - "type": "uint32_t", - "name": "max_len", - "desc": "字符串的最大长度。" - }, - { - "type": "const char*", - "name": "s", - "desc": "要追加的字符串。" - } - ], - "annotation": {}, - "desc": "字符串追加函数。", - "name": "tk_str_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint16_t*", - "name": "buff", - "desc": "buff" - }, - { - "type": "uint16_t", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - } - ], - "annotation": {}, - "desc": "设置数据2字节。", - "name": "tk_memset16", - "return": { - "type": "uint16_t*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "uint32_t*", - "name": "buff", - "desc": "buff。" - }, - { - "type": "void*", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - } - ], - "annotation": {}, - "desc": "设置数据3字节。", - "name": "tk_memset24", - "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "uint32_t*", - "name": "buff", - "desc": "buff。" - }, - { - "type": "uint32_t", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - } - ], - "annotation": {}, - "desc": "设置数据4字节。", - "name": "tk_memset32", - "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "uint16_t*", - "name": "dst", - "desc": "目标" - }, - { - "type": "uint16_t*", - "name": "src", - "desc": "源。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - } - ], - "annotation": {}, - "desc": "拷贝数据2字节。", - "name": "tk_memcpy16", - "return": { - "type": "uint16_t*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "uint32_t*", - "name": "dst", - "desc": "目标" - }, - { - "type": "uint32_t*", - "name": "src", - "desc": "源。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - } - ], - "annotation": {}, - "desc": "拷贝数据4字节。", - "name": "tk_memcpy32", - "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "dst", - "desc": "目标" - }, - { - "type": "void*", - "name": "src", - "desc": "源。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" - }, - { - "type": "uint8_t", - "name": "bpp", - "desc": "单个数据的字节数。" - } - ], - "annotation": {}, - "desc": "已bpp字节为标准拷贝数据。", - "name": "tk_pixel_copy", - "return": { - "type": "void*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "目标字符串。" - }, - { - "type": "size_t", - "name": "size", - "desc": "拷贝字节数。" - }, - { - "type": "const char*", - "name": "format", - "desc": "格式化字符串。" - } - ], - "annotation": {}, - "desc": "将可变参数(...)按照format格式化字符串,并将字符串复制到str中。", - "name": "tk_snprintf", - "return": { - "type": "int", - "desc": "返回格式化后的字符串长度+1。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要输入的字符串。" - }, - { - "type": "const char*", - "name": "format", - "desc": "格式化字符串。" - } - ], - "annotation": {}, - "desc": "从字符串读取格式化输入。", - "name": "tk_sscanf", - "return": { - "type": "int", - "desc": "返回成功匹配和赋值的个数。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "filename", - "desc": "完整的文件名。" - }, - { - "type": "char*", - "name": "str", - "desc": "用于返回文件名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "文件名(str参数)的最大长度。" - } - ], - "annotation": {}, - "desc": "从完整文件名中获取文件名。", - "name": "filename_to_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "filename", - "desc": "完整的文件名。" - }, - { - "type": "char*", - "name": "str", - "desc": "用于返回文件名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "文件名(str参数)的最大长度。" - }, - { - "type": "bool_t", - "name": "remove_extname", - "desc": "是否移除扩展名。" - } - ], - "annotation": {}, - "desc": "从完整文件名中获取文件名。", - "name": "filename_to_name_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "filename", - "desc": "文件名。" - }, - { - "type": "str_t*", - "name": "s", - "desc": "用于返回内容。" - } - ], - "annotation": {}, - "desc": "expand include process instruction to file content: ", - "name": "xml_file_expand_read", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "源字符串。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数。\n> XXX: 要求dst为NULL或内存块的首地址,本函数调用之后,dst可能无效,请保留返回的地址", - "name": "tk_str_copy", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - } - ], - "annotation": {}, - "desc": "空的destroy函数。", - "name": "dummy_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - } - ], - "annotation": {}, - "desc": "缺省的destroy函数。释放data指向的内存。", - "name": "default_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "a", - "desc": "数据a。" - }, - { - "type": "const void*", - "name": "b", - "desc": "数据b。" - } - ], - "annotation": {}, - "desc": "指针比较。", - "name": "pointer_compare", - "return": { - "type": "int", - "desc": "返回0表示相等,返回负数表示小于,返回整数表示大于。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "a", - "desc": "数据a。" - }, - { - "type": "const void*", - "name": "b", - "desc": "数据b。" - } - ], - "annotation": {}, - "desc": "始终返回相等。", - "name": "compare_always_equal", - "return": { - "type": "int", - "desc": "始终返回0。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "名字字符串。" - } - ], - "annotation": {}, - "desc": "判断是否是有效的属性名。", - "name": "tk_is_valid_name", - "return": { - "type": "bool_t", - "desc": "如果名称有效返回TRUE,否则返回FALSE。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要检查字符串。" - }, - { - "type": "const char*", - "name": "prefix", - "desc": "被检查的字符串。" - } - ], - "annotation": {}, - "desc": "检查字符串是否以指定的字符串prefix开头。", - "name": "tk_str_start_with", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是;否则表示不是。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "下划线名字。" - }, - { - "type": "char*", - "name": "out", - "desc": "驼峰名字(保存结果)。" - }, - { - "type": "uint32_t", - "name": "max_out_size", - "desc": "结果最大长度。" - } - ], - "annotation": {}, - "desc": "将下划线名字转成驼峰名字。", - "name": "tk_under_score_to_camel", - "return": { - "type": "const char*", - "desc": "返回T驼峰名字。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "p", - "desc": "指针。" - } - ], - "annotation": {}, - "desc": "将指针转换成int。\n\n>与tk_pointer_from_int配套使用,也就是pointer本身必须就是整数,而不是指针,否则pointer会被截断。", - "name": "tk_pointer_to_int", - "return": { - "type": "int32_t", - "desc": "返回对应的int数据。" - } - }, - { - "params": [ - { - "type": "int32_t", - "name": "v", - "desc": "整数。" - } - ], - "annotation": {}, - "desc": "将int转换成指针。\n\n> 常用于将int类型的数据作为回调函数的ctx。", - "name": "tk_pointer_from_int", - "return": { - "type": "void*", - "desc": "返回对应的指针。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要被转换成大写字母的字符串。" - } - ], - "annotation": {}, - "desc": "将小写字母转换为大写字母。", - "name": "tk_str_toupper", - "return": { - "type": "char*", - "desc": "返回转换后的大写字母字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要被转换成小写字母的字符串。" - } - ], - "annotation": {}, - "desc": "将大写字母转换为小写字母。", - "name": "tk_str_tolower", - "return": { - "type": "char*", - "desc": "返回转换后的小写字母字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "utf8编码的字符串。" - } - ], - "annotation": {}, - "desc": "将utf8字符串拷贝为UCS字符串。", - "name": "tk_wstr_dup_utf8", - "return": { - "type": "wchar_t*", - "desc": "返回UCS字符串(需要调用TKMEM_FREE释放)。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "统计UCS字符串中某个字符出现的次数。", - "name": "tk_wstr_count_c", - "return": { - "type": "uint32_t", - "desc": "返回字符出现的次数。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "img_w", - "desc": "图片宽度。" - }, - { - "type": "uint32_t", - "name": "img_h", - "desc": "图片宽度。" - }, - { - "type": "const char*", - "name": "region", - "desc": "region。" - }, - { - "type": "rect_t*", - "name": "r", - "desc": "返回具体位置。" - } - ], - "annotation": {}, - "desc": "解析子图的区域信息。", - "name": "image_region_parse", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/utils.h", - "desc": "工具类。", - "name": "utils_t", - "annotation": { - "fake": true - }, - "level": 1 - }, { "params": [ { @@ -25828,103 +24753,6 @@ "header": "conf_io/conf_ini.h", "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const wchar_t*", - "name": "in", - "desc": "输入字符串。" - }, - { - "type": "const char*", - "name": "out", - "desc": "输出字符串。" - }, - { - "type": "uint32_t", - "name": "out_size", - "desc": "输出字符串的最大长度。" - } - ], - "annotation": {}, - "desc": "把ucs字符串转成UTF8字符串。", - "name": "tk_utf8_from_utf16", - "return": { - "type": "char*", - "desc": "返回UTF8字符串。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "in", - "desc": "输入字符串。" - }, - { - "type": "uint32_t", - "name": "in_size", - "desc": "输入字符串的长度。" - }, - { - "type": "const char*", - "name": "out", - "desc": "输出字符串。" - }, - { - "type": "uint32_t", - "name": "out_size", - "desc": "输出字符串的最大长度。" - } - ], - "annotation": {}, - "desc": "把ucs字符串转成UTF8字符串。", - "name": "tk_utf8_from_utf16_ex", - "return": { - "type": "char*", - "desc": "返回UTF8字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "str。" - }, - { - "type": "const wchar_t*", - "name": "out", - "desc": "返回结果缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "将char类型转换为wchar_t类型。", - "name": "tk_utf8_to_utf16", - "return": { - "type": "wchar_t*", - "desc": "值。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/utf8.h", - "desc": "wchar_t和char类型转换接口。\n\n示例:\n\n```c\nconst char* str = \"hello\";\nconst wchar_t* wstr = L\"hello\";\nchar res_str[128];\nwchar_t res_wstr[128];\n\ntk_utf8_to_utf16(str, res_wstr, ARRAY_SIZE(res_wstr));\ntk_utf8_from_utf16(wstr, res_str, ARRAY_SIZE(res_str));\n```", - "name": "utf8_t", - "annotation": { - "fake": true - }, - "level": 1 - }, { "params": [ { @@ -26912,362 +25740,6 @@ "name": "conf_node_t", "level": 1 }, - { - "type": "enum", - "desc": "函数返回值常量定义。", - "consts": [ - { - "desc": "成功。", - "name": "RET_OK" - }, - { - "desc": "Out of memory。", - "name": "RET_OOM" - }, - { - "desc": "失败。", - "name": "RET_FAIL" - }, - { - "desc": "没有实现/不支持。", - "name": "RET_NOT_IMPL" - }, - { - "desc": "退出。通常用于主循环。", - "name": "RET_QUIT" - }, - { - "desc": "找到。", - "name": "RET_FOUND" - }, - { - "desc": "对象忙。", - "name": "RET_BUSY" - }, - { - "desc": "移出。通常用于定时器。", - "name": "RET_REMOVE" - }, - { - "desc": "重复。通常用于定时器。", - "name": "RET_REPEAT" - }, - { - "desc": "没找到。", - "name": "RET_NOT_FOUND" - }, - { - "desc": "操作完成。", - "name": "RET_DONE" - }, - { - "desc": "停止后续操作。", - "name": "RET_STOP" - }, - { - "desc": "跳过当前项。", - "name": "RET_SKIP" - }, - { - "desc": "继续后续操作。", - "name": "RET_CONTINUE" - }, - { - "desc": "对象属性变化。", - "name": "RET_OBJECT_CHANGED" - }, - { - "desc": "集合数目变化。", - "name": "RET_ITEMS_CHANGED" - }, - { - "desc": "无效参数。", - "name": "RET_BAD_PARAMS" - }, - { - "desc": "超时。", - "name": "RET_TIMEOUT" - }, - { - "desc": "CRC错误。", - "name": "RET_CRC" - }, - { - "desc": "IO错误。", - "name": "RET_IO" - }, - { - "desc": "End of Stream", - "name": "RET_EOS" - }, - { - "desc": "没有改变。", - "name": "RET_NOT_MODIFIED" - } - ], - "header": "tkc/types_def.h", - "name": "ret_t", - "prefix": "RET_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - }, - { - "type": "char*", - "name": "separtor", - "desc": "分隔字符。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化tokenizer对象。", - "name": "tokenizer_init", - "return": { - "type": "tokenizer_t*", - "desc": "tokenizer对象本身。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - }, - { - "type": "char*", - "name": "separtor", - "desc": "分隔字符。" - }, - { - "type": "char*", - "name": "single_char_token", - "desc": "单字符token。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化tokenizer对象。", - "name": "tokenizer_init_ex", - "return": { - "type": "tokenizer_t*", - "desc": "tokenizer对象本身。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - } - ], - "annotation": {}, - "desc": "是否还有下一个token。", - "name": "tokenizer_has_more", - "return": { - "type": "bool_t", - "desc": "还有下一个token返回TRUE,否则返回FALSE。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - } - ], - "annotation": {}, - "desc": "获取下一个token。", - "name": "tokenizer_next", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符集。" - } - ], - "annotation": {}, - "desc": "获取下一个token,该token直到遇到指定的char。", - "name": "tokenizer_next_until", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符集。" - } - ], - "annotation": {}, - "desc": "获取下一个expr,该expr直到遇到指定的char。", - "name": "tokenizer_next_expr_until", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "int", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": {}, - "desc": "获取下一个token,并转换成int。", - "name": "tokenizer_next_int", - "return": { - "type": "char*", - "desc": "成功返回token的int值,失败返回缺省值。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "float", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": {}, - "desc": "获取下一个token,并转换成float。", - "name": "tokenizer_next_float", - "return": { - "type": "char*", - "desc": "成功返回token的float值,失败返回缺省值。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - } - ], - "annotation": {}, - "desc": "重置tokenizer。", - "name": "tokenizer_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "str", - "desc": "字符串。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "size", - "desc": "字符串的长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "cursor", - "desc": "当前位置。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "separtor", - "desc": "分隔字符串。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "single_char_token", - "desc": "单字符的token。", - "type": "char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/tokenizer.h", - "desc": "从字符串中解析出一个一个的token。\n\n```c\ntokenizer_t tokenizer;\ntokenizer_t* t = tokenizer_init(&tokenizer, \"20,111.2,22.3,333.3,44,555.5\", 0xffffff, \",\");\n\nwhile(tokenizer_has_more(t)) {\ndouble v = tokenizer_next_float(t, 0);\nlog_debug(\"%lf\\n\", v);\n}\n\ntokenizer_deinit(t);\n```", - "name": "tokenizer_t", - "level": 1 - }, { "params": [ { @@ -27569,246 +26041,10 @@ { "params": [], "annotation": { - "constructor": true + "static": true }, - "desc": "获取缺省的定时器管理器。", - "name": "timer_manager", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager_t", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的定时器管理器。", - "name": "timer_manager_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_get_time_t", - "name": "get_time", - "desc": "获取当前时间的函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建定时器管理器。", - "name": "timer_manager_create", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "timer_get_time_t", - "name": "get_time", - "desc": "获取当前时间的函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化定时器管理器。", - "name": "timer_manager_init", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "析构定时器管理器。", - "name": "timer_manager_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "析构并释放定时器管理器。", - "name": "timer_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "timer_func_t*", - "name": "on_timer", - "desc": "timer回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "timer回调函数的上下文。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "时间。" - } - ], - "annotation": {}, - "desc": "添加定时器。", - "name": "timer_manager_add", - "return": { - "type": "uint32_t", - "desc": "返回timer的ID,TK_INVALID_ID表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t", - "name": "timer_id", - "desc": "timer_id。" - } - ], - "annotation": {}, - "desc": "根据id删除定时器。", - "name": "timer_manager_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t*", - "name": "timer_id", - "desc": "timer_id。" - } - ], - "annotation": {}, - "desc": "重置定时器。", - "name": "timer_manager_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t", - "name": "timer_id", - "desc": "timer_id" - } - ], - "annotation": {}, - "desc": "查找指定ID的定时器。", - "name": "timer_manager_find", - "return": { - "type": "timer_info_t*", - "desc": "返回timer的信息。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "返回定时器的个数。", - "name": "timer_manager_count", - "return": { - "type": "uint32_t", - "desc": "返回timer的个数。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "返回最近的定时器到期时间。", - "name": "timer_manager_next_time", - "return": { - "type": "uint64_t", - "desc": "返回最近的timer到期时间。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。。" - }, - { - "type": "timer_info_t*", - "name": "timer", - "desc": "timer对象。" - } - ], - "annotation": {}, - "desc": "追加定时器。", - "name": "timer_manager_append", + "desc": "初始化AWTK扩展控件。", + "name": "tk_ext_widgets_init", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -27817,12 +26053,76 @@ ], "events": [], "properties": [], - "header": "tkc/timer_manager.h", - "desc": "定时器管理器。", - "name": "timer_manager_t", - "annotation": { - "scriptable": true - }, + "header": "ext_widgets/ext_widgets.h", + "desc": "", + "name": "tk_ext_widgets_t", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "name", + "desc": "名称。", + "type": "char*", + "annotation": { + "readable": true + } + }, + { + "name": "is_dir", + "desc": "是否是目录。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "is_reg_file", + "desc": "是否是常规文件。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "size", + "desc": "文件大小。", + "type": "uint64_t", + "annotation": { + "readable": true + } + }, + { + "name": "atime", + "desc": "最后一次访问时间。", + "type": "uint64_t", + "annotation": { + "readable": true + } + }, + { + "name": "mtime", + "desc": "最后修改时间。", + "type": "uint64_t", + "annotation": { + "readable": true + } + }, + { + "name": "ctime", + "desc": "创建时间。", + "type": "uint64_t", + "annotation": { + "readable": true + } + } + ], + "header": "file_browser/file_browser.h", + "desc": "文件或目录的信息。", + "name": "fb_item_t", "level": 1 }, { @@ -27831,37 +26131,605 @@ { "params": [], "annotation": { - "scriptable": true, - "static": true + "constructor": true }, - "desc": "获取当前时间(秒)。", - "name": "time_now_s", + "desc": "创建file_browser对象", + "name": "file_browser_create", "return": { - "type": "uint64_t", - "desc": "返回当前时间(秒)。" + "type": "file_browser_t*", + "desc": "对象。" } }, { - "params": [], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取当前时间(毫秒)。", - "name": "time_now_ms", + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "const char*", + "name": "cwd", + "desc": "当前目录。" + } + ], + "annotation": {}, + "desc": "设置当前目录。", + "name": "file_browser_set_cwd", "return": { - "type": "uint64_t", - "desc": "返回当前时间(毫秒)。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "当前目录下的子目录名。" + } + ], + "annotation": {}, + "desc": "在当前目录下创建指定子目录。", + "name": "file_browser_create_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "当前目录下的文件名。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "文件内容。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "文件内容的长度。" + } + ], + "annotation": {}, + "desc": "在当前目录下创建指定文件。", + "name": "file_browser_create_file", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "当前目录下的子目录名/文件名。" + } + ], + "annotation": {}, + "desc": "删除当前目录下的指定子目录或文件。", + "name": "file_browser_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "const char*", + "name": "dir", + "desc": "当前目录下的子目录名。" + } + ], + "annotation": {}, + "desc": "进入当前目录下的指定子目录。", + "name": "file_browser_enter", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + } + ], + "annotation": {}, + "desc": "返回上一级目录。", + "name": "file_browser_up", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + } + ], + "annotation": {}, + "desc": "刷新。", + "name": "file_browser_refresh", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "tk_filter_t", + "name": "filter", + "desc": "过滤函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "过滤函数的上下文。" + } + ], + "annotation": {}, + "desc": "设置过滤函数。", + "name": "file_browser_set_filter", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "tk_compare_t", + "name": "compare", + "desc": "排序用的比较函数。" + } + ], + "annotation": {}, + "desc": "设置排序用的比较函数。", + "name": "file_browser_set_compare", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "bool_t", + "name": "ascending", + "desc": "按升序排。" + } + ], + "annotation": {}, + "desc": "按名称排序。", + "name": "file_browser_sort_by_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "bool_t", + "name": "ascending", + "desc": "按升序排。" + } + ], + "annotation": {}, + "desc": "按类型排序。", + "name": "file_browser_sort_by_type", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "bool_t", + "name": "ascending", + "desc": "按升序排。" + } + ], + "annotation": {}, + "desc": "按大小排序。", + "name": "file_browser_sort_by_size", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "bool_t", + "name": "ascending", + "desc": "按升序排。" + } + ], + "annotation": {}, + "desc": "按修改时间排序。", + "name": "file_browser_sort_by_mtime", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + } + ], + "annotation": {}, + "desc": "获取当前目录下文件项个数。", + "name": "file_browser_get_items_nr", + "return": { + "type": "uint32_t", + "desc": "返回当前目录下文件项个数。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "uint32_t", + "name": "index", + "desc": "序数。" + } + ], + "annotation": {}, + "desc": "获取指定项序数的项目。", + "name": "file_browser_get_item", + "return": { + "type": "fb_item_t*", + "desc": "返回指定项序数的项目。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + }, + { + "type": "bool_t", + "name": "ignore_hidden_files", + "desc": "是否忽略隐藏文件。" + } + ], + "annotation": {}, + "desc": "设置是否忽略隐藏文件。", + "name": "file_browser_set_ignore_hidden_files", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_browser_t*", + "name": "fb", + "desc": "file browser对象。" + } + ], + "annotation": {}, + "desc": "销毁file_browser对象", + "name": "file_browser_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "cwd", + "desc": "当前路径。", + "type": "char*", + "annotation": { + "readable": true + } + } + ], + "header": "file_browser/file_browser.h", + "desc": "文件浏览器模型。", + "name": "file_browser_t", + "level": 1 + }, + { + "type": "enum", + "desc": "指示器默认绘制的类型。", + "consts": [ + { + "desc": "自动选择。", + "name": "INDICATOR_DEFAULT_PAINT_AUTO" + }, + { + "desc": "实心圆点指示器,当前项填充selected_fg_color,其他填充fg_color。", + "name": "INDICATOR_DEFAULT_PAINT_FILL_DOT" + }, + { + "desc": "镂空圆点指示器,当前项填充selected_fg_color,其他镂空fg_color。", + "name": "INDICATOR_DEFAULT_PAINT_STROKE_DOT" + }, + { + "desc": "实心矩形指示器,当前项填充selected_fg_color,其他填充fg_color。", + "name": "INDICATOR_DEFAULT_PAINT_FILL_RECT" + }, + { + "desc": "镂空矩形指示器,当前项填充selected_fg_color,其他镂空fg_color。", + "name": "INDICATOR_DEFAULT_PAINT_STROKE_RECT" + } + ], + "header": "slide_view/slide_indicator.h", + "name": "indicator_default_paint_t", + "prefix": "INDICATOR_DEFAULT_PAINT_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "缓存不够时丢弃数据的策略。", + "consts": [ + { + "desc": "丢弃旧的数据。", + "name": "DATA_DISCARD_OLD" + }, + { + "desc": "丢弃新的数据。", + "name": "DATA_DISCARD_NEW" + } + ], + "header": "misc/ostream_retry.h", + "name": "data_discard_policy_t", + "prefix": "DATA_DISCARD_", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "fd", + "desc": "fd." + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_serial_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" } } ], "events": [], "properties": [], - "header": "tkc/time_now.h", - "desc": "获取当前时间的函数。\n这里的当前时间是相对的,在嵌入式系统一般相对于开机时间。\n它本身并没有任何意义,一般用来计算时间间隔,如实现定时器和动画等等。", - "name": "time_now_t", + "header": "serial/ostream_serial.h", + "desc": "基于串口实现的输出流。\n\ninput stream base on fd", + "name": "tk_ostream_serial_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t*", + "name": "data", + "desc": "bsvg数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "bsvg数据长度。" + }, + { + "type": "str_t*", + "name": "str", + "desc": "用于返回svg数据。" + } + ], + "annotation": {}, + "desc": "bsvg to svg", + "name": "bsvg_to_svg", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "xml", + "desc": "svg数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "svg数据长度。" + }, + { + "type": "uint32_t*", + "name": "out", + "desc": "用于返回bsvg数据。" + }, + { + "type": "uint32_t*", + "name": "out_size", + "desc": "bsvg数据长度。" + } + ], + "annotation": {}, + "desc": "svg to bsvg", + "name": "svg_to_bsvg", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "action的容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建action_queue对象。", + "name": "action_queue_create", + "return": { + "type": "action_queue_t*", + "desc": "action_queue对象。" + } + }, + { + "params": [ + { + "type": "action_queue_t*", + "name": "q", + "desc": "action_queue对象。" + }, + { + "type": "qaction_t**", + "name": "action", + "desc": "用于返回action对象。" + } + ], + "annotation": {}, + "desc": "接收一个请求。", + "name": "action_queue_recv", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_queue_t*", + "name": "q", + "desc": "action_queue对象。" + }, + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + } + ], + "annotation": {}, + "desc": "发送一个请求。", + "name": "action_queue_send", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_queue_t*", + "name": "q", + "desc": "action_queue对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "action_queue_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "svg/bsvg_to_svg.h", + "desc": "", + "name": "svg_helper_t", "annotation": { - "scriptable": true, "fake": true }, "level": 1 @@ -27872,61 +26740,538 @@ { "params": [ { - "type": "tk_thread_entry_t", - "name": "entry", - "desc": "线程函数。" + "type": "bsvg_t*", + "name": "", + "desc": "。" }, { - "type": "void*", - "name": "args", - "desc": "线程函数的上下文。" + "type": "const uint32_t*", + "name": "data", + "desc": "svg数据。" + }, + { + "type": "size", + "name": "size", + "desc": "data长度。" } ], "annotation": {}, - "desc": "创建thread对象。", - "name": "tk_thread_create", + "desc": "初始化bsvg对象。", + "name": "bsvg_init", "return": { - "type": "tk_thread_t*", - "desc": "thread对象。" + "type": "bsvg_t*", + "desc": "返回解析后的svg。" + } + } + ], + "events": [], + "properties": [], + "header": "svg/bsvg.h", + "desc": "SVG的二进制格式。", + "name": "bsvg_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint16_t", + "name": "max_thread_nr", + "desc": "最大线程数。" + }, + { + "type": "uint16_t", + "name": "min_idle_nr", + "desc": "最小空闲线程数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建action_thread_pool对象。", + "name": "action_thread_pool_create", + "return": { + "type": "action_thread_pool_t*", + "desc": "action_thread_pool对象。" } }, { "params": [ { - "type": "tk_thread_t*", + "type": "action_thread_pool_t*", + "name": "thread_pool", + "desc": "action_thread_pool对象。" + }, + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + } + ], + "annotation": {}, + "desc": "执行action。", + "name": "action_thread_pool_exec", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_thread_pool_t*", + "name": "thread_pool", + "desc": "action_thread_pool对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "action_thread_pool_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "max_thread_nr", + "desc": "最大线程数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "min_idle_nr", + "desc": "最小空闲线程数", + "type": "uint32_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/action_thread_pool.h", + "desc": "action线程池。", + "name": "action_thread_pool_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建action_thread对象。", + "name": "action_thread_create", + "return": { + "type": "action_thread_t*", + "desc": "action_thread对象。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "queue", + "desc": "queue对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建action_thread对象。", + "name": "action_thread_create_with_queue", + "return": { + "type": "action_thread_t*", + "desc": "action_thread对象。" + } + }, + { + "params": [ + { + "type": "action_thread_t*", "name": "thread", - "desc": "thread对象。" + "desc": "action_thread对象。" + }, + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + } + ], + "annotation": {}, + "desc": "让线程执行action。", + "name": "action_thread_exec", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" + }, + { + "type": "action_thread_on_idle_t", + "name": "on_idle", + "desc": "空闲时的回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], + "annotation": {}, + "desc": "设置空闲时的回调函数。", + "name": "action_thread_set_on_idle", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" + }, + { + "type": "action_thread_on_quit_t", + "name": "on_quit", + "desc": "退出时的回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], + "annotation": {}, + "desc": "设置退出时的回调函数。", + "name": "action_thread_set_on_quit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "action_thread_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "thread", + "desc": "线程对象。", + "type": "tk_thread_t*", + "annotation": { + "readable": true + } + }, + { + "name": "queue", + "desc": "action queue。", + "type": "waitable_action_queue_t*", + "annotation": { + "readable": true + } + }, + { + "name": "executed_actions_nr", + "desc": "已经执行action的个数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/action_thread.h", + "desc": "执行action的线程。\n\n> 每个线程都有一个action queue,可以是共享的queue,也可以是私有的queue。", + "name": "action_thread_t", + "level": 1 + }, + { + "type": "enum", + "desc": "资源类型常量定义。", + "consts": [ + { + "desc": "无效资源。", + "name": "ASSET_TYPE_NONE" + }, + { + "desc": "字体资源。", + "name": "ASSET_TYPE_FONT" + }, + { + "desc": "图片资源。", + "name": "ASSET_TYPE_IMAGE" + }, + { + "desc": "主题资源。", + "name": "ASSET_TYPE_STYLE" + }, + { + "desc": "UI数据资源。", + "name": "ASSET_TYPE_UI" + }, + { + "desc": "XML数据资源。", + "name": "ASSET_TYPE_XML" + }, + { + "desc": "字符串数据资源。", + "name": "ASSET_TYPE_STRINGS" + }, + { + "desc": "JS等脚本资源。", + "name": "ASSET_TYPE_SCRIPT" + }, + { + "desc": "其它数据资源。", + "name": "ASSET_TYPE_DATA" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_type_t", + "prefix": "ASSET_TYPE_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "字体资源类型定义。", + "consts": [ + { + "desc": "无效字体。", + "name": "ASSET_TYPE_FONT_NONE" + }, + { + "desc": "TTF字体。", + "name": "ASSET_TYPE_FONT_TTF" + }, + { + "desc": "位图字体。", + "name": "ASSET_TYPE_FONT_BMP" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_font_type_t", + "prefix": "ASSET_FONT_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "数据资源类型定义。", + "consts": [ + { + "desc": "未知数据类型。", + "name": "ASSET_TYPE_DATA_NONE" + }, + { + "desc": "文本数据类型。", + "name": "ASSET_TYPE_DATA_TEXT" + }, + { + "desc": "二进制数据类型。", + "name": "ASSET_TYPE_DATA_BIN" + }, + { + "desc": "JSON数据类型。", + "name": "ASSET_TYPE_DATA_JSON" + }, + { + "desc": "通用数据类型。", + "name": "ASSET_TYPE_DATA_DAT" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_data_type_t", + "prefix": "ASSET_DATA_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "脚本资源类型定义。", + "consts": [ + { + "desc": "未知脚本类型。", + "name": "ASSET_TYPE_SCRIPT_NONE" + }, + { + "desc": "JS脚本类型。", + "name": "ASSET_TYPE_SCRIPT_JS" + }, + { + "desc": "LUA脚本类型。", + "name": "ASSET_TYPE_SCRIPT_LUA" + }, + { + "desc": "Python脚本类型。", + "name": "ASSET_TYPE_SCRIPT_PYTHON" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_script_type_t", + "prefix": "ASSET_SCRIPT_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "图片资源类型定义。", + "consts": [ + { + "desc": "未知图片类型。", + "name": "ASSET_TYPE_IMAGE_NONE" + }, + { + "desc": "Raw图片类型。", + "name": "ASSET_TYPE_IMAGE_RAW" + }, + { + "desc": "位图图片类型。", + "name": "ASSET_TYPE_IMAGE_BMP" + }, + { + "desc": "PNG图片类型。", + "name": "ASSET_TYPE_IMAGE_PNG" + }, + { + "desc": "JPG图片类型。", + "name": "ASSET_TYPE_IMAGE_JPG" + }, + { + "desc": "BSVG图片类型。", + "name": "ASSET_TYPE_IMAGE_BSVG" + }, + { + "desc": "GIF图片类型。", + "name": "ASSET_TYPE_IMAGE_GIF" + }, + { + "desc": "WEBP图片类型。", + "name": "ASSET_TYPE_IMAGE_WEBP" + }, + { + "desc": "LZ4压缩的图片类型。", + "name": "ASSET_TYPE_IMAGE_LZ4" + }, + { + "desc": "其它图片类型。", + "name": "ASSET_TYPE_IMAGE_OTHER" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_image_type_t", + "prefix": "ASSET_IMAGE_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "UI资源类型定义。", + "consts": [ + { + "desc": "无效UI类型。", + "name": "ASSET_TYPE_UI_NONE" + }, + { + "desc": "二进制的UI类型。", + "name": "ASSET_TYPE_UI_BIN" + }, + { + "desc": "XML格式的UI类型。", + "name": "ASSET_TYPE_UI_XML" + } + ], + "header": "tkc/asset_info.h", + "name": "asset_ui_type_t", + "prefix": "ASSET_UI_TYPE_", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/asset_info.h", + "desc": "预加载资源的描述信息。", + "name": "preload_res_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint16_t", + "name": "type", + "desc": "资源的类型。" + }, + { + "type": "uint16_t", + "name": "subtype", + "desc": "资源的子类型。" }, { "type": "const char*", "name": "name", - "desc": "名称。" - } - ], - "annotation": {}, - "desc": "设置线程的名称。\n\n> 需要在调用start之前调用本函数。", - "name": "tk_thread_set_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "desc": "资源的名称。" }, { "type": "uint32_t", - "name": "stack_size", - "desc": "栈的大小。" + "name": "size", + "desc": "资源的数据长度(用于分配空间)。" } ], - "annotation": {}, - "desc": "设置线程的栈大小。\n\n> 需要在调用start之前调用本函数。", - "name": "tk_thread_set_stack_size", + "annotation": { + "constructor": true + }, + "desc": "创建asset_info对象。\n\n> 主要供脚本语言使用。", + "name": "asset_info_create", + "return": { + "type": "asset_info_t*", + "desc": "asset_info对象。" + } + }, + { + "params": [ + { + "type": "asset_info_t*", + "name": "info", + "desc": "asset_info对象。" + } + ], + "annotation": { + "deconstructor": true + }, + "desc": "销毁asset_info对象。", + "name": "asset_info_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -27935,19 +27280,248 @@ { "params": [ { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "type": "asset_info_t*", + "name": "info", + "desc": "asset_info对象。" + } + ], + "annotation": {}, + "desc": "减少asset_info对象的引用计数。", + "name": "asset_info_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "asset_info_t*", + "name": "info", + "desc": "asset_info对象。" + } + ], + "annotation": {}, + "desc": "增加asset_info对象的引用计数。", + "name": "asset_info_ref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "未格式化名字。" + } + ], + "annotation": {}, + "desc": "把资源名字格式化为符合标准长度的字符串。", + "name": "asset_info_get_formatted_name", + "return": { + "type": "ret_t", + "desc": "返回格式化后的名字。" + } + } + ], + "events": [], + "properties": [ + { + "name": "type", + "desc": "类型。", + "type": "uint16_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "subtype", + "desc": "子类型。", + "type": "uint8_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "is_in_rom", + "desc": "资源是否在ROM中。", + "type": "uint8_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "size", + "desc": "大小。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "refcount", + "desc": "引用计数。\nis\\_in\\_rom == FALSE时才有效。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "name", + "desc": "名称。", + "type": "char*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/asset_info.h", + "desc": "单个资源的描述信息。", + "name": "asset_info_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "async_exec_t", + "name": "exec", + "desc": "需要异步支持的函数。" + }, + { + "type": "async_on_result_t", + "name": "on_result", + "desc": "返回执行结果(可选)" + }, + { + "type": "void*", + "name": "ctx", + "desc": "两个回调函数的上下文。" + } + ], + "annotation": { + "static": true + }, + "desc": "异步执行exec函数,执行完成后,在后台线程调用on_result函数。", + "name": "async_call", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true + }, + "desc": "全局初始化。", + "name": "async_call_init", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true + }, + "desc": "全局~初始化。", + "name": "async_call_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/async.h", + "desc": "异步请求。", + "name": "async_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "uint8_t*", + "name": "data", + "desc": "缓冲区。" + }, + { + "type": "uint16_t", + "name": "capacity", + "desc": "缓冲区的容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始wbuffer对象。", + "name": "wbuffer_init", + "return": { + "type": "wbuffer_t*", + "desc": "wbuffer对象本身。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始wbuffer对象,容量不够时是否支持自动扩展,使用完成后需要调用wbuffer\\_deinit释放资源。", + "name": "wbuffer_init_extendable", + "return": { + "type": "wbuffer_t*", + "desc": "wbuffer对象本身。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" }, { "type": "uint32_t", - "name": "priority", - "desc": "优先级。" + "name": "capacity", + "desc": "缓冲区的容量。" } ], "annotation": {}, - "desc": "设置线程的优先级。\n\n> 部分平台支持。", - "name": "tk_thread_set_priority", + "desc": "扩展缓冲区至指定的大小。", + "name": "wbuffer_extend_capacity", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -27956,14 +27530,14 @@ { "params": [ { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" } ], "annotation": {}, - "desc": "启动线程。", - "name": "tk_thread_start", + "desc": "释放资源。", + "name": "wbuffer_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -27972,14 +27546,19 @@ { "params": [ { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "int32_t", + "name": "delta", + "desc": "跳过的偏移量,正数往前负数往回跳。" } ], "annotation": {}, - "desc": "等待线程退出。\n必须调用 tk_thread_destroy 函数来释放线程资源,以免出现内存泄漏的问题。", - "name": "tk_thread_join", + "desc": "跳过指定的长度。", + "name": "wbuffer_skip", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -27988,30 +27567,4827 @@ { "params": [ { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "uint8_t", + "name": "value", + "desc": "要写入的数据。" } ], "annotation": {}, - "desc": "获取线程的参数。", - "name": "tk_thread_get_args", + "desc": "写入uint8数据。", + "name": "wbuffer_write_uint8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "uint16_t", + "name": "value", + "desc": "要写入的数据。" + } + ], + "annotation": {}, + "desc": "写入uint16数据。", + "name": "wbuffer_write_uint16", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "uint32_t", + "name": "value", + "desc": "要写入的数据。" + } + ], + "annotation": {}, + "desc": "写入uint32数据。", + "name": "wbuffer_write_uint32", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "float_t", + "name": "value", + "desc": "要写入的数据。" + } + ], + "annotation": {}, + "desc": "写入float数据。", + "name": "wbuffer_write_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "void*", + "name": "data", + "desc": "要写入的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "要写入的数据长度。" + } + ], + "annotation": {}, + "desc": "写入指定长度的二进制数据。", + "name": "wbuffer_write_binary", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "char*", + "name": "data", + "desc": "要写入的字符串。" + } + ], + "annotation": {}, + "desc": "写入字符串。", + "name": "wbuffer_write_string", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wbuffer_t*", + "name": "wbuffer", + "desc": "wbuffer对象。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "空间大小。" + } + ], + "annotation": {}, + "desc": "是否还有空间。", + "name": "wbuffer_has_room", + "return": { + "type": "bool_t", + "desc": "返回FALSE表示无,否则表示有。" + } + } + ], + "events": [], + "properties": [ + { + "name": "data", + "desc": "数据缓冲区。用于保存写入的数据。", + "type": "uint8_t*", + "annotation": { + "readable": true + } + }, + { + "name": "cursor", + "desc": "当前写入位置。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "数据缓冲区最大容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "extendable", + "desc": "容量不够时是否支持自动扩展。", + "type": "bool_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/buffer.h", + "desc": "Write Buffer。用于数据打包。\n\n示例:\n\n```c\nuint8_t buff[128];\nwbuffer_t wbuffer;\nrbuffer_t rbuffer;\nconst char* str = NULL;\nwbuffer_init(&wbuffer, buff, sizeof(buff));\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nrbuffer_init(&rbuffer, wbuffer.data, wbuffer.cursor);\nrbuffer_read_string(&rbuffer, &str);\n```\n\n```c\nwbuffer_t wbuffer;\nwbuffer_init_extendable(&wbuffer);\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nwbuffer_deinit(&wbuffer);\n```\n> 如果初始化为extendable,则最后需要调用wbuffer\\_deinit释放资源。", + "name": "wbuffer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint8_t*", + "name": "data", + "desc": "缓冲区。" + }, + { + "type": "uint16_t", + "name": "capacity", + "desc": "缓冲区的容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始rbuffer对象。", + "name": "rbuffer_init", + "return": { + "type": "rbuffer_t*", + "desc": "rbuffer对象本身。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + } + ], + "annotation": {}, + "desc": "判断是否还有数据可读。", + "name": "rbuffer_has_more", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示还有数据可读,否则表示无数据可读。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "int32_t", + "name": "offset", + "desc": "跳过的偏移量,正数往前负数往回跳。" + } + ], + "annotation": {}, + "desc": "跳过指定的长度。", + "name": "rbuffer_skip", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint8_t*", + "name": "value", + "desc": "返回读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint8数据。", + "name": "rbuffer_read_uint8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint16_t*", + "name": "value", + "desc": "读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint16数据。", + "name": "rbuffer_read_uint16", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint32_t*", + "name": "value", + "desc": "返回读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint32数据。", + "name": "rbuffer_read_uint32", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "float_t*", + "name": "value", + "desc": "返回读取的数据。" + } + ], + "annotation": {}, + "desc": "读取float数据。", + "name": "rbuffer_read_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "void*", + "name": "data", + "desc": "返回读取的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "读取的数据长度。" + } + ], + "annotation": {}, + "desc": "读取指定长度的二进制数据。", + "name": "rbuffer_read_binary", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "char**", + "name": "str", + "desc": "返回字符串。" + } + ], + "annotation": {}, + "desc": "读取字符串。", + "name": "rbuffer_read_string", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint8_t*", + "name": "value", + "desc": "返回读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint8数据,但不改变cursor的位置。", + "name": "rbuffer_peek_uint8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint16_t*", + "name": "value", + "desc": "返回读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint16数据,但不改变cursor的位置。", + "name": "rbuffer_peek_uint16", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rbuffer_t*", + "name": "rbuffer", + "desc": "rbuffer对象。" + }, + { + "type": "uint32_t*", + "name": "value", + "desc": "读取的数据。" + } + ], + "annotation": {}, + "desc": "读取uint32数据,但不改变cursor的位置。", + "name": "rbuffer_peek_uint32", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "data", + "desc": "数据缓冲区。", + "type": "uint8_t*", + "annotation": { + "readable": true + } + }, + { + "name": "cursor", + "desc": "当前读取位置。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "缓存区的容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/buffer.h", + "desc": "Read Buffer。用于数据解包。\n\n示例:\n\n```c\nuint8_t buff[128];\nwbuffer_t wbuffer;\nrbuffer_t rbuffer;\nconst char* str = NULL;\nwbuffer_init(&wbuffer, buff, sizeof(buff));\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nrbuffer_init(&rbuffer, wbuffer.data, wbuffer.cursor);\nrbuffer_read_string(&rbuffer, &str);\n```", + "name": "rbuffer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "color", + "desc": "字符串格式的颜色。" + } + ], + "annotation": { + "static": true + }, + "desc": "把字符串格式的颜色转换成color\\_t对象。\n\n目前支持下列格式:\n\n* 16进制格式。如:\"#112233\"\n* 颜色名称格式。如:\"green\"\n* rgb格式。如:\"rgb(11,22,33)\"\n* rgba格式。如:\"rgba(11,22,33,0.5)\"", + "name": "color_parse", "return": { "type": "void*", - "desc": "返回线程的参数。" + "desc": "返回color_t对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/color_parser.h", + "desc": "颜色解析相关函数。\n\n示例:\n\n```c\ncolor_t c;\nc = color_parse(\"#112233\");\nc = color_parse(\"white\");\nc = color_parse(\"rgb(11,22,33)\");\nc = color_parse(\"rgba(11,22,33,0.5)\");\n```", + "name": "color_parser_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "r", + "desc": "红色。", + "type": "uint8_t", + "annotation": { + "readable": true, + "writable": true + } + }, + { + "name": "g", + "desc": "绿色。", + "type": "uint8_t", + "annotation": { + "readable": true, + "writable": true + } + }, + { + "name": "b", + "desc": "蓝色。", + "type": "uint8_t", + "annotation": { + "readable": true, + "writable": true + } + }, + { + "name": "a", + "desc": "alpha。", + "type": "uint8_t", + "annotation": { + "readable": true, + "writable": true + } + } + ], + "header": "tkc/color.h", + "desc": "颜色的四个通道。", + "name": "rgba_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint8_t", + "name": "r", + "desc": "红色。" + }, + { + "type": "uint8_t", + "name": "g", + "desc": "绿色。" + }, + { + "type": "uint8_t", + "name": "b", + "desc": "蓝色。" + }, + { + "type": "uint8_t", + "name": "a", + "desc": "alpha。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化颜色对象。", + "name": "color_init", + "return": { + "type": "color_t", + "desc": "颜色对象。" } }, { "params": [ { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" + "type": "uint8_t", + "name": "r", + "desc": "红色通道。" + }, + { + "type": "uint8_t", + "name": "b", + "desc": "蓝色通道。" + }, + { + "type": "uint8_t", + "name": "g", + "desc": "绿色通道。" + }, + { + "type": "uint8_t", + "name": "a", + "desc": "alpha通道。" + } + ], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建color对象。\n\n> 主要供脚本语言使用。", + "name": "color_create", + "return": { + "type": "color_t*", + "desc": "color对象。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "css类似的颜色值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "创建color对象。\n\n> 主要供脚本语言使用。", + "name": "color_from_str", + "return": { + "type": "color_t*", + "desc": "color对象。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取红色通道的值。\n\n> 主要供脚本语言使用。", + "name": "color_r", + "return": { + "type": "uint8_t", + "desc": "返回红色通道的值。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取绿色通道的值。\n\n> 主要供脚本语言使用。", + "name": "color_g", + "return": { + "type": "uint8_t", + "desc": "返回绿色通道的值。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取蓝色通道的值。\n\n> 主要供脚本语言使用。", + "name": "color_b", + "return": { + "type": "uint8_t", + "desc": "返回蓝色通道的值。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取alpha通道的值。\n\n> 主要供脚本语言使用。", + "name": "color_a", + "return": { + "type": "uint8_t", + "desc": "返回alpha通道的值。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "color", + "desc": "color对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为color对象。\n\n> 供脚本语言使用。", + "name": "color_cast", + "return": { + "type": "color_t*", + "desc": "color对象。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "销毁color对象。\n> 主要供脚本语言使用。", + "name": "color_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + }, + { + "type": "char*", + "name": "str", + "desc": "内存。" } ], "annotation": {}, - "desc": "销毁thread对象。\n在销毁对象前必须调用 tk_thread_join 函数等待退出线程", - "name": "tk_thread_destroy", + "desc": "获取16进制格式表示的颜色", + "name": "color_hex_str", + "return": { + "type": "char*", + "desc": "获取16进制字符串表示的颜色。" + } + }, + { + "params": [ + { + "type": "color_t*", + "name": "c", + "desc": "color对象。" + }, + { + "type": "char*", + "name": "str", + "desc": "内存。" + } + ], + "annotation": {}, + "desc": "获取rgba格式表示的颜色", + "name": "color_rgba_str", + "return": { + "type": "char*", + "desc": "获取rgba格式表示的颜色。" + } + } + ], + "events": [], + "properties": [ + { + "name": "rgba", + "desc": "颜色的RGBA值。", + "type": "rgba_t", + "annotation": { + "readable": true, + "writable": true + } + }, + { + "name": "color", + "desc": "颜色的数值。", + "type": "uint32_t", + "annotation": { + "readable": true, + "writable": true, + "scriptable": true + } + } + ], + "header": "tkc/color.h", + "desc": "颜色。", + "name": "color_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "compressor_t*", + "name": "compressor", + "desc": "compressor对象。" + }, + { + "type": "const void*", + "name": "data", + "desc": "待压缩的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + }, + { + "type": "wbuffer_t*", + "name": "out", + "desc": "压缩之后的数据。" + } + ], + "annotation": {}, + "desc": "压缩数据。", + "name": "compressor_compress", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "compressor_t*", + "name": "compressor", + "desc": "compressor对象。" + }, + { + "type": "const void*", + "name": "data", + "desc": "待解压的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + }, + { + "type": "wbuffer_t*", + "name": "out", + "desc": "解压之后的数据。" + } + ], + "annotation": {}, + "desc": "解压数据。", + "name": "compressor_uncompress", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "compressor_t*", + "name": "compressor", + "desc": "compressor对象。" + } + ], + "annotation": {}, + "desc": "销毁compressor对象。", + "name": "compressor_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/compressor.h", + "desc": "压缩解压接口。", + "name": "compressor_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "创建cond_var。", + "name": "tk_cond_var_create", + "return": { + "type": "tk_cond_var_t*", + "desc": "cond_var对象。" + } + }, + { + "params": [ + { + "type": "tk_cond_var_t*", + "name": "cond_var", + "desc": "cond_var对象。" + }, + { + "type": "uint32_t*", + "name": "timeout_ms", + "desc": "最长等待时间。" + } + ], + "annotation": {}, + "desc": "等待。", + "name": "tk_cond_var_wait", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_cond_var_t*", + "name": "cond_var", + "desc": "cond_var对象。" + } + ], + "annotation": {}, + "desc": "唤醒。", + "name": "tk_cond_var_awake", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_cond_var_t*", + "name": "cond_var", + "desc": "cond_var对象。" + } + ], + "annotation": {}, + "desc": "销毁cond_var对象。", + "name": "tk_cond_var_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/cond_var.h", + "desc": "简化版的条件变量。", + "name": "tk_cond_var_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "创建cond。", + "name": "tk_cond_create", + "return": { + "type": "tk_cond_t*", + "desc": "cond对象。" + } + }, + { + "params": [ + { + "type": "tk_cond_t*", + "name": "cond", + "desc": "cond对象。" + }, + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + } + ], + "annotation": {}, + "desc": "等待。", + "name": "tk_cond_wait", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_cond_t*", + "name": "cond", + "desc": "cond对象。" + }, + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + }, + { + "type": "uint32_t*", + "name": "timeout_ms", + "desc": "最长等待时间。" + } + ], + "annotation": {}, + "desc": "等待指定时间。", + "name": "tk_cond_wait_timeout", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_cond_t*", + "name": "cond", + "desc": "cond对象。" + } + ], + "annotation": {}, + "desc": "唤醒。", + "name": "tk_cond_signal", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_cond_t*", + "name": "cond", + "desc": "cond对象。" + } + ], + "annotation": {}, + "desc": "销毁cond对象。", + "name": "tk_cond_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/cond.h", + "desc": "条件变量。", + "name": "tk_cond_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "数组的初始容量。" + }, + { + "type": "tk_destroy_t", + "name": "destroy", + "desc": "元素销毁函数。" + }, + { + "type": "tk_compare_t", + "name": "compare", + "desc": "元素比较函数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建darray对象。", + "name": "darray_create", + "return": { + "type": "darray_t*", + "desc": "数组对象。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "uint32_t*", + "name": "capacity", + "desc": "数组的初始容量。" + }, + { + "type": "tk_destroy_t", + "name": "destroy", + "desc": "元素销毁函数。" + }, + { + "type": "tk_compare_t", + "name": "compare", + "desc": "元素比较函数。" + } + ], + "annotation": {}, + "desc": "初始化darray对象。", + "name": "darray_init", + "return": { + "type": "darray_t*", + "desc": "数组对象。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "查找第一个满足条件的元素。", + "name": "darray_find", + "return": { + "type": "void*", + "desc": "如果找到,返回满足条件的对象,否则返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数,为NULL则使用内置的比较函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "二分查找(确保数组有序)。", + "name": "darray_bsearch_index", + "return": { + "type": "int", + "desc": "如果找到,返回满足条件的对象的位置,否则返回-1。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数,为NULL则使用内置的比较函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "二分查找(确保数组有序)。", + "name": "darray_bsearch", + "return": { + "type": "void*", + "desc": "如果找到,返回满足条件的对象,否则返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "uint32_t", + "name": "index", + "desc": "序数。" + } + ], + "annotation": {}, + "desc": "获取指定序数的元素。", + "name": "darray_get", + "return": { + "type": "void*", + "desc": "返回满足条件的对象,否则返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "查找第一个满足条件的元素,并返回位置。", + "name": "darray_find_index", + "return": { + "type": "int", + "desc": "如果找到,返回满足条件的对象的位置,否则返回-1。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "删除第一个满足条件的元素。", + "name": "darray_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "uint32_t", + "name": "index", + "desc": "位置序数。" + } + ], + "annotation": {}, + "desc": "删除指定位置的元素。", + "name": "darray_remove_index", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数,为NULL则使用内置的比较函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "删除全部满足条件的元素。", + "name": "darray_remove_all", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数,为NULL则使用内置的比较函数。" + } + ], + "annotation": {}, + "desc": "排序。", + "name": "darray_sort", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数,为NULL则使用内置的比较函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + }, + { + "type": "darray_t*", + "name": "matched", + "desc": "返回满足条件的元素。" + } + ], + "annotation": {}, + "desc": "查找全部满足条件的元素。\n\n```\ndarray_t matched;\ndarray_init(&matched, 0, NULL, NULL);\ndarray_find_all(darray, mycmp, myctx, &matched);\n...\ndarray_deinit(&matched);\n\n```", + "name": "darray_find_all", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "弹出最后一个元素。", + "name": "darray_pop", + "return": { + "type": "void*", + "desc": "成功返回最后一个元素,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "返回最后一个元素。", + "name": "darray_tail", + "return": { + "type": "void*", + "desc": "成功返回最后一个元素,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "返回第一个元素。", + "name": "darray_head", + "return": { + "type": "void*", + "desc": "成功返回最后一个元素,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "void*", + "name": "data", + "desc": "待追加的元素。" + } + ], + "annotation": {}, + "desc": "在尾巴追加一个元素。", + "name": "darray_push", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "返回满足条件元素的个数。", + "name": "darray_count", + "return": { + "type": "int32_t", + "desc": "返回元素个数。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "清除全部元素。", + "name": "darray_clear", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + }, + { + "type": "tk_visit_t", + "name": "visit", + "desc": "遍历函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "遍历函数的上下文。" + } + ], + "annotation": {}, + "desc": "遍历元素。", + "name": "darray_foreach", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "清除全部元素,并释放elms。", + "name": "darray_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "darray_t*", + "name": "darray", + "desc": "数组对象。" + } + ], + "annotation": {}, + "desc": "销毁darray对象。", + "name": "darray_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "size", + "desc": "数组中元素的个数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "数组的容量大小。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "elms", + "desc": "数组中的元素。", + "type": "void**", + "annotation": { + "readable": true + } + }, + { + "name": "destroy", + "desc": "元素销毁函数。", + "type": "tk_destroy_t", + "annotation": { + "readable": true + } + }, + { + "name": "compare", + "desc": "元素比较函数。", + "type": "tk_compare_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/darray.h", + "desc": "动态数组,根据元素个数动态调整数组的容量。\n\n用darray\\_init初始化时,用darray\\_deinit释放。如:\n\n```c\ndarray_t darray;\ndarray_init(&darray, 10, destroy, compare);\n...\ndarray_deinit(&darray);\n```\n\n用darray\\_create创建时,用darray\\_destroy销毁。如:\n\n```c\ndarray_t* darray = darray_create(10, destroy, compare);\n...\ndarray_destroy(darray);\n```", + "name": "darray_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的data reader工厂对象。", + "name": "data_reader_factory", + "return": { + "type": "data_reader_factory_t*", + "desc": "返回data reader工厂对象。" + } + }, + { + "params": [ + { + "type": "data_reader_factory_t*", + "name": "factory", + "desc": "data reader工厂对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的data reader工厂对象。", + "name": "data_reader_factory_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建data reader工厂对象。", + "name": "data_reader_factory_create", + "return": { + "type": "data_reader_factory_t*", + "desc": "返回data reader工厂对象。" + } + }, + { + "params": [ + { + "type": "data_reader_factory_t*", + "name": "factory", + "desc": "reader工厂对象。" + }, + { + "type": "const char*", + "name": "protocol", + "desc": "协议(如file)。" + }, + { + "type": "data_reader_create_t", + "name": "create", + "desc": "data reader创建函数。" + } + ], + "annotation": {}, + "desc": "注册data reader创建函数。", + "name": "data_reader_factory_register", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "data_reader_factory_t*", + "name": "factory", + "desc": "data reader工厂对象。" + }, + { + "type": "const char*", + "name": "url", + "desc": "URL。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建指定类型的data reader对象。", + "name": "data_reader_factory_create_reader", + "return": { + "type": "data_reader_t*", + "desc": "返回data reader对象。" + } + }, + { + "params": [ + { + "type": "data_reader_factory_t*", + "name": "factory", + "desc": "data reader工厂对象。" + } + ], + "annotation": {}, + "desc": "析构并释放data reader工厂对象。", + "name": "data_reader_factory_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "创建基于文件的data reader。", + "name": "data_reader_file_create", + "return": { + "type": "data_reader_t*", + "desc": "返回data reader对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/data_reader_factory.h", + "desc": "data reader工厂。", + "name": "data_reader_factory_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "data_reader_t*", + "name": "reader", + "desc": "reader对象。" + }, + { + "type": "uint64_t", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "void*", + "name": "data", + "desc": "用于读取数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大读取数据长度。" + } + ], + "annotation": {}, + "desc": "在指定位置读取数据。", + "name": "data_reader_read", + "return": { + "type": "int32_t", + "desc": "返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "data_reader_t*", + "name": "reader", + "desc": "reader对象。" + } + ], + "annotation": {}, + "desc": "获取数据长度。", + "name": "data_reader_get_size", + "return": { + "type": "uint64_t", + "desc": "返回数据长度。" + } + }, + { + "params": [ + { + "type": "data_reader_t*", + "name": "reader", + "desc": "reader对象。" + } + ], + "annotation": {}, + "desc": "销毁reader对象。", + "name": "data_reader_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "url", + "desc": "URL。" + }, + { + "type": "uint32_t*", + "name": "size", + "desc": "返回数据长度。" + } + ], + "annotation": {}, + "desc": "从指定的URL读取全部数据。", + "name": "data_reader_read_all", + "return": { + "type": "void*", + "desc": "返回全部数据,调用者需要调用TKMEM_FREE释放返回值。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/data_reader.h", + "desc": "数据读取接口。\n\n>用于抽象flash等外部设备。", + "name": "data_reader_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的data writer工厂对象。", + "name": "data_writer_factory", + "return": { + "type": "data_writer_factory_t*", + "desc": "返回data writer工厂对象。" + } + }, + { + "params": [ + { + "type": "data_writer_factory_t*", + "name": "factory", + "desc": "data writer工厂对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的data writer工厂对象。", + "name": "data_writer_factory_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建data writer工厂对象。", + "name": "data_writer_factory_create", + "return": { + "type": "data_writer_factory_t*", + "desc": "返回data writer工厂对象。" + } + }, + { + "params": [ + { + "type": "data_writer_factory_t*", + "name": "factory", + "desc": "writer工厂对象。" + }, + { + "type": "const char*", + "name": "protocol", + "desc": "协议(如file)。" + }, + { + "type": "data_writer_create_t", + "name": "create", + "desc": "data writer创建函数。" + } + ], + "annotation": {}, + "desc": "注册data writer创建函数。", + "name": "data_writer_factory_register", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "data_writer_factory_t*", + "name": "factory", + "desc": "data writer工厂对象。" + }, + { + "type": "const char*", + "name": "url", + "desc": "URL。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建指定类型的data writer对象。", + "name": "data_writer_factory_create_writer", + "return": { + "type": "data_writer_t*", + "desc": "返回data writer对象。" + } + }, + { + "params": [ + { + "type": "data_writer_factory_t*", + "name": "factory", + "desc": "data writer工厂对象。" + } + ], + "annotation": {}, + "desc": "析构并释放data writer工厂对象。", + "name": "data_writer_factory_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "创建基于文件的data writer。", + "name": "data_writer_file_create", + "return": { + "type": "data_writer_t*", + "desc": "返回data writer对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/data_writer_factory.h", + "desc": "data writer工厂。", + "name": "data_writer_factory_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "data_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "uint64_t", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "const void*", + "name": "data", + "desc": "数据缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "在指定位置写入数据。", + "name": "data_writer_write", + "return": { + "type": "int32_t", + "desc": "返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "data_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "销毁writer对象。", + "name": "data_writer_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/data_writer.h", + "desc": "数据写入接口。\n\n>用于抽象flash等外部设备。", + "name": "data_writer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建date_time对象,并初始为当前日期和时间(一般供脚本语言中使用)。", + "name": "date_time_create", + "return": { + "type": "date_time_t*", + "desc": "返回date_time对象。" + } + }, + { + "params": [ + { + "type": "date_time_t*", + "name": "dt", + "desc": "date_time对象。" + } + ], + "annotation": {}, + "desc": "初始为当前日期和时间。", + "name": "date_time_init", + "return": { + "type": "date_time_t*", + "desc": "返回date_time对象。" + } + }, + { + "params": [ + { + "type": "date_time_t*", + "name": "dt", + "desc": "date_time对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置当前时间。", + "name": "date_time_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "date_time_t*", + "name": "dt", + "desc": "date_time对象。" + }, + { + "type": "uint64_t", + "name": "time", + "desc": "时间。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "从time转换而来。", + "name": "date_time_from_time", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "year", + "desc": "年份。" + } + ], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "是否是闰年。", + "name": "date_time_is_leap", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是,否则表示否。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "year", + "desc": "年份。" + }, + { + "type": "uint32_t", + "name": "montn", + "desc": "月份(1-12)。" + } + ], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取指定年份月份的天数。", + "name": "date_time_get_days", + "return": { + "type": "int32_t", + "desc": "返回大于0表示天数,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "year", + "desc": "年份。" + }, + { + "type": "uint32_t", + "name": "montn", + "desc": "月份(1-12)。" + }, + { + "type": "uint32_t", + "name": "day", + "desc": "日(1-31)。" + } + ], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取指定日期是周几(0-6, Sunday = 0)。。", + "name": "date_time_get_wday", + "return": { + "type": "int32_t", + "desc": "返回大于等于0表示周几(0-6),否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "montn", + "desc": "月份(1-12)。" + } + ], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取指定月份的英文名称(简写)。", + "name": "date_time_get_month_name", + "return": { + "type": "const char*", + "desc": "返回指定月份的英文名称(简写)。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "wday", + "desc": "星期几(0-6, Sunday = 0)。" + } + ], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取周几的英文名称(简写)。", + "name": "date_time_get_wday_name", + "return": { + "type": "const char*", + "desc": "返回指定周几的英文名称(简写)。" + } + }, + { + "params": [ + { + "type": "date_time_t*", + "name": "dt", + "desc": "date_time对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "销毁date_time对象(一般供脚本语言中使用)。", + "name": "date_time_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "date_time_vtable_t", + "name": "vt", + "desc": "日期和时间的相关函数的实现。" + } + ], + "annotation": {}, + "desc": "时间日期全局初始化。\n\n> 嵌入式平台需要提供并设置获取当前日期和时间的函数,否则相关的功能(如时钟控件)将无法正常工作。", + "name": "date_time_global_init_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "second", + "desc": "秒(0 - 59)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "minute", + "desc": "分(0 - 59)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "hour", + "desc": "时(0 - 23)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "day", + "desc": "日(1-31)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "wday", + "desc": "星期几(0-6, Sunday = 0)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "month", + "desc": "月(1-12)。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "year", + "desc": "年。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/date_time.h", + "desc": "日期时间。\n\n> 在嵌入式平台中,在系统初始时,需要调用date\\_time\\_global\\_init设置实际获取/设置系统时间的函数。", + "name": "date_time_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "打开动态链接库。", + "name": "tk_dl_open", + "return": { + "type": "tk_dl_t*", + "desc": "动态链接库对象。" + } + }, + { + "params": [ + { + "type": "tk_dl_t*", + "name": "dl", + "desc": "dl对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "函数名。" + } + ], + "annotation": {}, + "desc": "获取指定名称函数的地址。", + "name": "tk_dl_sym", + "return": { + "type": "void*", + "desc": "返回函数的地址。" + } + }, + { + "params": [ + { + "type": "tk_dl_t*", + "name": "dl", + "desc": "dl对象。" + } + ], + "annotation": {}, + "desc": "关闭dl对象。", + "name": "tk_dl_close", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/dl.h", + "desc": "动态链接库对象。", + "name": "tk_dl_t", + "level": 1 + }, + { + "type": "enum", + "desc": "缓动作动画常量定义。", + "consts": [ + { + "desc": "EASING_LINEAR。", + "name": "EASING_LINEAR" + }, + { + "desc": "EASING_QUADRATIC_IN", + "name": "EASING_QUADRATIC_IN" + }, + { + "desc": "EASING_QUADRATIC_OUT", + "name": "EASING_QUADRATIC_OUT" + }, + { + "desc": "EASING_QUADRATIC_INOUT", + "name": "EASING_QUADRATIC_INOUT" + }, + { + "desc": "EASING_CUBIC_IN", + "name": "EASING_CUBIC_IN" + }, + { + "desc": "EASING_CUBIC_OUT", + "name": "EASING_CUBIC_OUT" + }, + { + "desc": "EASING_SIN_IN", + "name": "EASING_SIN_IN" + }, + { + "desc": "EASING_SIN_OUT", + "name": "EASING_SIN_OUT" + }, + { + "desc": "EASING_SIN_OUT", + "name": "EASING_SIN_INOUT" + }, + { + "desc": "EASING_POW_IN", + "name": "EASING_POW_IN" + }, + { + "desc": "EASING_POW_OUT", + "name": "EASING_POW_OUT" + }, + { + "desc": "EASING_POW_INOUT", + "name": "EASING_POW_INOUT" + }, + { + "desc": "EASING_CIRCULAR_IN", + "name": "EASING_CIRCULAR_IN" + }, + { + "desc": "EASING_CIRCULAR_OUT", + "name": "EASING_CIRCULAR_OUT" + }, + { + "desc": "EASING_CIRCULAR_INOUT", + "name": "EASING_CIRCULAR_INOUT" + }, + { + "desc": "EASING_ELASTIC_IN", + "name": "EASING_ELASTIC_IN" + }, + { + "desc": "EASING_ELASTIC_OUT", + "name": "EASING_ELASTIC_OUT" + }, + { + "desc": "EASING_ELASTIC_INOUT", + "name": "EASING_ELASTIC_INOUT" + }, + { + "desc": "EASING_BACK_IN", + "name": "EASING_BACK_IN" + }, + { + "desc": "EASING_BACK_OUT", + "name": "EASING_BACK_OUT" + }, + { + "desc": "EASING_BACK_INOUT", + "name": "EASING_BACK_INOUT" + }, + { + "desc": "EASING_BOUNCE_IN", + "name": "EASING_BOUNCE_IN" + }, + { + "desc": "EASING_BOUNCE_OUT", + "name": "EASING_BOUNCE_OUT" + }, + { + "desc": "EASING_BOUNCE_INOUT", + "name": "EASING_BOUNCE_INOUT" + } + ], + "header": "tkc/easing.h", + "name": "easing_type_t", + "prefix": "EASING_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "params": [ + { + "type": "easing_type_t", + "name": "type", + "desc": "类型。" + } + ], + "annotation": { + "global": true + }, + "desc": "获取对应类型的操作函数。", + "name": "easing_get", + "return": { + "type": "easing_func_t", + "desc": "返回对应的操作函数地址。" + }, + "type": "method", + "header": "tkc/easing.h", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + } + ], + "annotation": {}, + "desc": "初始化。", + "name": "event_source_manager_init", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + } + ], + "annotation": {}, + "desc": "~初始化。", + "name": "event_source_manager_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + } + ], + "annotation": {}, + "desc": "获取wakeup时间(ms)", + "name": "event_source_manager_get_wakeup_time", + "return": { + "type": "uint32_t", + "desc": "返回wakeup时间(ms)。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + } + ], + "annotation": {}, + "desc": "分发事件。", + "name": "event_source_manager_dispatch", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + }, + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "增加事件源对象。", + "name": "event_source_manager_add", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + }, + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "移除事件源对象。", + "name": "event_source_manager_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + }, + { + "type": "void*", + "name": "tag", + "desc": "tag。" + } + ], + "annotation": {}, + "desc": "移除所有tag相同的事件源对象。", + "name": "event_source_manager_remove_by_tag", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" + } + ], + "annotation": {}, + "desc": "销毁事件源管理器。", + "name": "event_source_manager_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_manager.h", + "desc": "事件源管理器。", + "name": "event_source_manager_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "expr", + "desc": "表达式" + }, + { + "type": "const EvalHooks*", + "name": "hooks", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + }, + { + "type": "ExprValue*", + "name": "output", + "desc": "计算结果。" + } + ], + "annotation": {}, + "desc": "计算表达式的值。", + "name": "eval_execute", + "return": { + "type": "EvalResult", + "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "expor", + "desc": "表达式" + } + ], + "annotation": {}, + "desc": "计算表达式返回浮点数。", + "name": "tk_expr_eval", + "return": { + "type": "double", + "desc": "返回结果。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "expor", + "desc": "表达式" + }, + { + "type": "char*", + "name": "result", + "desc": "结果字符串" + }, + { + "type": "uint32_t", + "name": "", + "desc": "。" + } + ], + "annotation": {}, + "desc": "计算表达式返回字符串。", + "name": "tk_expr_eval_str", + "return": { + "type": "const char*", + "desc": "返回结果。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "获取内置函数。", + "name": "eval_default_hooks", + "return": { + "type": "const EvalHooks*", + "desc": "回调函数列表。" + } + }, + { + "params": [ + { + "type": "EvalResult", + "name": "result", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "将错误码转换成字符串。", + "name": "eval_result_to_string", + "return": { + "type": "const char*", + "desc": "返回对应的字符串。" + } + }, + { + "params": [ + { + "type": "ExprValue*", + "name": "v", + "desc": "值对象。" + } + ], + "annotation": {}, + "desc": "初始化值。", + "name": "expr_value_init", + "return": { + "type": "void", + "desc": "返回void。" + } + }, + { + "params": [ + { + "type": "ExprValue*", + "name": "v", + "desc": "值对象。" + } + ], + "annotation": {}, + "desc": "清除值。", + "name": "expr_value_clear", + "return": { + "type": "void", + "desc": "返回void。" + } + }, + { + "params": [ + { + "type": "const ExprValue*", + "name": "v", + "desc": "值对象。" + } + ], + "annotation": {}, + "desc": "获取浮点数值。", + "name": "expr_value_get_number", + "return": { + "type": "double", + "desc": "返回浮点数值。" + } + }, + { + "params": [ + { + "type": "ExprValue*", + "name": "v", + "desc": "值对象。" + }, + { + "type": "double", + "name": "val", + "desc": "浮点数的值。" + } + ], + "annotation": {}, + "desc": "设置浮点数值。", + "name": "expr_value_set_number", + "return": { + "type": "EvalResult", + "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const ExprValue*", + "name": "v", + "desc": "值对象。" + } + ], + "annotation": {}, + "desc": "获取字符串。", + "name": "expr_value_get_string", + "return": { + "type": "const char*", + "desc": "返回字符串。" + } + }, + { + "params": [ + { + "type": "ExprValue*", + "name": "v", + "desc": "值对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "size_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "设置字符串。", + "name": "expr_value_set_string", + "return": { + "type": "EvalResult", + "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/expr_eval.h", + "desc": "表达式。", + "name": "eval_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "size", + "desc": "文件大小。", + "type": "uint64_t" + }, + { + "name": "atime", + "desc": "最后访问时间。", + "type": "uint64_t" + }, + { + "name": "mtime", + "desc": "最后修改时间。", + "type": "uint64_t" + }, + { + "name": "ctime", + "desc": "创建时间。", + "type": "uint64_t" + }, + { + "name": "is_dir", + "desc": "是否为目录。", + "type": "bool_t" + }, + { + "name": "is_link", + "desc": "是否为链接。", + "type": "bool_t" + }, + { + "name": "is_reg_file", + "desc": "是否普通文件。", + "type": "bool_t" + } + ], + "header": "tkc/fs.h", + "desc": "文件状态信息。", + "name": "fs_stat_info_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + }, + { + "type": "void*", + "name": "buffer", + "desc": "用于返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "读取文件。", + "name": "fs_file_read", + "return": { + "type": "int32_t", + "desc": "返回实际读取的字节数。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + }, + { + "type": "const void*", + "name": "buffer", + "desc": "数据缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "写入文件。", + "name": "fs_file_write", + "return": { + "type": "int32_t", + "desc": "返回实际写入的字节数。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + }, + { + "type": "const char* const", + "name": "format_str", + "desc": "格式化字符串。" + } + ], + "annotation": {}, + "desc": "写入文件。", + "name": "fs_file_printf", + "return": { + "type": "int32_t", + "desc": "返回实际写入的字节数。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "定位读写指针到指定的位置。", + "name": "fs_file_seek", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "清除文件内容。", + "name": "fs_file_truncate", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "关闭文件。", + "name": "fs_file_close", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "同步文件到磁盘。", + "name": "fs_file_sync", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + }, + { + "type": "fs_stat_info_t*", + "name": "fst", + "desc": "文件状态信息。" + } + ], + "annotation": {}, + "desc": "获取文件信息。", + "name": "fs_file_stat", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "判断文件是否结束。", + "name": "fs_file_eof", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示结束,否则表示没结束。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "获取文件当前读写位置。", + "name": "fs_file_tell", + "return": { + "type": "int64_t", + "desc": "返回文件当前读写位置。" + } + }, + { + "params": [ + { + "type": "fs_file_t*", + "name": "file", + "desc": "文件对象。" + } + ], + "annotation": {}, + "desc": "获取文件大小。", + "name": "fs_file_size", + "return": { + "type": "int64_t", + "desc": "返回文件大小。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/fs.h", + "desc": "文件接口。\n\n示例:\n\n```c\nint32_t ret = 0;\nconst char* file_name = \"test.txt\";\nint32_t len = file_get_size(file_name);\nuint8_t* buff = (uint8_t*)TKMEM_ALLOC(len + 1);\nreturn_value_if_fail(buff != NULL, NULL);\n\nfs_file_t* fp = fs_open_file(os_fs(), file_name, \"rb\");\nif (fp != NULL) {\nret = fs_file_read(fp, buff, len);\nfs_file_close(fp);\n}\n```", + "name": "fs_file_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "is_dir", + "desc": "是否是目录。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "is_link", + "desc": "是否是符号链接。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "is_reg_file", + "desc": "是否是普通文件。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "name", + "desc": "名称。", + "type": "char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/fs.h", + "desc": "代表目录或文件。", + "name": "fs_item_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "fs_dir_t*", + "name": "dir", + "desc": "文件夹对象。" + } + ], + "annotation": {}, + "desc": "重置文件夹读取位置到开始。", + "name": "fs_dir_rewind", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_dir_t*", + "name": "dir", + "desc": "文件夹对象。" + }, + { + "type": "fs_item_t*", + "name": "item", + "desc": "返回一项。" + } + ], + "annotation": {}, + "desc": "读取文件夹对象。", + "name": "fs_dir_read", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_dir_t*", + "name": "dir", + "desc": "文件夹对象。" + } + ], + "annotation": {}, + "desc": "关闭文件夹对象。", + "name": "fs_dir_close", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/fs.h", + "desc": "文件夹接口。", + "name": "fs_dir_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "const char*", + "name": "mode", + "desc": "打开方式,取值请参考POSIX的[fopen函数](https://www.runoob.com/cprogramming/c-function-fopen.html)相应的参数。" + } + ], + "annotation": {}, + "desc": "打开文件。", + "name": "fs_open_file", + "return": { + "type": "ret_t", + "desc": "返回非NULL表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "刪除文件。", + "name": "fs_remove_file", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "判断文件是否存在。", + "name": "fs_file_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则表示不存在。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "旧文件名。" + }, + { + "type": "const char*", + "name": "new_name", + "desc": "新文件名。" + } + ], + "annotation": {}, + "desc": "文件重命名。", + "name": "fs_file_rename", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "目录名称。" + } + ], + "annotation": {}, + "desc": "打开目录。", + "name": "fs_open_dir", + "return": { + "type": "fs_dir_t", + "desc": "返回非NULL表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "目录名称。" + } + ], + "annotation": {}, + "desc": "创建目录。", + "name": "fs_create_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "目录名称。" + } + ], + "annotation": {}, + "desc": "刪除目录。", + "name": "fs_remove_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "目录名称。" + } + ], + "annotation": {}, + "desc": "判断目录是否存在。", + "name": "fs_dir_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则表示不存在。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "旧目录名称。" + }, + { + "type": "const char*", + "name": "new_name", + "desc": "新目录名称。" + } + ], + "annotation": {}, + "desc": "目录重命名。", + "name": "fs_dir_rename", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "获取文件大小。", + "name": "fs_get_file_size", + "return": { + "type": "ret_t", + "desc": "返回不是-1表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "value", + "desc": "卷名。" + }, + { + "type": "int32_t*", + "name": "free_kb", + "desc": "用于返回空闲空间大小(KB)" + }, + { + "type": "int32_t*", + "name": "total_kb", + "desc": "用于返回总共空间大小(KB)" + } + ], + "annotation": {}, + "desc": "获取文件系统信息。", + "name": "fs_get_disk_info", + "return": { + "type": "ret_t", + "desc": "返回不是-1表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "fs_stat_info_t*", + "name": "fst", + "desc": "文件状态信息。" + } + ], + "annotation": {}, + "desc": "获取文件信息。", + "name": "fs_stat", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "char*", + "name": "path", + "desc": "保存可执行文件的路径。" + } + ], + "annotation": {}, + "desc": "获取可执行文件所在目录。", + "name": "fs_get_exe", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "char*", + "name": "path", + "desc": "保存路径。" + } + ], + "annotation": {}, + "desc": "获取home目录或者应用程序可以写入数据的目录。", + "name": "fs_get_user_storage_path", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "fs_t*", + "name": "fs", + "desc": "文件系统对象,一般赋值为os_fs()。" + }, + { + "type": "char*", + "name": "path", + "desc": "保存当前所在目录的路径。" + } + ], + "annotation": {}, + "desc": "获取当前所在目录。", + "name": "fs_get_cwd", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的文件系统对象。", + "name": "os_fs", + "return": { + "type": "fs_t*", + "desc": "返回文件系统对象。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "判断文件是否存在。", + "name": "file_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "刪除文件。", + "name": "file_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "获取文件大小。", + "name": "file_get_size", + "return": { + "type": "int32_t", + "desc": "返回非负表示文件大小,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "uint32_t*", + "name": "size", + "desc": "返回实际读取的长度。" + } + ], + "annotation": {}, + "desc": "读取文件的全部内容。", + "name": "file_read", + "return": { + "type": "void*", + "desc": "返回读取的数据,需要调用TKMEM_FREE释放。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "const void*", + "name": "buffer", + "desc": "数据缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + } + ], + "annotation": {}, + "desc": "从某个位置读取文件。", + "name": "file_read_part", + "return": { + "type": "int32_t", + "desc": "返回实际读取的字节数。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "const void*", + "name": "buffer", + "desc": "数据缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "写入文件。", + "name": "file_write", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/fs.h", + "desc": "文件系统接口。", + "name": "fs_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "func_call_parser_t*", + "name": "parser", + "desc": "parser对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "要解析的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串长度。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化parser对象。", + "name": "func_call_parser_init", + "return": { + "type": "func_call_parser_t*", + "desc": "parser对象本身。" + } + }, + { + "params": [ + { + "type": "func_call_parser_t*", + "name": "parser", + "desc": "parser对象。" + } + ], + "annotation": {}, + "desc": "开始解析。", + "name": "func_call_parser_parse", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "func_call_parser_t*", + "name": "parser", + "desc": "parser对象。" + } + ], + "annotation": {}, + "desc": "重置parser。", + "name": "func_call_parser_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要解析的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "解析参数,并将结果生成一个object对象。\n\n> 调用者负责释放返回的object对象。", + "name": "func_call_parse", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/func_call_parser.h", + "desc": "从字符串中解析出函数调用需要的参数。\n\n```\nfunc_call => func_name '(' params ')'\nparams => param ',' params\nparam => name '=' value\nfunc_name => ID\nname = ID\nvalue = int | float | ID\n```\n\n如:move(x=10, y=20)\n如:rename(old_name=aa, new_name=bb)", + "name": "func_call_parser_t", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "name", + "desc": "名称。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "desc", + "desc": "描述。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "exec", + "desc": "函数指针。", + "type": "func_exec_t", + "annotation": { + "readable": true + } + }, + { + "name": "args", + "desc": "函数参数描述。", + "type": "arg_desc_t**", + "annotation": { + "readable": true + } + }, + { + "name": "return_value", + "desc": "函数返回值描述。", + "type": "value_desc_t*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/func_desc.h", + "desc": "函数描述。", + "name": "func_desc_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的idle_manager_t管理器。", + "name": "idle_manager", + "return": { + "type": "idle_manager_t*", + "desc": "返回idle_manager_t管理器对象。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager_t", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的idle_manager_t管理器。", + "name": "idle_manager_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建idle_manager_t管理器。", + "name": "idle_manager_create", + "return": { + "type": "idle_manager_t*", + "desc": "返回idle_manager_t管理器对象。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化idle_manager_t管理器。", + "name": "idle_manager_init", + "return": { + "type": "idle_manager_t*", + "desc": "返回idle_manager_t管理器对象。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": {}, + "desc": "析构idle_manager_t管理器。", + "name": "idle_manager_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": {}, + "desc": "析构并释放idle_manager_t管理器。", + "name": "idle_manager_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": {}, + "desc": "返回idle的个数。", + "name": "idle_manager_count", + "return": { + "type": "uint32_t", + "desc": "返回timer的个数。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + } + ], + "annotation": {}, + "desc": "删除全部idle。", + "name": "idle_manager_remove_all", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + }, + { + "type": "uint32_t", + "name": "idle_id", + "desc": "idle_id。" + } + ], + "annotation": {}, + "desc": "根据idle_id删除idle。", + "name": "idle_manager_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + }, + { + "type": "idle_info_t*", + "name": "idle", + "desc": "idle对象。" + } + ], + "annotation": {}, + "desc": "追加idle。", + "name": "idle_manager_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + }, + { + "type": "uint32_t", + "name": "idle_id", + "desc": "idle_id。" + } + ], + "annotation": {}, + "desc": "查找指定ID的idle。", + "name": "idle_manager_find", + "return": { + "type": "idle_info_t*", + "desc": "返回idle的信息。" + } + }, + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "idle_manager_t管理器对象。" + }, + { + "type": "idle_func_t*", + "name": "on_idle", + "desc": "idle回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "idle回调函数的上下文。" + } + ], + "annotation": {}, + "desc": "添加idle。", + "name": "idle_manager_add", + "return": { + "type": "uint32_t", + "desc": "返回idle的ID,TK_INVALID_ID表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/idle_manager.h", + "desc": "idle_manager_t管理器。", + "name": "idle_manager_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const int_str_t*", + "name": "items", + "desc": "int_str_t数组。" + }, + { + "type": "int32_t", + "name": "name", + "desc": "name。" + } + ], + "annotation": {}, + "desc": "根据name获取对应的value。", + "name": "int_str_value", + "return": { + "type": "const char*", + "desc": "返回value。" + } + }, + { + "params": [ + { + "type": "const int_str_t*", + "name": "items", + "desc": "int_str_t数组。" + }, + { + "type": "const char*", + "name": "value", + "desc": "value。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "如果没有找到对应的name,则返回的defval默认值。" + } + ], + "annotation": {}, + "desc": "根据value获取对应的name。", + "name": "int_str_name", + "return": { + "type": "int32_t", + "desc": "返回name。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/int_str.h", + "desc": "数字-字符串类型。\n\n负责把一个数字映射成一个字符串。\n\n示例:\n\n```c\nstatic const int_str_t color_values[] = {{1, \"red\"}, {2, \"black\"}, {3, \"blue\"}, {4, \"white\"}};\nconst char* value = int_str_value(color_values, 3);\nint32_t name = int_str_name(color_values, \"blue\", 0);\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %d \\n\", name);\n```", + "name": "int_str_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "LOG的级别。", + "consts": [ + { + "desc": "DEBUG", + "name": "LOG_LEVEL_DEBUG" + }, + { + "desc": "INFO", + "name": "LOG_LEVEL_INFO" + }, + { + "desc": "WARN", + "name": "LOG_LEVEL_WARN" + }, + { + "desc": "ERROR", + "name": "LOG_LEVEL_ERROR" + } + ], + "header": "tkc/log.h", + "name": "log_level_t", + "prefix": "LOG_LEVEL_", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "获取log的级别。", + "name": "log_get_log_level", + "return": { + "type": "log_level_t", + "desc": "返回log的级别。" + } + }, + { + "params": [ + { + "type": "log_level_t", + "name": "log_level", + "desc": "log的级别。" + } + ], + "annotation": {}, + "desc": "设置log的级别。", + "name": "log_set_log_level", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "format", + "desc": "格式或信息。" + } + ], + "annotation": {}, + "desc": "输出调试信息。\n> 变参函数。\n\n```\nlog_debug(\"debug message\\n\");\n```", + "name": "log_debug", + "export": "none", + "return": { + "type": "void", + "desc": "无返回值。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "format", + "desc": "格式或信息。" + } + ], + "annotation": {}, + "desc": "输出参考信息。\n> 变参函数。\n\n```\nlog_info(\"info message\\n\");\n```", + "name": "log_info", + "export": "none", + "return": { + "type": "void", + "desc": "无返回值。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "format", + "desc": "格式或信息。" + } + ], + "annotation": {}, + "desc": "输出警告信息。\n> 变参函数。\n\n```\nlog_warn(\"warn message\\n\");\n```", + "name": "log_warn", + "export": "none", + "return": { + "type": "void", + "desc": "无返回值。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "format", + "desc": "格式或信息。" + } + ], + "annotation": {}, + "desc": "输出错误信息。\n> 变参函数。\n\n```\nlog_error(\"error message\\n\");\n```", + "name": "log_error", + "export": "none", + "return": { + "type": "void", + "desc": "无返回值。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/log.h", + "desc": "log。", + "name": "log_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + } + ], + "annotation": {}, + "desc": "初始化矩阵对象。", + "name": "matrix_init", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + } + ], + "annotation": {}, + "desc": "重置矩阵对象为单位矩阵。", + "name": "matrix_identity", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + } + ], + "annotation": {}, + "desc": "求矩阵的逆。", + "name": "matrix_invert", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "float", + "name": "a0", + "desc": "a0" + }, + { + "type": "float", + "name": "a1", + "desc": "a1" + }, + { + "type": "float", + "name": "a2", + "desc": "a2" + }, + { + "type": "float", + "name": "a3", + "desc": "a3" + }, + { + "type": "float", + "name": "a4", + "desc": "a4" + }, + { + "type": "float", + "name": "a5", + "desc": "a5" + } + ], + "annotation": {}, + "desc": "设置矩阵的参数。", + "name": "matrix_set", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "matrix_t*", + "name": "b", + "desc": "矩阵对象。" + } + ], + "annotation": {}, + "desc": "矩阵相乘。", + "name": "matrix_multiply", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "float", + "name": "x", + "desc": "x" + }, + { + "type": "float", + "name": "y", + "desc": "y" + } + ], + "annotation": {}, + "desc": "平移。", + "name": "matrix_translate", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "float", + "name": "sx", + "desc": "sx" + }, + { + "type": "float", + "name": "sy", + "desc": "sy" + } + ], + "annotation": {}, + "desc": "缩放。", + "name": "matrix_scale", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "float", + "name": "rad", + "desc": "角度。" + } + ], + "annotation": {}, + "desc": "旋转。", + "name": "matrix_rotate", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + }, + { + "params": [ + { + "type": "matrix_t*", + "name": "m", + "desc": "矩阵对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y" + }, + { + "type": "xy_t*", + "name": "out_x", + "desc": "out_x" + }, + { + "type": "xy_t*", + "name": "out_y", + "desc": "out_y" + } + ], + "annotation": {}, + "desc": "对点进行变换。", + "name": "matrix_transform_point", + "return": { + "type": "matrix_t*", + "desc": "矩阵对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/matrix.h", + "desc": "2D矩阵对象。", + "name": "matrix_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "mem_allocator_t*", + "name": "allocator", + "desc": "allocator对象。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "内存的大小。" + }, + { + "type": "const char*", + "name": "", + "desc": "。" + }, + { + "type": "uint32_t", + "name": "line", + "desc": "分配内存的行数(用于调试)。" + } + ], + "annotation": {}, + "desc": "分配指定大小的内存。", + "name": "mem_allocator_alloc", + "export": "none", + "return": { + "type": "void*", + "desc": "成功返回内存块的地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "mem_allocator_t*", + "name": "allocator", + "desc": "allocator对象。" + }, + { + "type": "void*", + "name": "ptr", + "desc": "原来内存的地址。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "内存的大小。" + }, + { + "type": "const char*", + "name": "", + "desc": "。" + }, + { + "type": "uint32_t", + "name": "line", + "desc": "分配内存的行数(用于调试)。" + } + ], + "annotation": {}, + "desc": "重新分配指定大小的内存。", + "name": "mem_allocator_realloc", + "export": "none", + "return": { + "type": "void*", + "desc": "成功返回内存块的地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "mem_allocator_t*", + "name": "allocator", + "desc": "allocator对象。" + }, + { + "type": "void*", + "name": "ptr", + "desc": "内存的地址。" + } + ], + "annotation": {}, + "desc": "释放内存。", + "name": "mem_allocator_free", + "export": "none", + "return": { + "type": "void*", + "desc": "成功返回内存块的地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "mem_allocator_t*", + "name": "allocator", + "desc": "allocator对象。" + } + ], + "annotation": {}, + "desc": "显示内存信息,用于调试。", + "name": "mem_allocator_dump", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "mem_allocator_t*", + "name": "allocator", + "desc": "allocator对象。" + } + ], + "annotation": {}, + "desc": "销毁内存分配器。", + "name": "mem_allocator_destroy", + "export": "none", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/mem_allocator.h", + "desc": "内存分配接口。", + "name": "mem_allocator_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "size", + "desc": "内存大小。" + } + ], + "annotation": { + "macro": true + }, + "desc": "分配一块内存。", + "name": "TKMEM_ALLOC", + "export": "tk_alloc", + "return": { + "type": "void*", + "desc": "成功返回内存块首地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "nmemb", + "desc": "内存块数量。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "每一块的大小。" + } + ], + "annotation": { + "macro": true + }, + "desc": "分配一块内存,并将内容清零。", + "name": "TKMEM_CALLOC", + "export": "tk_calloc", + "return": { + "type": "void*", + "desc": "成功返回内存块首地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "p", + "desc": "原来的内存地址。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "每一块的大小。" + } + ], + "annotation": { + "macro": true + }, + "desc": "重新分配一块内存,如果原来的内存块大于等于需要的空间,直接返回原来的内存块。", + "name": "TKMEM_REALLOC", + "export": "tk_realloc", + "return": { + "type": "void*", + "desc": "成功返回内存块首地址,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "p", + "desc": "内存地址。" + } + ], + "annotation": { + "macro": true + }, + "desc": "释放内存。", + "name": "TKMEM_FREE", + "export": "tk_free", + "return": { + "type": "void", + "desc": "无。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "显示内存信息。", + "name": "tk_mem_dump", + "return": { + "type": "void", + "desc": "返回void。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "buffer", + "desc": "内存地址。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "内存长度。" + } + ], + "annotation": {}, + "desc": "初始化内存。", + "name": "tk_mem_init", + "export": "none", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -28020,19 +32396,2918 @@ { "params": [], "annotation": {}, - "desc": "获取当前线程的原生句柄。", - "name": "tk_thread_self", + "desc": "初始化互斥和oom。", + "name": "tk_mem_init_stage2", + "export": "none", "return": { - "type": "uint64_t", - "desc": "返回当前线程的原生句柄。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "检查给定的地址是否是一个有效的heap地址。\n\n> 用于辅助发现内存问题。", + "name": "tk_mem_is_valid_addr", + "return": { + "type": "bool_t", + "desc": "返回FALSE一定是无效地址,返回TRUE在PC则不太确定。" } } ], "events": [], "properties": [], - "header": "tkc/thread.h", - "desc": "线程对象。", - "name": "tk_thread_t", + "header": "tkc/mem.h", + "desc": "内存管理相关的宏和函数。\n\n示例:\n\n```c\nchar* str = (char*)TKMEM_ALLOC(100);\n...\nTKMEM_FREE(str);\n```\n\n```c\nchar* str = (char*)TKMEM_ALLOC(100);\n...\nstr = (char*)TKMEM_REALLOC(str, 128);\n...\nTKMEM_FREE(str);\n```", + "name": "tk_mem_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "MIME_TYPE。", + "consts": [ + { + "desc": "\"application/envoy\"。", + "name": "MIME_TYPE_APPLICATION_ENVOY" + }, + { + "desc": "\"application/fractals\"。", + "name": "MIME_TYPE_APPLICATION_FRACTALS" + }, + { + "desc": "\"application/futuresplash\"。", + "name": "MIME_TYPE_APPLICATION_FUTURESPLASH" + }, + { + "desc": "\"application/hta\"。", + "name": "MIME_TYPE_APPLICATION_HTA" + }, + { + "desc": "\"application/json\"。", + "name": "MIME_TYPE_APPLICATION_JSON" + }, + { + "desc": "\"application/ubjson\"。", + "name": "MIME_TYPE_APPLICATION_UBJSON" + }, + { + "desc": "\"application/mac-binhex40\"。", + "name": "MIME_TYPE_APPLICATION_MAC_BINHEX40" + }, + { + "desc": "\"application/msword\"。", + "name": "MIME_TYPE_APPLICATION_MSWORD" + }, + { + "desc": "\"application/octet-stream\"。", + "name": "MIME_TYPE_APPLICATION_OCTET_STREAM" + }, + { + "desc": "\"application/oda\"。", + "name": "MIME_TYPE_APPLICATION_ODA" + }, + { + "desc": "\"application/olescript\"。", + "name": "MIME_TYPE_APPLICATION_OLESCRIPT" + }, + { + "desc": "\"application/pdf\"。", + "name": "MIME_TYPE_APPLICATION_PDF" + }, + { + "desc": "\"application/pics-rules\"。", + "name": "MIME_TYPE_APPLICATION_PICS_RULES" + }, + { + "desc": "\"application/pkcs10\"。", + "name": "MIME_TYPE_APPLICATION_PKCS10" + }, + { + "desc": "\"application/pkix-crl\"。", + "name": "MIME_TYPE_APPLICATION_PKIX_CRL" + }, + { + "desc": "\"application/postscript\"。", + "name": "MIME_TYPE_APPLICATION_POSTSCRIPT" + }, + { + "desc": "\"application/rtf\"。", + "name": "MIME_TYPE_APPLICATION_RTF" + }, + { + "desc": "\"application/vnd.ms-excel\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_EXCEL" + }, + { + "desc": "\"application/vnd.ms-outlook\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_OUTLOOK" + }, + { + "desc": "\"application/vnd.ms-pkicertstore\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKICERTSTORE" + }, + { + "desc": "\"application/vnd.ms-pkiseccat\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKISECCAT" + }, + { + "desc": "\"application/vnd.ms-pkistl\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKISTL" + }, + { + "desc": "\"application/vnd.ms-powerpoint\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_POWERPOINT" + }, + { + "desc": "\"application/vnd.ms-project\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PROJECT" + }, + { + "desc": "\"application/vnd.ms-works\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_WORKS" + }, + { + "desc": "\"application/winhlp\"。", + "name": "MIME_TYPE_APPLICATION_WINHLP" + }, + { + "desc": "\"application/x-bcpio\"。", + "name": "MIME_TYPE_APPLICATION_X_BCPIO" + }, + { + "desc": "\"application/x-cdf\"。", + "name": "MIME_TYPE_APPLICATION_X_CDF" + }, + { + "desc": "\"application/x-compress\"。", + "name": "MIME_TYPE_APPLICATION_X_COMPRESS" + }, + { + "desc": "\"application/x-compressed\"。", + "name": "MIME_TYPE_APPLICATION_X_COMPRESSED" + }, + { + "desc": "\"application/x-cpio\"。", + "name": "MIME_TYPE_APPLICATION_X_CPIO" + }, + { + "desc": "\"application/x-csh\"。", + "name": "MIME_TYPE_APPLICATION_X_CSH" + }, + { + "desc": "\"application/x-director\"。", + "name": "MIME_TYPE_APPLICATION_X_DIRECTOR" + }, + { + "desc": "\"application/x-dvi\"。", + "name": "MIME_TYPE_APPLICATION_X_DVI" + }, + { + "desc": "\"application/x-gtar\"。", + "name": "MIME_TYPE_APPLICATION_X_GTAR" + }, + { + "desc": "\"application/x-gzip\"。", + "name": "MIME_TYPE_APPLICATION_X_GZIP" + }, + { + "desc": "\"application/x-hdf\"。", + "name": "MIME_TYPE_APPLICATION_X_HDF" + }, + { + "desc": "\"application/x-iphone\"。", + "name": "MIME_TYPE_APPLICATION_X_IPHONE" + }, + { + "desc": "\"application/x-javascript\"。", + "name": "MIME_TYPE_APPLICATION_X_JAVASCRIPT" + }, + { + "desc": "\"application/x-latex\"。", + "name": "MIME_TYPE_APPLICATION_X_LATEX" + }, + { + "desc": "\"application/x-msaccess\"。", + "name": "MIME_TYPE_APPLICATION_X_MSACCESS" + }, + { + "desc": "\"application/x-mscardfile\"。", + "name": "MIME_TYPE_APPLICATION_X_MSCARDFILE" + }, + { + "desc": "\"application/x-msclip\"。", + "name": "MIME_TYPE_APPLICATION_X_MSCLIP" + }, + { + "desc": "\"application/x-msdownload\"。", + "name": "MIME_TYPE_APPLICATION_X_MSDOWNLOAD" + }, + { + "desc": "\"application/x-msmediaview\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMEDIAVIEW" + }, + { + "desc": "\"application/x-msmetafile\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMETAFILE" + }, + { + "desc": "\"application/x-msmoney\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMONEY" + }, + { + "desc": "\"application/x-mspublisher\"。", + "name": "MIME_TYPE_APPLICATION_X_MSPUBLISHER" + }, + { + "desc": "\"application/x-msschedule\"。", + "name": "MIME_TYPE_APPLICATION_X_MSSCHEDULE" + }, + { + "desc": "\"application/x-msterminal\"。", + "name": "MIME_TYPE_APPLICATION_X_MSTERMINAL" + }, + { + "desc": "\"application/x-mswrite\"。", + "name": "MIME_TYPE_APPLICATION_X_MSWRITE" + }, + { + "desc": "\"application/x-netcdf\"。", + "name": "MIME_TYPE_APPLICATION_X_NETCDF" + }, + { + "desc": "\"application/x-perfmon\"。", + "name": "MIME_TYPE_APPLICATION_X_PERFMON" + }, + { + "desc": "\"application/x-pkcs12\"。", + "name": "MIME_TYPE_APPLICATION_X_PKCS12" + }, + { + "desc": "\"application/x-sh\"。", + "name": "MIME_TYPE_APPLICATION_X_SH" + }, + { + "desc": "\"application/x-shar\"。", + "name": "MIME_TYPE_APPLICATION_X_SHAR" + }, + { + "desc": "\"application/x-shockwave-flash\"。", + "name": "MIME_TYPE_APPLICATION_X_SHOCKWAVE_FLASH" + }, + { + "desc": "\"application/x-stuffit\"。", + "name": "MIME_TYPE_APPLICATION_X_STUFFIT" + }, + { + "desc": "\"application/x-sv4cpio\"。", + "name": "MIME_TYPE_APPLICATION_X_SV4CPIO" + }, + { + "desc": "\"application/x-sv4crc\"。", + "name": "MIME_TYPE_APPLICATION_X_SV4CRC" + }, + { + "desc": "\"application/x-tar\"。", + "name": "MIME_TYPE_APPLICATION_X_TAR" + }, + { + "desc": "\"application/x-tcl\"。", + "name": "MIME_TYPE_APPLICATION_X_TCL" + }, + { + "desc": "\"application/x-tex\"。", + "name": "MIME_TYPE_APPLICATION_X_TEX" + }, + { + "desc": "\"application/x-texinfo\"。", + "name": "MIME_TYPE_APPLICATION_X_TEXINFO" + }, + { + "desc": "\"application/x-troff\"。", + "name": "MIME_TYPE_APPLICATION_X_TROFF" + }, + { + "desc": "\"application/x-ustar\"。", + "name": "MIME_TYPE_APPLICATION_X_USTAR" + }, + { + "desc": "\"application/zip\"。", + "name": "MIME_TYPE_APPLICATION_ZIP" + }, + { + "desc": "\"audio/basic\"。", + "name": "MIME_TYPE_AUDIO_BASIC" + }, + { + "desc": "\"audio/mid\"。", + "name": "MIME_TYPE_AUDIO_MID" + }, + { + "desc": "\"audio/mpeg\"。", + "name": "MIME_TYPE_AUDIO_MPEG" + }, + { + "desc": "\"audio/x-aiff\"。", + "name": "MIME_TYPE_AUDIO_X_AIFF" + }, + { + "desc": "\"audio/x-mpegurl\"。", + "name": "MIME_TYPE_AUDIO_X_MPEGURL" + }, + { + "desc": "\"audio/x-wav\"。", + "name": "MIME_TYPE_AUDIO_X_WAV" + }, + { + "desc": "\"image/bmp\"。", + "name": "MIME_TYPE_IMAGE_BMP" + }, + { + "desc": "\"image/cis-cod\"。", + "name": "MIME_TYPE_IMAGE_CIS_COD" + }, + { + "desc": "\"image/gif\"。", + "name": "MIME_TYPE_IMAGE_GIF" + }, + { + "desc": "\"image/ief\"。", + "name": "MIME_TYPE_IMAGE_IEF" + }, + { + "desc": "\"image/jpeg\"。", + "name": "MIME_TYPE_IMAGE_JPEG" + }, + { + "desc": "\"image/pipeg\"。", + "name": "MIME_TYPE_IMAGE_PIPEG" + }, + { + "desc": "\"image/svg+xml\"。", + "name": "MIME_TYPE_IMAGE_SVG_XML" + }, + { + "desc": "\"image/tiff\"。", + "name": "MIME_TYPE_IMAGE_TIFF" + }, + { + "desc": "\"image/x-cmx\"。", + "name": "MIME_TYPE_IMAGE_X_CMX" + }, + { + "desc": "\"image/x-icon\"。", + "name": "MIME_TYPE_IMAGE_X_ICON" + }, + { + "desc": "\"image/x-rgb\"。", + "name": "MIME_TYPE_IMAGE_X_RGB" + }, + { + "desc": "\"image/x-xbitmap\"。", + "name": "MIME_TYPE_IMAGE_X_XBITMAP" + }, + { + "desc": "\"image/x-xpixmap\"。", + "name": "MIME_TYPE_IMAGE_X_XPIXMAP" + }, + { + "desc": "\"image/x-xwindowdump\"。", + "name": "MIME_TYPE_IMAGE_X_XWINDOWDUMP" + }, + { + "desc": "\"message/rfc822\"。", + "name": "MIME_TYPE_MESSAGE_RFC822" + }, + { + "desc": "\"text/css\"。", + "name": "MIME_TYPE_TEXT_CSS" + }, + { + "desc": "\"text/h323\"。", + "name": "MIME_TYPE_TEXT_H323" + }, + { + "desc": "\"text/html\"。", + "name": "MIME_TYPE_TEXT_HTML" + }, + { + "desc": "\"text/iuls\"。", + "name": "MIME_TYPE_TEXT_IULS" + }, + { + "desc": "\"text/plain\"。", + "name": "MIME_TYPE_TEXT_PLAIN" + }, + { + "desc": "\"text/richtext\"。", + "name": "MIME_TYPE_TEXT_RICHTEXT" + }, + { + "desc": "\"text/scriptlet\"。", + "name": "MIME_TYPE_TEXT_SCRIPTLET" + }, + { + "desc": "\"text/webviewhtml\"。", + "name": "MIME_TYPE_TEXT_WEBVIEWHTML" + }, + { + "desc": "\"text/x-component\"。", + "name": "MIME_TYPE_TEXT_X_COMPONENT" + }, + { + "desc": "\"text/x-setext\"。", + "name": "MIME_TYPE_TEXT_X_SETEXT" + }, + { + "desc": "\"text/x-vcard\"。", + "name": "MIME_TYPE_TEXT_X_VCARD" + }, + { + "desc": "\"video/mpeg\"。", + "name": "MIME_TYPE_VIDEO_MPEG" + }, + { + "desc": "\"video/quicktime\"。", + "name": "MIME_TYPE_VIDEO_QUICKTIME" + }, + { + "desc": "\"video/x-msvideo\"。", + "name": "MIME_TYPE_VIDEO_X_MSVIDEO" + } + ], + "header": "tkc/mime_types.h", + "name": "MIME_TYPE", + "prefix": "MIME_TYPE_", + "annotation": { + "scriptable": true, + "string": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "创建嵌套互斥锁。", + "name": "tk_mutex_nest_create", + "return": { + "type": "tk_mutex_nest_t*", + "desc": "mutex_nest对象。" + } + }, + { + "params": [ + { + "type": "tk_mutex_nest_t*", + "name": "mutex_nest", + "desc": "mutex_nest对象。" + } + ], + "annotation": {}, + "desc": "加锁。", + "name": "tk_mutex_nest_lock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_nest_t*", + "name": "mutex_nest", + "desc": "mutex_nest对象。" + } + ], + "annotation": {}, + "desc": "尝试加锁。", + "name": "tk_mutex_nest_try_lock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_nest_t*", + "name": "mutex_nest", + "desc": "mutex_nest对象。" + } + ], + "annotation": {}, + "desc": "解锁。只允许解锁当前线程所加的锁。", + "name": "tk_mutex_nest_unlock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_nest_t*", + "name": "mutex_nest", + "desc": "mutex_nest对象。" + } + ], + "annotation": {}, + "desc": "销毁mutex_nest对象。", + "name": "tk_mutex_nest_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/mutex_nest.h", + "desc": "嵌套互斥锁。允许同一个线程多次加锁。", + "name": "tk_mutex_nest_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "创建mutex。", + "name": "tk_mutex_create", + "return": { + "type": "tk_mutex_t*", + "desc": "mutex对象。" + } + }, + { + "params": [ + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + } + ], + "annotation": {}, + "desc": "加锁。", + "name": "tk_mutex_lock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + } + ], + "annotation": {}, + "desc": "尝试加锁。", + "name": "tk_mutex_try_lock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + } + ], + "annotation": {}, + "desc": "解锁。", + "name": "tk_mutex_unlock", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_mutex_t*", + "name": "mutex", + "desc": "mutex对象。" + } + ], + "annotation": {}, + "desc": "销毁mutex对象。", + "name": "tk_mutex_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/mutex.h", + "desc": "互斥锁。", + "name": "tk_mutex_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建named_value对象。", + "name": "named_value_create", + "return": { + "type": "named_value_t*", + "desc": "返回named_value对象。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "名称。" + }, + { + "type": "const value_t*", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化。", + "name": "named_value_init", + "return": { + "type": "ret_t", + "desc": "返回named_value对象。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为named_value对象(供脚本语言使用)。", + "name": "named_value_cast", + "return": { + "type": "named_value_t*", + "desc": "返回named_value对象。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置名称。", + "name": "named_value_set_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + }, + { + "type": "const value_t*", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置值。", + "name": "named_value_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取值对象(主要给脚本语言使用)。", + "name": "named_value_get_value", + "return": { + "type": "value_t*", + "desc": "返回值对象。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + } + ], + "annotation": { + "deconstructor": true + }, + "desc": "重置named_value对象。", + "name": "named_value_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "named_value_t*", + "name": "nv", + "desc": "named_value对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "销毁named_value对象。", + "name": "named_value_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "name", + "desc": "名称。", + "type": "char*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "value", + "desc": "值。", + "type": "value_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/named_value.h", + "desc": "命名的值。", + "name": "named_value_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "对象常见命令定义", + "consts": [ + { + "desc": "保存命令", + "name": "OBJECT_CMD_SAVE" + }, + { + "desc": "重新加载命令", + "name": "OBJECT_CMD_RELOAD" + }, + { + "desc": "和前一个属性交换位置\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_MOVE_UP" + }, + { + "desc": "和后一个属性交换位置\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_MOVE_DOWN" + }, + { + "desc": "删除属性。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_REMOVE" + }, + { + "desc": "删除勾选的属性。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_REMOVE_CHECKED" + }, + { + "desc": "清除全部属性。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_CLEAR" + }, + { + "desc": "增加子项。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_ADD" + }, + { + "desc": "显示对象详细信息。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_DETAIL" + }, + { + "desc": "编辑子项。\n>参数为属性的名称或路径。", + "name": "OBJECT_CMD_EDIT" + } + ], + "header": "tkc/object.h", + "name": "object_cmd_t", + "prefix": "OBJECT_CMD_", + "annotation": { + "scriptable": true, + "string": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "对象常见属性定义", + "consts": [ + { + "desc": "属性的个数。", + "name": "OBJECT_PROP_SIZE" + }, + { + "desc": "属性是否勾选。", + "name": "OBJECT_PROP_CHECKED" + } + ], + "header": "tkc/object.h", + "name": "object_prop_t", + "prefix": "OBJECT_PROP_", + "annotation": { + "scriptable": true, + "string": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + }, + { + "type": "char*", + "name": "result", + "desc": "用于返回文件名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "返回文件名。", + "name": "path_basename", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + }, + { + "type": "char*", + "name": "result", + "desc": "用于返回文件扩展名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "返回文件扩展名。", + "name": "path_extname", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + }, + { + "type": "char*", + "name": "result", + "desc": "用于返回目录。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "返回目录。", + "name": "path_dirname", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + }, + { + "type": "char*", + "name": "result", + "desc": "用于返回规范后的路径。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "规范路径字符形式。", + "name": "path_normalize", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + }, + { + "type": "char*", + "name": "result", + "desc": "用于返回绝对路径。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "返回绝对路径。", + "name": "path_abs", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char* path*", + "name": "path", + "desc": "路径。" + } + ], + "annotation": {}, + "desc": "判断路径是否为绝对路径。", + "name": "path_is_abs", + "return": { + "type": "ret_t", + "desc": "返回FALSE表示不是绝对路径,否则表示是绝对路径。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "result", + "desc": "用于返回路径。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "构造路径。\n\n> 可变参数为字符串,以NULL参数结束。", + "name": "path_build", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "result", + "desc": "用于返回结果。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "char*", + "name": "filename", + "desc": "原始文件路径。" + }, + { + "type": "char*", + "name": "basename", + "desc": "替换后的文件名。" + } + ], + "annotation": {}, + "desc": "替换文件名。", + "name": "path_replace_basename", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "result", + "desc": "用于返回结果。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "char*", + "name": "filename", + "desc": "原始文件路径。" + }, + { + "type": "char*", + "name": "extname", + "desc": "替换后的文件扩展名。" + } + ], + "annotation": {}, + "desc": "替换文件扩展名。", + "name": "path_replace_extname", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "path", + "desc": "保存当前所在目录的路径。" + } + ], + "annotation": {}, + "desc": "获取当前所在目录。", + "name": "path_cwd", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "path", + "desc": "保存可执行文件所在目录。" + } + ], + "annotation": {}, + "desc": "获取可执行文件所在目录。", + "name": "path_exe", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "path", + "desc": "保存app所在目录。" + } + ], + "annotation": {}, + "desc": "获取app所在目录。", + "name": "path_app_root", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "path", + "desc": "目录。" + } + ], + "annotation": {}, + "desc": "判断目录是否存在。", + "name": "path_exist", + "return": { + "type": "ret_t", + "desc": "返回TRUE表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/path.h", + "desc": "路径相关的工具函数。", + "name": "path_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": {}, + "desc": "获取当前时间。", + "name": "get_time_ms64", + "return": { + "type": "uint64_t", + "desc": "成功返回当前时间。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "ms", + "desc": "睡眠时间(毫秒)。" + } + ], + "annotation": {}, + "desc": "睡眠指定时间。", + "name": "sleep_ms", + "return": { + "type": "void", + "desc": "无。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "平台准备函数。", + "name": "platform_prepare", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/platform.h", + "desc": "平台接口,包括:获取时间、休眠等函数。", + "name": "platform_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "path", + "desc": "插件所在的目录。" + }, + { + "type": "plugin_get_init_func_name_t", + "name": "get_init", + "desc": "获取初始化函数的函数名。为NULL时使用\"init\"。" + }, + { + "type": "plugin_get_deinit_func_name_t", + "name": "get_deinit", + "desc": "获取~初始化函数的函数名。为NULL时使用\"deinit\"。" + } + ], + "annotation": {}, + "desc": "创建插件管理器。", + "name": "plugin_manager_create", + "return": { + "type": "plugin_manager_t*", + "desc": "动态链接库对象。" + } + }, + { + "params": [ + { + "type": "plugin_manager_t*", + "name": "plugin_manager", + "desc": "plugin_manager对象。" + } + ], + "annotation": {}, + "desc": "重新扫描目录中的插件,加载没有加载的插件。", + "name": "plugin_manager_refresh", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "plugin_manager_t*", + "name": "plugin_manager", + "desc": "plugin_manager对象。" + } + ], + "annotation": {}, + "desc": "卸载所有插件并重新加载。", + "name": "plugin_manager_reload", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "plugin_manager_t*", + "name": "plugin_manager", + "desc": "plugin_manager对象。" + } + ], + "annotation": {}, + "desc": "显示所有的插件。", + "name": "plugin_manager_dump", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "plugin_manager_t*", + "name": "plugin_manager", + "desc": "plugin_manager对象。" + }, + { + "type": "const char*", + "name": "lib_name", + "desc": "动态库的名称。" + } + ], + "annotation": {}, + "desc": "检查指定的插件是否存在。", + "name": "plugin_manager_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则表示不存在。" + } + }, + { + "params": [ + { + "type": "plugin_manager_t*", + "name": "plugin_manager", + "desc": "plugin_manager对象。" + } + ], + "annotation": {}, + "desc": "卸载全部插件,并销毁插件管理器对象。", + "name": "plugin_manager_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/plugin_manager.h", + "desc": "插件管理器。", + "name": "plugin_manager_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "qaction_exec_t", + "name": "exec", + "desc": "执行函数。" + }, + { + "type": "void*", + "name": "args", + "desc": "参数。" + }, + { + "type": "uint32_t", + "name": "args_size", + "desc": "参数长度。" + } + ], + "annotation": {}, + "desc": "创建action对象。", + "name": "qaction_create", + "return": { + "type": "qaction_t*", + "desc": "返回action对象。" + } + }, + { + "params": [ + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + }, + { + "type": "qaction_on_event_t", + "name": "on_event", + "desc": "事件处理函数。" + } + ], + "annotation": {}, + "desc": "设置事件处理函数(回调函数在后台线程执行)。\n\n> exec执行完成后,会触发EVT\\_DONE事件,一般在EVT\\_DONE事件中调用qaction\\_destroy函数销毁action。", + "name": "qaction_set_on_event", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + } + ], + "annotation": {}, + "desc": "执行。", + "name": "qaction_exec", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + }, + { + "type": "event_t**", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": {}, + "desc": "事件通知。", + "name": "qaction_notify", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "qaction_t*", + "name": "q", + "desc": "qaction对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "qaction_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "exec", + "desc": "执行函数。", + "type": "qaction_exec_t", + "annotation": { + "readable": true + } + }, + { + "name": "on_event", + "desc": "事件处理函数。如进度、错误和完成等。", + "type": "qaction_on_event_t", + "annotation": { + "readable": true + } + }, + { + "name": "args", + "desc": "exec的参数(视具体的action而不同)。", + "type": "uint32_t*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/qaction.h", + "desc": "代表一个action,放在action queue中。", + "name": "qaction_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "init_capacity", + "desc": "初始容量。" + }, + { + "type": "uint32_t", + "name": "max_capacity", + "desc": "最大容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建ring_buffer对象。", + "name": "ring_buffer_create", + "return": { + "type": "ring_buffer_t*", + "desc": "ring_buffer对象。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "检查ring_buffer是否满。", + "name": "ring_buffer_is_full", + "return": { + "type": "bool_t", + "desc": "是否满。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "检查ring_buffer是否空。", + "name": "ring_buffer_is_empty", + "return": { + "type": "bool_t", + "desc": "是否空。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "获取数据长度。", + "name": "ring_buffer_size", + "return": { + "type": "uint32_t", + "desc": "数据长度。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "获取空闲空间的长度。", + "name": "ring_buffer_free_size", + "return": { + "type": "uint32_t", + "desc": "空闲空间的长度。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "获取容量。", + "name": "ring_buffer_capacity", + "return": { + "type": "uint32_t", + "desc": "容量。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大长度。" + } + ], + "annotation": {}, + "desc": "读取数据。", + "name": "ring_buffer_read", + "return": { + "type": "uint32_t", + "desc": "返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大长度。" + } + ], + "annotation": {}, + "desc": "读取数据(不修改读取位置)。", + "name": "ring_buffer_peek", + "return": { + "type": "uint32_t", + "desc": "返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大长度。" + } + ], + "annotation": {}, + "desc": "写入数据。", + "name": "ring_buffer_write", + "return": { + "type": "uint32_t", + "desc": "返回实际写入数据的长度。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大长度。" + } + ], + "annotation": {}, + "desc": "读取指定长度数据,要么成功要么失败。", + "name": "ring_buffer_read_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "长度。" + } + ], + "annotation": {}, + "desc": "跳过指定长度数据,要么成功要么失败。", + "name": "ring_buffer_skip", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "最大长度。" + } + ], + "annotation": {}, + "desc": "写入指定长度数据,要么成功要么失败。", + "name": "ring_buffer_write_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "重置ring_buffer为空。", + "name": "ring_buffer_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "r", + "desc": "读取光标的位置。" + } + ], + "annotation": {}, + "desc": "设置读取光标的位置。", + "name": "ring_buffer_set_read_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "r_delta", + "desc": "读取光标的位置(delta)。" + } + ], + "annotation": {}, + "desc": "设置读取光标的位置(delta)。", + "name": "ring_buffer_set_read_cursor_delta", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "w", + "desc": "写入光标的位置。" + } + ], + "annotation": {}, + "desc": "设置写入光标的位置。", + "name": "ring_buffer_set_write_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "w_delta", + "desc": "写入光标的位置(delta)。" + } + ], + "annotation": {}, + "desc": "设置写入光标的位置(delta)。", + "name": "ring_buffer_set_write_cursor_delta", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "需要的大小。" + } + ], + "annotation": {}, + "desc": "扩展buffer。", + "name": "ring_buffer_ensure_write_space", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ring_buffer_t*", + "name": "ring_buffer", + "desc": "ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "销毁ring_buffer。", + "name": "ring_buffer_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "r", + "desc": "读取位置。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "w", + "desc": "写入位置。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "full", + "desc": "是否满。", + "type": "bool_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "当前容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "max_capacity", + "desc": "最大容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "data", + "desc": "数据。", + "type": "uint8_t*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/ring_buffer.h", + "desc": "循环缓存区。", + "name": "ring_buffer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "const char*", + "name": "mode", + "desc": "打开方式。" + } + ], + "annotation": {}, + "desc": "打开文件。", + "name": "rom_fopen", + "return": { + "type": "ret_t", + "desc": "返回不是NULL表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const uint8_t*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "capacity", + "desc": "容量。" + } + ], + "annotation": {}, + "desc": "打开文件。", + "name": "rom_fopen_buff", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "返回文件当前位置。", + "name": "rom_ftell", + "return": { + "type": "long", + "desc": "返回当前位置。" + } + }, + { + "params": [ + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "判断是否到文件末尾。", + "name": "rom_feof", + "return": { + "type": "int", + "desc": "返回当前位置。" + } + }, + { + "params": [ + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + }, + { + "type": "long", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "int", + "name": "whence", + "desc": "要从哪个位置开始偏移, SEEK_SET表示从头开始,SEEK_CUR表示从当前位置开始,SEEK_END表示从文件末尾开始。" + } + ], + "annotation": {}, + "desc": "设置文件当前位置。", + "name": "rom_fseek", + "return": { + "type": "int", + "desc": "返回0表示成功。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "ptr", + "desc": "数据的缓冲区。" + }, + { + "type": "size_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "size_t", + "name": "nitems", + "desc": "元素的个数。" + }, + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "读取文件。", + "name": "rom_fread", + "return": { + "type": "size_t", + "desc": "返回实际读取的字节数。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "ptr", + "desc": "数据的缓冲区。" + }, + { + "type": "size_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "size_t", + "name": "nitems", + "desc": "元素的个数。" + }, + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "写文件。\n> 本函数什么也不做。", + "name": "rom_fwrite", + "return": { + "type": "size_t", + "desc": "返回实际写的字节数。" + } + }, + { + "params": [ + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "关闭文件。", + "name": "rom_fclose", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/rom_fs.h", + "desc": "rom_file接口。\n\n> 主要用于给google pinyin输入提供兼容的文件系统API。\n\n示例:\n\n```c\nchar rbuff[100];\nsize_t len = 0;\nconst char* buff = \"hello world\";\nrom_file_t* f = rom_fopen_buff((const uint8_t*)buff, sizeof(buff));\nlen = rom_fread(rbuff, 2, 1, f);\nrom_fclose(f);\n```", + "name": "rom_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "value", + "desc": "初始值。" + }, + { + "type": "const char*", + "name": "name", + "desc": "名称。" + } + ], + "annotation": {}, + "desc": "创建信号量对象。", + "name": "tk_semaphore_create", + "return": { + "type": "tk_semaphore_t*", + "desc": "semaphore对象。" + } + }, + { + "params": [ + { + "type": "tk_semaphore_t*", + "name": "semaphore", + "desc": "信号量对象。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间。" + } + ], + "annotation": {}, + "desc": "获取资源。", + "name": "tk_semaphore_wait", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_semaphore_t*", + "name": "semaphore", + "desc": "信号量对象。" + } + ], + "annotation": {}, + "desc": "释放资源。", + "name": "tk_semaphore_post", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_semaphore_t*", + "name": "semaphore", + "desc": "信号量对象。" + } + ], + "annotation": {}, + "desc": "销毁信号量对象。", + "name": "tk_semaphore_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/semaphore.h", + "desc": "信号量。", + "name": "tk_semaphore_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_destroy_t", + "name": "destroy", + "desc": "元素销毁函数。" + }, + { + "type": "tk_compare_t", + "name": "compare", + "desc": "元素比较函数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建slist对象", + "name": "slist_create", + "return": { + "type": "slist_t*", + "desc": "单向链表对象。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "tk_destroy_t", + "name": "destroy", + "desc": "元素销毁函数。" + }, + { + "type": "tk_compare_t", + "name": "compare", + "desc": "元素比较函数。" + } + ], + "annotation": {}, + "desc": "初始化slist对象", + "name": "slist_init", + "return": { + "type": "slist_t*", + "desc": "单向链表对象。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "查找第一个满足条件的元素。", + "name": "slist_find", + "return": { + "type": "void*", + "desc": "如果找到,返回满足条件的对象,否则返回NULL。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "删除第一个满足条件的元素。", + "name": "slist_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "删除全部元素。", + "name": "slist_remove_all", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "data", + "desc": "待追加的元素。" + } + ], + "annotation": {}, + "desc": "在尾巴追加一个元素。", + "name": "slist_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "data", + "desc": "待追加的元素。" + } + ], + "annotation": {}, + "desc": "在头部追加一个元素。", + "name": "slist_prepend", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "tk_visit_t", + "name": "visit", + "desc": "遍历函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "遍历函数的上下文。" + } + ], + "annotation": {}, + "desc": "遍历元素。", + "name": "slist_foreach", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "弹出最后一个元素。", + "name": "slist_tail_pop", + "return": { + "type": "ret_t", + "desc": "成功返回最后一个元素,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "弹出第一个元素。", + "name": "slist_head_pop", + "return": { + "type": "ret_t", + "desc": "成功返回最后一个元素,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "返回元素个数。", + "name": "slist_size", + "return": { + "type": "int32_t", + "desc": "返回元素个数。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "比较函数的上下文。" + } + ], + "annotation": {}, + "desc": "返回满足条件元素的个数。", + "name": "slist_count", + "return": { + "type": "int32_t", + "desc": "返回元素个数。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "清除单向链表中的元素。", + "name": "slist_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "slist_t*", + "name": "slist", + "desc": "单向链表对象。" + } + ], + "annotation": {}, + "desc": "清除单向链表中的元素,并释放单向链表对象。", + "name": "slist_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "first", + "desc": "首节点。", + "type": "slist_node_t*", + "annotation": { + "readable": true + } + }, + { + "name": "destroy", + "desc": "元素销毁函数。", + "type": "tk_destroy_t", + "annotation": { + "readable": true + } + }, + { + "name": "compare", + "desc": "元素比较函数。", + "type": "tk_compare_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/slist.h", + "desc": "单向链表\n\n用slist\\_init初始化时,用slist\\_deinit释放。如:\n\n```c\nslist_t slist;\nslist_init(&slist, destroy, compare);\n...\nslist_deinit(&slist);\n```\n\n用slist\\_create创建时,用slist\\_destroy销毁。如:\n\n```c\nslist_t* slist = slist_create(destroy, compare);\n...\nslist_destroy(slist);\n```", + "name": "slist_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "static": true + }, + "desc": "tcp/udp 平台初始化。", + "name": "socket_init", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true + }, + "desc": "tcp/udp 平台~初始化。", + "name": "socket_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + } + ], + "annotation": { + "static": true + }, + "desc": "关闭socket句柄。", + "name": "socket_close", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + }, + { + "type": "int", + "name": "port", + "desc": "端口号。" + } + ], + "annotation": { + "static": true + }, + "desc": "绑定到指定端口。", + "name": "socket_bind", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "等待时间(ms)。" + } + ], + "annotation": { + "static": true + }, + "desc": "等待数据。", + "name": "socket_wait_for_data", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + }, + { + "type": "bool_t", + "name": "blocking", + "desc": "是否阻塞。" + } + ], + "annotation": { + "static": true + }, + "desc": "设置为阻塞或非阻塞模式。", + "name": "socket_set_blocking", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + }, + { + "type": "bool_t", + "name": "", + "desc": "g" + }, + { + "type": "struct sockaddr_in*", + "name": "addr", + "desc": "地址对象。" + } + ], + "annotation": { + "static": true + }, + "desc": "解析主机名,并初始化addr对象。", + "name": "socket_resolve", + "return": { + "type": "struct sockaddr*", + "desc": "返回地址对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/socket_helper.h", + "desc": "", + "name": "socket", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "port", + "desc": "端口号。" + } + ], + "annotation": { + "static": true + }, + "desc": "监听指定端口,成功返回sock句柄。", + "name": "tcp_listen", + "return": { + "type": "int", + "desc": "返回sock句柄。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket句柄。" + } + ], + "annotation": { + "static": true + }, + "desc": "监听指定端口,成功返回sock句柄。", + "name": "tcp_accept", + "return": { + "type": "int", + "desc": "返回sock句柄。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "host", + "desc": "主机名或IP地址。" + }, + { + "type": "int", + "name": "port", + "desc": "端口号。" + } + ], + "annotation": { + "static": true + }, + "desc": "连接到指定服务器。", + "name": "tcp_connect", + "return": { + "type": "int", + "desc": "返回sock句柄。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/socket_helper.h", + "desc": "", + "name": "tcp_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "port", + "desc": "端口号。" + } + ], + "annotation": { + "static": true + }, + "desc": "监听指定端口,成功返回sock句柄。", + "name": "udp_listen", + "return": { + "type": "int", + "desc": "返回sock句柄。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "host", + "desc": "主机名或IP地址。" + }, + { + "type": "int", + "name": "port", + "desc": "端口号。" + } + ], + "annotation": { + "static": true + }, + "desc": "连接到指定服务器。", + "name": "udp_connect", + "return": { + "type": "int", + "desc": "返回sock句柄。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/socket_helper.h", + "desc": "", + "name": "udp_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int*", + "name": "socks", + "desc": "由于返回生成的socket句柄。" + } + ], + "annotation": {}, + "desc": "生成两个socket句柄。两者可以模拟客户端和服务器通信。", + "name": "tk_socketpair", + "return": { + "type": "int", + "desc": "小于0表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/socket_pair.h", + "desc": "socketpair", + "name": "socketpair_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const str_str_t*", + "name": "items", + "desc": "str_str_t数组。" + }, + { + "type": "const char*", + "name": "name", + "desc": "name。" + } + ], + "annotation": {}, + "desc": "根据name获取对应的value。", + "name": "str_str_value", + "return": { + "type": "const char*", + "desc": "返回value。" + } + }, + { + "params": [ + { + "type": "const str_str_t*", + "name": "items", + "desc": "str_str_t数组。" + }, + { + "type": "const char*", + "name": "value", + "desc": "value" + } + ], + "annotation": {}, + "desc": "根据value获取对应的name。", + "name": "str_str_name", + "return": { + "type": "const char*", + "desc": "返回name。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/str_str.h", + "desc": "字符串-字符串类型。\n\n负责把一个字符串映射成另外一个字符串。\n\n示例:\n\n```c\nstatic const str_str_t color_values[] = {{\"1\", \"red\"}, {\"2\", \"black\"}, {\"3\", \"blue\"}, {\"4\", \"white\"}};\nconst char* value = str_str_value(color_values, \"3\");\nconst char* name = str_str_name(color_values, \"blue\", \"0\");\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %s \\n\", name);\n```", + "name": "str_str_t", + "annotation": { + "fake": true + }, "level": 1 }, { @@ -28971,1168 +36246,36 @@ "name": "str_t", "level": 1 }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "static": true - }, - "desc": "初始化AWTK扩展控件。", - "name": "tk_ext_widgets_init", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "ext_widgets/ext_widgets.h", - "desc": "", - "name": "tk_ext_widgets_t", - "level": 1 - }, { "type": "class", "methods": [ { "params": [ { - "type": "const str_str_t*", - "name": "items", - "desc": "str_str_t数组。" - }, - { - "type": "const char*", - "name": "name", - "desc": "name。" - } - ], - "annotation": {}, - "desc": "根据name获取对应的value。", - "name": "str_str_value", - "return": { - "type": "const char*", - "desc": "返回value。" - } - }, - { - "params": [ - { - "type": "const str_str_t*", - "name": "items", - "desc": "str_str_t数组。" - }, - { - "type": "const char*", - "name": "value", - "desc": "value" - } - ], - "annotation": {}, - "desc": "根据value获取对应的name。", - "name": "str_str_name", - "return": { - "type": "const char*", - "desc": "返回name。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/str_str.h", - "desc": "字符串-字符串类型。\n\n负责把一个字符串映射成另外一个字符串。\n\n示例:\n\n```c\nstatic const str_str_t color_values[] = {{\"1\", \"red\"}, {\"2\", \"black\"}, {\"3\", \"blue\"}, {\"4\", \"white\"}};\nconst char* value = str_str_value(color_values, \"3\");\nconst char* name = str_str_name(color_values, \"blue\", \"0\");\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %s \\n\", name);\n```", - "name": "str_str_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int*", - "name": "socks", - "desc": "由于返回生成的socket句柄。" - } - ], - "annotation": {}, - "desc": "生成两个socket句柄。两者可以模拟客户端和服务器通信。", - "name": "tk_socketpair", - "return": { - "type": "int", - "desc": "小于0表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/socket_pair.h", - "desc": "socketpair", - "name": "socketpair_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "name", - "desc": "名称。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "is_dir", - "desc": "是否是目录。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "is_reg_file", - "desc": "是否是常规文件。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "size", - "desc": "文件大小。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "atime", - "desc": "最后一次访问时间。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "mtime", - "desc": "最后修改时间。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "ctime", - "desc": "创建时间。", - "type": "uint64_t", - "annotation": { - "readable": true - } - } - ], - "header": "file_browser/file_browser.h", - "desc": "文件或目录的信息。", - "name": "fb_item_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建file_browser对象", - "name": "file_browser_create", - "return": { - "type": "file_browser_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "const char*", - "name": "cwd", - "desc": "当前目录。" - } - ], - "annotation": {}, - "desc": "设置当前目录。", - "name": "file_browser_set_cwd", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "当前目录下的子目录名。" - } - ], - "annotation": {}, - "desc": "在当前目录下创建指定子目录。", - "name": "file_browser_create_dir", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "当前目录下的文件名。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "文件内容。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "文件内容的长度。" - } - ], - "annotation": {}, - "desc": "在当前目录下创建指定文件。", - "name": "file_browser_create_file", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "当前目录下的子目录名/文件名。" - } - ], - "annotation": {}, - "desc": "删除当前目录下的指定子目录或文件。", - "name": "file_browser_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "const char*", - "name": "dir", - "desc": "当前目录下的子目录名。" - } - ], - "annotation": {}, - "desc": "进入当前目录下的指定子目录。", - "name": "file_browser_enter", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - } - ], - "annotation": {}, - "desc": "返回上一级目录。", - "name": "file_browser_up", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - } - ], - "annotation": {}, - "desc": "刷新。", - "name": "file_browser_refresh", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "tk_filter_t", - "name": "filter", - "desc": "过滤函数。" + "type": "tk_thread_entry_t", + "name": "entry", + "desc": "线程函数。" }, { "type": "void*", - "name": "ctx", - "desc": "过滤函数的上下文。" + "name": "args", + "desc": "线程函数的上下文。" } ], "annotation": {}, - "desc": "设置过滤函数。", - "name": "file_browser_set_filter", + "desc": "创建thread对象。", + "name": "tk_thread_create", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "tk_thread_t*", + "desc": "thread对象。" } }, { "params": [ { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "tk_compare_t", - "name": "compare", - "desc": "排序用的比较函数。" - } - ], - "annotation": {}, - "desc": "设置排序用的比较函数。", - "name": "file_browser_set_compare", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "bool_t", - "name": "ascending", - "desc": "按升序排。" - } - ], - "annotation": {}, - "desc": "按名称排序。", - "name": "file_browser_sort_by_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "bool_t", - "name": "ascending", - "desc": "按升序排。" - } - ], - "annotation": {}, - "desc": "按类型排序。", - "name": "file_browser_sort_by_type", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "bool_t", - "name": "ascending", - "desc": "按升序排。" - } - ], - "annotation": {}, - "desc": "按大小排序。", - "name": "file_browser_sort_by_size", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "bool_t", - "name": "ascending", - "desc": "按升序排。" - } - ], - "annotation": {}, - "desc": "按修改时间排序。", - "name": "file_browser_sort_by_mtime", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - } - ], - "annotation": {}, - "desc": "获取当前目录下文件项个数。", - "name": "file_browser_get_items_nr", - "return": { - "type": "uint32_t", - "desc": "返回当前目录下文件项个数。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "uint32_t", - "name": "index", - "desc": "序数。" - } - ], - "annotation": {}, - "desc": "获取指定项序数的项目。", - "name": "file_browser_get_item", - "return": { - "type": "fb_item_t*", - "desc": "返回指定项序数的项目。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - }, - { - "type": "bool_t", - "name": "ignore_hidden_files", - "desc": "是否忽略隐藏文件。" - } - ], - "annotation": {}, - "desc": "设置是否忽略隐藏文件。", - "name": "file_browser_set_ignore_hidden_files", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "file_browser_t*", - "name": "fb", - "desc": "file browser对象。" - } - ], - "annotation": {}, - "desc": "销毁file_browser对象", - "name": "file_browser_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "cwd", - "desc": "当前路径。", - "type": "char*", - "annotation": { - "readable": true - } - } - ], - "header": "file_browser/file_browser.h", - "desc": "文件浏览器模型。", - "name": "file_browser_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int", - "name": "port", - "desc": "端口号。" - } - ], - "annotation": { - "static": true - }, - "desc": "监听指定端口,成功返回sock句柄。", - "name": "udp_listen", - "return": { - "type": "int", - "desc": "返回sock句柄。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "host", - "desc": "主机名或IP地址。" - }, - { - "type": "int", - "name": "port", - "desc": "端口号。" - } - ], - "annotation": { - "static": true - }, - "desc": "连接到指定服务器。", - "name": "udp_connect", - "return": { - "type": "int", - "desc": "返回sock句柄。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/socket_helper.h", - "desc": "", - "name": "udp_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int", - "name": "port", - "desc": "端口号。" - } - ], - "annotation": { - "static": true - }, - "desc": "监听指定端口,成功返回sock句柄。", - "name": "tcp_listen", - "return": { - "type": "int", - "desc": "返回sock句柄。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - } - ], - "annotation": { - "static": true - }, - "desc": "监听指定端口,成功返回sock句柄。", - "name": "tcp_accept", - "return": { - "type": "int", - "desc": "返回sock句柄。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "host", - "desc": "主机名或IP地址。" - }, - { - "type": "int", - "name": "port", - "desc": "端口号。" - } - ], - "annotation": { - "static": true - }, - "desc": "连接到指定服务器。", - "name": "tcp_connect", - "return": { - "type": "int", - "desc": "返回sock句柄。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/socket_helper.h", - "desc": "", - "name": "tcp_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "static": true - }, - "desc": "tcp/udp 平台初始化。", - "name": "socket_init", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "static": true - }, - "desc": "tcp/udp 平台~初始化。", - "name": "socket_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - } - ], - "annotation": { - "static": true - }, - "desc": "关闭socket句柄。", - "name": "socket_close", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - }, - { - "type": "int", - "name": "port", - "desc": "端口号。" - } - ], - "annotation": { - "static": true - }, - "desc": "绑定到指定端口。", - "name": "socket_bind", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "等待时间(ms)。" - } - ], - "annotation": { - "static": true - }, - "desc": "等待数据。", - "name": "socket_wait_for_data", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - }, - { - "type": "bool_t", - "name": "blocking", - "desc": "是否阻塞。" - } - ], - "annotation": { - "static": true - }, - "desc": "设置为阻塞或非阻塞模式。", - "name": "socket_set_blocking", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "int", - "name": "sock", - "desc": "socket句柄。" - }, - { - "type": "bool_t", - "name": "", - "desc": "g" - }, - { - "type": "struct sockaddr_in*", - "name": "addr", - "desc": "地址对象。" - } - ], - "annotation": { - "static": true - }, - "desc": "解析主机名,并初始化addr对象。", - "name": "socket_resolve", - "return": { - "type": "struct sockaddr*", - "desc": "返回地址对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/socket_helper.h", - "desc": "", - "name": "socket", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "tk_destroy_t", - "name": "destroy", - "desc": "元素销毁函数。" - }, - { - "type": "tk_compare_t", - "name": "compare", - "desc": "元素比较函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建slist对象", - "name": "slist_create", - "return": { - "type": "slist_t*", - "desc": "单向链表对象。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "tk_destroy_t", - "name": "destroy", - "desc": "元素销毁函数。" - }, - { - "type": "tk_compare_t", - "name": "compare", - "desc": "元素比较函数。" - } - ], - "annotation": {}, - "desc": "初始化slist对象", - "name": "slist_init", - "return": { - "type": "slist_t*", - "desc": "单向链表对象。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "查找第一个满足条件的元素。", - "name": "slist_find", - "return": { - "type": "void*", - "desc": "如果找到,返回满足条件的对象,否则返回NULL。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "删除第一个满足条件的元素。", - "name": "slist_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "删除全部元素。", - "name": "slist_remove_all", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "data", - "desc": "待追加的元素。" - } - ], - "annotation": {}, - "desc": "在尾巴追加一个元素。", - "name": "slist_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "data", - "desc": "待追加的元素。" - } - ], - "annotation": {}, - "desc": "在头部追加一个元素。", - "name": "slist_prepend", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "tk_visit_t", - "name": "visit", - "desc": "遍历函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "遍历函数的上下文。" - } - ], - "annotation": {}, - "desc": "遍历元素。", - "name": "slist_foreach", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "弹出最后一个元素。", - "name": "slist_tail_pop", - "return": { - "type": "ret_t", - "desc": "成功返回最后一个元素,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "弹出第一个元素。", - "name": "slist_head_pop", - "return": { - "type": "ret_t", - "desc": "成功返回最后一个元素,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "返回元素个数。", - "name": "slist_size", - "return": { - "type": "int32_t", - "desc": "返回元素个数。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "返回满足条件元素的个数。", - "name": "slist_count", - "return": { - "type": "int32_t", - "desc": "返回元素个数。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "清除单向链表中的元素。", - "name": "slist_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "slist_t*", - "name": "slist", - "desc": "单向链表对象。" - } - ], - "annotation": {}, - "desc": "清除单向链表中的元素,并释放单向链表对象。", - "name": "slist_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "first", - "desc": "首节点。", - "type": "slist_node_t*", - "annotation": { - "readable": true - } - }, - { - "name": "destroy", - "desc": "元素销毁函数。", - "type": "tk_destroy_t", - "annotation": { - "readable": true - } - }, - { - "name": "compare", - "desc": "元素比较函数。", - "type": "tk_compare_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/slist.h", - "desc": "单向链表\n\n用slist\\_init初始化时,用slist\\_deinit释放。如:\n\n```c\nslist_t slist;\nslist_init(&slist, destroy, compare);\n...\nslist_deinit(&slist);\n```\n\n用slist\\_create创建时,用slist\\_destroy销毁。如:\n\n```c\nslist_t* slist = slist_create(destroy, compare);\n...\nslist_destroy(slist);\n```", - "name": "slist_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "value", - "desc": "初始值。" + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" }, { "type": "const char*", @@ -30141,29 +36284,29 @@ } ], "annotation": {}, - "desc": "创建信号量对象。", - "name": "tk_semaphore_create", + "desc": "设置线程的名称。\n\n> 需要在调用start之前调用本函数。", + "name": "tk_thread_set_name", "return": { - "type": "tk_semaphore_t*", - "desc": "semaphore对象。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "tk_semaphore_t*", - "name": "semaphore", - "desc": "信号量对象。" + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" }, { "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间。" + "name": "stack_size", + "desc": "栈的大小。" } ], "annotation": {}, - "desc": "获取资源。", - "name": "tk_semaphore_wait", + "desc": "设置线程的栈大小。\n\n> 需要在调用start之前调用本函数。", + "name": "tk_thread_set_stack_size", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -30172,14 +36315,19 @@ { "params": [ { - "type": "tk_semaphore_t*", - "name": "semaphore", - "desc": "信号量对象。" + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + }, + { + "type": "uint32_t", + "name": "priority", + "desc": "优先级。" } ], "annotation": {}, - "desc": "释放资源。", - "name": "tk_semaphore_post", + "desc": "设置线程的优先级。\n\n> 部分平台支持。", + "name": "tk_thread_set_priority", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -30188,215 +36336,122 @@ { "params": [ { - "type": "tk_semaphore_t*", - "name": "semaphore", - "desc": "信号量对象。" + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" } ], "annotation": {}, - "desc": "销毁信号量对象。", - "name": "tk_semaphore_destroy", + "desc": "启动线程。", + "name": "tk_thread_start", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "等待线程退出。\n必须调用 tk_thread_destroy 函数来释放线程资源,以免出现内存泄漏的问题。", + "name": "tk_thread_join", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "获取线程的参数。", + "name": "tk_thread_get_args", + "return": { + "type": "void*", + "desc": "返回线程的参数。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "销毁thread对象。\n在销毁对象前必须调用 tk_thread_join 函数等待退出线程", + "name": "tk_thread_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "获取当前线程的原生句柄。", + "name": "tk_thread_self", + "return": { + "type": "uint64_t", + "desc": "返回当前线程的原生句柄。" + } } ], "events": [], "properties": [], - "header": "tkc/semaphore.h", - "desc": "信号量。", - "name": "tk_semaphore_t", + "header": "tkc/thread.h", + "desc": "线程对象。", + "name": "tk_thread_t", "level": 1 }, { "type": "class", "methods": [ { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "const char*", - "name": "mode", - "desc": "打开方式。" - } - ], - "annotation": {}, - "desc": "打开文件。", - "name": "rom_fopen", + "params": [], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取当前时间(秒)。", + "name": "time_now_s", "return": { - "type": "ret_t", - "desc": "返回不是NULL表示成功,否则表示失败。" + "type": "uint64_t", + "desc": "返回当前时间(秒)。" } }, { - "params": [ - { - "type": "const uint8_t*", - "name": "data", - "desc": "数据。" - }, - { - "type": "uint32_t", - "name": "capacity", - "desc": "容量。" - } - ], - "annotation": {}, - "desc": "打开文件。", - "name": "rom_fopen_buff", + "params": [], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取当前时间(毫秒)。", + "name": "time_now_ms", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "返回文件当前位置。", - "name": "rom_ftell", - "return": { - "type": "long", - "desc": "返回当前位置。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "判断是否到文件末尾。", - "name": "rom_feof", - "return": { - "type": "int", - "desc": "返回当前位置。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - }, - { - "type": "long", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "int", - "name": "whence", - "desc": "要从哪个位置开始偏移, SEEK_SET表示从头开始,SEEK_CUR表示从当前位置开始,SEEK_END表示从文件末尾开始。" - } - ], - "annotation": {}, - "desc": "设置文件当前位置。", - "name": "rom_fseek", - "return": { - "type": "int", - "desc": "返回0表示成功。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "ptr", - "desc": "数据的缓冲区。" - }, - { - "type": "size_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "size_t", - "name": "nitems", - "desc": "元素的个数。" - }, - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "读取文件。", - "name": "rom_fread", - "return": { - "type": "size_t", - "desc": "返回实际读取的字节数。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "ptr", - "desc": "数据的缓冲区。" - }, - { - "type": "size_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "size_t", - "name": "nitems", - "desc": "元素的个数。" - }, - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "写文件。\n> 本函数什么也不做。", - "name": "rom_fwrite", - "return": { - "type": "size_t", - "desc": "返回实际写的字节数。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "关闭文件。", - "name": "rom_fclose", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "uint64_t", + "desc": "返回当前时间(毫秒)。" } } ], "events": [], "properties": [], - "header": "tkc/rom_fs.h", - "desc": "rom_file接口。\n\n> 主要用于给google pinyin输入提供兼容的文件系统API。\n\n示例:\n\n```c\nchar rbuff[100];\nsize_t len = 0;\nconst char* buff = \"hello world\";\nrom_file_t* f = rom_fopen_buff((const uint8_t*)buff, sizeof(buff));\nlen = rom_fread(rbuff, 2, 1, f);\nrom_fclose(f);\n```", - "name": "rom_t", + "header": "tkc/time_now.h", + "desc": "获取当前时间的函数。\n这里的当前时间是相对的,在嵌入式系统一般相对于开机时间。\n它本身并没有任何意义,一般用来计算时间间隔,如实现定时器和动画等等。", + "name": "time_now_t", "annotation": { + "scriptable": true, "fake": true }, "level": 1 @@ -30404,392 +36459,249 @@ { "type": "class", "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的定时器管理器。", + "name": "timer_manager", + "return": { + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" + } + }, { "params": [ { - "type": "uint32_t", - "name": "init_capacity", - "desc": "初始容量。" - }, + "type": "timer_manager_t*", + "name": "timer_manager_t", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的定时器管理器。", + "name": "timer_manager_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ { - "type": "uint32_t", - "name": "max_capacity", - "desc": "最大容量。" + "type": "timer_get_time_t", + "name": "get_time", + "desc": "获取当前时间的函数。" } ], "annotation": { "constructor": true }, - "desc": "创建ring_buffer对象。", - "name": "ring_buffer_create", + "desc": "创建定时器管理器。", + "name": "timer_manager_create", "return": { - "type": "ring_buffer_t*", - "desc": "ring_buffer对象。" + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "timer_get_time_t", + "name": "get_time", + "desc": "获取当前时间的函数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化定时器管理器。", + "name": "timer_manager_init", + "return": { + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" } ], "annotation": {}, - "desc": "检查ring_buffer是否满。", - "name": "ring_buffer_is_full", + "desc": "析构定时器管理器。", + "name": "timer_manager_deinit", "return": { - "type": "bool_t", - "desc": "是否满。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" } ], "annotation": {}, - "desc": "检查ring_buffer是否空。", - "name": "ring_buffer_is_empty", + "desc": "析构并释放定时器管理器。", + "name": "timer_manager_destroy", "return": { - "type": "bool_t", - "desc": "是否空。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "获取数据长度。", - "name": "ring_buffer_size", - "return": { - "type": "uint32_t", - "desc": "数据长度。" - } - }, - { - "params": [ + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "获取空闲空间的长度。", - "name": "ring_buffer_free_size", - "return": { - "type": "uint32_t", - "desc": "空闲空间的长度。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "获取容量。", - "name": "ring_buffer_capacity", - "return": { - "type": "uint32_t", - "desc": "容量。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" + "type": "timer_func_t*", + "name": "on_timer", + "desc": "timer回调函数。" }, { "type": "void*", - "name": "buff", - "desc": "缓冲区。" + "name": "ctx", + "desc": "timer回调函数的上下文。" }, { "type": "uint32_t", - "name": "size", - "desc": "最大长度。" + "name": "duration", + "desc": "时间。" } ], "annotation": {}, - "desc": "读取数据。", - "name": "ring_buffer_read", + "desc": "添加定时器。", + "name": "timer_manager_add", "return": { "type": "uint32_t", - "desc": "返回实际读取数据的长度。" + "desc": "返回timer的ID,TK_INVALID_ID表示失败。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "缓冲区。" + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" }, { "type": "uint32_t", - "name": "size", - "desc": "最大长度。" + "name": "timer_id", + "desc": "timer_id。" } ], "annotation": {}, - "desc": "读取数据(不修改读取位置)。", - "name": "ring_buffer_peek", + "desc": "根据id删除定时器。", + "name": "timer_manager_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "uint32_t*", + "name": "timer_id", + "desc": "timer_id。" + } + ], + "annotation": {}, + "desc": "重置定时器。", + "name": "timer_manager_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "uint32_t", + "name": "timer_id", + "desc": "timer_id" + } + ], + "annotation": {}, + "desc": "查找指定ID的定时器。", + "name": "timer_manager_find", + "return": { + "type": "timer_info_t*", + "desc": "返回timer的信息。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "返回定时器的个数。", + "name": "timer_manager_count", "return": { "type": "uint32_t", - "desc": "返回实际读取数据的长度。" + "desc": "返回timer的个数。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "最大长度。" + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" } ], "annotation": {}, - "desc": "写入数据。", - "name": "ring_buffer_write", + "desc": "返回最近的定时器到期时间。", + "name": "timer_manager_next_time", "return": { - "type": "uint32_t", - "desc": "返回实际写入数据的长度。" + "type": "uint64_t", + "desc": "返回最近的timer到期时间。" } }, { "params": [ { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。。" }, { - "type": "void*", - "name": "buff", - "desc": "缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "最大长度。" + "type": "timer_info_t*", + "name": "timer", + "desc": "timer对象。" } ], "annotation": {}, - "desc": "读取指定长度数据,要么成功要么失败。", - "name": "ring_buffer_read_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "长度。" - } - ], - "annotation": {}, - "desc": "跳过指定长度数据,要么成功要么失败。", - "name": "ring_buffer_skip", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "最大长度。" - } - ], - "annotation": {}, - "desc": "写入指定长度数据,要么成功要么失败。", - "name": "ring_buffer_write_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "重置ring_buffer为空。", - "name": "ring_buffer_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "r", - "desc": "读取光标的位置。" - } - ], - "annotation": {}, - "desc": "设置读取光标的位置。", - "name": "ring_buffer_set_read_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "r_delta", - "desc": "读取光标的位置(delta)。" - } - ], - "annotation": {}, - "desc": "设置读取光标的位置(delta)。", - "name": "ring_buffer_set_read_cursor_delta", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "w", - "desc": "写入光标的位置。" - } - ], - "annotation": {}, - "desc": "设置写入光标的位置。", - "name": "ring_buffer_set_write_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "w_delta", - "desc": "写入光标的位置(delta)。" - } - ], - "annotation": {}, - "desc": "设置写入光标的位置(delta)。", - "name": "ring_buffer_set_write_cursor_delta", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "需要的大小。" - } - ], - "annotation": {}, - "desc": "扩展buffer。", - "name": "ring_buffer_ensure_write_space", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "ring_buffer_t*", - "name": "ring_buffer", - "desc": "ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "销毁ring_buffer。", - "name": "ring_buffer_destroy", + "desc": "追加定时器。", + "name": "timer_manager_append", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -30797,97 +36709,10 @@ } ], "events": [], - "properties": [ - { - "name": "r", - "desc": "读取位置。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "w", - "desc": "写入位置。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "full", - "desc": "是否满。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "当前容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max_capacity", - "desc": "最大容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "data", - "desc": "数据。", - "type": "uint8_t*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/ring_buffer.h", - "desc": "循环缓存区。", - "name": "ring_buffer_t", - "level": 1 - }, - { - "type": "enum", - "desc": "bidi 类型常量定义。", - "consts": [ - { - "desc": "自动检查。", - "name": "BIDI_TYPE_AUTO" - }, - { - "desc": "Left-To-Right letter。", - "name": "BIDI_TYPE_LTR" - }, - { - "desc": "Right-To-Left letter。", - "name": "BIDI_TYPE_RTL" - }, - { - "desc": "Left-To-Right letter Override。", - "name": "BIDI_TYPE_LRO" - }, - { - "desc": "Right-To-Left letter Override。", - "name": "BIDI_TYPE_RLO" - }, - { - "desc": "Weak Left To Right paragraph。", - "name": "BIDI_TYPE_WLTR" - }, - { - "desc": "Weak Right To Left paragraph。", - "name": "BIDI_TYPE_WRTL" - } - ], - "header": "base/bidi.h", - "name": "bidi_type_t", - "prefix": "BIDI_TYPE_", + "properties": [], + "header": "tkc/timer_manager.h", + "desc": "定时器管理器。", + "name": "timer_manager_t", "annotation": { "scriptable": true }, @@ -30899,93 +36724,201 @@ { "params": [ { - "type": "bidi_t*", - "name": "bidi", - "desc": "bidi对象。" + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" }, { - "type": "bool_t", - "name": "alloc_l2v", - "desc": "是否为positions_L_to_V分配空间。" - }, - { - "type": "bool_t", - "name": "alloc_v2l", - "desc": "是否为positions_V_to_L分配空间。" - }, - { - "type": "bidi_type_t", - "name": "type", - "desc": "类型。" - } - ], - "annotation": { - "deconstructor": true - }, - "desc": "初始化bidi对象。", - "name": "bidi_init", - "return": { - "type": "bidi_t*", - "desc": "返回bidi对象。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "类型名称(取值:rtl,ltr,auto,wrtl,wltr,lro,rlo)。" - } - ], - "annotation": { - "static": true - }, - "desc": "将bidi类型的名称转换成类型。", - "name": "bidi_type_from_name", - "return": { - "type": "bidi_t*", - "desc": "返回bidi对象。" - } - }, - { - "params": [ - { - "type": "bidi_t*", - "name": "bidi", - "desc": "bidi对象。" - }, - { - "type": "const wchar_t*", + "type": "char*", "name": "str", - "desc": "字符串。" + "desc": "要解析的字符串。" }, { "type": "uint32_t", "name": "size", - "desc": "字符串的长度。" + "desc": "字符串长度。" + }, + { + "type": "char*", + "name": "separtor", + "desc": "分隔字符。" } ], - "annotation": {}, - "desc": "将字符串转成用于显示的字符串,输出结果放在bidi->vis_str中。", - "name": "bidi_log2vis", + "annotation": { + "constructor": true + }, + "desc": "初始化tokenizer对象。", + "name": "tokenizer_init", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "tokenizer_t*", + "desc": "tokenizer对象本身。" } }, { "params": [ { - "type": "bidi_t*", - "name": "bidi", - "desc": "bidi对象。" + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "char*", + "name": "str", + "desc": "要解析的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串长度。" + }, + { + "type": "char*", + "name": "separtor", + "desc": "分隔字符。" + }, + { + "type": "char*", + "name": "single_char_token", + "desc": "单字符token。" } ], "annotation": { - "deconstructor": true + "constructor": true }, - "desc": "释放bidi对象相关资源。", - "name": "bidi_deinit", + "desc": "初始化tokenizer对象。", + "name": "tokenizer_init_ex", + "return": { + "type": "tokenizer_t*", + "desc": "tokenizer对象本身。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "是否还有下一个token。", + "name": "tokenizer_has_more", + "return": { + "type": "bool_t", + "desc": "还有下一个token返回TRUE,否则返回FALSE。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "获取下一个token。", + "name": "tokenizer_next", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符集。" + } + ], + "annotation": {}, + "desc": "获取下一个token,该token直到遇到指定的char。", + "name": "tokenizer_next_until", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符集。" + } + ], + "annotation": {}, + "desc": "获取下一个expr,该expr直到遇到指定的char。", + "name": "tokenizer_next_expr_until", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "int", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取下一个token,并转换成int。", + "name": "tokenizer_next_int", + "return": { + "type": "char*", + "desc": "成功返回token的int值,失败返回缺省值。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "float", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取下一个token,并转换成float。", + "name": "tokenizer_next_float", + "return": { + "type": "char*", + "desc": "成功返回token的float值,失败返回缺省值。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "重置tokenizer。", + "name": "tokenizer_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -30995,57 +36928,3563 @@ "events": [], "properties": [ { - "name": "vis_strx", - "desc": "用于显示的字符串(存放log2vis的结果)。", - "type": "wchar_t*", + "name": "str", + "desc": "字符串。", + "type": "char*", "annotation": { "readable": true } }, { - "name": "vis_str_size", - "desc": "用于显示的字符串长度(存放log2vis的结果)。", + "name": "size", + "desc": "字符串的长度。", "type": "uint32_t", "annotation": { "readable": true } }, { - "name": "request_type", - "desc": "请求的类型。", - "type": "bidi_type_t", + "name": "cursor", + "desc": "当前位置。", + "type": "uint32_t", "annotation": { "readable": true } }, { - "name": "resolved_type", - "desc": "实际的类型。", - "type": "bidi_type_t", + "name": "separtor", + "desc": "分隔字符串。", + "type": "char*", "annotation": { "readable": true } }, { - "name": "positions_L_to_V", - "desc": "logical位置与visual位置的映射。", - "type": "int32_t*", - "annotation": { - "readable": true - } - }, - { - "name": "positions_V_to_L", - "desc": "visual位置与logical位置的映射。", - "type": "int32_t*", + "name": "single_char_token", + "desc": "单字符的token。", + "type": "char*", "annotation": { "readable": true } } ], - "header": "base/bidi.h", - "desc": "Unicode Bidirectional Algorithm.", - "name": "bidi_t", + "header": "tkc/tokenizer.h", + "desc": "从字符串中解析出一个一个的token。\n\n```c\ntokenizer_t tokenizer;\ntokenizer_t* t = tokenizer_init(&tokenizer, \"20,111.2,22.3,333.3,44,555.5\", 0xffffff, \",\");\n\nwhile(tokenizer_has_more(t)) {\ndouble v = tokenizer_next_float(t, 0);\nlog_debug(\"%lf\\n\", v);\n}\n\ntokenizer_deinit(t);\n```", + "name": "tokenizer_t", + "level": 1 + }, + { + "type": "enum", + "desc": "函数返回值常量定义。", + "consts": [ + { + "desc": "成功。", + "name": "RET_OK" + }, + { + "desc": "Out of memory。", + "name": "RET_OOM" + }, + { + "desc": "失败。", + "name": "RET_FAIL" + }, + { + "desc": "没有实现/不支持。", + "name": "RET_NOT_IMPL" + }, + { + "desc": "退出。通常用于主循环。", + "name": "RET_QUIT" + }, + { + "desc": "找到。", + "name": "RET_FOUND" + }, + { + "desc": "对象忙。", + "name": "RET_BUSY" + }, + { + "desc": "移出。通常用于定时器。", + "name": "RET_REMOVE" + }, + { + "desc": "重复。通常用于定时器。", + "name": "RET_REPEAT" + }, + { + "desc": "没找到。", + "name": "RET_NOT_FOUND" + }, + { + "desc": "操作完成。", + "name": "RET_DONE" + }, + { + "desc": "停止后续操作。", + "name": "RET_STOP" + }, + { + "desc": "跳过当前项。", + "name": "RET_SKIP" + }, + { + "desc": "继续后续操作。", + "name": "RET_CONTINUE" + }, + { + "desc": "对象属性变化。", + "name": "RET_OBJECT_CHANGED" + }, + { + "desc": "集合数目变化。", + "name": "RET_ITEMS_CHANGED" + }, + { + "desc": "无效参数。", + "name": "RET_BAD_PARAMS" + }, + { + "desc": "超时。", + "name": "RET_TIMEOUT" + }, + { + "desc": "CRC错误。", + "name": "RET_CRC" + }, + { + "desc": "IO错误。", + "name": "RET_IO" + }, + { + "desc": "End of Stream", + "name": "RET_EOS" + }, + { + "desc": "没有改变。", + "name": "RET_NOT_MODIFIED" + } + ], + "header": "tkc/types_def.h", + "name": "ret_t", + "prefix": "RET_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const wchar_t*", + "name": "in", + "desc": "输入字符串。" + }, + { + "type": "const char*", + "name": "out", + "desc": "输出字符串。" + }, + { + "type": "uint32_t", + "name": "out_size", + "desc": "输出字符串的最大长度。" + } + ], + "annotation": {}, + "desc": "把ucs字符串转成UTF8字符串。", + "name": "tk_utf8_from_utf16", + "return": { + "type": "char*", + "desc": "返回UTF8字符串。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "in", + "desc": "输入字符串。" + }, + { + "type": "uint32_t", + "name": "in_size", + "desc": "输入字符串的长度。" + }, + { + "type": "const char*", + "name": "out", + "desc": "输出字符串。" + }, + { + "type": "uint32_t", + "name": "out_size", + "desc": "输出字符串的最大长度。" + } + ], + "annotation": {}, + "desc": "把ucs字符串转成UTF8字符串。", + "name": "tk_utf8_from_utf16_ex", + "return": { + "type": "char*", + "desc": "返回UTF8字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "str。" + }, + { + "type": "const wchar_t*", + "name": "out", + "desc": "返回结果缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "将char类型转换为wchar_t类型。", + "name": "tk_utf8_to_utf16", + "return": { + "type": "wchar_t*", + "desc": "值。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/utf8.h", + "desc": "wchar_t和char类型转换接口。\n\n示例:\n\n```c\nconst char* str = \"hello\";\nconst wchar_t* wstr = L\"hello\";\nchar res_str[128];\nwchar_t res_wstr[128];\n\ntk_utf8_to_utf16(str, res_wstr, ARRAY_SIZE(res_wstr));\ntk_utf8_from_utf16(wstr, res_str, ARRAY_SIZE(res_str));\n```", + "name": "utf8_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为整形的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为整形。", + "name": "tk_atoi", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为布尔类型的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为布尔类型。", + "name": "tk_atob", + "return": { + "type": "bool_t", + "desc": "返回转换后的布尔类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为浮点类型的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为浮点类型。", + "name": "tk_atof", + "return": { + "type": "double", + "desc": "返回转换后的浮点类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "a", + "desc": "要进行比较的第一个字符串。" + }, + { + "type": "const char*", + "name": "b", + "desc": "要进行比较的第二个字符串。" + } + ], + "annotation": {}, + "desc": "字符串比较函数。", + "name": "tk_str_cmp", + "return": { + "type": "int32_t", + "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "a", + "desc": "要进行比较的第一个字符串。" + }, + { + "type": "const char*", + "name": "b", + "desc": "要进行比较的第二个字符串。" + } + ], + "annotation": {}, + "desc": "字符串比较函数(不区分大小写)。", + "name": "tk_str_icmp", + "return": { + "type": "int32_t", + "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为整形的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为整形。", + "name": "tk_watoi", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为整形的宽字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为整形。", + "name": "tk_watoi_n", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为布尔类型的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为布尔类型。", + "name": "tk_watob", + "return": { + "type": "bool_t", + "desc": "返回转换后的布尔类型。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为浮点类型的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为浮点类型。", + "name": "tk_watof", + "return": { + "type": "double", + "desc": "返回转换后的浮点类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要输入的原始字符串。" + } + ], + "annotation": {}, + "desc": "跳过字符串函数,如:字符串\"hello123world\",返回的结果是\"123world\"。", + "name": "tk_skip_to_num", + "return": { + "type": "const char*", + "desc": "返回转换后的字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "保存字符串缓冲区。" + }, + { + "type": "int", + "name": "len", + "desc": "缓冲区大小。" + }, + { + "type": "int", + "name": "n", + "desc": "要转换的整形。" + } + ], + "annotation": {}, + "desc": "将整形转换为字符串。", + "name": "tk_itoa", + "return": { + "type": "const char*", + "desc": "返回字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "保存字符串缓冲区。" + }, + { + "type": "int", + "name": "len", + "desc": "缓冲区大小。" + }, + { + "type": "double", + "name": "f", + "desc": "要转换的浮点型。" + } + ], + "annotation": {}, + "desc": "将浮点型转换为字符串。", + "name": "tk_ftoa", + "return": { + "type": "const char*", + "desc": "返回字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为长整形的字符串。" + }, + { + "type": "const char**", + "name": "end", + "desc": "对类型char*的对象的引用。" + }, + { + "type": "int", + "name": "base", + "desc": "基数。" + } + ], + "annotation": {}, + "desc": "将字符串转换为长整形。", + "name": "tk_strtol", + "return": { + "type": "long", + "desc": "返回转换后的长整形。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "原字符串。" + } + ], + "annotation": {}, + "desc": "将src所指向的字符串复制到dst。", + "name": "tk_strcpy", + "return": { + "type": "char*", + "desc": "返回目标字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "原字符串。" + }, + { + "type": "size_t", + "name": "len", + "desc": "要复制的字符串个数。" + } + ], + "annotation": {}, + "desc": "将src所指向的字符串复制到dst,最多复制len个字符串,并在[len]位置添加'\\0'。\n\n> 请确保dst的长度>=(len+1)", + "name": "tk_strncpy", + "return": { + "type": "char*", + "desc": "返回目标字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "原字符串。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数。", + "name": "tk_strdup", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "原宽字符串。" + } + ], + "annotation": {}, + "desc": "宽字符串拷贝函数。", + "name": "tk_wstrdup", + "return": { + "type": "wchar_t*", + "desc": "返回指向的复制宽字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "原字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "要复制的字符串个数。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数,最多复制len个字符串。", + "name": "tk_strndup", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + } + ], + "annotation": {}, + "desc": "获取字符串的长度。str为空时返回0。", + "name": "tk_strlen", + "return": { + "type": "uint32_t", + "desc": "返回字符串的长度。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "被追加字符串。" + }, + { + "type": "uint32_t", + "name": "max_len", + "desc": "字符串的最大长度。" + }, + { + "type": "const char*", + "name": "s", + "desc": "要追加的字符串。" + } + ], + "annotation": {}, + "desc": "字符串追加函数。", + "name": "tk_str_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint16_t*", + "name": "buff", + "desc": "buff" + }, + { + "type": "uint16_t", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据2字节。", + "name": "tk_memset16", + "return": { + "type": "uint16_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "buff", + "desc": "buff。" + }, + { + "type": "void*", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据3字节。", + "name": "tk_memset24", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "buff", + "desc": "buff。" + }, + { + "type": "uint32_t", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据4字节。", + "name": "tk_memset32", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint16_t*", + "name": "dst", + "desc": "目标" + }, + { + "type": "uint16_t*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "拷贝数据2字节。", + "name": "tk_memcpy16", + "return": { + "type": "uint16_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "dst", + "desc": "目标" + }, + { + "type": "uint32_t*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "拷贝数据4字节。", + "name": "tk_memcpy32", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "dst", + "desc": "目标" + }, + { + "type": "void*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + }, + { + "type": "uint8_t", + "name": "bpp", + "desc": "单个数据的字节数。" + } + ], + "annotation": {}, + "desc": "已bpp字节为标准拷贝数据。", + "name": "tk_pixel_copy", + "return": { + "type": "void*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "目标字符串。" + }, + { + "type": "size_t", + "name": "size", + "desc": "拷贝字节数。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式化字符串。" + } + ], + "annotation": {}, + "desc": "将可变参数(...)按照format格式化字符串,并将字符串复制到str中。", + "name": "tk_snprintf", + "return": { + "type": "int", + "desc": "返回格式化后的字符串长度+1。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要输入的字符串。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式化字符串。" + } + ], + "annotation": {}, + "desc": "从字符串读取格式化输入。", + "name": "tk_sscanf", + "return": { + "type": "int", + "desc": "返回成功匹配和赋值的个数。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "完整的文件名。" + }, + { + "type": "char*", + "name": "str", + "desc": "用于返回文件名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "文件名(str参数)的最大长度。" + } + ], + "annotation": {}, + "desc": "从完整文件名中获取文件名。", + "name": "filename_to_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "完整的文件名。" + }, + { + "type": "char*", + "name": "str", + "desc": "用于返回文件名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "文件名(str参数)的最大长度。" + }, + { + "type": "bool_t", + "name": "remove_extname", + "desc": "是否移除扩展名。" + } + ], + "annotation": {}, + "desc": "从完整文件名中获取文件名。", + "name": "filename_to_name_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + }, + { + "type": "str_t*", + "name": "s", + "desc": "用于返回内容。" + } + ], + "annotation": {}, + "desc": "expand include process instruction to file content: ", + "name": "xml_file_expand_read", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "源字符串。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数。\n> XXX: 要求dst为NULL或内存块的首地址,本函数调用之后,dst可能无效,请保留返回的地址", + "name": "tk_str_copy", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "空的destroy函数。", + "name": "dummy_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "缺省的destroy函数。释放data指向的内存。", + "name": "default_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "a", + "desc": "数据a。" + }, + { + "type": "const void*", + "name": "b", + "desc": "数据b。" + } + ], + "annotation": {}, + "desc": "指针比较。", + "name": "pointer_compare", + "return": { + "type": "int", + "desc": "返回0表示相等,返回负数表示小于,返回整数表示大于。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "a", + "desc": "数据a。" + }, + { + "type": "const void*", + "name": "b", + "desc": "数据b。" + } + ], + "annotation": {}, + "desc": "始终返回相等。", + "name": "compare_always_equal", + "return": { + "type": "int", + "desc": "始终返回0。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "名字字符串。" + } + ], + "annotation": {}, + "desc": "判断是否是有效的属性名。", + "name": "tk_is_valid_name", + "return": { + "type": "bool_t", + "desc": "如果名称有效返回TRUE,否则返回FALSE。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要检查字符串。" + }, + { + "type": "const char*", + "name": "prefix", + "desc": "被检查的字符串。" + } + ], + "annotation": {}, + "desc": "检查字符串是否以指定的字符串prefix开头。", + "name": "tk_str_start_with", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是;否则表示不是。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "下划线名字。" + }, + { + "type": "char*", + "name": "out", + "desc": "驼峰名字(保存结果)。" + }, + { + "type": "uint32_t", + "name": "max_out_size", + "desc": "结果最大长度。" + } + ], + "annotation": {}, + "desc": "将下划线名字转成驼峰名字。", + "name": "tk_under_score_to_camel", + "return": { + "type": "const char*", + "desc": "返回T驼峰名字。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "p", + "desc": "指针。" + } + ], + "annotation": {}, + "desc": "将指针转换成int。\n\n>与tk_pointer_from_int配套使用,也就是pointer本身必须就是整数,而不是指针,否则pointer会被截断。", + "name": "tk_pointer_to_int", + "return": { + "type": "int32_t", + "desc": "返回对应的int数据。" + } + }, + { + "params": [ + { + "type": "int32_t", + "name": "v", + "desc": "整数。" + } + ], + "annotation": {}, + "desc": "将int转换成指针。\n\n> 常用于将int类型的数据作为回调函数的ctx。", + "name": "tk_pointer_from_int", + "return": { + "type": "void*", + "desc": "返回对应的指针。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要被转换成大写字母的字符串。" + } + ], + "annotation": {}, + "desc": "将小写字母转换为大写字母。", + "name": "tk_str_toupper", + "return": { + "type": "char*", + "desc": "返回转换后的大写字母字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要被转换成小写字母的字符串。" + } + ], + "annotation": {}, + "desc": "将大写字母转换为小写字母。", + "name": "tk_str_tolower", + "return": { + "type": "char*", + "desc": "返回转换后的小写字母字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "utf8编码的字符串。" + } + ], + "annotation": {}, + "desc": "将utf8字符串拷贝为UCS字符串。", + "name": "tk_wstr_dup_utf8", + "return": { + "type": "wchar_t*", + "desc": "返回UCS字符串(需要调用TKMEM_FREE释放)。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "wchar_t", + "name": "c", + "desc": "字符。" + } + ], + "annotation": {}, + "desc": "统计UCS字符串中某个字符出现的次数。", + "name": "tk_wstr_count_c", + "return": { + "type": "uint32_t", + "desc": "返回字符出现的次数。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "img_w", + "desc": "图片宽度。" + }, + { + "type": "uint32_t", + "name": "img_h", + "desc": "图片宽度。" + }, + { + "type": "const char*", + "name": "region", + "desc": "region。" + }, + { + "type": "rect_t*", + "name": "r", + "desc": "返回具体位置。" + } + ], + "annotation": {}, + "desc": "解析子图的区域信息。", + "name": "image_region_parse", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/utils.h", + "desc": "工具类。", + "name": "utils_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述类型常量定义。", + "consts": [ + { + "desc": "有符号8位整数类型。", + "name": "VALUE_DESC_TYPE_INT8" + }, + { + "desc": "无符号8位整数类型。", + "name": "VALUE_DESC_TYPE_UINT8" + }, + { + "desc": "有符号16位整数类型。", + "name": "VALUE_DESC_TYPE_INT16" + }, + { + "desc": "无符号16位整数类型。", + "name": "VALUE_DESC_TYPE_UINT16" + }, + { + "desc": "有符号32位整数类型。", + "name": "VALUE_DESC_TYPE_INT32" + }, + { + "desc": "无符号32位整数类型。", + "name": "VALUE_DESC_TYPE_UINT32" + }, + { + "desc": "有符号64位整数类型。", + "name": "VALUE_DESC_TYPE_INT64" + }, + { + "desc": "无符号64位整数类型。", + "name": "VALUE_DESC_TYPE_UINT64" + }, + { + "desc": "单精度浮点数类型。", + "name": "VALUE_DESC_TYPE_FLOAT" + }, + { + "desc": "双精度浮点数类型。", + "name": "VALUE_DESC_TYPE_DOUBLE" + }, + { + "desc": "布尔类型。", + "name": "VALUE_DESC_TYPE_BOOL" + }, + { + "desc": "字符串类型。", + "name": "VALUE_DESC_TYPE_STRING" + }, + { + "desc": "二进制类型。", + "name": "VALUE_DESC_TYPE_BINARY" + }, + { + "desc": "整数枚举类型。", + "name": "VALUE_DESC_TYPE_INT_ENUMS" + }, + { + "desc": "字符串枚举类型。", + "name": "VALUE_DESC_TYPE_STRING_ENUMS" + } + ], + "header": "tkc/value_desc.h", + "name": "value_desc_type_t", + "prefix": "VALUE_DESC_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述格式常量定义。", + "consts": [ + { + "desc": "无特殊格式。", + "name": "VALUE_FORMAT_TYPE_NONE" + }, + { + "desc": "16进制格式。", + "name": "VALUE_FORMAT_TYPE_HEX" + }, + { + "desc": "非负格式(用于进一步限制float/double)。", + "name": "VALUE_FORMAT_TYPE_HEX" + }, + { + "desc": "手机号码格式。", + "name": "VALUE_FORMAT_TYPE_PHONE" + }, + { + "desc": "邮件格式。", + "name": "VALUE_FORMAT_TYPE_PHONE" + }, + { + "desc": "ip4地址格式。", + "name": "VALUE_FORMAT_TYPE_IP4_ADDRESS" + }, + { + "desc": "域名格式。", + "name": "VALUE_FORMAT_TYPE_DOMAIN_NAME" + }, + { + "desc": "URL格式。", + "name": "VALUE_FORMAT_TYPE_URL" + }, + { + "desc": "JSON格式。", + "name": "VALUE_FORMAT_TYPE_JSON" + }, + { + "desc": "XML格式。", + "name": "VALUE_FORMAT_TYPE_XML" + }, + { + "desc": "UBJSON格式。", + "name": "VALUE_FORMAT_TYPE_UBJSON" + }, + { + "desc": "JS格式。", + "name": "VALUE_FORMAT_TYPE_JS" + } + ], + "header": "tkc/value_desc.h", + "name": "value_format_type_t", + "prefix": "VALUE_FORMAT_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述范围常量定义。", + "consts": [ + { + "desc": "单个对象的属性。", + "name": "PROP_DESC_FLAG_OBJECT" + }, + { + "desc": "同一个类所有实例共享属性。", + "name": "PROP_DESC_FLAG_CLASS" + }, + { + "desc": "全局属性。", + "name": "PROP_DESC_FLAG_GLOBAL" + }, + { + "desc": "可读取。", + "name": "PROP_DESC_FLAG_READABLE," + }, + { + "desc": "可修改。", + "name": "PROP_DESC_FLAG_WRITBALE," + }, + { + "desc": "可配置。", + "name": "PROP_DESC_FLAG_CONFIGURABLE" + }, + { + "desc": "需要持久化。", + "name": "PROP_DESC_FLAG_PERSISTENT" + } + ], + "header": "tkc/value_desc.h", + "name": "prop_desc_flags_t", + "prefix": "PROP_DESC_FLAGS_", + "level": 1 + }, + { + "type": "enum", + "desc": "参数描述范围常量定义。", + "consts": [ + { + "desc": "必须提供。", + "name": "ARG_DESC_FLAGS_REQUIRED" + } + ], + "header": "tkc/value_desc.h", + "name": "arg_desc_flags_t", + "prefix": "ARG_DESC_FLAGS_", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "type", + "desc": "类型。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "format", + "desc": "格式。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "flags", + "desc": "flags。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "name", + "desc": "名称。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "display_name", + "desc": "显示名称。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "desc", + "desc": "描述。", + "type": "const char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "属性描述。", + "name": "value_desc_t", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "enums", + "desc": "枚举值。", + "type": "const char**", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "字符串枚举类型属性描述。", + "name": "value_desc_string_enums_t", + "level": 1 + }, + { + "type": "enum", + "desc": "类型常量定义。", + "consts": [ + { + "desc": "无效类型。", + "name": "VALUE_TYPE_INVALID" + }, + { + "desc": "BOOL类型。", + "name": "VALUE_TYPE_BOOL" + }, + { + "desc": "int8_t类型。", + "name": "VALUE_TYPE_INT8" + }, + { + "desc": "uint8_t类型。", + "name": "VALUE_TYPE_UINT8" + }, + { + "desc": "int16_t类型。", + "name": "VALUE_TYPE_INT16" + }, + { + "desc": "uint16_t类型。", + "name": "VALUE_TYPE_UINT16" + }, + { + "desc": "int32_t类型。", + "name": "VALUE_TYPE_INT32" + }, + { + "desc": "uint32_t类型。", + "name": "VALUE_TYPE_UINT32" + }, + { + "desc": "int64_t类型。", + "name": "VALUE_TYPE_INT64" + }, + { + "desc": "uint64_t类型。", + "name": "VALUE_TYPE_UINT64" + }, + { + "desc": "void*类型。", + "name": "VALUE_TYPE_POINTER" + }, + { + "desc": "float_t类型。", + "name": "VALUE_TYPE_FLOAT" + }, + { + "desc": "float类型。", + "name": "VALUE_TYPE_FLOAT32" + }, + { + "desc": "double类型。", + "name": "VALUE_TYPE_DOUBLE" + }, + { + "desc": "char*类型。", + "name": "VALUE_TYPE_STRING" + }, + { + "desc": "wchar_t*类型。", + "name": "VALUE_TYPE_WSTRING" + }, + { + "desc": "object_t*类型。", + "name": "VALUE_TYPE_OBJECT" + }, + { + "desc": "带长度的字符串。", + "name": "VALUE_TYPE_SIZED_STRING" + }, + { + "desc": "二进制数据。", + "name": "VALUE_TYPE_BINARY" + }, + { + "desc": "二进制数据(UBJSON)。", + "name": "VALUE_TYPE_UBJSON" + }, + { + "desc": "特殊用途。", + "name": "VALUE_TYPE_TOKEN" + } + ], + "header": "tkc/value.h", + "name": "value_type_t", + "prefix": "VALUE_TYPE_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "action的容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建waitable_action_queue对象。", + "name": "waitable_action_queue_create", + "return": { + "type": "waitable_action_queue_t*", + "desc": "waitable_action_queue对象。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + }, + { + "type": "qaction_t**", + "name": "action", + "desc": "用于返回action对象。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "接收一个请求。", + "name": "waitable_action_queue_recv", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + }, + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "发送一个请求。", + "name": "waitable_action_queue_send", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "waitable_action_queue_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/waitable_action_queue.h", + "desc": "waitable actionqueue", + "name": "waitable_action_queue_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "容量。" + }, + { + "type": "uint32_t", + "name": "block_size", + "desc": "块的大小。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建waitable_ring_buffer对象。", + "name": "waitable_ring_buffer_create", + "return": { + "type": "waitable_ring_buffer_t*", + "desc": "waitable_ring_buffer对象。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "接收数据的buff。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "读取数据的长度(必须等于 block_size)。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "读取数据。", + "name": "waitable_ring_buffer_read", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "要写入的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度(必须等于 block_size)。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "写入数据。", + "name": "waitable_ring_buffer_write", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "waitable_ring_buffer_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/waitable_ring_buffer.h", + "desc": "waitable ring buffer", + "name": "waitable_ring_buffer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "capacity", + "desc": "初始容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化字符串对象。", + "name": "wstr_init", + "return": { + "type": "wstr_t*", + "desc": "str对象本身。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "text", + "desc": "要设置的字符串。" + } + ], + "annotation": {}, + "desc": "设置字符串。", + "name": "wstr_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "清除字符串内容。", + "name": "wstr_clear", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要设置的字符串。" + } + ], + "annotation": {}, + "desc": "设置UTF8字符串。", + "name": "wstr_set_utf8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "返回的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "text最大长度。" + } + ], + "annotation": {}, + "desc": "获取UTF8字符串。", + "name": "wstr_get_utf8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "指定的位置。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "要删除的字符数。" + } + ], + "annotation": {}, + "desc": "删除指定范围的字符。", + "name": "wstr_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "指定的位置。" + }, + { + "type": "wchar_t*", + "name": "text", + "desc": "待插入的文本。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "要插入的字符数。" + } + ], + "annotation": {}, + "desc": "在指定位置插入字符串。", + "name": "wstr_insert", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "text", + "desc": "要追加的字符串。" + } + ], + "annotation": {}, + "desc": "追加字符串。", + "name": "wstr_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "text", + "desc": "要追加的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "追加字符串。", + "name": "wstr_append_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t", + "name": "c", + "desc": "字符。" + } + ], + "annotation": {}, + "desc": "追加一个字符。", + "name": "wstr_push", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "删除尾部字符。", + "name": "wstr_pop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式(用于snprintf格式化数值)" + }, + { + "type": "int32_t", + "name": "value", + "desc": "数值。" + } + ], + "annotation": {}, + "desc": "追加一个整数。", + "name": "wstr_push_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wstr_t*", + "name": "other", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "判断两个字符是否相同。", + "name": "wstr_equal", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示相同,否则表示不同。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "int32_t", + "name": "v", + "desc": "整数。" + } + ], + "annotation": {}, + "desc": "用整数初始化字符串。", + "name": "wstr_from_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "double", + "name": "v", + "desc": "浮点数。" + } + ], + "annotation": {}, + "desc": "用浮点数初始化字符串。", + "name": "wstr_from_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "value_t", + "name": "v", + "desc": "value。" + } + ], + "annotation": {}, + "desc": "用value初始化字符串。", + "name": "wstr_from_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "int32_t*", + "name": "v", + "desc": "用于返回整数。" + } + ], + "annotation": {}, + "desc": "将字符串转成整数。", + "name": "wstr_to_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "double*", + "name": "v", + "desc": "用于返回浮点数。" + } + ], + "annotation": {}, + "desc": "将字符串转成浮点数。", + "name": "wstr_to_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "double", + "name": "delta", + "desc": "要加上的值。" + } + ], + "annotation": {}, + "desc": "将字符串转成浮点数,加上delta,再转换回来。", + "name": "wstr_add_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "去掉浮点数小数点尾部的零。", + "name": "wstr_trim_float_zero", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t", + "name": "newline", + "desc": "换行符。" + } + ], + "annotation": {}, + "desc": "规范化换行符。", + "name": "wstr_normalize_newline", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t", + "name": "c", + "desc": "字符。" + } + ], + "annotation": {}, + "desc": "统计指定字符的个数。", + "name": "wstr_count_char", + "return": { + "type": "uint32_t", + "desc": "返回指定字符的个数。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "重置字符串为空。", + "name": "wstr_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "size", + "desc": "长度。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "str", + "desc": "字符串。", + "type": "wchar_t*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/wstr.h", + "desc": "可变长度的宽字符字符串。\n\n示例:\n\n```c\nwstr_t s;\nwstr_init(&s, 0);\n\nwstr_append(&s, L\"abc\");\nwstr_append(&s, L\"123\");\n\nwstr_reset(&s);\n```\n> 先调wstr\\_init进行初始化,最后调用wstr\\_reset释放内存。", + "name": "wstr_t", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s", + "desc": "wchar_t*。" + }, + { + "type": "wchar_t", + "name": "c", + "desc": "wchar_t。" + } + ], + "annotation": { + "global": true + }, + "desc": "查找字符位置", + "name": "wcs_chr", + "return": { + "type": "const wchar_t*", + "desc": "返回找到c的地址。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "wchar_t*", + "name": "s1", + "desc": "目标串。" + }, + { + "type": "const wchar_t*", + "name": "s2", + "desc": "源串。" + } + ], + "annotation": { + "global": true + }, + "desc": "复制字符串", + "name": "wcs_cpy", + "return": { + "type": "const wchar_t*", + "desc": "复制后的串地址。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s1", + "desc": "目标串。" + }, + { + "type": "const wchar_t*", + "name": "s2", + "desc": "源串。" + } + ], + "annotation": { + "global": true + }, + "desc": "比较字符串", + "name": "wcs_cmp", + "return": { + "type": "int", + "desc": "小于0表示s1s2。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s", + "desc": "串地址。" + } + ], + "annotation": { + "global": true + }, + "desc": "获取字符串长度。", + "name": "wcs_len", + "return": { + "type": "size_t", + "desc": "返回串长度'\\0'结尾。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s", + "desc": "源字符串。" + } + ], + "annotation": { + "global": true + }, + "desc": "获取一个新的内存保存s串。", + "name": "wcs_dup", + "return": { + "type": "wchar_t*", + "desc": "返回新的字符串地址。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + }, + { + "type": "ubjson_on_key_value_t", + "name": "on_key_value", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], + "annotation": { + "static": true + }, + "desc": "解析ubjson数据,遇到key/value时调用提供的回调函数。", + "name": "ubjson_parse", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + } + ], + "annotation": { + "static": true + }, + "desc": "解析ubjson数据,生成object对象。", + "name": "ubjson_to_object", + "return": { + "type": "void*", + "desc": "返回object表示的数据。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + } + ], + "annotation": { + "static": true + }, + "desc": "将ubjson数据打印到控制台。", + "name": "ubjson_dump", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "ubjson/ubjson_parser.h", + "desc": "ubjson parser", + "name": "ubjson_parser_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "ubjson_write_callback_t", + "name": "write", + "desc": "真正写入数据的函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "write函数的上下文。" + } + ], + "annotation": {}, + "desc": "初始化。", + "name": "ubjson_writer_init", + "return": { + "type": "ubjson_writer_t*", + "desc": "返回writer对象。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "value", + "desc": "key的名称。" + } + ], + "annotation": {}, + "desc": "写入key。", + "name": "ubjson_writer_write_key", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入null。", + "name": "ubjson_writer_write_null", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入noop。", + "name": "ubjson_writer_write_noop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入true。", + "name": "ubjson_writer_write_true", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入false。", + "name": "ubjson_writer_write_false", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int。", + "name": "ubjson_writer_write_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "int8_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int8。", + "name": "ubjson_writer_write_int8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "uint8_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入uint8。", + "name": "ubjson_writer_write_uint8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "int16_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int16。", + "name": "ubjson_writer_write_int16", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int32。", + "name": "ubjson_writer_write_int32", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "int64_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int64。", + "name": "ubjson_writer_write_int64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "float", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入float。", + "name": "ubjson_writer_write_float32", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "double", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入double。", + "name": "ubjson_writer_write_float64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "char", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入char。", + "name": "ubjson_writer_write_char", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "value", + "desc": "要写入的字符串。" + } + ], + "annotation": {}, + "desc": "写入str。", + "name": "ubjson_writer_write_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "value", + "desc": "要写入的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串的长度。" + } + ], + "annotation": {}, + "desc": "写入str。", + "name": "ubjson_writer_write_str_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "object_t*", + "name": "obj", + "desc": "要写入的对象。" + } + ], + "annotation": {}, + "desc": "写入obj。", + "name": "ubjson_writer_write_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入数组开始。\n> 即: [", + "name": "ubjson_writer_write_array_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入数组结束。\n> 即: ]", + "name": "ubjson_writer_write_array_end", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入对象开始。\n> 即: {", + "name": "ubjson_writer_write_object_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入对象结束。\n> 即:}", + "name": "ubjson_writer_write_object_end", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "写入二进制数据。", + "name": "ubjson_writer_write_data", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键值。" + } + ], + "annotation": {}, + "desc": "写key和对象的开始。\n\n> 即:\"key\": {", + "name": "ubjson_writer_write_kv_object_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "object_t*", + "name": "value", + "desc": "对象。" + } + ], + "annotation": {}, + "desc": "写key和对象。\n\n> 即:\"key\": { object }", + "name": "ubjson_writer_write_kv_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和int的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "int64_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和int64_t的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_int64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "float", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和float的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "double", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和double的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_double", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "bool_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和bool的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "const char*", + "name": "value", + "desc": "字符串。" + } + ], + "annotation": {}, + "desc": "写入key和str的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "const char*", + "name": "value", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串的长度。" + } + ], + "annotation": {}, + "desc": "写入key和str的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_str_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "value_t*", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和value_t的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "ubjson/ubjson_writer.h", + "desc": "ubjson writer", + "name": "ubjson_writer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "uint32_t", + "name": "duration", + "desc": "动画持续时间。" + }, + { + "type": "uint32_t", + "name": "delay", + "desc": "动画执行时间。" + }, + { + "type": "easing_type_t", + "name": "easing", + "desc": "插值函数类型。" + }, + { + "type": "const char*", + "name": "prop_name", + "desc": "属性的名称。" + } + ], + "annotation": {}, + "desc": "创建单属性动画对象。", + "name": "widget_animator_prop_create", + "return": { + "type": "widget_animator_t*", + "desc": "成功返回动画对象,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "widget_animator_t*", + "name": "animator", + "desc": "动画对象本身。" + }, + { + "type": "double", + "name": "from", + "desc": "prop起始值。" + }, + { + "type": "double", + "name": "to", + "desc": "prop结束值。" + } + ], + "annotation": {}, + "desc": "设置动画对象的参数。", + "name": "widget_animator_prop_set_params", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "widget_animators/widget_animator_prop.h", + "desc": "通过修改对象的指定属性形成动画效果。", + "name": "widget_animator_prop_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "uint32_t", + "name": "duration", + "desc": "动画持续时间。" + }, + { + "type": "uint32_t", + "name": "delay", + "desc": "动画执行时间。" + }, + { + "type": "easing_type_t", + "name": "easing", + "desc": "插值函数类型。" + }, + { + "type": "const char*", + "name": "prop1_name", + "desc": "属性1的名称。" + }, + { + "type": "const char*", + "name": "prop2_name", + "desc": "属性2的名称。" + } + ], + "annotation": {}, + "desc": "创建双属性动画对象。", + "name": "widget_animator_prop2_create", + "return": { + "type": "widget_animator_t*", + "desc": "成功返回动画对象,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "widget_animator_t*", + "name": "animator", + "desc": "动画对象本身。" + }, + { + "type": "double", + "name": "from1", + "desc": "x的初值。" + }, + { + "type": "double", + "name": "from2", + "desc": "y的初值。" + }, + { + "type": "double", + "name": "to1", + "desc": "x的终值。" + }, + { + "type": "double", + "name": "to2", + "desc": "y的终值。" + } + ], + "annotation": {}, + "desc": "设置动画对象的参数。", + "name": "widget_animator_prop2_set_params", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "widget_animators/widget_animator_prop2.h", + "desc": "通过修改对象的两个指定属性形成动画效果。", + "name": "widget_animator_prop2_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "uint32_t", + "name": "duration", + "desc": "动画持续时间。" + }, + { + "type": "uint32_t", + "name": "delay", + "desc": "动画执行时间。" + }, + { + "type": "easing_type_t", + "name": "easing", + "desc": "插值函数类型。" + } + ], + "annotation": {}, + "desc": "创建动画对象。", + "name": "widget_animator_scroll_create", + "return": { + "type": "widget_animator_t*", + "desc": "成功返回动画对象,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "widget_animator_t*", + "name": "animator", + "desc": "动画对象本身。" + }, + { + "type": "xy_t", + "name": "x_from", + "desc": "x起点值。" + }, + { + "type": "xy_t", + "name": "y_from", + "desc": "y起点值。" + }, + { + "type": "xy_t", + "name": "x_to", + "desc": "x终点值。" + }, + { + "type": "xy_t", + "name": "y_to", + "desc": "y终点值。" + } + ], + "annotation": {}, + "desc": "设置动画对象的参数。", + "name": "widget_animator_scroll_set_params", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "widget_animators/widget_animator_scroll.h", + "desc": "滚动控件的动画。\n本动画也可以用widget_animator_prop2实现,但滚动控件需要访问内部数据结构,出于可读性考虑保留独立实现。", + "name": "widget_animator_scroll_t", + "level": 1 + }, + { + "params": [], + "annotation": { + "global": true + }, + "desc": "初始化AWTK控件。", + "name": "tk_widgets_init", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + }, + "type": "method", + "header": "widgets/widgets.h", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char**", + "name": "attrs", + "desc": "属性列表。" + }, + { + "type": "const char*", + "name": "attr", + "desc": "属性名。" + } + ], + "annotation": {}, + "desc": "获取属性。", + "name": "xml_builder_get_attr", + "return": { + "type": "const char*", + "desc": "返回属性的值。" + } + } + ], + "events": [], + "properties": [], + "header": "xml/xml_builder.h", + "desc": "xml builder interface", + "name": "xml_builder_t", "level": 1 }, { @@ -31180,1570 +40619,253 @@ { "params": [ { - "type": "qaction_exec_t", - "name": "exec", - "desc": "执行函数。" - }, - { - "type": "void*", - "name": "args", - "desc": "参数。" - }, - { - "type": "uint32_t", - "name": "args_size", - "desc": "参数长度。" - } - ], - "annotation": {}, - "desc": "创建action对象。", - "name": "qaction_create", - "return": { - "type": "qaction_t*", - "desc": "返回action对象。" - } - }, - { - "params": [ - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - }, - { - "type": "qaction_on_event_t", - "name": "on_event", - "desc": "事件处理函数。" - } - ], - "annotation": {}, - "desc": "设置事件处理函数(回调函数在后台线程执行)。\n\n> exec执行完成后,会触发EVT\\_DONE事件,一般在EVT\\_DONE事件中调用qaction\\_destroy函数销毁action。", - "name": "qaction_set_on_event", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - } - ], - "annotation": {}, - "desc": "执行。", - "name": "qaction_exec", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - }, - { - "type": "event_t**", + "type": "event_t*", "name": "event", "desc": "event对象。" } ], - "annotation": {}, - "desc": "事件通知。", - "name": "qaction_notify", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "qaction_t*", - "name": "q", - "desc": "qaction对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "qaction_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "exec", - "desc": "执行函数。", - "type": "qaction_exec_t", - "annotation": { - "readable": true - } - }, - { - "name": "on_event", - "desc": "事件处理函数。如进度、错误和完成等。", - "type": "qaction_on_event_t", - "annotation": { - "readable": true - } - }, - { - "name": "args", - "desc": "exec的参数(视具体的action而不同)。", - "type": "uint32_t*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/qaction.h", - "desc": "代表一个action,放在action queue中。", - "name": "qaction_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char*", - "name": "path", - "desc": "插件所在的目录。" - }, - { - "type": "plugin_get_init_func_name_t", - "name": "get_init", - "desc": "获取初始化函数的函数名。为NULL时使用\"init\"。" - }, - { - "type": "plugin_get_deinit_func_name_t", - "name": "get_deinit", - "desc": "获取~初始化函数的函数名。为NULL时使用\"deinit\"。" - } - ], - "annotation": {}, - "desc": "创建插件管理器。", - "name": "plugin_manager_create", - "return": { - "type": "plugin_manager_t*", - "desc": "动态链接库对象。" - } - }, - { - "params": [ - { - "type": "plugin_manager_t*", - "name": "plugin_manager", - "desc": "plugin_manager对象。" - } - ], - "annotation": {}, - "desc": "重新扫描目录中的插件,加载没有加载的插件。", - "name": "plugin_manager_refresh", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "plugin_manager_t*", - "name": "plugin_manager", - "desc": "plugin_manager对象。" - } - ], - "annotation": {}, - "desc": "卸载所有插件并重新加载。", - "name": "plugin_manager_reload", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "plugin_manager_t*", - "name": "plugin_manager", - "desc": "plugin_manager对象。" - } - ], - "annotation": {}, - "desc": "显示所有的插件。", - "name": "plugin_manager_dump", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "plugin_manager_t*", - "name": "plugin_manager", - "desc": "plugin_manager对象。" - }, - { - "type": "const char*", - "name": "lib_name", - "desc": "动态库的名称。" - } - ], - "annotation": {}, - "desc": "检查指定的插件是否存在。", - "name": "plugin_manager_exist", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则表示不存在。" - } - }, - { - "params": [ - { - "type": "plugin_manager_t*", - "name": "plugin_manager", - "desc": "plugin_manager对象。" - } - ], - "annotation": {}, - "desc": "卸载全部插件,并销毁插件管理器对象。", - "name": "plugin_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/plugin_manager.h", - "desc": "插件管理器。", - "name": "plugin_manager_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "获取当前时间。", - "name": "get_time_ms64", - "return": { - "type": "uint64_t", - "desc": "成功返回当前时间。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "ms", - "desc": "睡眠时间(毫秒)。" - } - ], - "annotation": {}, - "desc": "睡眠指定时间。", - "name": "sleep_ms", - "return": { - "type": "void", - "desc": "无。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "平台准备函数。", - "name": "platform_prepare", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/platform.h", - "desc": "平台接口,包括:获取时间、休眠等函数。", - "name": "platform_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - }, - { - "type": "char*", - "name": "result", - "desc": "用于返回文件名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "返回文件名。", - "name": "path_basename", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - }, - { - "type": "char*", - "name": "result", - "desc": "用于返回文件扩展名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "返回文件扩展名。", - "name": "path_extname", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - }, - { - "type": "char*", - "name": "result", - "desc": "用于返回目录。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "返回目录。", - "name": "path_dirname", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - }, - { - "type": "char*", - "name": "result", - "desc": "用于返回规范后的路径。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "规范路径字符形式。", - "name": "path_normalize", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - }, - { - "type": "char*", - "name": "result", - "desc": "用于返回绝对路径。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "返回绝对路径。", - "name": "path_abs", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char* path*", - "name": "path", - "desc": "路径。" - } - ], - "annotation": {}, - "desc": "判断路径是否为绝对路径。", - "name": "path_is_abs", - "return": { - "type": "ret_t", - "desc": "返回FALSE表示不是绝对路径,否则表示是绝对路径。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "result", - "desc": "用于返回路径。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "构造路径。\n\n> 可变参数为字符串,以NULL参数结束。", - "name": "path_build", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "result", - "desc": "用于返回结果。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "char*", - "name": "filename", - "desc": "原始文件路径。" - }, - { - "type": "char*", - "name": "basename", - "desc": "替换后的文件名。" - } - ], - "annotation": {}, - "desc": "替换文件名。", - "name": "path_replace_basename", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "result", - "desc": "用于返回结果。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "char*", - "name": "filename", - "desc": "原始文件路径。" - }, - { - "type": "char*", - "name": "extname", - "desc": "替换后的文件扩展名。" - } - ], - "annotation": {}, - "desc": "替换文件扩展名。", - "name": "path_replace_extname", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "path", - "desc": "保存当前所在目录的路径。" - } - ], - "annotation": {}, - "desc": "获取当前所在目录。", - "name": "path_cwd", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "path", - "desc": "保存可执行文件所在目录。" - } - ], - "annotation": {}, - "desc": "获取可执行文件所在目录。", - "name": "path_exe", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "path", - "desc": "保存app所在目录。" - } - ], - "annotation": {}, - "desc": "获取app所在目录。", - "name": "path_app_root", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "path", - "desc": "目录。" - } - ], - "annotation": {}, - "desc": "判断目录是否存在。", - "name": "path_exist", - "return": { - "type": "ret_t", - "desc": "返回TRUE表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/path.h", - "desc": "路径相关的工具函数。", - "name": "path_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "enum", - "desc": "对象常见属性定义", - "consts": [ - { - "desc": "属性的个数。", - "name": "OBJECT_PROP_SIZE" - }, - { - "desc": "属性是否勾选。", - "name": "OBJECT_PROP_CHECKED" - } - ], - "header": "tkc/object.h", - "name": "object_prop_t", - "prefix": "OBJECT_PROP_", - "annotation": { - "scriptable": true, - "string": true - }, - "level": 1 - }, - { - "type": "enum", - "desc": "对象常见命令定义", - "consts": [ - { - "desc": "保存命令", - "name": "OBJECT_CMD_SAVE" - }, - { - "desc": "重新加载命令", - "name": "OBJECT_CMD_RELOAD" - }, - { - "desc": "和前一个属性交换位置\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_MOVE_UP" - }, - { - "desc": "和后一个属性交换位置\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_MOVE_DOWN" - }, - { - "desc": "删除属性。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_REMOVE" - }, - { - "desc": "删除勾选的属性。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_REMOVE_CHECKED" - }, - { - "desc": "清除全部属性。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_CLEAR" - }, - { - "desc": "增加子项。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_ADD" - }, - { - "desc": "显示对象详细信息。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_DETAIL" - }, - { - "desc": "编辑子项。\n>参数为属性的名称或路径。", - "name": "OBJECT_CMD_EDIT" - } - ], - "header": "tkc/object.h", - "name": "object_cmd_t", - "prefix": "OBJECT_CMD_", - "annotation": { - "scriptable": true, - "string": true - }, - "level": 1 - }, - { - "type": "enum", - "desc": "图片绘制方法常量定义。", - "consts": [ - { - "desc": "缺省显示。将图片按原大小显示在目标矩形的左上角。", - "name": "IMAGE_DRAW_DEFAULT" - }, - { - "desc": "居中显示。将图片按原大小显示在目标矩形的中央。", - "name": "IMAGE_DRAW_CENTER" - }, - { - "desc": "图标显示。同居中显示,但会根据屏幕密度调整大小。", - "name": "IMAGE_DRAW_ICON" - }, - { - "desc": "缩放显示。将图片缩放至目标矩形的大小(不保证宽高成比例)。", - "name": "IMAGE_DRAW_SCALE" - }, - { - "desc": "自动缩放显示。将图片缩放至目标矩形的宽度或高度(选取最小的比例),并居中显示。", - "name": "IMAGE_DRAW_SCALE_AUTO" - }, - { - "desc": "如果图片比目标矩形大,自动缩小显示,否则居中显示。", - "name": "IMAGE_DRAW_SCALE_DOWN" - }, - { - "desc": "宽度缩放显示。 将图片缩放至目标矩形的宽度,高度按此比例进行缩放,超出不部分不显示。", - "name": "IMAGE_DRAW_SCALE_W" - }, - { - "desc": "高度缩放显示。将图片缩放至目标矩形的高度,宽度按此比例进行缩放,超出不部分不显示。", - "name": "IMAGE_DRAW_SCALE_H" - }, - { - "desc": "平铺显示。", - "name": "IMAGE_DRAW_REPEAT" - }, - { - "desc": "水平方向平铺显示,垂直方向缩放。", - "name": "IMAGE_DRAW_REPEAT_X" - }, - { - "desc": "垂直方向平铺显示,水平方向缩放。", - "name": "IMAGE_DRAW_REPEAT_Y" - }, - { - "desc": "垂直方向平铺显示,水平方向缩放(从底部到顶部)。", - "name": "IMAGE_DRAW_REPEAT_Y_INVERSE" - }, - { - "desc": "9宫格显示。\n将图片分成等大小的9块,4个角按原大小显示在目标矩形的4个角,左右上下和中间5块分别缩放显示在对应的目标区域。", - "name": "IMAGE_DRAW_PATCH9" - }, - { - "desc": "水平方向3宫格显示,垂直方向居中显示。\n将图片在水平方向上分成等大小的3块,左右两块按原大小显示在目标矩形的左右,中间一块缩放显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_PATCH3_X" - }, - { - "desc": "垂直方向3宫格显示,水平方向居中显示。\n将图片在垂直方向上分成等大小的3块,上下两块按原大小显示在目标矩形的上下,中间一块缩放显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_PATCH3_Y" - }, - { - "desc": "水平方向3宫格显示,垂直方向缩放显示。\n将图片在水平方向上分成等大小的3块,左右两块按原大小显示在目标矩形的左右,中间一块缩放显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_PATCH3_X_SCALE_Y" - }, - { - "desc": "垂直方向3宫格显示,水平方向缩放显示。\n将图片在垂直方向上分成等大小的3块,上下两块按原大小显示在目标矩形的上下,中间一块缩放显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_PATCH3_Y_SCALE_X" - }, - { - "desc": "平铺9宫格显示。\n将图片分成4个角和5块平铺块,4个角按原大小显示在目标矩形的4个角,其余5块会平铺对应的目标区域。\n切割方法为(如下图):\n如果图片宽度为奇数,则中间一块为一列数据,如果图片宽度为偶数,则中间一块为二列数据,其他数据分为左右块\n如果图片高度为奇数,则中间一块为一行数据,如果图片高度为偶数,则中间一块为二行数据,其他数据分为上下块\n中间一块数据根据上面两条规则组成4中情况,分别是一列一行数据,一列两行数据,两列一行数据和两行两列数据", - "name": "IMAGE_DRAW_REPEAT9" - }, - { - "desc": "水平方向3宫格显示,垂直方向居中显示。\n将图片在水平方向上分成左右相等两块和中间一块,如果图片宽度为奇数,则中间一块为一列数据,如果图片宽度为偶数,则中间一块为二列数据,其他数据分为左右块。\n左右两块按原大小显示在目标矩形的左右,中间一列像素点平铺显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_REPEAT3_X" - }, - { - "desc": "垂直方向3宫格显示,水平方向居中显示。\n将图片在垂直方向上分成上下相等两块和中间一块,如果图片高度为奇数,则中间一块为一行数据,如果图片高度为偶数,则中间一块为二行数据,其他数据分为上下块\n上下两块按原大小显示在目标矩形的上下,中间一块平铺显示在目标区域中间剩余部分。", - "name": "IMAGE_DRAW_REPEAT3_Y" - } - ], - "header": "base/bitmap.h", - "name": "image_draw_type_t", - "prefix": "IMAGE_DRAW_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建named_value对象。", - "name": "named_value_create", - "return": { - "type": "named_value_t*", - "desc": "返回named_value对象。" - } - }, - { - "params": [ - { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "名称。" - }, - { - "type": "const value_t*", - "name": "value", - "desc": "值。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化。", - "name": "named_value_init", - "return": { - "type": "ret_t", - "desc": "返回named_value对象。" - } - }, - { - "params": [ - { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" - } - ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为named_value对象(供脚本语言使用)。", - "name": "named_value_cast", + "desc": "把event对象转wheel_event_t对象,主要给脚本语言使用。", + "name": "wheel_event_cast", "return": { - "type": "named_value_t*", - "desc": "返回named_value对象。" + "type": "wheel_event_t*", + "desc": "event对象。" } }, { "params": [ { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" + "type": "wheel_event_t*", + "name": "event", + "desc": "event对象。" }, { - "type": "const char*", - "name": "name", - "desc": "名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置名称。", - "name": "named_value_set_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" + "type": "void*", + "name": "target", + "desc": "事件目标。" }, { - "type": "const value_t*", - "name": "value", - "desc": "值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置值。", - "name": "named_value_set_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" + "type": "int32_t", + "name": "dy", + "desc": "滚轮的y值。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取值对象(主要给脚本语言使用)。", - "name": "named_value_get_value", + "annotation": {}, + "desc": "初始化事件。", + "name": "wheel_event_init", "return": { - "type": "value_t*", - "desc": "返回值对象。" - } - }, - { - "params": [ - { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" - } - ], - "annotation": { - "deconstructor": true - }, - "desc": "重置named_value对象。", - "name": "named_value_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "named_value_t*", - "name": "nv", - "desc": "named_value对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "销毁named_value对象。", - "name": "named_value_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "event_t*", + "desc": "event对象。" } } ], "events": [], "properties": [ { - "name": "name", - "desc": "名称。", - "type": "char*", + "name": "dy", + "desc": "滚轮的y值。", + "type": "int32_t", "annotation": { "readable": true, "scriptable": true } }, { - "name": "value", - "desc": "值。", + "name": "alt", + "desc": "alt键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "ctrl", + "desc": "ctrl键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "shift", + "desc": "shift键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "滚轮事件。", + "name": "wheel_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转orientation_event_t对象,主要给脚本语言使用。", + "name": "orientation_event_cast", + "return": { + "type": "orientation_event_t*", + "desc": "event对象。" + } + }, + { + "params": [ + { + "type": "orientation_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "int32_t", + "name": "dy", + "desc": "滚轮的y值。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "orientation_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "orientation", + "desc": "屏幕方向。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "滚轮事件。", + "name": "orientation_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转value_change_event_t对象,主要给脚本语言使用。", + "name": "value_change_event_cast", + "return": { + "type": "value_change_event_t*", + "desc": "event对象。" + } + }, + { + "params": [ + { + "type": "value_change_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "value_change_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "old_value", + "desc": "旧值。", + "type": "value_t", + "annotation": { + "readable": true + } + }, + { + "name": "new_value", + "desc": "新值。", "type": "value_t", "annotation": { "readable": true } } ], - "header": "tkc/named_value.h", - "desc": "命名的值。", - "name": "named_value_t", + "header": "base/events.h", + "desc": "值变化事件。", + "name": "value_change_event_t", "annotation": { "scriptable": true }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "创建mutex。", - "name": "tk_mutex_create", - "return": { - "type": "tk_mutex_t*", - "desc": "mutex对象。" - } - }, - { - "params": [ - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - } - ], - "annotation": {}, - "desc": "加锁。", - "name": "tk_mutex_lock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - } - ], - "annotation": {}, - "desc": "尝试加锁。", - "name": "tk_mutex_try_lock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - } - ], - "annotation": {}, - "desc": "解锁。", - "name": "tk_mutex_unlock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - } - ], - "annotation": {}, - "desc": "销毁mutex对象。", - "name": "tk_mutex_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/mutex.h", - "desc": "互斥锁。", - "name": "tk_mutex_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "创建嵌套互斥锁。", - "name": "tk_mutex_nest_create", - "return": { - "type": "tk_mutex_nest_t*", - "desc": "mutex_nest对象。" - } - }, - { - "params": [ - { - "type": "tk_mutex_nest_t*", - "name": "mutex_nest", - "desc": "mutex_nest对象。" - } - ], - "annotation": {}, - "desc": "加锁。", - "name": "tk_mutex_nest_lock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_nest_t*", - "name": "mutex_nest", - "desc": "mutex_nest对象。" - } - ], - "annotation": {}, - "desc": "尝试加锁。", - "name": "tk_mutex_nest_try_lock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_nest_t*", - "name": "mutex_nest", - "desc": "mutex_nest对象。" - } - ], - "annotation": {}, - "desc": "解锁。只允许解锁当前线程所加的锁。", - "name": "tk_mutex_nest_unlock", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_mutex_nest_t*", - "name": "mutex_nest", - "desc": "mutex_nest对象。" - } - ], - "annotation": {}, - "desc": "销毁mutex_nest对象。", - "name": "tk_mutex_nest_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/mutex_nest.h", - "desc": "嵌套互斥锁。允许同一个线程多次加锁。", - "name": "tk_mutex_nest_t", - "level": 1 - }, - { - "type": "enum", - "desc": "MIME_TYPE。", - "consts": [ - { - "desc": "\"application/envoy\"。", - "name": "MIME_TYPE_APPLICATION_ENVOY" - }, - { - "desc": "\"application/fractals\"。", - "name": "MIME_TYPE_APPLICATION_FRACTALS" - }, - { - "desc": "\"application/futuresplash\"。", - "name": "MIME_TYPE_APPLICATION_FUTURESPLASH" - }, - { - "desc": "\"application/hta\"。", - "name": "MIME_TYPE_APPLICATION_HTA" - }, - { - "desc": "\"application/json\"。", - "name": "MIME_TYPE_APPLICATION_JSON" - }, - { - "desc": "\"application/ubjson\"。", - "name": "MIME_TYPE_APPLICATION_UBJSON" - }, - { - "desc": "\"application/mac-binhex40\"。", - "name": "MIME_TYPE_APPLICATION_MAC_BINHEX40" - }, - { - "desc": "\"application/msword\"。", - "name": "MIME_TYPE_APPLICATION_MSWORD" - }, - { - "desc": "\"application/octet-stream\"。", - "name": "MIME_TYPE_APPLICATION_OCTET_STREAM" - }, - { - "desc": "\"application/oda\"。", - "name": "MIME_TYPE_APPLICATION_ODA" - }, - { - "desc": "\"application/olescript\"。", - "name": "MIME_TYPE_APPLICATION_OLESCRIPT" - }, - { - "desc": "\"application/pdf\"。", - "name": "MIME_TYPE_APPLICATION_PDF" - }, - { - "desc": "\"application/pics-rules\"。", - "name": "MIME_TYPE_APPLICATION_PICS_RULES" - }, - { - "desc": "\"application/pkcs10\"。", - "name": "MIME_TYPE_APPLICATION_PKCS10" - }, - { - "desc": "\"application/pkix-crl\"。", - "name": "MIME_TYPE_APPLICATION_PKIX_CRL" - }, - { - "desc": "\"application/postscript\"。", - "name": "MIME_TYPE_APPLICATION_POSTSCRIPT" - }, - { - "desc": "\"application/rtf\"。", - "name": "MIME_TYPE_APPLICATION_RTF" - }, - { - "desc": "\"application/vnd.ms-excel\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_EXCEL" - }, - { - "desc": "\"application/vnd.ms-outlook\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_OUTLOOK" - }, - { - "desc": "\"application/vnd.ms-pkicertstore\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKICERTSTORE" - }, - { - "desc": "\"application/vnd.ms-pkiseccat\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKISECCAT" - }, - { - "desc": "\"application/vnd.ms-pkistl\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKISTL" - }, - { - "desc": "\"application/vnd.ms-powerpoint\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_POWERPOINT" - }, - { - "desc": "\"application/vnd.ms-project\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PROJECT" - }, - { - "desc": "\"application/vnd.ms-works\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_WORKS" - }, - { - "desc": "\"application/winhlp\"。", - "name": "MIME_TYPE_APPLICATION_WINHLP" - }, - { - "desc": "\"application/x-bcpio\"。", - "name": "MIME_TYPE_APPLICATION_X_BCPIO" - }, - { - "desc": "\"application/x-cdf\"。", - "name": "MIME_TYPE_APPLICATION_X_CDF" - }, - { - "desc": "\"application/x-compress\"。", - "name": "MIME_TYPE_APPLICATION_X_COMPRESS" - }, - { - "desc": "\"application/x-compressed\"。", - "name": "MIME_TYPE_APPLICATION_X_COMPRESSED" - }, - { - "desc": "\"application/x-cpio\"。", - "name": "MIME_TYPE_APPLICATION_X_CPIO" - }, - { - "desc": "\"application/x-csh\"。", - "name": "MIME_TYPE_APPLICATION_X_CSH" - }, - { - "desc": "\"application/x-director\"。", - "name": "MIME_TYPE_APPLICATION_X_DIRECTOR" - }, - { - "desc": "\"application/x-dvi\"。", - "name": "MIME_TYPE_APPLICATION_X_DVI" - }, - { - "desc": "\"application/x-gtar\"。", - "name": "MIME_TYPE_APPLICATION_X_GTAR" - }, - { - "desc": "\"application/x-gzip\"。", - "name": "MIME_TYPE_APPLICATION_X_GZIP" - }, - { - "desc": "\"application/x-hdf\"。", - "name": "MIME_TYPE_APPLICATION_X_HDF" - }, - { - "desc": "\"application/x-iphone\"。", - "name": "MIME_TYPE_APPLICATION_X_IPHONE" - }, - { - "desc": "\"application/x-javascript\"。", - "name": "MIME_TYPE_APPLICATION_X_JAVASCRIPT" - }, - { - "desc": "\"application/x-latex\"。", - "name": "MIME_TYPE_APPLICATION_X_LATEX" - }, - { - "desc": "\"application/x-msaccess\"。", - "name": "MIME_TYPE_APPLICATION_X_MSACCESS" - }, - { - "desc": "\"application/x-mscardfile\"。", - "name": "MIME_TYPE_APPLICATION_X_MSCARDFILE" - }, - { - "desc": "\"application/x-msclip\"。", - "name": "MIME_TYPE_APPLICATION_X_MSCLIP" - }, - { - "desc": "\"application/x-msdownload\"。", - "name": "MIME_TYPE_APPLICATION_X_MSDOWNLOAD" - }, - { - "desc": "\"application/x-msmediaview\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMEDIAVIEW" - }, - { - "desc": "\"application/x-msmetafile\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMETAFILE" - }, - { - "desc": "\"application/x-msmoney\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMONEY" - }, - { - "desc": "\"application/x-mspublisher\"。", - "name": "MIME_TYPE_APPLICATION_X_MSPUBLISHER" - }, - { - "desc": "\"application/x-msschedule\"。", - "name": "MIME_TYPE_APPLICATION_X_MSSCHEDULE" - }, - { - "desc": "\"application/x-msterminal\"。", - "name": "MIME_TYPE_APPLICATION_X_MSTERMINAL" - }, - { - "desc": "\"application/x-mswrite\"。", - "name": "MIME_TYPE_APPLICATION_X_MSWRITE" - }, - { - "desc": "\"application/x-netcdf\"。", - "name": "MIME_TYPE_APPLICATION_X_NETCDF" - }, - { - "desc": "\"application/x-perfmon\"。", - "name": "MIME_TYPE_APPLICATION_X_PERFMON" - }, - { - "desc": "\"application/x-pkcs12\"。", - "name": "MIME_TYPE_APPLICATION_X_PKCS12" - }, - { - "desc": "\"application/x-sh\"。", - "name": "MIME_TYPE_APPLICATION_X_SH" - }, - { - "desc": "\"application/x-shar\"。", - "name": "MIME_TYPE_APPLICATION_X_SHAR" - }, - { - "desc": "\"application/x-shockwave-flash\"。", - "name": "MIME_TYPE_APPLICATION_X_SHOCKWAVE_FLASH" - }, - { - "desc": "\"application/x-stuffit\"。", - "name": "MIME_TYPE_APPLICATION_X_STUFFIT" - }, - { - "desc": "\"application/x-sv4cpio\"。", - "name": "MIME_TYPE_APPLICATION_X_SV4CPIO" - }, - { - "desc": "\"application/x-sv4crc\"。", - "name": "MIME_TYPE_APPLICATION_X_SV4CRC" - }, - { - "desc": "\"application/x-tar\"。", - "name": "MIME_TYPE_APPLICATION_X_TAR" - }, - { - "desc": "\"application/x-tcl\"。", - "name": "MIME_TYPE_APPLICATION_X_TCL" - }, - { - "desc": "\"application/x-tex\"。", - "name": "MIME_TYPE_APPLICATION_X_TEX" - }, - { - "desc": "\"application/x-texinfo\"。", - "name": "MIME_TYPE_APPLICATION_X_TEXINFO" - }, - { - "desc": "\"application/x-troff\"。", - "name": "MIME_TYPE_APPLICATION_X_TROFF" - }, - { - "desc": "\"application/x-ustar\"。", - "name": "MIME_TYPE_APPLICATION_X_USTAR" - }, - { - "desc": "\"application/zip\"。", - "name": "MIME_TYPE_APPLICATION_ZIP" - }, - { - "desc": "\"audio/basic\"。", - "name": "MIME_TYPE_AUDIO_BASIC" - }, - { - "desc": "\"audio/mid\"。", - "name": "MIME_TYPE_AUDIO_MID" - }, - { - "desc": "\"audio/mpeg\"。", - "name": "MIME_TYPE_AUDIO_MPEG" - }, - { - "desc": "\"audio/x-aiff\"。", - "name": "MIME_TYPE_AUDIO_X_AIFF" - }, - { - "desc": "\"audio/x-mpegurl\"。", - "name": "MIME_TYPE_AUDIO_X_MPEGURL" - }, - { - "desc": "\"audio/x-wav\"。", - "name": "MIME_TYPE_AUDIO_X_WAV" - }, - { - "desc": "\"image/bmp\"。", - "name": "MIME_TYPE_IMAGE_BMP" - }, - { - "desc": "\"image/cis-cod\"。", - "name": "MIME_TYPE_IMAGE_CIS_COD" - }, - { - "desc": "\"image/gif\"。", - "name": "MIME_TYPE_IMAGE_GIF" - }, - { - "desc": "\"image/ief\"。", - "name": "MIME_TYPE_IMAGE_IEF" - }, - { - "desc": "\"image/jpeg\"。", - "name": "MIME_TYPE_IMAGE_JPEG" - }, - { - "desc": "\"image/pipeg\"。", - "name": "MIME_TYPE_IMAGE_PIPEG" - }, - { - "desc": "\"image/svg+xml\"。", - "name": "MIME_TYPE_IMAGE_SVG_XML" - }, - { - "desc": "\"image/tiff\"。", - "name": "MIME_TYPE_IMAGE_TIFF" - }, - { - "desc": "\"image/x-cmx\"。", - "name": "MIME_TYPE_IMAGE_X_CMX" - }, - { - "desc": "\"image/x-icon\"。", - "name": "MIME_TYPE_IMAGE_X_ICON" - }, - { - "desc": "\"image/x-rgb\"。", - "name": "MIME_TYPE_IMAGE_X_RGB" - }, - { - "desc": "\"image/x-xbitmap\"。", - "name": "MIME_TYPE_IMAGE_X_XBITMAP" - }, - { - "desc": "\"image/x-xpixmap\"。", - "name": "MIME_TYPE_IMAGE_X_XPIXMAP" - }, - { - "desc": "\"image/x-xwindowdump\"。", - "name": "MIME_TYPE_IMAGE_X_XWINDOWDUMP" - }, - { - "desc": "\"message/rfc822\"。", - "name": "MIME_TYPE_MESSAGE_RFC822" - }, - { - "desc": "\"text/css\"。", - "name": "MIME_TYPE_TEXT_CSS" - }, - { - "desc": "\"text/h323\"。", - "name": "MIME_TYPE_TEXT_H323" - }, - { - "desc": "\"text/html\"。", - "name": "MIME_TYPE_TEXT_HTML" - }, - { - "desc": "\"text/iuls\"。", - "name": "MIME_TYPE_TEXT_IULS" - }, - { - "desc": "\"text/plain\"。", - "name": "MIME_TYPE_TEXT_PLAIN" - }, - { - "desc": "\"text/richtext\"。", - "name": "MIME_TYPE_TEXT_RICHTEXT" - }, - { - "desc": "\"text/scriptlet\"。", - "name": "MIME_TYPE_TEXT_SCRIPTLET" - }, - { - "desc": "\"text/webviewhtml\"。", - "name": "MIME_TYPE_TEXT_WEBVIEWHTML" - }, - { - "desc": "\"text/x-component\"。", - "name": "MIME_TYPE_TEXT_X_COMPONENT" - }, - { - "desc": "\"text/x-setext\"。", - "name": "MIME_TYPE_TEXT_X_SETEXT" - }, - { - "desc": "\"text/x-vcard\"。", - "name": "MIME_TYPE_TEXT_X_VCARD" - }, - { - "desc": "\"video/mpeg\"。", - "name": "MIME_TYPE_VIDEO_MPEG" - }, - { - "desc": "\"video/quicktime\"。", - "name": "MIME_TYPE_VIDEO_QUICKTIME" - }, - { - "desc": "\"video/x-msvideo\"。", - "name": "MIME_TYPE_VIDEO_X_MSVIDEO" - } - ], - "header": "tkc/mime_types.h", - "name": "MIME_TYPE", - "prefix": "MIME_TYPE_", - "annotation": { - "scriptable": true, - "string": true - }, - "level": 1 + "parent": "event_t", + "level": 2 }, { "type": "class", @@ -32751,4081 +40873,64 @@ { "params": [ { - "type": "uint32_t", - "name": "size", - "desc": "内存大小。" - } - ], - "annotation": { - "macro": true - }, - "desc": "分配一块内存。", - "name": "TKMEM_ALLOC", - "export": "tk_alloc", - "return": { - "type": "void*", - "desc": "成功返回内存块首地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "nmemb", - "desc": "内存块数量。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "每一块的大小。" - } - ], - "annotation": { - "macro": true - }, - "desc": "分配一块内存,并将内容清零。", - "name": "TKMEM_CALLOC", - "export": "tk_calloc", - "return": { - "type": "void*", - "desc": "成功返回内存块首地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "p", - "desc": "原来的内存地址。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "每一块的大小。" - } - ], - "annotation": { - "macro": true - }, - "desc": "重新分配一块内存,如果原来的内存块大于等于需要的空间,直接返回原来的内存块。", - "name": "TKMEM_REALLOC", - "export": "tk_realloc", - "return": { - "type": "void*", - "desc": "成功返回内存块首地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "p", - "desc": "内存地址。" - } - ], - "annotation": { - "macro": true - }, - "desc": "释放内存。", - "name": "TKMEM_FREE", - "export": "tk_free", - "return": { - "type": "void", - "desc": "无。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "显示内存信息。", - "name": "tk_mem_dump", - "return": { - "type": "void", - "desc": "返回void。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "buffer", - "desc": "内存地址。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "内存长度。" - } - ], - "annotation": {}, - "desc": "初始化内存。", - "name": "tk_mem_init", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "初始化互斥和oom。", - "name": "tk_mem_init_stage2", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "检查给定的地址是否是一个有效的heap地址。\n\n> 用于辅助发现内存问题。", - "name": "tk_mem_is_valid_addr", - "return": { - "type": "bool_t", - "desc": "返回FALSE一定是无效地址,返回TRUE在PC则不太确定。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/mem.h", - "desc": "内存管理相关的宏和函数。\n\n示例:\n\n```c\nchar* str = (char*)TKMEM_ALLOC(100);\n...\nTKMEM_FREE(str);\n```\n\n```c\nchar* str = (char*)TKMEM_ALLOC(100);\n...\nstr = (char*)TKMEM_REALLOC(str, 128);\n...\nTKMEM_FREE(str);\n```", - "name": "tk_mem_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "mem_allocator_t*", - "name": "allocator", - "desc": "allocator对象。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "内存的大小。" - }, - { - "type": "const char*", - "name": "", - "desc": "。" - }, - { - "type": "uint32_t", - "name": "line", - "desc": "分配内存的行数(用于调试)。" - } - ], - "annotation": {}, - "desc": "分配指定大小的内存。", - "name": "mem_allocator_alloc", - "export": "none", - "return": { - "type": "void*", - "desc": "成功返回内存块的地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "mem_allocator_t*", - "name": "allocator", - "desc": "allocator对象。" - }, - { - "type": "void*", - "name": "ptr", - "desc": "原来内存的地址。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "内存的大小。" - }, - { - "type": "const char*", - "name": "", - "desc": "。" - }, - { - "type": "uint32_t", - "name": "line", - "desc": "分配内存的行数(用于调试)。" - } - ], - "annotation": {}, - "desc": "重新分配指定大小的内存。", - "name": "mem_allocator_realloc", - "export": "none", - "return": { - "type": "void*", - "desc": "成功返回内存块的地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "mem_allocator_t*", - "name": "allocator", - "desc": "allocator对象。" - }, - { - "type": "void*", - "name": "ptr", - "desc": "内存的地址。" - } - ], - "annotation": {}, - "desc": "释放内存。", - "name": "mem_allocator_free", - "export": "none", - "return": { - "type": "void*", - "desc": "成功返回内存块的地址,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "mem_allocator_t*", - "name": "allocator", - "desc": "allocator对象。" - } - ], - "annotation": {}, - "desc": "显示内存信息,用于调试。", - "name": "mem_allocator_dump", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "mem_allocator_t*", - "name": "allocator", - "desc": "allocator对象。" - } - ], - "annotation": {}, - "desc": "销毁内存分配器。", - "name": "mem_allocator_destroy", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/mem_allocator.h", - "desc": "内存分配接口。", - "name": "mem_allocator_t", - "level": 1 - }, - { - "type": "enum", - "desc": "指示器默认绘制的类型。", - "consts": [ - { - "desc": "自动选择。", - "name": "INDICATOR_DEFAULT_PAINT_AUTO" - }, - { - "desc": "实心圆点指示器,当前项填充selected_fg_color,其他填充fg_color。", - "name": "INDICATOR_DEFAULT_PAINT_FILL_DOT" - }, - { - "desc": "镂空圆点指示器,当前项填充selected_fg_color,其他镂空fg_color。", - "name": "INDICATOR_DEFAULT_PAINT_STROKE_DOT" - }, - { - "desc": "实心矩形指示器,当前项填充selected_fg_color,其他填充fg_color。", - "name": "INDICATOR_DEFAULT_PAINT_FILL_RECT" - }, - { - "desc": "镂空矩形指示器,当前项填充selected_fg_color,其他镂空fg_color。", - "name": "INDICATOR_DEFAULT_PAINT_STROKE_RECT" - } - ], - "header": "slide_view/slide_indicator.h", - "name": "indicator_default_paint_t", - "prefix": "INDICATOR_DEFAULT_PAINT_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - } - ], - "annotation": {}, - "desc": "初始化矩阵对象。", - "name": "matrix_init", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - } - ], - "annotation": {}, - "desc": "重置矩阵对象为单位矩阵。", - "name": "matrix_identity", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - } - ], - "annotation": {}, - "desc": "求矩阵的逆。", - "name": "matrix_invert", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "float", - "name": "a0", - "desc": "a0" - }, - { - "type": "float", - "name": "a1", - "desc": "a1" - }, - { - "type": "float", - "name": "a2", - "desc": "a2" - }, - { - "type": "float", - "name": "a3", - "desc": "a3" - }, - { - "type": "float", - "name": "a4", - "desc": "a4" - }, - { - "type": "float", - "name": "a5", - "desc": "a5" - } - ], - "annotation": {}, - "desc": "设置矩阵的参数。", - "name": "matrix_set", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "matrix_t*", - "name": "b", - "desc": "矩阵对象。" - } - ], - "annotation": {}, - "desc": "矩阵相乘。", - "name": "matrix_multiply", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "float", - "name": "x", - "desc": "x" - }, - { - "type": "float", - "name": "y", - "desc": "y" - } - ], - "annotation": {}, - "desc": "平移。", - "name": "matrix_translate", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "float", - "name": "sx", - "desc": "sx" - }, - { - "type": "float", - "name": "sy", - "desc": "sy" - } - ], - "annotation": {}, - "desc": "缩放。", - "name": "matrix_scale", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "float", - "name": "rad", - "desc": "角度。" - } - ], - "annotation": {}, - "desc": "旋转。", - "name": "matrix_rotate", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - }, - { - "params": [ - { - "type": "matrix_t*", - "name": "m", - "desc": "矩阵对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y" - }, - { - "type": "xy_t*", - "name": "out_x", - "desc": "out_x" - }, - { - "type": "xy_t*", - "name": "out_y", - "desc": "out_y" - } - ], - "annotation": {}, - "desc": "对点进行变换。", - "name": "matrix_transform_point", - "return": { - "type": "matrix_t*", - "desc": "矩阵对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/matrix.h", - "desc": "2D矩阵对象。", - "name": "matrix_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "获取log的级别。", - "name": "log_get_log_level", - "return": { - "type": "log_level_t", - "desc": "返回log的级别。" - } - }, - { - "params": [ - { - "type": "log_level_t", - "name": "log_level", - "desc": "log的级别。" - } - ], - "annotation": {}, - "desc": "设置log的级别。", - "name": "log_set_log_level", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "format", - "desc": "格式或信息。" - } - ], - "annotation": {}, - "desc": "输出调试信息。\n> 变参函数。\n\n```\nlog_debug(\"debug message\\n\");\n```", - "name": "log_debug", - "export": "none", - "return": { - "type": "void", - "desc": "无返回值。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "format", - "desc": "格式或信息。" - } - ], - "annotation": {}, - "desc": "输出参考信息。\n> 变参函数。\n\n```\nlog_info(\"info message\\n\");\n```", - "name": "log_info", - "export": "none", - "return": { - "type": "void", - "desc": "无返回值。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "format", - "desc": "格式或信息。" - } - ], - "annotation": {}, - "desc": "输出警告信息。\n> 变参函数。\n\n```\nlog_warn(\"warn message\\n\");\n```", - "name": "log_warn", - "export": "none", - "return": { - "type": "void", - "desc": "无返回值。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "format", - "desc": "格式或信息。" - } - ], - "annotation": {}, - "desc": "输出错误信息。\n> 变参函数。\n\n```\nlog_error(\"error message\\n\");\n```", - "name": "log_error", - "export": "none", - "return": { - "type": "void", - "desc": "无返回值。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/log.h", - "desc": "log。", - "name": "log_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "enum", - "desc": "LOG的级别。", - "consts": [ - { - "desc": "DEBUG", - "name": "LOG_LEVEL_DEBUG" - }, - { - "desc": "INFO", - "name": "LOG_LEVEL_INFO" - }, - { - "desc": "WARN", - "name": "LOG_LEVEL_WARN" - }, - { - "desc": "ERROR", - "name": "LOG_LEVEL_ERROR" - } - ], - "header": "tkc/log.h", - "name": "log_level_t", - "prefix": "LOG_LEVEL_", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const int_str_t*", - "name": "items", - "desc": "int_str_t数组。" - }, - { - "type": "int32_t", - "name": "name", - "desc": "name。" - } - ], - "annotation": {}, - "desc": "根据name获取对应的value。", - "name": "int_str_value", - "return": { - "type": "const char*", - "desc": "返回value。" - } - }, - { - "params": [ - { - "type": "const int_str_t*", - "name": "items", - "desc": "int_str_t数组。" - }, - { - "type": "const char*", - "name": "value", - "desc": "value。" - }, - { - "type": "int32_t", - "name": "defval", - "desc": "如果没有找到对应的name,则返回的defval默认值。" - } - ], - "annotation": {}, - "desc": "根据value获取对应的name。", - "name": "int_str_name", - "return": { - "type": "int32_t", - "desc": "返回name。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/int_str.h", - "desc": "数字-字符串类型。\n\n负责把一个数字映射成一个字符串。\n\n示例:\n\n```c\nstatic const int_str_t color_values[] = {{1, \"red\"}, {2, \"black\"}, {3, \"blue\"}, {4, \"white\"}};\nconst char* value = int_str_value(color_values, 3);\nint32_t name = int_str_name(color_values, \"blue\", 0);\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %d \\n\", name);\n```", - "name": "int_str_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的idle_manager_t管理器。", - "name": "idle_manager", - "return": { - "type": "idle_manager_t*", - "desc": "返回idle_manager_t管理器对象。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager_t", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的idle_manager_t管理器。", - "name": "idle_manager_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建idle_manager_t管理器。", - "name": "idle_manager_create", - "return": { - "type": "idle_manager_t*", - "desc": "返回idle_manager_t管理器对象。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化idle_manager_t管理器。", - "name": "idle_manager_init", - "return": { - "type": "idle_manager_t*", - "desc": "返回idle_manager_t管理器对象。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": {}, - "desc": "析构idle_manager_t管理器。", - "name": "idle_manager_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": {}, - "desc": "析构并释放idle_manager_t管理器。", - "name": "idle_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": {}, - "desc": "返回idle的个数。", - "name": "idle_manager_count", - "return": { - "type": "uint32_t", - "desc": "返回timer的个数。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - } - ], - "annotation": {}, - "desc": "删除全部idle。", - "name": "idle_manager_remove_all", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - }, - { - "type": "uint32_t", - "name": "idle_id", - "desc": "idle_id。" - } - ], - "annotation": {}, - "desc": "根据idle_id删除idle。", - "name": "idle_manager_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - }, - { - "type": "idle_info_t*", - "name": "idle", - "desc": "idle对象。" - } - ], - "annotation": {}, - "desc": "追加idle。", - "name": "idle_manager_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - }, - { - "type": "uint32_t", - "name": "idle_id", - "desc": "idle_id。" - } - ], - "annotation": {}, - "desc": "查找指定ID的idle。", - "name": "idle_manager_find", - "return": { - "type": "idle_info_t*", - "desc": "返回idle的信息。" - } - }, - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "idle_manager_t管理器对象。" - }, - { - "type": "idle_func_t*", - "name": "on_idle", - "desc": "idle回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "idle回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "添加idle。", - "name": "idle_manager_add", - "return": { - "type": "uint32_t", - "desc": "返回idle的ID,TK_INVALID_ID表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/idle_manager.h", - "desc": "idle_manager_t管理器。", - "name": "idle_manager_t", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "name", - "desc": "名称。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "desc", - "desc": "描述。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "exec", - "desc": "函数指针。", - "type": "func_exec_t", - "annotation": { - "readable": true - } - }, - { - "name": "args", - "desc": "函数参数描述。", - "type": "arg_desc_t**", - "annotation": { - "readable": true - } - }, - { - "name": "return_value", - "desc": "函数返回值描述。", - "type": "value_desc_t*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/func_desc.h", - "desc": "函数描述。", - "name": "func_desc_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "func_call_parser_t*", - "name": "parser", - "desc": "parser对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化parser对象。", - "name": "func_call_parser_init", - "return": { - "type": "func_call_parser_t*", - "desc": "parser对象本身。" - } - }, - { - "params": [ - { - "type": "func_call_parser_t*", - "name": "parser", - "desc": "parser对象。" - } - ], - "annotation": {}, - "desc": "开始解析。", - "name": "func_call_parser_parse", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "func_call_parser_t*", - "name": "parser", - "desc": "parser对象。" - } - ], - "annotation": {}, - "desc": "重置parser。", - "name": "func_call_parser_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "解析参数,并将结果生成一个object对象。\n\n> 调用者负责释放返回的object对象。", - "name": "func_call_parse", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/func_call_parser.h", - "desc": "从字符串中解析出函数调用需要的参数。\n\n```\nfunc_call => func_name '(' params ')'\nparams => param ',' params\nparam => name '=' value\nfunc_name => ID\nname = ID\nvalue = int | float | ID\n```\n\n如:move(x=10, y=20)\n如:rename(old_name=aa, new_name=bb)", - "name": "func_call_parser_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "const char*", - "name": "mode", - "desc": "打开方式,取值请参考POSIX的[fopen函数](https://www.runoob.com/cprogramming/c-function-fopen.html)相应的参数。" - } - ], - "annotation": {}, - "desc": "打开文件。", - "name": "fs_open_file", - "return": { - "type": "ret_t", - "desc": "返回非NULL表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "刪除文件。", - "name": "fs_remove_file", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "判断文件是否存在。", - "name": "fs_file_exist", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则表示不存在。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "旧文件名。" - }, - { - "type": "const char*", - "name": "new_name", - "desc": "新文件名。" - } - ], - "annotation": {}, - "desc": "文件重命名。", - "name": "fs_file_rename", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "目录名称。" - } - ], - "annotation": {}, - "desc": "打开目录。", - "name": "fs_open_dir", - "return": { - "type": "fs_dir_t", - "desc": "返回非NULL表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "目录名称。" - } - ], - "annotation": {}, - "desc": "创建目录。", - "name": "fs_create_dir", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "目录名称。" - } - ], - "annotation": {}, - "desc": "刪除目录。", - "name": "fs_remove_dir", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "目录名称。" - } - ], - "annotation": {}, - "desc": "判断目录是否存在。", - "name": "fs_dir_exist", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则表示不存在。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "旧目录名称。" - }, - { - "type": "const char*", - "name": "new_name", - "desc": "新目录名称。" - } - ], - "annotation": {}, - "desc": "目录重命名。", - "name": "fs_dir_rename", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "获取文件大小。", - "name": "fs_get_file_size", - "return": { - "type": "ret_t", - "desc": "返回不是-1表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "value", - "desc": "卷名。" - }, - { - "type": "int32_t*", - "name": "free_kb", - "desc": "用于返回空闲空间大小(KB)" - }, - { - "type": "int32_t*", - "name": "total_kb", - "desc": "用于返回总共空间大小(KB)" - } - ], - "annotation": {}, - "desc": "获取文件系统信息。", - "name": "fs_get_disk_info", - "return": { - "type": "ret_t", - "desc": "返回不是-1表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "fs_stat_info_t*", - "name": "fst", - "desc": "文件状态信息。" - } - ], - "annotation": {}, - "desc": "获取文件信息。", - "name": "fs_stat", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "char*", - "name": "path", - "desc": "保存可执行文件的路径。" - } - ], - "annotation": {}, - "desc": "获取可执行文件所在目录。", - "name": "fs_get_exe", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "char*", - "name": "path", - "desc": "保存路径。" - } - ], - "annotation": {}, - "desc": "获取home目录或者应用程序可以写入数据的目录。", - "name": "fs_get_user_storage_path", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_t*", - "name": "fs", - "desc": "文件系统对象,一般赋值为os_fs()。" - }, - { - "type": "char*", - "name": "path", - "desc": "保存当前所在目录的路径。" - } - ], - "annotation": {}, - "desc": "获取当前所在目录。", - "name": "fs_get_cwd", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的文件系统对象。", - "name": "os_fs", - "return": { - "type": "fs_t*", - "desc": "返回文件系统对象。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "判断文件是否存在。", - "name": "file_exist", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "刪除文件。", - "name": "file_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "获取文件大小。", - "name": "file_get_size", - "return": { - "type": "int32_t", - "desc": "返回非负表示文件大小,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "uint32_t*", - "name": "size", - "desc": "返回实际读取的长度。" - } - ], - "annotation": {}, - "desc": "读取文件的全部内容。", - "name": "file_read", - "return": { - "type": "void*", - "desc": "返回读取的数据,需要调用TKMEM_FREE释放。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "const void*", - "name": "buffer", - "desc": "数据缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - } - ], - "annotation": {}, - "desc": "从某个位置读取文件。", - "name": "file_read_part", - "return": { - "type": "int32_t", - "desc": "返回实际读取的字节数。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "const void*", - "name": "buffer", - "desc": "数据缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - } - ], - "annotation": {}, - "desc": "写入文件。", - "name": "file_write", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/fs.h", - "desc": "文件系统接口。", - "name": "fs_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "fs_dir_t*", - "name": "dir", - "desc": "文件夹对象。" - } - ], - "annotation": {}, - "desc": "重置文件夹读取位置到开始。", - "name": "fs_dir_rewind", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_dir_t*", - "name": "dir", - "desc": "文件夹对象。" - }, - { - "type": "fs_item_t*", - "name": "item", - "desc": "返回一项。" - } - ], - "annotation": {}, - "desc": "读取文件夹对象。", - "name": "fs_dir_read", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_dir_t*", - "name": "dir", - "desc": "文件夹对象。" - } - ], - "annotation": {}, - "desc": "关闭文件夹对象。", - "name": "fs_dir_close", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/fs.h", - "desc": "文件夹接口。", - "name": "fs_dir_t", - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "is_dir", - "desc": "是否是目录。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "is_link", - "desc": "是否是符号链接。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "is_reg_file", - "desc": "是否是普通文件。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "name", - "desc": "名称。", - "type": "char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/fs.h", - "desc": "代表目录或文件。", - "name": "fs_item_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - }, - { - "type": "void*", - "name": "buffer", - "desc": "用于返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "读取文件。", - "name": "fs_file_read", - "return": { - "type": "int32_t", - "desc": "返回实际读取的字节数。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - }, - { - "type": "const void*", - "name": "buffer", - "desc": "数据缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - } - ], - "annotation": {}, - "desc": "写入文件。", - "name": "fs_file_write", - "return": { - "type": "int32_t", - "desc": "返回实际写入的字节数。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - }, - { - "type": "const char* const", - "name": "format_str", - "desc": "格式化字符串。" - } - ], - "annotation": {}, - "desc": "写入文件。", - "name": "fs_file_printf", - "return": { - "type": "int32_t", - "desc": "返回实际写入的字节数。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "数据长度。" - } - ], - "annotation": {}, - "desc": "定位读写指针到指定的位置。", - "name": "fs_file_seek", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "清除文件内容。", - "name": "fs_file_truncate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "关闭文件。", - "name": "fs_file_close", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "同步文件到磁盘。", - "name": "fs_file_sync", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - }, - { - "type": "fs_stat_info_t*", - "name": "fst", - "desc": "文件状态信息。" - } - ], - "annotation": {}, - "desc": "获取文件信息。", - "name": "fs_file_stat", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "判断文件是否结束。", - "name": "fs_file_eof", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示结束,否则表示没结束。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "获取文件当前读写位置。", - "name": "fs_file_tell", - "return": { - "type": "int64_t", - "desc": "返回文件当前读写位置。" - } - }, - { - "params": [ - { - "type": "fs_file_t*", - "name": "file", - "desc": "文件对象。" - } - ], - "annotation": {}, - "desc": "获取文件大小。", - "name": "fs_file_size", - "return": { - "type": "int64_t", - "desc": "返回文件大小。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/fs.h", - "desc": "文件接口。\n\n示例:\n\n```c\nint32_t ret = 0;\nconst char* file_name = \"test.txt\";\nint32_t len = file_get_size(file_name);\nuint8_t* buff = (uint8_t*)TKMEM_ALLOC(len + 1);\nreturn_value_if_fail(buff != NULL, NULL);\n\nfs_file_t* fp = fs_open_file(os_fs(), file_name, \"rb\");\nif (fp != NULL) {\nret = fs_file_read(fp, buff, len);\nfs_file_close(fp);\n}\n```", - "name": "fs_file_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "size", - "desc": "文件大小。", - "type": "uint64_t" - }, - { - "name": "atime", - "desc": "最后访问时间。", - "type": "uint64_t" - }, - { - "name": "mtime", - "desc": "最后修改时间。", - "type": "uint64_t" - }, - { - "name": "ctime", - "desc": "创建时间。", - "type": "uint64_t" - }, - { - "name": "is_dir", - "desc": "是否为目录。", - "type": "bool_t" - }, - { - "name": "is_link", - "desc": "是否为链接。", - "type": "bool_t" - }, - { - "name": "is_reg_file", - "desc": "是否普通文件。", - "type": "bool_t" - } - ], - "header": "tkc/fs.h", - "desc": "文件状态信息。", - "name": "fs_stat_info_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char*", - "name": "expr", - "desc": "表达式" - }, - { - "type": "const EvalHooks*", - "name": "hooks", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - }, - { - "type": "ExprValue*", - "name": "output", - "desc": "计算结果。" - } - ], - "annotation": {}, - "desc": "计算表达式的值。", - "name": "eval_execute", - "return": { - "type": "EvalResult", - "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "expor", - "desc": "表达式" - } - ], - "annotation": {}, - "desc": "计算表达式返回浮点数。", - "name": "tk_expr_eval", - "return": { - "type": "double", - "desc": "返回结果。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "expor", - "desc": "表达式" - }, - { - "type": "char*", - "name": "result", - "desc": "结果字符串" - }, - { - "type": "uint32_t", - "name": "", - "desc": "。" - } - ], - "annotation": {}, - "desc": "计算表达式返回字符串。", - "name": "tk_expr_eval_str", - "return": { - "type": "const char*", - "desc": "返回结果。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "获取内置函数。", - "name": "eval_default_hooks", - "return": { - "type": "const EvalHooks*", - "desc": "回调函数列表。" - } - }, - { - "params": [ - { - "type": "EvalResult", - "name": "result", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "将错误码转换成字符串。", - "name": "eval_result_to_string", - "return": { - "type": "const char*", - "desc": "返回对应的字符串。" - } - }, - { - "params": [ - { - "type": "ExprValue*", - "name": "v", - "desc": "值对象。" - } - ], - "annotation": {}, - "desc": "初始化值。", - "name": "expr_value_init", - "return": { - "type": "void", - "desc": "返回void。" - } - }, - { - "params": [ - { - "type": "ExprValue*", - "name": "v", - "desc": "值对象。" - } - ], - "annotation": {}, - "desc": "清除值。", - "name": "expr_value_clear", - "return": { - "type": "void", - "desc": "返回void。" - } - }, - { - "params": [ - { - "type": "const ExprValue*", - "name": "v", - "desc": "值对象。" - } - ], - "annotation": {}, - "desc": "获取浮点数值。", - "name": "expr_value_get_number", - "return": { - "type": "double", - "desc": "返回浮点数值。" - } - }, - { - "params": [ - { - "type": "ExprValue*", - "name": "v", - "desc": "值对象。" - }, - { - "type": "double", - "name": "val", - "desc": "浮点数的值。" - } - ], - "annotation": {}, - "desc": "设置浮点数值。", - "name": "expr_value_set_number", - "return": { - "type": "EvalResult", - "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const ExprValue*", - "name": "v", - "desc": "值对象。" - } - ], - "annotation": {}, - "desc": "获取字符串。", - "name": "expr_value_get_string", - "return": { - "type": "const char*", - "desc": "返回字符串。" - } - }, - { - "params": [ - { - "type": "ExprValue*", - "name": "v", - "desc": "值对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "size_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "设置字符串。", - "name": "expr_value_set_string", - "return": { - "type": "EvalResult", - "desc": "返回EVAL_RESULT_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/expr_eval.h", - "desc": "表达式。", - "name": "eval_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "w", - "desc": "离线 canvas 的宽。" - }, - { - "type": "uint32_t", - "name": "h", - "desc": "离线 canvas 的高。" - }, - { - "type": "bitmap_format_t", - "name": "format", - "desc": "离线 canvas 的格式。" - } - ], - "annotation": {}, - "desc": "创建一个离线的 canvas\n在 opengl 模式下 format 参数只能为 BITMAP_FMT_RGBA8888\n在其他模式下,离线 canvas 格式可以为 rgba,bgar,bgr565和rgb565", - "name": "canvas_offline_create", - "return": { - "type": "canvas_t*", - "desc": "成功返回 canvas ,失败返回 NULL。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "清除离线 canvas 所有数据,并把背景设置为全透明(注意:该离线 canvas 需要有透明通道)\n该函数调用前必须要先 canvas_offline_begin_draw 函数。\n该函数用来解决离线 canvas 多次绘图半透效果后导致半透效果无效的问题。", - "name": "canvas_offline_clear_canvas", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "设置离线 canvas 开始绘图", - "name": "canvas_offline_begin_draw", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "设置离线 canvas 结束绘图", - "name": "canvas_offline_end_draw", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "获取离线 canvas 的离线 bitmap。", - "name": "canvas_offline_get_bitmap", - "return": { - "type": "bitmap_t*", - "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - }, - { - "type": "bitmap_t*", - "name": "bitmap", - "desc": "新的 bitmap 对象。" - } - ], - "annotation": {}, - "desc": "把离线 canvas 的离线 bitmap 移动赋值给新的 bitmap。\n移动赋值后原来的离线 canvas 的离线 bitmap 就会被置空。\n备注:在移动赋值之前会先调用 canvas_offline_flush_bitmap 把数据回流到内存中。", - "name": "canvas_offline_bitmap_move_to_new_bitmap", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "把离线 canvas 的数据放到绑定的 bitmap 中\n该函数只有在 opengl 模式才需要调用,是否把显存中的数据回传到内存中。", - "name": "canvas_offline_flush_bitmap", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "释放离线 canvas 和离线 bitmap", - "name": "canvas_offline_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "w", - "desc": "离线 canvas 的宽。" - }, - { - "type": "uint32_t", - "name": "h", - "desc": "离线 canvas 的高。" - }, - { - "type": "bitmap_format_t", - "name": "format", - "desc": "离线 canvas 的格式。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_create", - "name": "canvas_offline_custom_create", - "export": "none", - "return": { - "type": "canvas_t*", - "desc": "成功返回 canvas ,失败返回 NULL。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_clear_canvas", - "name": "canvas_offline_custom_clear_canvas", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_begin_draw", - "name": "canvas_offline_custom_begin_draw", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_end_draw", - "name": "canvas_offline_custom_end_draw", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_get_bitmap", - "name": "canvas_offline_custom_get_bitmap", - "export": "none", - "return": { - "type": "bitmap_t*", - "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_bitmap_move_to_new_bitmap", - "name": "canvas_offline_custom_bitmap_move_to_new_bitmap", - "export": "none", - "return": { - "type": "bitmap_t*", - "desc": "返回 bitmap_t 对象表示成功,返回 NULL 表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_flush_bitmap", - "name": "canvas_offline_custom_flush_bitmap", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "离线 canvas 对象。" - } - ], - "annotation": {}, - "desc": "用户自定义 canvas_offline_custom_destroy", - "name": "canvas_offline_custom_destroy", - "export": "none", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "bitmap", - "desc": "绑定的离线 bitmap", - "type": "bitmap_t*", - "annotation": { - "readable": true - } - } - ], - "header": "base/canvas_offline.h", - "desc": "离线画布 canvas。", - "name": "canvas_offline_t", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "初始化。", - "name": "event_source_manager_init", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "~初始化。", - "name": "event_source_manager_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "获取wakeup时间(ms)", - "name": "event_source_manager_get_wakeup_time", - "return": { - "type": "uint32_t", - "desc": "返回wakeup时间(ms)。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "分发事件。", - "name": "event_source_manager_dispatch", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - }, - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "增加事件源对象。", - "name": "event_source_manager_add", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - }, - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "移除事件源对象。", - "name": "event_source_manager_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - }, - { - "type": "void*", - "name": "tag", - "desc": "tag。" - } - ], - "annotation": {}, - "desc": "移除所有tag相同的事件源对象。", - "name": "event_source_manager_remove_by_tag", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "销毁事件源管理器。", - "name": "event_source_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_manager.h", - "desc": "事件源管理器。", - "name": "event_source_manager_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "lcd_t*", - "name": "lcd", - "desc": "lcd对象。" - }, - { - "type": "font_manager_t*", - "name": "font_manager", - "desc": "字体管理器对象。" - } - ], - "annotation": {}, - "desc": "初始化,系统内部调用。", - "name": "canvas_init", - "return": { - "type": "canvas_t*", - "desc": "返回canvas对象本身。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取画布的宽度。", - "name": "canvas_get_width", - "return": { - "type": "wh_t", - "desc": "返回画布的宽度。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取画布的高度。", - "name": "canvas_get_height", - "return": { - "type": "wh_t", - "desc": "返回画布的高度。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "rect_t*", - "name": "r", - "desc": "rect对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取裁剪区。", - "name": "canvas_get_clip_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "rect对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置裁剪区。", - "name": "canvas_set_clip_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "rect对象。" - }, - { - "type": "bool_t", - "name": "translate", - "desc": "是否将裁剪区的位置加上canvas当前的偏移。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置裁剪区。", - "name": "canvas_set_clip_rect_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "color_t", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": {}, - "desc": "设置填充颜色。", - "name": "canvas_set_fill_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "color_t", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": {}, - "desc": "设置文本颜色。", - "name": "canvas_set_text_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "color_t", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": {}, - "desc": "设置线条颜色。", - "name": "canvas_set_stroke_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置填充颜色。\n\n> 供脚本语言使用。", - "name": "canvas_set_fill_color_str", - "alias": "canvas_set_fill_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置文本颜色。\n\n> 供脚本语言使用。", - "name": "canvas_set_text_color_str", - "alias": "canvas_set_text_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置线条颜色。\n\n> 供脚本语言使用。", - "name": "canvas_set_stroke_color_str", - "alias": "canvas_set_stroke_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "uint8_t", - "name": "alpha", - "desc": "alpha值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置全局alpha值。", - "name": "canvas_set_global_alpha", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "dx", - "desc": "x偏移。" - }, - { - "type": "xy_t", - "name": "dy", - "desc": "y偏移。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "平移原点坐标。", - "name": "canvas_translate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "dx", - "desc": "x偏移。" - }, - { - "type": "xy_t", - "name": "dy", - "desc": "y偏移。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "反向平移原点坐标。", - "name": "canvas_untranslate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "画垂直线。", - "name": "canvas_draw_vline", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "画水平线。", - "name": "canvas_draw_hline", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const point_t*", - "name": "points", - "desc": "点数组。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "点的个数。" - } - ], - "annotation": {}, - "desc": "画多个点。", - "name": "canvas_draw_points", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制矩形。", - "name": "canvas_fill_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "用填充颜色填充指定矩形。\n\n> 如果lcd的颜色格式带alpha通道,连同alpha的值一起修改。", - "name": "canvas_clear_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制矩形。", - "name": "canvas_stroke_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "字体名称。" - }, - { - "type": "font_size_t", - "name": "size", - "desc": "字体大小。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置字体。", - "name": "canvas_set_font", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "align_h_t", - "name": "align_h", - "desc": "水平对齐方式。" - }, - { - "type": "align_v_t", - "name": "align_v", - "desc": "垂直对齐方式。" - } - ], - "annotation": {}, - "desc": "设置文本对齐方式。", - "name": "canvas_set_text_align", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "字符数。" - } - ], - "annotation": {}, - "desc": "计算文本所占的宽度。", - "name": "canvas_measure_text", - "return": { - "type": "float_t", - "desc": "返回文本所占的宽度。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": {}, - "desc": "获取字体的高度。", - "name": "canvas_get_font_height", - "return": { - "type": "float_t", - "desc": "返回字体的高度。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "计算文本所占的宽度。\n\n> 供脚本语言使用。", - "name": "canvas_measure_utf8", - "alias": "canvas_measure_text", - "return": { - "type": "float_t", - "desc": "返回文本所占的宽度。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "字符数。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - } - ], - "annotation": {}, - "desc": "绘制文本。", - "name": "canvas_draw_text", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制文本。\n\n> 供脚本语言使用。", - "name": "canvas_draw_utf8", - "alias": "canvas_draw_text", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "字符数。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形区域。" - } - ], - "annotation": {}, - "desc": "绘制文本。", - "name": "canvas_draw_text_in_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "字符数。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形区域。" - }, - { - "type": "const char*", - "name": "bidi_type", - "desc": "类型。" - }, - { - "type": "bool_t", - "name": "ellipses", - "desc": "如果目标宽度不够,是否显示省略号。" - } - ], - "annotation": {}, - "desc": "绘制文本(支持Unicode Bidirectional Algorithm)。", - "name": "canvas_draw_text_bidi_in_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形区域。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制文本。\n\n> 供脚本语言使用。", - "name": "canvas_draw_utf8_in_rect", - "alias": "canvas_draw_text_in_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "bitmap_t*", - "name": "img", - "desc": "图片对象。" - }, - { - "type": "xy_t", - "name": "cx", - "desc": "中心点x坐标。" - }, - { - "type": "xy_t", - "name": "cy", - "desc": "中心点y坐标。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制图标。", - "name": "canvas_draw_icon", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "bitmap_t*", - "name": "img", - "desc": "图片对象。" - }, - { - "type": "const rect_t*", - "name": "src", - "desc": "源区域。" - }, - { - "type": "const rect_t*", - "name": "dst", - "desc": "目的区域。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制图片。", - "name": "canvas_draw_image", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "bitmap_t*", - "name": "img", - "desc": "图片对象。" - }, - { - "type": "image_draw_type_t", - "name": "draw_type", - "desc": "绘制类型。" - }, - { - "type": "const rect_t*", - "name": "dst", - "desc": "目的区域。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制图片。", - "name": "canvas_draw_image_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "bitmap_t*", - "name": "img", - "desc": "图片对象。" - }, - { - "type": "image_draw_type_t", - "name": "draw_type", - "desc": "绘制类型。" - }, - { - "type": "const rect_t*", - "name": "src", - "desc": "源区域。" - }, - { - "type": "const rect_t*", - "name": "dst", - "desc": "目的区域。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "绘制图片。", - "name": "canvas_draw_image_ex2", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取vgcanvas对象。", - "name": "canvas_get_vgcanvas", - "return": { - "type": "vgcanvas_t*", - "desc": "返回vgcanvas对象。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" + "type": "event_t*", + "name": "event", + "desc": "event对象。" } ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为canvas对象(供脚本语言使用)。", - "name": "canvas_cast", + "desc": "把event对象转pointer_event_t对象,主要给脚本语言使用。", + "name": "pointer_event_cast", "return": { - "type": "canvas_t*", - "desc": "canvas对象。" + "type": "pointer_event_t*", + "desc": "event对象。" } }, { "params": [ { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "释放相关资源。", - "name": "canvas_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" + "type": "pointer_event_t*", + "name": "event", + "desc": "event对象。" }, { - "type": "bitmap_t*", - "name": "img", - "desc": "图片对象。" + "type": "void*", + "name": "target", + "desc": "事件目标。" }, { - "type": "xy_t", + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "int32_t", "name": "x", - "desc": "x坐标。" + "desc": "x的值。" }, { - "type": "xy_t", + "type": "int32_t", "name": "y", - "desc": "w坐标。" + "desc": "y的值。" } ], "annotation": {}, - "desc": "在指定位置画图。", - "name": "canvas_draw_image_at", + "desc": "初始化事件。", + "name": "pointer_event_init", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "xy_t", - "name": "x1", - "desc": "起始点的x坐标。" - }, - { - "type": "xy_t", - "name": "y1", - "desc": "起始点的y坐标。" - }, - { - "type": "xy_t", - "name": "x2", - "desc": "结束点的x坐标。" - }, - { - "type": "xy_t", - "name": "y2", - "desc": "结束点的y坐标。" - } - ], - "annotation": {}, - "desc": "画直线。", - "name": "canvas_draw_line", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "font_manager_t*", - "name": "font_manager", - "desc": "font_manager对象。" - } - ], - "annotation": {}, - "desc": "设置canvas的font_manager对象。", - "name": "canvas_set_font_manager", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "assets_manager_t*", - "name": "assets_manager", - "desc": "assets_manager对象。" - } - ], - "annotation": {}, - "desc": "设置canvas的assets_manager对象。", - "name": "canvas_set_assets_manager", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "canvas", - "desc": "canvas对象。" - }, - { - "type": "float_t*", - "name": "ascent", - "desc": "用于返回ascent。" - }, - { - "type": "float_t*", - "name": "descent", - "desc": "用于返回descent。" - }, - { - "type": "float_t*", - "name": "line_hight", - "desc": "用于返回line height。" - } - ], - "annotation": {}, - "desc": "获取当前字体的度量信息。", - "name": "canvas_get_text_metrics", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "dirty_rect", - "desc": "脏矩形。" - }, - { - "type": "lcd_draw_mode_t", - "name": "draw_mode", - "desc": "绘制模式。" - } - ], - "annotation": {}, - "desc": "绘制开始。", - "name": "canvas_begin_frame", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形。" - }, - { - "type": "const color_t*", - "name": "color", - "desc": "颜色。" - }, - { - "type": "uint32_t", - "name": "radius", - "desc": "圆角半径。" - } - ], - "annotation": {}, - "desc": "填充区域。", - "name": "canvas_fill_rounded_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形。" - }, - { - "type": "const color_t*", - "name": "color", - "desc": "颜色。" - }, - { - "type": "uint32_t", - "name": "radius_tl", - "desc": "左上角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_tr", - "desc": "右上角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_bl", - "desc": "左下角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_br", - "desc": "右下角圆角半径。" - } - ], - "annotation": {}, - "desc": "填充区域。\n半径半径小于等于2,则表示该角为直角,如果全部角都为直角则返回RET_FAIL。(如果全是直角,该函数效率没有canvas_fill_rect函数快)\n如果各个半径都不一样的话,就是会使用vg,如果不支持vg就会返回RET_FAIL(直角的情况除外)。", - "name": "canvas_fill_rounded_rect_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形。" - }, - { - "type": "const color_t*", - "name": "color", - "desc": "颜色。" - }, - { - "type": "uint32_t", - "name": "radius", - "desc": "圆角半径。" - }, - { - "type": "uint32_t", - "name": "border_width", - "desc": "边宽。" - } - ], - "annotation": {}, - "desc": "绘制边框。", - "name": "canvas_stroke_rounded_rect", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "矩形。" - }, - { - "type": "const color_t*", - "name": "color", - "desc": "颜色。" - }, - { - "type": "uint32_t", - "name": "radius_tl", - "desc": "左上角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_tr", - "desc": "右上角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_bl", - "desc": "左下角圆角半径。" - }, - { - "type": "uint32_t", - "name": "radius_br", - "desc": "右下角圆角半径。" - }, - { - "type": "uint32_t", - "name": "border_width", - "desc": "边宽。" - }, - { - "type": "uint32_t", - "name": "border_model", - "desc": "边框类型。" - } - ], - "annotation": {}, - "desc": "绘制边框。\n半径半径小于等于2,则表示该角为直角,如果全部角都为直角则返回RET_FAIL。(如果全是直角,该函数效率没有canvas_stroke_rect函数快)\n如果各个半径都不一样的话,就是会使用vg,如果不支持vg就会返回RET_FAIL(直角的情况除外)。", - "name": "canvas_stroke_rounded_rect_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": {}, - "desc": "绘制结束。", - "name": "canvas_end_frame", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "event_t*", + "desc": "event对象。" } } ], "events": [], "properties": [ { - "name": "ox", - "desc": "x坐标偏移。", + "name": "x", + "desc": "x坐标。", "type": "xy_t", "annotation": { "readable": true, @@ -36833,8 +40938,8 @@ } }, { - "name": "oy", - "desc": "y坐标偏移。", + "name": "y", + "desc": "y坐标。", "type": "xy_t", "annotation": { "readable": true, @@ -36842,26 +40947,8 @@ } }, { - "name": "font_name", - "desc": "当前字体名称。", - "type": "char*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "font_size", - "desc": "当前字体大小。", - "type": "uint16_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "global_alpha", - "desc": "当前全局alpha。", + "name": "button", + "desc": "button。", "type": "uint8_t", "annotation": { "readable": true, @@ -36869,165 +40956,1046 @@ } }, { - "name": "clip_left", - "desc": "当前裁剪矩形的左边位置。", + "name": "pressed", + "desc": "指针是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "alt", + "desc": "alt键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "ctrl", + "desc": "ctrl键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "cmd", + "desc": "cmd键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "menu", + "desc": "menu键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "shift", + "desc": "shift键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "指针事件。", + "name": "pointer_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转key_event_t对象,主要给脚本语言使用。", + "name": "key_event_cast", + "return": { + "type": "key_event_t*", + "desc": "event对象。" + } + }, + { + "params": [ + { + "type": "key_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "int32_t", + "name": "key", + "desc": "key的值。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "key_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "key", + "desc": "键值。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "alt", + "desc": "alt键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "lalt", + "desc": "left alt键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "ralt", + "desc": "right alt键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "ctrl", + "desc": "right alt键是否按下。\nctrl键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "lctrl", + "desc": "left ctrl键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "rctrl", + "desc": "right ctrl键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "shift", + "desc": "shift键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "lshift", + "desc": "left shift键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "rshift", + "desc": "right shift键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "cmd", + "desc": "left shift键是否按下。\ncmd/win键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "menu", + "desc": "menu键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "capslock", + "desc": "capslock键是否按下。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "按键事件。", + "name": "key_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转paint_event_t对象。主要给脚本语言使用。", + "name": "paint_event_cast", + "return": { + "type": "paint_event_t*", + "desc": "event 对象。" + } + }, + { + "params": [ + { + "type": "paint_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "paint_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "c", + "desc": "canvas。", + "type": "canvas_t*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "绘制事件。", + "name": "paint_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转window_event_t对象。主要给脚本语言使用。", + "name": "window_event_cast", + "return": { + "type": "window_event_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "window_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "widget_t*", + "name": "widget", + "desc": "window对象。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "window_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + }, + { + "params": [ + { + "type": "pointer_event_t*", + "name": "evt", + "desc": "指针事件对象。" + }, + { + "type": "system_info_t*", + "name": "info", + "desc": "系统信息。" + } + ], + "annotation": {}, + "desc": "根据屏幕旋转方向修正pointer_event中的坐标。", + "name": "pointer_event_rotate", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "window", + "desc": "canvas。", + "type": "widget_t*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "窗口事件,由窗口管理器触发。", + "name": "window_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转multi_gesture_event_t对象,主要给脚本语言使用。", + "name": "multi_gesture_event_cast", + "return": { + "type": "multi_gesture_event_t*", + "desc": "event对象。" + } + }, + { + "params": [ + { + "type": "multi_gesture_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "void*", + "name": "target", + "desc": "事件目标。" + }, + { + "type": "uint32_t", + "name": "touch_id", + "desc": "touch device id。" + }, + { + "type": "int32_t", + "name": "x", + "desc": "x的值。" + }, + { + "type": "int32_t", + "name": "y", + "desc": "y的值。" + }, + { + "type": "float", + "name": "rotation", + "desc": "旋转角度(幅度)增量。" + }, + { + "type": "float", + "name": "distance", + "desc": "两点间的距离增量。(-1,0)表示缩小,(0-1)表示增加。" + }, + { + "type": "uint32_t", + "name": "fingers", + "desc": "本事件用到手指数。" + } + ], + "annotation": {}, + "desc": "初始化事件。", + "name": "multi_gesture_event_init", + "return": { + "type": "event_t*", + "desc": "event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "touch_id", + "desc": "touch device id。", + "type": "int64_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "x", + "desc": "中心点x坐标。", "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "y", + "desc": "中心点y坐标。", + "type": "xy_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "rotation", + "desc": "旋转角度(幅度)增量。", + "type": "float", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "distance", + "desc": "两点间的距离增量。(-1,0)表示缩小,(0-1)表示增加。", + "type": "float", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "fingers", + "desc": "本事件用到手指数。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/events.h", + "desc": "多点触摸手势事件。", + "name": "multi_gesture_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image对象。" + }, + { + "type": "char*", + "name": "name", + "desc": "图片名称,该图片必须存在于资源管理器。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件的图片名称。\n\n> 如果需要显示文件系统中的图片,只需将图片名称换成实际的文件名,并加上\"file://\"前缀即可。", + "name": "image_base_set_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float_t", + "name": "rotation", + "desc": "旋转角度(幅度)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件的旋转角度(仅在WITH_VGCANVAS定义时生效)。", + "name": "image_base_set_rotation", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float_t", + "name": "scale_x", + "desc": "X方向缩放比例。" + }, + { + "type": "float_t", + "name": "scale_y", + "desc": "Y方向缩放比例。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件的缩放比例(仅在WITH_VGCANVAS定义时生效)。", + "name": "image_base_set_scale", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float_t", + "name": "anchor_x", + "desc": "锚点X(0-1)。0在控件左边,0.5在控件中间,1在控件右边。" + }, + { + "type": "float_t", + "name": "anchor_y", + "desc": "锚点Y(0-1)。0在控件顶部,0.5在控件中间,1在控件底部。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件的锚点(仅在WITH_VGCANVAS定义时生效)。", + "name": "image_base_set_anchor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "selected", + "desc": "是否被选中。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件的选中状态。", + "name": "image_base_set_selected", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "selectable", + "desc": "是否可以被选中。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件是否可以被选中。", + "name": "image_base_set_selectable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "clickable", + "desc": "是否可以被点击。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置控件是否可以被点击。", + "name": "image_base_set_clickable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_base对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为image_base对象(供脚本语言使用)。", + "name": "image_base_cast", + "return": { + "type": "widget_t*", + "desc": "image_base对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "image", + "desc": "图片的名称。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "anchor_x", + "desc": "锚点X(0-1)。0在控件左边,0.5在控件中间,1在控件右边。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "anchor_y", + "desc": "锚点Y(0-1)。0在控件顶部,0.5在控件中间,1在控件底部。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "scale_x", + "desc": "控件在X方向上的缩放比例。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "scale_y", + "desc": "控件在Y方向上的缩放比例。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "rotation", + "desc": "控件的旋转角度(幅度)。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "clickable", + "desc": "点击时,是否触发EVT_CLICK事件。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "selectable", + "desc": "是否设置选中状态。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "selected", + "desc": "当前是否被选中。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "base/image_base.h", + "desc": "图片控件基类。\n\n本类把图片相关控件的公共行为进行抽象,放到一起方便重用。目前已知的具体实现如下图:\n\n```graphviz\n[default_style]\n\nimage_t -> image_base_t[arrowhead = \"empty\"]\nsvg_image_t -> image_base_t[arrowhead = \"empty\"]\ngif_image_t -> image_base_t[arrowhead = \"empty\"]\n```\n\n> 本类是一个抽象类,不能进行实例化。请在应用程序中使用具体的类,如image\\_t。\n\n如果需要显示文件系统中的图片,只需将图片名称换成实际的文件名,并加上\"file://\"前缀即可。如:\n\n```\n\n\n\n```", + "name": "image_base_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "im_commit_event_t*", + "name": "e", + "desc": "事件对象。" + }, + { + "type": "const char*", + "name": "text", + "desc": "文本。" + }, + { + "type": "bool_t", + "name": "replace", + "desc": "是否替代当前的内容。" + } + ], + "annotation": {}, + "desc": "初始化im_commit事件。", + "name": "im_commit_event_init", + "return": { + "type": "event_t*", + "desc": "返回事件对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "text", + "desc": "提交的文本。", + "type": "char*", "annotation": { "readable": true } }, { - "name": "clip_top", - "desc": "当前裁剪矩形的顶部位置。", - "type": "xy_t", + "name": "replace", + "desc": "是否替换原来的文本。", + "type": "bool_t", + "annotation": { + "readable": true + } + } + ], + "header": "base/input_method.h", + "desc": "输入法提交输入的文本事件。", + "name": "im_commit_event_t", + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "text", + "desc": "软键盘上的action按钮显示的文本。", + "type": "char*", "annotation": { "readable": true } }, { - "name": "clip_right", - "desc": "当前裁剪矩形的右边位置。", - "type": "xy_t", + "name": "enable", + "desc": "软键盘上的action按钮启用。", + "type": "bool_t", + "annotation": { + "readable": true + } + } + ], + "header": "base/input_method.h", + "desc": "设置软键盘上的action按钮的信息事件。", + "name": "im_action_button_info_event_t", + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "candidates", + "desc": "可选的文本,多个文本以\\0分隔。如:里\\0李\\0力\\0离\\0", + "type": "char*", "annotation": { "readable": true } }, { - "name": "clip_bottom", - "desc": "当前裁剪矩形的底部位置。", - "type": "xy_t", - "annotation": { - "readable": true - } - }, - { - "name": "fps", - "desc": "当前的帧率。", + "name": "candidates_nr", + "desc": "可选的文本的个数。", "type": "uint32_t", "annotation": { "readable": true } }, { - "name": "show_fps", - "desc": "是否显示帧率。", - "type": "bool_t", - "annotation": { - "readable": true - } - }, - { - "name": "text_align_v", - "desc": "文本垂直对齐方式。", - "type": "align_v_t", - "annotation": { - "readable": true - } - }, - { - "name": "text_align_h", - "desc": "文本水平对齐方式。", - "type": "align_h_t", - "annotation": { - "readable": true - } - }, - { - "name": "lcd", - "desc": "lcd对象。", - "type": "lcd_t*", - "annotation": { - "readable": true - } - }, - { - "name": "font", - "desc": "字体对象。", - "type": "font_t*", - "annotation": { - "readable": true - } - }, - { - "name": "font_manager", - "desc": "字体管理器对象。", - "type": "font_manager_t*", - "annotation": { - "readable": true - } - }, - { - "name": "assets_manager", - "desc": "资源管理器对象。", - "type": "assets_manager_t*", + "name": "selected", + "desc": "缺省选中某个候选字,小于0不选择任何候选字。", + "type": "int32_t", "annotation": { "readable": true } } ], - "header": "base/canvas.h", - "desc": "提供基本的绘图功能和状态管理。", - "name": "canvas_t", - "annotation": { - "scriptable": true - }, - "level": 1 + "header": "base/input_method.h", + "desc": "输入法请求显示候选字的事件。", + "name": "im_candidates_event_t", + "parent": "event_t", + "level": 2 }, { - "params": [ - { - "type": "easing_type_t", - "name": "type", - "desc": "类型。" - } - ], - "annotation": { - "global": true - }, - "desc": "获取对应类型的操作函数。", - "name": "easing_get", - "return": { - "type": "easing_func_t", - "desc": "返回对应的操作函数地址。" - }, - "type": "method", - "header": "tkc/easing.h", - "level": 1 + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "base/lcd_profile.h", + "desc": "对现有LCD对象进行包装,实现对各个函数的时间统计,用于辅助定位性能瓶颈。", + "name": "lcd_profile_t", + "parent": "lcd_t", + "level": 2 }, { "type": "class", "methods": [ { "params": [], - "annotation": {}, - "desc": "创建缺省的资源加载器。", - "name": "asset_loader_create", + "annotation": { + "constructor": true + }, + "desc": "创建只读的style对象。", + "name": "style_const_create", "return": { - "type": "asset_loader_t*", - "desc": "返回loader对象。" + "type": "style_t*", + "desc": "返回style对象。" } - }, + } + ], + "events": [], + "properties": [], + "header": "base/style_const.h", + "desc": "只读的style,从theme\\_t中获取数据。\n\ntools/theme_gen用于把XML的主题数据转换成常量数据。", + "name": "style_const_t", + "parent": "style_t", + "level": 2 + }, + { + "type": "class", + "methods": [ { "params": [ { - "type": "asset_loader_t*", - "name": "loader", - "desc": "loader对象。" - }, - { - "type": "uint16_t", - "name": "type", - "desc": "资源类型。" - }, - { - "type": "uint16_t", - "name": "subtype", - "desc": "资源子类型。" - }, - { - "type": "const char*", - "name": "path", - "desc": "路径。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" }, { "type": "const char*", @@ -37035,278 +42003,44 @@ "desc": "名称。" } ], - "annotation": {}, - "desc": "加载指定的资源。", - "name": "asset_loader_load", - "return": { - "type": "asset_info_t*", - "desc": "返回资源对象(由调用者销毁)。" - } - }, - { - "params": [ - { - "type": "asset_loader_t*", - "name": "loader", - "desc": "loader对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "资源是路径。" - } - ], - "annotation": {}, - "desc": "判断指定资源是否存在。\n。", - "name": "asset_loader_exist", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则不存在。" - } - }, - { - "params": [ - { - "type": "asset_loader_t*", - "name": "loader", - "desc": "loader对象。" - } - ], - "annotation": {}, - "desc": "销毁loader对象。", - "name": "asset_loader_destroy", + "annotation": { + "scriptable": true + }, + "desc": "设置style的名称。", + "name": "style_mutable_set_name", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } - } - ], - "events": [], - "properties": [], - "header": "base/asset_loader.h", - "desc": "资源加载器接口。", - "name": "asset_loader_t", - "level": 1 - }, - { - "type": "enum", - "desc": "缓动作动画常量定义。", - "consts": [ - { - "desc": "EASING_LINEAR。", - "name": "EASING_LINEAR" }, - { - "desc": "EASING_QUADRATIC_IN", - "name": "EASING_QUADRATIC_IN" - }, - { - "desc": "EASING_QUADRATIC_OUT", - "name": "EASING_QUADRATIC_OUT" - }, - { - "desc": "EASING_QUADRATIC_INOUT", - "name": "EASING_QUADRATIC_INOUT" - }, - { - "desc": "EASING_CUBIC_IN", - "name": "EASING_CUBIC_IN" - }, - { - "desc": "EASING_CUBIC_OUT", - "name": "EASING_CUBIC_OUT" - }, - { - "desc": "EASING_SIN_IN", - "name": "EASING_SIN_IN" - }, - { - "desc": "EASING_SIN_OUT", - "name": "EASING_SIN_OUT" - }, - { - "desc": "EASING_SIN_OUT", - "name": "EASING_SIN_INOUT" - }, - { - "desc": "EASING_POW_IN", - "name": "EASING_POW_IN" - }, - { - "desc": "EASING_POW_OUT", - "name": "EASING_POW_OUT" - }, - { - "desc": "EASING_POW_INOUT", - "name": "EASING_POW_INOUT" - }, - { - "desc": "EASING_CIRCULAR_IN", - "name": "EASING_CIRCULAR_IN" - }, - { - "desc": "EASING_CIRCULAR_OUT", - "name": "EASING_CIRCULAR_OUT" - }, - { - "desc": "EASING_CIRCULAR_INOUT", - "name": "EASING_CIRCULAR_INOUT" - }, - { - "desc": "EASING_ELASTIC_IN", - "name": "EASING_ELASTIC_IN" - }, - { - "desc": "EASING_ELASTIC_OUT", - "name": "EASING_ELASTIC_OUT" - }, - { - "desc": "EASING_ELASTIC_INOUT", - "name": "EASING_ELASTIC_INOUT" - }, - { - "desc": "EASING_BACK_IN", - "name": "EASING_BACK_IN" - }, - { - "desc": "EASING_BACK_OUT", - "name": "EASING_BACK_OUT" - }, - { - "desc": "EASING_BACK_INOUT", - "name": "EASING_BACK_INOUT" - }, - { - "desc": "EASING_BOUNCE_IN", - "name": "EASING_BOUNCE_IN" - }, - { - "desc": "EASING_BOUNCE_OUT", - "name": "EASING_BOUNCE_OUT" - }, - { - "desc": "EASING_BOUNCE_INOUT", - "name": "EASING_BOUNCE_INOUT" - } - ], - "header": "tkc/easing.h", - "name": "easing_type_t", - "prefix": "EASING_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ { "params": [ + { + "type": "style_t*", + "name": "s", + "desc": "style对象。" + }, { "type": "const char*", - "name": "filename", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "打开动态链接库。", - "name": "tk_dl_open", - "return": { - "type": "tk_dl_t*", - "desc": "动态链接库对象。" - } - }, - { - "params": [ - { - "type": "tk_dl_t*", - "name": "dl", - "desc": "dl对象。" + "name": "state", + "desc": "控件状态。" }, { "type": "const char*", "name": "name", - "desc": "函数名。" - } - ], - "annotation": {}, - "desc": "获取指定名称函数的地址。", - "name": "tk_dl_sym", - "return": { - "type": "void*", - "desc": "返回函数的地址。" - } - }, - { - "params": [ + "desc": "属性名。" + }, { - "type": "tk_dl_t*", - "name": "dl", - "desc": "dl对象。" - } - ], - "annotation": {}, - "desc": "关闭dl对象。", - "name": "tk_dl_close", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/dl.h", - "desc": "动态链接库对象。", - "name": "tk_dl_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建date_time对象,并初始为当前日期和时间(一般供脚本语言中使用)。", - "name": "date_time_create", - "return": { - "type": "date_time_t*", - "desc": "返回date_time对象。" - } - }, - { - "params": [ - { - "type": "date_time_t*", - "name": "dt", - "desc": "date_time对象。" - } - ], - "annotation": {}, - "desc": "初始为当前日期和时间。", - "name": "date_time_init", - "return": { - "type": "date_time_t*", - "desc": "返回date_time对象。" - } - }, - { - "params": [ - { - "type": "date_time_t*", - "name": "dt", - "desc": "date_time对象。" + "type": "uint32_t", + "name": "val", + "desc": "值。" } ], "annotation": { "scriptable": true }, - "desc": "设置当前时间。", - "name": "date_time_set", + "desc": "设置指定名称整数格式的值。", + "name": "style_mutable_set_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -37315,408 +42049,29 @@ { "params": [ { - "type": "date_time_t*", - "name": "dt", - "desc": "date_time对象。" - }, - { - "type": "uint64_t", - "name": "time", - "desc": "时间。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "从time转换而来。", - "name": "date_time_from_time", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "year", - "desc": "年份。" - } - ], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "是否是闰年。", - "name": "date_time_is_leap", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是,否则表示否。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "year", - "desc": "年份。" - }, - { - "type": "uint32_t", - "name": "montn", - "desc": "月份(1-12)。" - } - ], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取指定年份月份的天数。", - "name": "date_time_get_days", - "return": { - "type": "int32_t", - "desc": "返回大于0表示天数,否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "year", - "desc": "年份。" - }, - { - "type": "uint32_t", - "name": "montn", - "desc": "月份(1-12)。" - }, - { - "type": "uint32_t", - "name": "day", - "desc": "日(1-31)。" - } - ], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取指定日期是周几(0-6, Sunday = 0)。。", - "name": "date_time_get_wday", - "return": { - "type": "int32_t", - "desc": "返回大于等于0表示周几(0-6),否则表示失败。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "montn", - "desc": "月份(1-12)。" - } - ], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取指定月份的英文名称(简写)。", - "name": "date_time_get_month_name", - "return": { - "type": "const char*", - "desc": "返回指定月份的英文名称(简写)。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "wday", - "desc": "星期几(0-6, Sunday = 0)。" - } - ], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取周几的英文名称(简写)。", - "name": "date_time_get_wday_name", - "return": { - "type": "const char*", - "desc": "返回指定周几的英文名称(简写)。" - } - }, - { - "params": [ - { - "type": "date_time_t*", - "name": "dt", - "desc": "date_time对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "销毁date_time对象(一般供脚本语言中使用)。", - "name": "date_time_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "date_time_vtable_t", - "name": "vt", - "desc": "日期和时间的相关函数的实现。" - } - ], - "annotation": {}, - "desc": "时间日期全局初始化。\n\n> 嵌入式平台需要提供并设置获取当前日期和时间的函数,否则相关的功能(如时钟控件)将无法正常工作。", - "name": "date_time_global_init_ex", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "second", - "desc": "秒(0 - 59)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "minute", - "desc": "分(0 - 59)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "hour", - "desc": "时(0 - 23)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "day", - "desc": "日(1-31)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "wday", - "desc": "星期几(0-6, Sunday = 0)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "month", - "desc": "月(1-12)。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "year", - "desc": "年。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/date_time.h", - "desc": "日期时间。\n\n> 在嵌入式平台中,在系统初始时,需要调用date\\_time\\_global\\_init设置实际获取/设置系统时间的函数。", - "name": "date_time_t", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "data_writer_t*", - "name": "writer", - "desc": "writer对象。" - }, - { - "type": "uint64_t", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "const void*", - "name": "data", - "desc": "数据缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - } - ], - "annotation": {}, - "desc": "在指定位置写入数据。", - "name": "data_writer_write", - "return": { - "type": "int32_t", - "desc": "返回实际读取数据的长度。" - } - }, - { - "params": [ - { - "type": "data_writer_t*", - "name": "writer", - "desc": "writer对象。" - } - ], - "annotation": {}, - "desc": "销毁writer对象。", - "name": "data_writer_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/data_writer.h", - "desc": "数据写入接口。\n\n>用于抽象flash等外部设备。", - "name": "data_writer_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的data writer工厂对象。", - "name": "data_writer_factory", - "return": { - "type": "data_writer_factory_t*", - "desc": "返回data writer工厂对象。" - } - }, - { - "params": [ - { - "type": "data_writer_factory_t*", - "name": "factory", - "desc": "data writer工厂对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的data writer工厂对象。", - "name": "data_writer_factory_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建data writer工厂对象。", - "name": "data_writer_factory_create", - "return": { - "type": "data_writer_factory_t*", - "desc": "返回data writer工厂对象。" - } - }, - { - "params": [ - { - "type": "data_writer_factory_t*", - "name": "factory", - "desc": "writer工厂对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" }, { "type": "const char*", - "name": "protocol", - "desc": "协议(如file)。" - }, - { - "type": "data_writer_create_t", - "name": "create", - "desc": "data writer创建函数。" - } - ], - "annotation": {}, - "desc": "注册data writer创建函数。", - "name": "data_writer_factory_register", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "data_writer_factory_t*", - "name": "factory", - "desc": "data writer工厂对象。" + "name": "state", + "desc": "控件状态。" }, { "type": "const char*", - "name": "url", - "desc": "URL。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建指定类型的data writer对象。", - "name": "data_writer_factory_create_writer", - "return": { - "type": "data_writer_t*", - "desc": "返回data writer对象。" - } - }, - { - "params": [ + "name": "name", + "desc": "属性名。" + }, { - "type": "data_writer_factory_t*", - "name": "factory", - "desc": "data writer工厂对象。" + "type": "color_t", + "name": "val", + "desc": "值。" } ], "annotation": {}, - "desc": "析构并释放data writer工厂对象。", - "name": "data_writer_factory_destroy", + "desc": "设置指定名称的颜色值。", + "name": "style_mutable_set_color", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -37725,2195 +42080,215 @@ { "params": [ { - "type": "const char*", - "name": "filename", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "创建基于文件的data writer。", - "name": "data_writer_file_create", - "return": { - "type": "data_writer_t*", - "desc": "返回data writer对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/data_writer_factory.h", - "desc": "data writer工厂。", - "name": "data_writer_factory_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "data_reader_t*", - "name": "reader", - "desc": "reader对象。" - }, - { - "type": "uint64_t", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "void*", - "name": "data", - "desc": "用于读取数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "最大读取数据长度。" - } - ], - "annotation": {}, - "desc": "在指定位置读取数据。", - "name": "data_reader_read", - "return": { - "type": "int32_t", - "desc": "返回实际读取数据的长度。" - } - }, - { - "params": [ - { - "type": "data_reader_t*", - "name": "reader", - "desc": "reader对象。" - } - ], - "annotation": {}, - "desc": "获取数据长度。", - "name": "data_reader_get_size", - "return": { - "type": "uint64_t", - "desc": "返回数据长度。" - } - }, - { - "params": [ - { - "type": "data_reader_t*", - "name": "reader", - "desc": "reader对象。" - } - ], - "annotation": {}, - "desc": "销毁reader对象。", - "name": "data_reader_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "url", - "desc": "URL。" - }, - { - "type": "uint32_t*", - "name": "size", - "desc": "返回数据长度。" - } - ], - "annotation": {}, - "desc": "从指定的URL读取全部数据。", - "name": "data_reader_read_all", - "return": { - "type": "void*", - "desc": "返回全部数据,调用者需要调用TKMEM_FREE释放返回值。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/data_reader.h", - "desc": "数据读取接口。\n\n>用于抽象flash等外部设备。", - "name": "data_reader_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的data reader工厂对象。", - "name": "data_reader_factory", - "return": { - "type": "data_reader_factory_t*", - "desc": "返回data reader工厂对象。" - } - }, - { - "params": [ - { - "type": "data_reader_factory_t*", - "name": "factory", - "desc": "data reader工厂对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的data reader工厂对象。", - "name": "data_reader_factory_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建data reader工厂对象。", - "name": "data_reader_factory_create", - "return": { - "type": "data_reader_factory_t*", - "desc": "返回data reader工厂对象。" - } - }, - { - "params": [ - { - "type": "data_reader_factory_t*", - "name": "factory", - "desc": "reader工厂对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" }, { "type": "const char*", - "name": "protocol", - "desc": "协议(如file)。" - }, - { - "type": "data_reader_create_t", - "name": "create", - "desc": "data reader创建函数。" - } - ], - "annotation": {}, - "desc": "注册data reader创建函数。", - "name": "data_reader_factory_register", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "data_reader_factory_t*", - "name": "factory", - "desc": "data reader工厂对象。" + "name": "state", + "desc": "控件状态。" }, { "type": "const char*", - "name": "url", - "desc": "URL。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建指定类型的data reader对象。", - "name": "data_reader_factory_create_reader", - "return": { - "type": "data_reader_t*", - "desc": "返回data reader对象。" - } - }, - { - "params": [ - { - "type": "data_reader_factory_t*", - "name": "factory", - "desc": "data reader工厂对象。" - } - ], - "annotation": {}, - "desc": "析构并释放data reader工厂对象。", - "name": "data_reader_factory_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "filename", - "desc": "文件名。" - } - ], - "annotation": {}, - "desc": "创建基于文件的data reader。", - "name": "data_reader_file_create", - "return": { - "type": "data_reader_t*", - "desc": "返回data reader对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/data_reader_factory.h", - "desc": "data reader工厂。", - "name": "data_reader_factory_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "capacity", - "desc": "数组的初始容量。" - }, - { - "type": "tk_destroy_t", - "name": "destroy", - "desc": "元素销毁函数。" - }, - { - "type": "tk_compare_t", - "name": "compare", - "desc": "元素比较函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建darray对象。", - "name": "darray_create", - "return": { - "type": "darray_t*", - "desc": "数组对象。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "uint32_t*", - "name": "capacity", - "desc": "数组的初始容量。" - }, - { - "type": "tk_destroy_t", - "name": "destroy", - "desc": "元素销毁函数。" - }, - { - "type": "tk_compare_t", - "name": "compare", - "desc": "元素比较函数。" - } - ], - "annotation": {}, - "desc": "初始化darray对象。", - "name": "darray_init", - "return": { - "type": "darray_t*", - "desc": "数组对象。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "查找第一个满足条件的元素。", - "name": "darray_find", - "return": { - "type": "void*", - "desc": "如果找到,返回满足条件的对象,否则返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数,为NULL则使用内置的比较函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "二分查找(确保数组有序)。", - "name": "darray_bsearch_index", - "return": { - "type": "int", - "desc": "如果找到,返回满足条件的对象的位置,否则返回-1。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数,为NULL则使用内置的比较函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "二分查找(确保数组有序)。", - "name": "darray_bsearch", - "return": { - "type": "void*", - "desc": "如果找到,返回满足条件的对象,否则返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "uint32_t", - "name": "index", - "desc": "序数。" - } - ], - "annotation": {}, - "desc": "获取指定序数的元素。", - "name": "darray_get", - "return": { - "type": "void*", - "desc": "返回满足条件的对象,否则返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "查找第一个满足条件的元素,并返回位置。", - "name": "darray_find_index", - "return": { - "type": "int", - "desc": "如果找到,返回满足条件的对象的位置,否则返回-1。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "删除第一个满足条件的元素。", - "name": "darray_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "uint32_t", - "name": "index", - "desc": "位置序数。" - } - ], - "annotation": {}, - "desc": "删除指定位置的元素。", - "name": "darray_remove_index", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数,为NULL则使用内置的比较函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "删除全部满足条件的元素。", - "name": "darray_remove_all", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数,为NULL则使用内置的比较函数。" - } - ], - "annotation": {}, - "desc": "排序。", - "name": "darray_sort", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数,为NULL则使用内置的比较函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - }, - { - "type": "darray_t*", - "name": "matched", - "desc": "返回满足条件的元素。" - } - ], - "annotation": {}, - "desc": "查找全部满足条件的元素。\n\n```\ndarray_t matched;\ndarray_init(&matched, 0, NULL, NULL);\ndarray_find_all(darray, mycmp, myctx, &matched);\n...\ndarray_deinit(&matched);\n\n```", - "name": "darray_find_all", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "弹出最后一个元素。", - "name": "darray_pop", - "return": { - "type": "void*", - "desc": "成功返回最后一个元素,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "返回最后一个元素。", - "name": "darray_tail", - "return": { - "type": "void*", - "desc": "成功返回最后一个元素,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "返回第一个元素。", - "name": "darray_head", - "return": { - "type": "void*", - "desc": "成功返回最后一个元素,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "void*", - "name": "data", - "desc": "待追加的元素。" - } - ], - "annotation": {}, - "desc": "在尾巴追加一个元素。", - "name": "darray_push", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "单向链表对象。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "比较函数的上下文。" - } - ], - "annotation": {}, - "desc": "返回满足条件元素的个数。", - "name": "darray_count", - "return": { - "type": "int32_t", - "desc": "返回元素个数。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "清除全部元素。", - "name": "darray_clear", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - }, - { - "type": "tk_visit_t", - "name": "visit", - "desc": "遍历函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "遍历函数的上下文。" - } - ], - "annotation": {}, - "desc": "遍历元素。", - "name": "darray_foreach", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "清除全部元素,并释放elms。", - "name": "darray_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "darray_t*", - "name": "darray", - "desc": "数组对象。" - } - ], - "annotation": {}, - "desc": "销毁darray对象。", - "name": "darray_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "size", - "desc": "数组中元素的个数。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "数组的容量大小。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "elms", - "desc": "数组中的元素。", - "type": "void**", - "annotation": { - "readable": true - } - }, - { - "name": "destroy", - "desc": "元素销毁函数。", - "type": "tk_destroy_t", - "annotation": { - "readable": true - } - }, - { - "name": "compare", - "desc": "元素比较函数。", - "type": "tk_compare_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/darray.h", - "desc": "动态数组,根据元素个数动态调整数组的容量。\n\n用darray\\_init初始化时,用darray\\_deinit释放。如:\n\n```c\ndarray_t darray;\ndarray_init(&darray, 10, destroy, compare);\n...\ndarray_deinit(&darray);\n```\n\n用darray\\_create创建时,用darray\\_destroy销毁。如:\n\n```c\ndarray_t* darray = darray_create(10, destroy, compare);\n...\ndarray_destroy(darray);\n```", - "name": "darray_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "创建cond。", - "name": "tk_cond_create", - "return": { - "type": "tk_cond_t*", - "desc": "cond对象。" - } - }, - { - "params": [ - { - "type": "tk_cond_t*", - "name": "cond", - "desc": "cond对象。" - }, - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - } - ], - "annotation": {}, - "desc": "等待。", - "name": "tk_cond_wait", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_cond_t*", - "name": "cond", - "desc": "cond对象。" - }, - { - "type": "tk_mutex_t*", - "name": "mutex", - "desc": "mutex对象。" - }, - { - "type": "uint32_t*", - "name": "timeout_ms", - "desc": "最长等待时间。" - } - ], - "annotation": {}, - "desc": "等待指定时间。", - "name": "tk_cond_wait_timeout", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_cond_t*", - "name": "cond", - "desc": "cond对象。" - } - ], - "annotation": {}, - "desc": "唤醒。", - "name": "tk_cond_signal", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_cond_t*", - "name": "cond", - "desc": "cond对象。" - } - ], - "annotation": {}, - "desc": "销毁cond对象。", - "name": "tk_cond_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/cond.h", - "desc": "条件变量。", - "name": "tk_cond_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": {}, - "desc": "创建cond_var。", - "name": "tk_cond_var_create", - "return": { - "type": "tk_cond_var_t*", - "desc": "cond_var对象。" - } - }, - { - "params": [ - { - "type": "tk_cond_var_t*", - "name": "cond_var", - "desc": "cond_var对象。" - }, - { - "type": "uint32_t*", - "name": "timeout_ms", - "desc": "最长等待时间。" - } - ], - "annotation": {}, - "desc": "等待。", - "name": "tk_cond_var_wait", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_cond_var_t*", - "name": "cond_var", - "desc": "cond_var对象。" - } - ], - "annotation": {}, - "desc": "唤醒。", - "name": "tk_cond_var_awake", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_cond_var_t*", - "name": "cond_var", - "desc": "cond_var对象。" - } - ], - "annotation": {}, - "desc": "销毁cond_var对象。", - "name": "tk_cond_var_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/cond_var.h", - "desc": "简化版的条件变量。", - "name": "tk_cond_var_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "compressor_t*", - "name": "compressor", - "desc": "compressor对象。" - }, - { - "type": "const void*", - "name": "data", - "desc": "待压缩的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - }, - { - "type": "wbuffer_t*", - "name": "out", - "desc": "压缩之后的数据。" - } - ], - "annotation": {}, - "desc": "压缩数据。", - "name": "compressor_compress", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "compressor_t*", - "name": "compressor", - "desc": "compressor对象。" - }, - { - "type": "const void*", - "name": "data", - "desc": "待解压的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据长度。" - }, - { - "type": "wbuffer_t*", - "name": "out", - "desc": "解压之后的数据。" - } - ], - "annotation": {}, - "desc": "解压数据。", - "name": "compressor_uncompress", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "compressor_t*", - "name": "compressor", - "desc": "compressor对象。" - } - ], - "annotation": {}, - "desc": "销毁compressor对象。", - "name": "compressor_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/compressor.h", - "desc": "压缩解压接口。", - "name": "compressor_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint8_t", - "name": "r", - "desc": "红色。" - }, - { - "type": "uint8_t", - "name": "g", - "desc": "绿色。" - }, - { - "type": "uint8_t", - "name": "b", - "desc": "蓝色。" - }, - { - "type": "uint8_t", - "name": "a", - "desc": "alpha。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化颜色对象。", - "name": "color_init", - "return": { - "type": "color_t", - "desc": "颜色对象。" - } - }, - { - "params": [ - { - "type": "uint8_t", - "name": "r", - "desc": "红色通道。" - }, - { - "type": "uint8_t", - "name": "b", - "desc": "蓝色通道。" - }, - { - "type": "uint8_t", - "name": "g", - "desc": "绿色通道。" - }, - { - "type": "uint8_t", - "name": "a", - "desc": "alpha通道。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建color对象。\n\n> 主要供脚本语言使用。", - "name": "color_create", - "return": { - "type": "color_t*", - "desc": "color对象。" - } - }, - { - "params": [ - { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "name": "name", + "desc": "属性名。" }, { "type": "const char*", - "name": "str", - "desc": "css类似的颜色值。" + "name": "val", + "desc": "值。" } ], - "annotation": { - "scriptable": true - }, - "desc": "创建color对象。\n\n> 主要供脚本语言使用。", - "name": "color_from_str", + "annotation": {}, + "desc": "设置指定名称字符串的值。", + "name": "style_mutable_set_str", "return": { - "type": "color_t*", - "desc": "color对象。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" + }, + { + "type": "tk_on_style_item_t", + "name": "on_style_item", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取红色通道的值。\n\n> 主要供脚本语言使用。", - "name": "color_r", + "annotation": {}, + "desc": "遍历。对每项调用回调函数on\\_style\\_item。", + "name": "style_mutable_foreach", "return": { - "type": "uint8_t", - "desc": "返回红色通道的值。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" + }, + { + "type": "const char*", + "name": "state", + "desc": "控件状态。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性名。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "值。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取绿色通道的值。\n\n> 主要供脚本语言使用。", - "name": "color_g", + "annotation": {}, + "desc": "获取指定名称的值。", + "name": "style_mutable_get_value", "return": { - "type": "uint8_t", - "desc": "返回绿色通道的值。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" + }, + { + "type": "const char*", + "name": "state", + "desc": "控件状态。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性名。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "值。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取蓝色通道的值。\n\n> 主要供脚本语言使用。", - "name": "color_b", + "annotation": {}, + "desc": "设置指定名称的值。", + "name": "style_mutable_set_value", "return": { - "type": "uint8_t", - "desc": "返回蓝色通道的值。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" + }, + { + "type": "style_t*", + "name": "other", + "desc": "style对象。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取alpha通道的值。\n\n> 主要供脚本语言使用。", - "name": "color_a", + "annotation": {}, + "desc": "将other对象的数据拷贝到s对象。", + "name": "style_mutable_copy", "return": { - "type": "uint8_t", - "desc": "返回alpha通道的值。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "color_t*", - "name": "color", - "desc": "color对象。" + "type": "style_t*", + "name": "s", + "desc": "style对象。" + } + ], + "annotation": {}, + "desc": "清空s对象。", + "name": "style_mutable_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "style_t*", + "name": "s", + "desc": "style对象。" } ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为color对象。\n\n> 供脚本语言使用。", - "name": "color_cast", + "desc": "转换为style_mutable对象。", + "name": "style_mutable_cast", "return": { - "type": "color_t*", - "desc": "color对象。" + "type": "style_t*", + "desc": "style对象。" } }, { "params": [ { - "type": "color_t*", - "name": "c", - "desc": "color对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "销毁color对象。\n> 主要供脚本语言使用。", - "name": "color_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "color_t*", - "name": "c", - "desc": "color对象。" + "type": "widget_t*", + "name": "widget", + "desc": "控件" }, { - "type": "char*", - "name": "str", - "desc": "内存。" + "type": "style_t*", + "name": "default_style", + "desc": "缺省的style。" } ], - "annotation": {}, - "desc": "获取16进制格式表示的颜色", - "name": "color_hex_str", - "return": { - "type": "char*", - "desc": "获取16进制字符串表示的颜色。" - } - }, - { - "params": [ - { - "type": "color_t*", - "name": "c", - "desc": "color对象。" - }, - { - "type": "char*", - "name": "str", - "desc": "内存。" - } - ], - "annotation": {}, - "desc": "获取rgba格式表示的颜色", - "name": "color_rgba_str", - "return": { - "type": "char*", - "desc": "获取rgba格式表示的颜色。" - } - } - ], - "events": [], - "properties": [ - { - "name": "rgba", - "desc": "颜色的RGBA值。", - "type": "rgba_t", "annotation": { - "readable": true, - "writable": true - } - }, - { - "name": "color", - "desc": "颜色的数值。", - "type": "uint32_t", - "annotation": { - "readable": true, - "writable": true, + "constructor": true, "scriptable": true - } - } - ], - "header": "tkc/color.h", - "desc": "颜色。", - "name": "color_t", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "r", - "desc": "红色。", - "type": "uint8_t", - "annotation": { - "readable": true, - "writable": true - } - }, - { - "name": "g", - "desc": "绿色。", - "type": "uint8_t", - "annotation": { - "readable": true, - "writable": true - } - }, - { - "name": "b", - "desc": "蓝色。", - "type": "uint8_t", - "annotation": { - "readable": true, - "writable": true - } - }, - { - "name": "a", - "desc": "alpha。", - "type": "uint8_t", - "annotation": { - "readable": true, - "writable": true - } - } - ], - "header": "tkc/color.h", - "desc": "颜色的四个通道。", - "name": "rgba_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "const char*", - "name": "color", - "desc": "字符串格式的颜色。" - } - ], - "annotation": { - "static": true }, - "desc": "把字符串格式的颜色转换成color\\_t对象。\n\n目前支持下列格式:\n\n* 16进制格式。如:\"#112233\"\n* 颜色名称格式。如:\"green\"\n* rgb格式。如:\"rgb(11,22,33)\"\n* rgba格式。如:\"rgba(11,22,33,0.5)\"", - "name": "color_parse", + "desc": "创建style\\_mutable对象。\n\n> 除了测试程序外不需要直接调用,widget会通过style\\_factory\\_create创建。", + "name": "style_mutable_create", "return": { - "type": "void*", - "desc": "返回color_t对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/color_parser.h", - "desc": "颜色解析相关函数。\n\n示例:\n\n```c\ncolor_t c;\nc = color_parse(\"#112233\");\nc = color_parse(\"white\");\nc = color_parse(\"rgb(11,22,33)\");\nc = color_parse(\"rgba(11,22,33,0.5)\");\n```", - "name": "color_parser_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint8_t*", - "name": "data", - "desc": "缓冲区。" - }, - { - "type": "uint16_t", - "name": "capacity", - "desc": "缓冲区的容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始rbuffer对象。", - "name": "rbuffer_init", - "return": { - "type": "rbuffer_t*", - "desc": "rbuffer对象本身。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - } - ], - "annotation": {}, - "desc": "判断是否还有数据可读。", - "name": "rbuffer_has_more", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示还有数据可读,否则表示无数据可读。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "int32_t", - "name": "offset", - "desc": "跳过的偏移量,正数往前负数往回跳。" - } - ], - "annotation": {}, - "desc": "跳过指定的长度。", - "name": "rbuffer_skip", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint8_t*", - "name": "value", - "desc": "返回读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint8数据。", - "name": "rbuffer_read_uint8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint16_t*", - "name": "value", - "desc": "读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint16数据。", - "name": "rbuffer_read_uint16", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint32_t*", - "name": "value", - "desc": "返回读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint32数据。", - "name": "rbuffer_read_uint32", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "float_t*", - "name": "value", - "desc": "返回读取的数据。" - } - ], - "annotation": {}, - "desc": "读取float数据。", - "name": "rbuffer_read_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "void*", - "name": "data", - "desc": "返回读取的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "读取的数据长度。" - } - ], - "annotation": {}, - "desc": "读取指定长度的二进制数据。", - "name": "rbuffer_read_binary", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "char**", - "name": "str", - "desc": "返回字符串。" - } - ], - "annotation": {}, - "desc": "读取字符串。", - "name": "rbuffer_read_string", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint8_t*", - "name": "value", - "desc": "返回读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint8数据,但不改变cursor的位置。", - "name": "rbuffer_peek_uint8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint16_t*", - "name": "value", - "desc": "返回读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint16数据,但不改变cursor的位置。", - "name": "rbuffer_peek_uint16", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "rbuffer_t*", - "name": "rbuffer", - "desc": "rbuffer对象。" - }, - { - "type": "uint32_t*", - "name": "value", - "desc": "读取的数据。" - } - ], - "annotation": {}, - "desc": "读取uint32数据,但不改变cursor的位置。", - "name": "rbuffer_peek_uint32", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "data", - "desc": "数据缓冲区。", - "type": "uint8_t*", - "annotation": { - "readable": true - } - }, - { - "name": "cursor", - "desc": "当前读取位置。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "缓存区的容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/buffer.h", - "desc": "Read Buffer。用于数据解包。\n\n示例:\n\n```c\nuint8_t buff[128];\nwbuffer_t wbuffer;\nrbuffer_t rbuffer;\nconst char* str = NULL;\nwbuffer_init(&wbuffer, buff, sizeof(buff));\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nrbuffer_init(&rbuffer, wbuffer.data, wbuffer.cursor);\nrbuffer_read_string(&rbuffer, &str);\n```", - "name": "rbuffer_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint8_t*", - "name": "data", - "desc": "缓冲区。" - }, - { - "type": "uint16_t", - "name": "capacity", - "desc": "缓冲区的容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始wbuffer对象。", - "name": "wbuffer_init", - "return": { - "type": "wbuffer_t*", - "desc": "wbuffer对象本身。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始wbuffer对象,容量不够时是否支持自动扩展,使用完成后需要调用wbuffer\\_deinit释放资源。", - "name": "wbuffer_init_extendable", - "return": { - "type": "wbuffer_t*", - "desc": "wbuffer对象本身。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint32_t", - "name": "capacity", - "desc": "缓冲区的容量。" - } - ], - "annotation": {}, - "desc": "扩展缓冲区至指定的大小。", - "name": "wbuffer_extend_capacity", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - } - ], - "annotation": {}, - "desc": "释放资源。", - "name": "wbuffer_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "int32_t", - "name": "delta", - "desc": "跳过的偏移量,正数往前负数往回跳。" - } - ], - "annotation": {}, - "desc": "跳过指定的长度。", - "name": "wbuffer_skip", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint8_t", - "name": "value", - "desc": "要写入的数据。" - } - ], - "annotation": {}, - "desc": "写入uint8数据。", - "name": "wbuffer_write_uint8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint16_t", - "name": "value", - "desc": "要写入的数据。" - } - ], - "annotation": {}, - "desc": "写入uint16数据。", - "name": "wbuffer_write_uint16", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint32_t", - "name": "value", - "desc": "要写入的数据。" - } - ], - "annotation": {}, - "desc": "写入uint32数据。", - "name": "wbuffer_write_uint32", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "float_t", - "name": "value", - "desc": "要写入的数据。" - } - ], - "annotation": {}, - "desc": "写入float数据。", - "name": "wbuffer_write_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "void*", - "name": "data", - "desc": "要写入的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "要写入的数据长度。" - } - ], - "annotation": {}, - "desc": "写入指定长度的二进制数据。", - "name": "wbuffer_write_binary", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "char*", - "name": "data", - "desc": "要写入的字符串。" - } - ], - "annotation": {}, - "desc": "写入字符串。", - "name": "wbuffer_write_string", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wbuffer_t*", - "name": "wbuffer", - "desc": "wbuffer对象。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "空间大小。" - } - ], - "annotation": {}, - "desc": "是否还有空间。", - "name": "wbuffer_has_room", - "return": { - "type": "bool_t", - "desc": "返回FALSE表示无,否则表示有。" - } - } - ], - "events": [], - "properties": [ - { - "name": "data", - "desc": "数据缓冲区。用于保存写入的数据。", - "type": "uint8_t*", - "annotation": { - "readable": true - } - }, - { - "name": "cursor", - "desc": "当前写入位置。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "数据缓冲区最大容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "extendable", - "desc": "容量不够时是否支持自动扩展。", - "type": "bool_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/buffer.h", - "desc": "Write Buffer。用于数据打包。\n\n示例:\n\n```c\nuint8_t buff[128];\nwbuffer_t wbuffer;\nrbuffer_t rbuffer;\nconst char* str = NULL;\nwbuffer_init(&wbuffer, buff, sizeof(buff));\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nrbuffer_init(&rbuffer, wbuffer.data, wbuffer.cursor);\nrbuffer_read_string(&rbuffer, &str);\n```\n\n```c\nwbuffer_t wbuffer;\nwbuffer_init_extendable(&wbuffer);\n\nwbuffer_write_string(&wbuffer, \"hello awtk\");\n\nwbuffer_deinit(&wbuffer);\n```\n> 如果初始化为extendable,则最后需要调用wbuffer\\_deinit释放资源。", - "name": "wbuffer_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "async_exec_t", - "name": "exec", - "desc": "需要异步支持的函数。" - }, - { - "type": "async_on_result_t", - "name": "on_result", - "desc": "返回执行结果(可选)" - }, - { - "type": "void*", - "name": "ctx", - "desc": "两个回调函数的上下文。" - } - ], - "annotation": { - "static": true - }, - "desc": "异步执行exec函数,执行完成后,在后台线程调用on_result函数。", - "name": "async_call", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "style_t*", + "desc": "style对象。" } }, { "params": [], - "annotation": { - "static": true - }, - "desc": "全局初始化。", - "name": "async_call_init", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "static": true - }, - "desc": "全局~初始化。", - "name": "async_call_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/async.h", - "desc": "异步请求。", - "name": "async_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint16_t", - "name": "type", - "desc": "资源的类型。" - }, - { - "type": "uint16_t", - "name": "subtype", - "desc": "资源的子类型。" - }, - { - "type": "const char*", - "name": "name", - "desc": "资源的名称。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "资源的数据长度(用于分配空间)。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建asset_info对象。\n\n> 主要供脚本语言使用。", - "name": "asset_info_create", - "return": { - "type": "asset_info_t*", - "desc": "asset_info对象。" - } - }, - { - "params": [ - { - "type": "asset_info_t*", - "name": "info", - "desc": "asset_info对象。" - } - ], - "annotation": { - "deconstructor": true - }, - "desc": "销毁asset_info对象。", - "name": "asset_info_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "asset_info_t*", - "name": "info", - "desc": "asset_info对象。" - } - ], "annotation": {}, - "desc": "减少asset_info对象的引用计数。", - "name": "asset_info_unref", + "desc": "将自己注册到style\\_factory。", + "name": "style_mutable_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } - }, - { - "params": [ - { - "type": "asset_info_t*", - "name": "info", - "desc": "asset_info对象。" - } - ], - "annotation": {}, - "desc": "增加asset_info对象的引用计数。", - "name": "asset_info_ref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "未格式化名字。" - } - ], - "annotation": {}, - "desc": "把资源名字格式化为符合标准长度的字符串。", - "name": "asset_info_get_formatted_name", - "return": { - "type": "ret_t", - "desc": "返回格式化后的名字。" - } } ], "events": [], "properties": [ - { - "name": "type", - "desc": "类型。", - "type": "uint16_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "subtype", - "desc": "子类型。", - "type": "uint8_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "is_in_rom", - "desc": "资源是否在ROM中。", - "type": "uint8_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "size", - "desc": "大小。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "refcount", - "desc": "引用计数。\nis\\_in\\_rom == FALSE时才有效。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, { "name": "name", "desc": "名称。", @@ -39922,242 +42297,40 @@ "readable": true, "scriptable": true } + }, + { + "name": "widget", + "desc": "与之关联的控件。", + "type": "widget_t*", + "annotation": { + "private": true + } + }, + { + "name": "default_style", + "desc": "缺省的style,在mutable中找不到时,再到default_style中找。", + "type": "style_t*", + "annotation": { + "private": true + } + }, + { + "name": "styles", + "desc": "控件在不同状态下的style。", + "type": "widget_state_style_t*", + "annotation": { + "private": true + } } ], - "header": "tkc/asset_info.h", - "desc": "单个资源的描述信息。", - "name": "asset_info_t", + "header": "base/style_mutable.h", + "desc": "可变的style(可实时修改并生效,主要用于在designer中被编辑的控件,或者一些特殊控件)。\n\nstyle\\_mutable也对style\\_const进行了包装,当用户没修改某个值时,便从style\\_const中获取。", + "name": "style_mutable_t", + "parent": "style_t", "annotation": { "scriptable": true }, - "level": 1 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/asset_info.h", - "desc": "预加载资源的描述信息。", - "name": "preload_res_t", - "level": 1 - }, - { - "type": "enum", - "desc": "UI资源类型定义。", - "consts": [ - { - "desc": "无效UI类型。", - "name": "ASSET_TYPE_UI_NONE" - }, - { - "desc": "二进制的UI类型。", - "name": "ASSET_TYPE_UI_BIN" - }, - { - "desc": "XML格式的UI类型。", - "name": "ASSET_TYPE_UI_XML" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_ui_type_t", - "prefix": "ASSET_UI_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "图片资源类型定义。", - "consts": [ - { - "desc": "未知图片类型。", - "name": "ASSET_TYPE_IMAGE_NONE" - }, - { - "desc": "Raw图片类型。", - "name": "ASSET_TYPE_IMAGE_RAW" - }, - { - "desc": "位图图片类型。", - "name": "ASSET_TYPE_IMAGE_BMP" - }, - { - "desc": "PNG图片类型。", - "name": "ASSET_TYPE_IMAGE_PNG" - }, - { - "desc": "JPG图片类型。", - "name": "ASSET_TYPE_IMAGE_JPG" - }, - { - "desc": "BSVG图片类型。", - "name": "ASSET_TYPE_IMAGE_BSVG" - }, - { - "desc": "GIF图片类型。", - "name": "ASSET_TYPE_IMAGE_GIF" - }, - { - "desc": "WEBP图片类型。", - "name": "ASSET_TYPE_IMAGE_WEBP" - }, - { - "desc": "LZ4压缩的图片类型。", - "name": "ASSET_TYPE_IMAGE_LZ4" - }, - { - "desc": "其它图片类型。", - "name": "ASSET_TYPE_IMAGE_OTHER" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_image_type_t", - "prefix": "ASSET_IMAGE_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "脚本资源类型定义。", - "consts": [ - { - "desc": "未知脚本类型。", - "name": "ASSET_TYPE_SCRIPT_NONE" - }, - { - "desc": "JS脚本类型。", - "name": "ASSET_TYPE_SCRIPT_JS" - }, - { - "desc": "LUA脚本类型。", - "name": "ASSET_TYPE_SCRIPT_LUA" - }, - { - "desc": "Python脚本类型。", - "name": "ASSET_TYPE_SCRIPT_PYTHON" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_script_type_t", - "prefix": "ASSET_SCRIPT_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "缓存不够时丢弃数据的策略。", - "consts": [ - { - "desc": "丢弃旧的数据。", - "name": "DATA_DISCARD_OLD" - }, - { - "desc": "丢弃新的数据。", - "name": "DATA_DISCARD_NEW" - } - ], - "header": "misc/ostream_retry.h", - "name": "data_discard_policy_t", - "prefix": "DATA_DISCARD_", - "level": 1 - }, - { - "type": "enum", - "desc": "数据资源类型定义。", - "consts": [ - { - "desc": "未知数据类型。", - "name": "ASSET_TYPE_DATA_NONE" - }, - { - "desc": "文本数据类型。", - "name": "ASSET_TYPE_DATA_TEXT" - }, - { - "desc": "二进制数据类型。", - "name": "ASSET_TYPE_DATA_BIN" - }, - { - "desc": "JSON数据类型。", - "name": "ASSET_TYPE_DATA_JSON" - }, - { - "desc": "通用数据类型。", - "name": "ASSET_TYPE_DATA_DAT" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_data_type_t", - "prefix": "ASSET_DATA_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "字体资源类型定义。", - "consts": [ - { - "desc": "无效字体。", - "name": "ASSET_TYPE_FONT_NONE" - }, - { - "desc": "TTF字体。", - "name": "ASSET_TYPE_FONT_TTF" - }, - { - "desc": "位图字体。", - "name": "ASSET_TYPE_FONT_BMP" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_font_type_t", - "prefix": "ASSET_FONT_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "资源类型常量定义。", - "consts": [ - { - "desc": "无效资源。", - "name": "ASSET_TYPE_NONE" - }, - { - "desc": "字体资源。", - "name": "ASSET_TYPE_FONT" - }, - { - "desc": "图片资源。", - "name": "ASSET_TYPE_IMAGE" - }, - { - "desc": "主题资源。", - "name": "ASSET_TYPE_STYLE" - }, - { - "desc": "UI数据资源。", - "name": "ASSET_TYPE_UI" - }, - { - "desc": "XML数据资源。", - "name": "ASSET_TYPE_XML" - }, - { - "desc": "字符串数据资源。", - "name": "ASSET_TYPE_STRINGS" - }, - { - "desc": "JS等脚本资源。", - "name": "ASSET_TYPE_SCRIPT" - }, - { - "desc": "其它数据资源。", - "name": "ASSET_TYPE_DATA" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_type_t", - "prefix": "ASSET_TYPE_", - "annotation": { - "scriptable": true - }, - "level": 1 + "level": 2 }, { "type": "class", @@ -40167,360 +42340,63 @@ "annotation": { "constructor": true }, - "desc": "创建action_thread对象。", - "name": "action_thread_create", + "desc": "获取缺省的控件工厂对象。", + "name": "widget_factory", + "alias": "widget_factory_instance", "return": { - "type": "action_thread_t*", - "desc": "action_thread对象。" + "type": "widget_factory_t*", + "desc": "返回控件工厂对象。" } }, { "params": [ { - "type": "waitable_action_queue_t*", - "name": "queue", - "desc": "queue对象。" + "type": "widget_factory_t*", + "name": "factory", + "desc": "控件工厂对象。" } ], + "annotation": {}, + "desc": "设置缺省的控件工厂对象。", + "name": "widget_factory_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], "annotation": { "constructor": true }, - "desc": "创建action_thread对象。", - "name": "action_thread_create_with_queue", + "desc": "创建控件工厂对象。", + "name": "widget_factory_create", "return": { - "type": "action_thread_t*", - "desc": "action_thread对象。" + "type": "widget_factory_t*", + "desc": "返回控件工厂对象。" } }, { "params": [ { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" + "type": "widget_factory_t*", + "name": "factory", + "desc": "控件工厂对象。" }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - } - ], - "annotation": {}, - "desc": "让线程执行action。", - "name": "action_thread_exec", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - }, - { - "type": "action_thread_on_idle_t", - "name": "on_idle", - "desc": "空闲时的回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置空闲时的回调函数。", - "name": "action_thread_set_on_idle", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - }, - { - "type": "action_thread_on_quit_t", - "name": "on_quit", - "desc": "退出时的回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置退出时的回调函数。", - "name": "action_thread_set_on_quit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "action_thread_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "thread", - "desc": "线程对象。", - "type": "tk_thread_t*", - "annotation": { - "readable": true - } - }, - { - "name": "queue", - "desc": "action queue。", - "type": "waitable_action_queue_t*", - "annotation": { - "readable": true - } - }, - { - "name": "executed_actions_nr", - "desc": "已经执行action的个数。", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/action_thread.h", - "desc": "执行action的线程。\n\n> 每个线程都有一个action queue,可以是共享的queue,也可以是私有的queue。", - "name": "action_thread_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint16_t", - "name": "max_thread_nr", - "desc": "最大线程数。" - }, - { - "type": "uint16_t", - "name": "min_idle_nr", - "desc": "最小空闲线程数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建action_thread_pool对象。", - "name": "action_thread_pool_create", - "return": { - "type": "action_thread_pool_t*", - "desc": "action_thread_pool对象。" - } - }, - { - "params": [ - { - "type": "action_thread_pool_t*", - "name": "thread_pool", - "desc": "action_thread_pool对象。" - }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - } - ], - "annotation": {}, - "desc": "执行action。", - "name": "action_thread_pool_exec", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_thread_pool_t*", - "name": "thread_pool", - "desc": "action_thread_pool对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "action_thread_pool_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "max_thread_nr", - "desc": "最大线程数。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "min_idle_nr", - "desc": "最小空闲线程数", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/action_thread_pool.h", - "desc": "action线程池。", - "name": "action_thread_pool_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int", - "name": "fd", - "desc": "fd." - } - ], - "annotation": {}, - "desc": "创建ostream对象。", - "name": "tk_ostream_serial_create", - "return": { - "type": "tk_ostream_t*", - "desc": "返回ostream对象。" - } - } - ], - "events": [], - "properties": [], - "header": "serial/ostream_serial.h", - "desc": "基于串口实现的输出流。\n\ninput stream base on fd", - "name": "tk_ostream_serial_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "bsvg_t*", - "name": "", - "desc": "。" - }, - { - "type": "const uint32_t*", - "name": "data", - "desc": "svg数据。" - }, - { - "type": "size", - "name": "size", - "desc": "data长度。" - } - ], - "annotation": {}, - "desc": "初始化bsvg对象。", - "name": "bsvg_init", - "return": { - "type": "bsvg_t*", - "desc": "返回解析后的svg。" - } - } - ], - "events": [], - "properties": [], - "header": "svg/bsvg.h", - "desc": "SVG的二进制格式。", - "name": "bsvg_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t*", - "name": "data", - "desc": "bsvg数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "bsvg数据长度。" - }, - { - "type": "str_t*", - "name": "str", - "desc": "用于返回svg数据。" - } - ], - "annotation": {}, - "desc": "bsvg to svg", - "name": "bsvg_to_svg", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ { "type": "const char*", - "name": "xml", - "desc": "svg数据。" + "name": "type", + "desc": "控件类型。" }, { - "type": "uint32_t", - "name": "size", - "desc": "svg数据长度。" - }, - { - "type": "uint32_t*", - "name": "out", - "desc": "用于返回bsvg数据。" - }, - { - "type": "uint32_t*", - "name": "out_size", - "desc": "bsvg数据长度。" + "type": "widget_create_t", + "name": "create", + "desc": "创建函数。" } ], "annotation": {}, - "desc": "svg to bsvg", - "name": "svg_to_bsvg", + "desc": "注册控件创建函数。", + "name": "widget_factory_register", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -40529,74 +42405,57 @@ { "params": [ { - "type": "uint32_t", - "name": "capacity", - "desc": "action的容量。" + "type": "widget_factory_t*", + "name": "factory", + "desc": "控件工厂对象。" + }, + { + "type": "const char*", + "name": "type", + "desc": "控件类型。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "初始X坐标。" + }, + { + "type": "xy_t", + "name": "y", + "desc": "初始Y坐标。" + }, + { + "type": "xy_t", + "name": "w", + "desc": "初始宽度。" + }, + { + "type": "xy_t", + "name": "h", + "desc": "初始高度。" } ], "annotation": { "constructor": true }, - "desc": "创建action_queue对象。", - "name": "action_queue_create", + "desc": "创建指定类型的控件。", + "name": "widget_factory_create_widget", "return": { - "type": "action_queue_t*", - "desc": "action_queue对象。" + "type": "widget_t*", + "desc": "返回控件对象。" } }, { "params": [ { - "type": "action_queue_t*", - "name": "q", - "desc": "action_queue对象。" - }, - { - "type": "qaction_t**", - "name": "action", - "desc": "用于返回action对象。" + "type": "widget_factory_t*", + "name": "factory", + "desc": "控件工厂对象。" } ], "annotation": {}, - "desc": "接收一个请求。", - "name": "action_queue_recv", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_queue_t*", - "name": "q", - "desc": "action_queue对象。" - }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - } - ], - "annotation": {}, - "desc": "发送一个请求。", - "name": "action_queue_send", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "action_queue_t*", - "name": "q", - "desc": "action_queue对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "action_queue_destroy", + "desc": "析构并释放控件工厂对象。", + "name": "widget_factory_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -40605,13 +42464,2345 @@ ], "events": [], "properties": [], - "header": "svg/bsvg_to_svg.h", - "desc": "", - "name": "svg_helper_t", + "header": "base/widget_factory.h", + "desc": "控件工厂对象。\n\n提供通过类型创建控件的能力。\n用户注册自定义控件,可以获得内置控件同等待遇。", + "name": "widget_factory_t", + "parent": "emitter_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + } + ], + "annotation": {}, + "desc": "窗口on_destroy函数的缺省实现。", + "name": "window_base_on_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "event_t*", + "name": "e", + "desc": "event对象。" + } + ], + "annotation": {}, + "desc": "窗口on_event函数的缺省实现。", + "name": "window_base_on_event", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "const rect_t*", + "name": "rect", + "desc": "rect对象。" + } + ], + "annotation": {}, + "desc": "窗口on_invalidate函数的缺省实现。", + "name": "window_base_invalidate", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "窗口on_paint_begin函数的缺省实现。", + "name": "window_base_on_paint_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "窗口on_paint_end函数的缺省实现。", + "name": "window_base_on_paint_end", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。1" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "canvas_t*", + "name": "c", + "desc": "canvas对象。" + } + ], + "annotation": {}, + "desc": "窗口on_paint_self函数的缺省实现。", + "name": "window_base_on_paint_self", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。g" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性名。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "value对象" + } + ], + "annotation": {}, + "desc": "窗口get_prop函数的缺省实现。", + "name": "window_base_get_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性名。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "value对象" + } + ], + "annotation": {}, + "desc": "窗口set_prop函数的缺省实现。", + "name": "window_base_set_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "const widget_vtable_t*", + "name": "vt", + "desc": "vtable对象。" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": {}, + "desc": "创建window base对象。", + "name": "window_base_create", + "return": { + "type": "widget_t*", + "desc": "窗口对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_base对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为window_base对象(供脚本语言使用)。", + "name": "window_base_cast", + "return": { + "type": "widget_t*", + "desc": "window_base对象。" + } + } + ], + "events": [ + { + "name": "EVT_WINDOW_WILL_OPEN", + "desc": "窗口即将打开事件。 如果有窗口动画,在窗口动画开始前触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。", + "type": "event_t" + }, + { + "name": "EVT_WINDOW_OPEN", + "desc": "窗口打开事件。 如果有窗口动画,在窗口动画完成时触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。", + "type": "event_t" + }, + { + "name": "EVT_WINDOW_TO_BACKGROUND", + "desc": "窗口被切换到后台事件。 打开新窗口时,当前窗口被切换到后台时,对当前窗口触发本事件。", + "type": "event_t" + }, + { + "name": "EVT_WINDOW_TO_FOREGROUND", + "desc": "窗口被切换到前台事件。 关闭当前窗口时,前一个窗口被切换到前台时,对前一个窗口触发本事件。", + "type": "event_t" + }, + { + "name": "EVT_WINDOW_CLOSE", + "desc": "窗口关闭事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "theme", + "desc": "主题资源的名称。\n每个窗口都可以有独立的主题文件,如果没指定,则使用系统缺省的主题文件。\n主题是一个XML文件,放在assets/raw/styles目录下。\n请参考[主题](https://github.com/zlgopen/awtk/blob/master/docs/theme.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "disable_anim", + "desc": "禁用窗口动画。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "closable", + "desc": "收到EVT_REQUEST_CLOSE_WINDOW是否自动关闭窗口。\n\n如果关闭窗口时,需要用户确认:\n\n* 1.将closable设置为WINDOW\\_CLOSABLE\\_CONFIRM\n\n* 2.处理窗口的EVT\\_REQUEST\\_CLOSE\\_WINDOW事件\n\n> closable在XML中取值为:yes/no/confirm,缺省为yes。", + "type": "window_closable_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "open_anim_hint", + "desc": "打开窗口动画的名称。\n请参考[窗口动画](https://github.com/zlgopen/awtk/blob/master/docs/window_animator.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "close_anim_hint", + "desc": "关闭窗口动画的名称。\n请参考[窗口动画](https://github.com/zlgopen/awtk/blob/master/docs/window_animator.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "stage", + "desc": "窗口当前处于的状态。", + "type": "char*", + "annotation": { + "readable": true, + "get_prop": true + } + }, + { + "name": "theme_obj", + "desc": "窗口的常量主题数据。\n\n>\n把主题管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载主题资源的问题。", + "type": "theme_t*", + "annotation": { + "get_prop": true + } + }, + { + "name": "image_manager", + "desc": "获取图片管理器对象。\n\n>\n把图片管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载图片资源的问题。", + "type": "image_manager_t*", + "annotation": { + "get_prop": true + } + }, + { + "name": "font_manager", + "desc": "获取字体管理器对象。\n\n>\n把字体管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载字体资源的问题。", + "type": "font_manager_t*", + "annotation": { + "get_prop": true + } + }, + { + "name": "assets_manager", + "desc": "获取资源管理器对象。\n\n>\n把资源管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载资源资源的问题。", + "type": "assets_manager_t*", + "annotation": { + "get_prop": true + } + }, + { + "name": "move_focus_prev_key", + "desc": "向前移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "move_focus_next_key", + "desc": "向后移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "move_focus_up_key", + "desc": "向上移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "move_focus_down_key", + "desc": "向下移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "move_focus_left_key", + "desc": "向左移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "move_focus_right_key", + "desc": "向右移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "single_instance", + "desc": "单例。如果窗口存在,先关闭再打开。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "base/window_base.h", + "desc": "窗口。\n\n本类把窗口相关的公共行为进行抽象,放到一起方便重用。目前已知的具体实现如下图:\n\n```graphviz\n[default_style]\n\nwindow_t -> window_base_t[arrowhead = \"empty\"]\npopup_t -> window_base_t[arrowhead = \"empty\"]\ndialog_t -> window_base_t[arrowhead = \"empty\"]\nsystem_bar_t -> window_base_t[arrowhead = \"empty\"]\ncalibration_win_t -> window_base_t[arrowhead = \"empty\"]\n```\n\n> 本类是一个抽象类,不能进行实例化。请在应用程序中使用具体的类,如window\\_t。", + "name": "window_base_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "cast": true + }, + "desc": "获取全局window_manager对象", + "name": "window_manager", + "alias": "window_manager_instance", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "window_manager对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为window_manager对象(供脚本语言使用)。", + "name": "window_manager_cast", + "return": { + "type": "widget_t*", + "desc": "window_manager对象。" + } + }, + { + "params": [ + { + "type": "window_manager_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的窗口管理器。", + "name": "window_manager_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取最上面的主窗口。", + "name": "window_manager_get_top_main_window", + "return": { + "type": "widget_t*", + "desc": "返回窗口对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取最上面的窗口。", + "name": "window_manager_get_top_window", + "return": { + "type": "widget_t*", + "desc": "返回窗口对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取前一个的窗口。", + "name": "window_manager_get_prev_window", + "return": { + "type": "widget_t*", + "desc": "返回窗口对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指针当前的X坐标。", + "name": "window_manager_get_pointer_x", + "return": { + "type": "xy_t", + "desc": "返回指针当前的X坐标。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指针当前的Y坐标。", + "name": "window_manager_get_pointer_y", + "return": { + "type": "xy_t", + "desc": "返回指针当前的X坐标。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指针当前是否按下。", + "name": "window_manager_get_pointer_pressed", + "return": { + "type": "bool_t", + "desc": "返回指针当前是否按下。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取当前窗口动画是否正在播放。", + "name": "window_manager_is_animating", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示正在播放,FALSE表示没有播放。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "widget_t*", + "name": "window", + "desc": "窗口对象。" + } + ], + "annotation": {}, + "desc": "打开窗口。", + "name": "window_manager_open_window", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": {}, + "desc": "绘制。\n\n> 仅由主循环调用。", + "name": "window_manager_paint", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "event_t*", + "name": "e", + "desc": "事件对象。" + } + ], + "annotation": {}, + "desc": "分发输入事件。\n\n> 一般仅由主循环调用,特殊情况也可以用来注入事件。", + "name": "window_manager_dispatch_input_event", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "bool_t", + "name": "show_fps", + "desc": "是否显示FPS。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否显示FPS。", + "name": "window_manager_set_show_fps", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "uint32_t", + "name": "screen_saver_time", + "desc": "屏保时间(单位毫秒), 为0关闭屏保。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置屏保时间。", + "name": "window_manager_set_screen_saver_time", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "const char*", + "name": "cursor", + "desc": "图片名称(从图片管理器中加载)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置鼠标指针。", + "name": "window_manager_set_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "请求关闭顶层窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", + "name": "window_manager_back", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "回到主窗口,关闭之上的全部窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", + "name": "window_manager_back_to_home", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "const char*", + "name": "target", + "desc": "目标窗口的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "回到指定的窗口,关闭之上的全部窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", + "name": "window_manager_back_to", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "event_t*", + "name": "e", + "desc": "事件。" + }, + { + "type": "void*", + "name": "handle", + "desc": "native window句柄。" + } + ], + "annotation": {}, + "desc": "处理native window事件。", + "name": "window_manager_dispatch_native_window_event", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "bool_t", + "name": "ignore_user_input", + "desc": "是否忽略用户输入。" + } + ], + "annotation": {}, + "desc": "开始等待鼠标指针。", + "name": "window_manager_begin_wait_pointer_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + } + ], + "annotation": {}, + "desc": "结束等待鼠标指针。", + "name": "window_manager_end_wait_pointer_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "窗口管理器对象。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "调整原生窗口的大小。", + "name": "window_manager_resize", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "global_emitter", + "desc": "全局事情分发器。", + "type": "emitter_t*", + "annotation": { + "readable": true + } + } + ], + "header": "base/window_manager.h", + "desc": "窗口管理器。", + "name": "window_manager_t", + "parent": "widget_t", + "annotation": { + "scriptable": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "compressor_options_t", + "name": "options", + "desc": "选项。" + } + ], + "annotation": {}, + "desc": "创建compressor对象。", + "name": "compressor_miniz_create", + "return": { + "type": "compressor_t*", + "desc": "返回compressor对象。" + } + } + ], + "events": [], + "properties": [], + "header": "compressors/compressor_miniz.h", + "desc": "基于miniz实现的compressor接口。", + "name": "compressor_miniz_t", + "parent": "compressor_t", "annotation": { "fake": true }, - "level": 1 + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建canvas_widget对象", + "name": "canvas_widget_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "canvas_widget对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为canvas_widget对象(供脚本语言使用)。", + "name": "canvas_widget_cast", + "return": { + "type": "widget_t*", + "desc": "canvas_widget对象。" + } + } + ], + "events": [], + "properties": [], + "header": "canvas_widget/canvas_widget.h", + "desc": "画布控件。\n\n画布控件让开发者可以自己在控件上绘制需要的内容。\n\ncanvas\\_widget\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于canvas\\_widget\\_t控件。\n\n在xml中使用\"canvas\"标签创建画布控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[canvas_widget.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/vgcanvas.xml)\n\n在c代码中使用函数canvas\\_widget\\_create创建画布控件。如:\n\n```c\nwidget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);\n```\n\n> 创建之后,需要用widget\\_on注册EVT\\_PAINT事件,并在EVT\\_PAINT事件处理函数中绘制。\n\n```c\nwidget_on(canvas, EVT_PAINT, on_paint_event, canvas);\n```\n\n绘制时,可以通过canvas接口去绘制,也可以通过vgcanvas接口去绘制。\n先从evt获取canvas对象,再通过canvas\\_get\\_vgcanvas从canvas中获取vgcanvas对象。\n\n```c\n\nstatic ret_t on_paint_event(void* ctx, event_t* evt) {\nwidget_t* canvas_widget = WIDGET(ctx);\ncanvas_t* c = paint_event_cast(evt)->c;\nvgcanvas_t* vg = canvas_get_vgcanvas(c);\ncolor_t bg = color_init(0xe0, 0xe0, 0xe0, 0xff);\ncolor_t tc = color_init(0, 0, 0, 0xff);\nrect_t r = rect_init(canvas_widget->x, canvas_widget->y, canvas_widget->w, canvas_widget->h);\n\nvgcanvas_save(vg);\nvgcanvas_clip_rect(vg, r.x, r.y, r.w, r.h);\nvgcanvas_translate(vg, r.x, r.y);\n\n...\n\nvgcanvas_restore(vg);\n\nreturn RET_OK;\n}\n```\n\n> 完整示例请参考:\n[canvas demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/canvas.c)\n\n参考:\n\n* [canvas接口描述](canvas_t.md)\n* [vgcanvas接口描述](vgcanvas_t.md)", + "name": "canvas_widget_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建color_component对象", + "name": "color_component_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "color_t", + "name": "c", + "desc": "颜色。" + } + ], + "annotation": {}, + "desc": "设置颜色。", + "name": "color_component_set_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float", + "name": "h", + "desc": "色调。" + }, + { + "type": "float", + "name": "s", + "desc": "饱和度。" + }, + { + "type": "float", + "name": "v", + "desc": "明度。" + } + ], + "annotation": {}, + "desc": "设置颜色。", + "name": "color_component_set_hsv", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "color_component对象。" + } + ], + "annotation": {}, + "desc": "获取h分量。", + "name": "color_component_get_h", + "return": { + "type": "float", + "desc": "返回h分量。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "color_component对象。" + } + ], + "annotation": {}, + "desc": "获取s分量。", + "name": "color_component_get_s", + "return": { + "type": "float", + "desc": "返回s分量。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "color_component对象。" + } + ], + "annotation": {}, + "desc": "获取v分量。", + "name": "color_component_get_v", + "return": { + "type": "float", + "desc": "返回v分量。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "color_component对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为color_component对象(供脚本语言使用)。", + "name": "color_component_cast", + "return": { + "type": "widget_t*", + "desc": "color_component对象。" + } + } + ], + "events": [], + "properties": [], + "header": "color_picker/color_component.h", + "desc": "颜色选择器的颜色分量。\n控件的名称有严格规定:\nCOLOR_PICKER_CHILD_SV: 水平为Value/Brightness(递增),垂直为Saturation(递减)。\nCOLOR_PICKER_CHILD_H: 水平为同色,垂直为Hue(递减)。", + "name": "color_component_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建color_picker对象", + "name": "color_picker_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "color", + "desc": "颜色。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置颜色。", + "name": "color_picker_set_color", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "color_picker对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为color_picker对象(供脚本语言使用)。", + "name": "color_picker_cast", + "return": { + "type": "widget_t*", + "desc": "color_picker对象。" + } + } + ], + "events": [ + { + "name": "EVT_VALUE_WILL_CHANGE", + "desc": "值(颜色)即将改变事件。", + "type": "event_t" + }, + { + "name": "EVT_VALUE_CHANGED", + "desc": "值(颜色)改变事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "value", + "desc": "颜色。", + "type": "const char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "color_picker/color_picker.h", + "desc": "颜色选择器。\n\ncolor\\_picker\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于color\\_picker\\_t控件。\n\n在xml中使用\"color\\_picker\"标签创建颜色选择器控件。如:\n\n```xml\n\n\n\n\n\n\n```\n\n> 更多用法请参考:\n[color\\_picker](https://github.com/zlgopen/awtk/blob/master/design/default/ui/color_picker.xml)\n\n其中的子控件必须按下列规则命名:\n\n* r 红色分量。可以是spin_box、edit和slider。\n* g 绿色分量。可以是spin_box、edit和slider。\n* b 蓝色分量。可以是spin_box、edit和slider。\n* h Hue分量。可以是spin_box、edit、slider和color_component。\n* s Saturation分量。可以是spin_box、edit和slider。\n* v Value/Brightness分量。可以是spin_box、edit和slider。\n* sv Saturation和Value/Brightness分量。可以是color_component。\n* old 旧的值。可以是spin_box、edit和color_tile。\n* new 新的值。可以是spin_box、edit和color_tile。", + "name": "color_picker_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建draggable对象", + "name": "draggable_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "draggable对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为draggable对象(供脚本语言使用)。", + "name": "draggable_cast", + "return": { + "type": "widget_t*", + "desc": "draggable对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "int32_t", + "name": "top", + "desc": "拖动范围的顶部限制。缺省为父控件的顶部。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置top。", + "name": "draggable_set_top", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "int32_t", + "name": "bottom", + "desc": "拖动范围的底部限制。缺省为父控件的底部。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置bottom。", + "name": "draggable_set_bottom", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "int32_t", + "name": "left", + "desc": "拖动范围的左边限制。缺省为父控件的左边。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置left。", + "name": "draggable_set_left", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "int32_t", + "name": "right", + "desc": "拖动范围的右边限制。缺省为父控件的右边边。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置right。", + "name": "draggable_set_right", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "vertical_only", + "desc": "只允许垂直拖动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置vertical_only。", + "name": "draggable_set_vertical_only", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "horizontal_only", + "desc": "只允许水平拖动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置horizontal_only。", + "name": "draggable_set_horizontal_only", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "drag_window", + "desc": "drag_window" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置drag_window。\n拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。", + "name": "draggable_set_drag_window", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "top", + "desc": "拖动范围的顶部限制。缺省为父控件的顶部。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "bottom", + "desc": "拖动范围的底部限制。缺省为父控件的底部。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "left", + "desc": "拖动范围的左边限制。缺省为父控件的左边。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "right", + "desc": "拖动范围的右边限制。缺省为父控件的右边边。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "vertical_only", + "desc": "只允许垂直拖动。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "horizontal_only", + "desc": "只允许水平拖动。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "drag_window", + "desc": "拖动窗口而不是父控件。比如放在对话框的titlebar上,拖动titlebar其实是希望拖动对话框。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "features/draggable.h", + "desc": "将draggable放入目标控件,即可让目标控件或当前窗口可以被拖动。\n\ndraggable\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于draggable\\_t控件。\n\n在xml中使用\"draggable\"标签创建draggable控件。如:\n\n```xml\n\n```\n\n拖动对话框标题时移动对话框:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:\n[draggable.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/draggable.xml)\n\n在c代码中使用函数draggable\\_create创建按钮控件。如:\n\n```c\nwidget_t* draggable = draggable_create(target, 0, 0, 0, 0);\n```\n\n> draggable本身不可见,故无需style。", + "name": "draggable_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建file_browser_view对象", + "name": "file_browser_view_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "file_browser_view对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为file_browser_view对象(供脚本语言使用)。", + "name": "file_browser_view_cast", + "return": { + "type": "widget_t*", + "desc": "file_browser_view对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "const char*", + "name": "init_dir", + "desc": "初始文件夹。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 初始文件夹。", + "name": "file_browser_view_set_init_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "const char*", + "name": "filter", + "desc": "过滤规则。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 过滤规则。\n> files_only 表示只列出文件,dir_only 表示只列出目录,其它表示只列出满足扩展名文件集合(如:.jpg.png.gif)。", + "name": "file_browser_view_set_filter", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "重新加载。", + "name": "file_browser_view_reload", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "ignore_hidden_files", + "desc": "忽略隐藏文件。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 忽略隐藏文件。", + "name": "file_browser_view_set_ignore_hidden_files", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "sort_ascending", + "desc": "是否为升序排序。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 是否为升序排序。", + "name": "file_browser_view_set_sort_ascending", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "show_check_button", + "desc": "是否显示checkbutton。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 是否显示checkbutton。", + "name": "file_browser_view_set_show_check_button", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "const char*", + "name": "sort_by", + "desc": "排序方式。可选值(name, size, mtime, type)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置 排序方式。可选值(name, size, mtime, type)。", + "name": "file_browser_view_set_sort_by", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + } + ], + "annotation": {}, + "desc": "返回当前选中的项目。\n\n> 在返回数组中,每个元素是一个fb\\_item\\_t对象。\n> 调用者无需释放返回值,返回值只在当次调用有效。", + "name": "file_browser_view_get_selected_items", + "return": { + "type": "darray_t*", + "desc": "返回当前选中的项目。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取当前路径。", + "name": "file_browser_view_get_cwd", + "return": { + "type": "const char*", + "desc": "返回当前路径。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "子文件夹名。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "在当前文件夹创建子文件夹。", + "name": "file_browser_view_create_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "文件名。" + }, + { + "type": "const char*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "在当前文件夹创建文件。", + "name": "file_browser_view_create_file", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "init_dir", + "desc": "初始文件夹。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "filter", + "desc": "过滤规则。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "ignore_hidden_files", + "desc": "是否忽略隐藏文件。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "sort_ascending", + "desc": "是否为升序排序。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "show_check_button", + "desc": "是否显示checkbutton。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "sort_by", + "desc": "排序方式。可选值(name, size, mtime, type)。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "file_browser/file_browser_view.h", + "desc": "文件管理/浏览/选择控件。\n\nfile\\_browser\\_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于file\\_browser\\_view\\_t控件。\n\n考虑到文件浏览器界面呈现的多样性,界面呈现工作完全有子控件来完成。\n\nfile\\_browser\\_view\\_t负责关联文件/文件夹数据到子控件上,子控件需要特定的规范命名。\n\n* 名为 \"cwd\" 的子控件用于显示当前路径。\n\n* 名为 \"selected_file\" 的子控件用于显示当前选择的文件。\n\n* 名为 \"file\" 的子控件用于显示文件项的模板控件。\n\n* 名为 \"folder\" 的子控件用于显示文件夹项的模板控件。\n\n* 名为 \"return_up\" 的子控件用于返回上一级文件夹的模板控件。\n\n* 名为 \"container\" 的子控件为容器控件,通常是scrollview。\n\n* 名为 \"name\" 的子控件用于显示文件和文件夹的名称(放在列表项目内)。\n\n* 名为 \"size\" 的子控件用于显示文件和文件夹的大小(放在列表项目内)。\n\n* 名为 \"mtime\" 的子控件用于显示文件和文件夹的修改时间(放在列表项目内)。\n\n* 名为 \"ctime\" 的子控件用于显示文件和文件夹的创建时间(放在列表项目内)。\n\n* 名为 \"icon\" 的子控件用于显示文件和文件夹的图标(放在列表项目内)。\n\n* 类型为 \"check_button\" 的子控件用于选择(放在列表项目内)。\n\n完整示例请参考:\n\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/file_chooser_for_open.xml", + "name": "file_browser_view_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建file_chooser对象", + "name": "file_chooser_create", + "return": { + "type": "file_chooser_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + }, + { + "type": "const char*", + "name": "init_dir", + "desc": "初始目录" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置初始目录。", + "name": "file_chooser_set_init_dir", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + }, + { + "type": "const char*", + "name": "filter", + "desc": "过滤规则。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置过滤规则。\n> files_only 表示只列出文件,dir_only 表示只列出目录,其它表示只列出满足扩展名文件集合(如:.jpg.png.gif)。", + "name": "file_chooser_set_filter", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为file_chooser对象(供脚本语言使用)。", + "name": "file_chooser_cast", + "return": { + "type": "file_chooser_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "为了保存而选择文件。", + "name": "file_chooser_choose_file_for_save", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "为了打开而选择文件。", + "name": "file_chooser_choose_file_for_open", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "选择目录。", + "name": "file_chooser_choose_folder", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取目录。", + "name": "file_chooser_get_dir", + "return": { + "type": "const char*", + "desc": "返回选择的目录。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取文件名。", + "name": "file_chooser_get_filename", + "return": { + "type": "const char*", + "desc": "返回选择的文件名。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "用户是否取消了选择。", + "name": "file_chooser_is_aborted", + "return": { + "type": "bool_t", + "desc": "返回用户是否取消了选择。" + } + }, + { + "params": [ + { + "type": "file_chooser_t*", + "name": "chooser", + "desc": "file_chooser对象。" + } + ], + "annotation": {}, + "desc": "销毁file_chooser对象(选择完成后自动调用)。", + "name": "file_chooser_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "init_dir", + "desc": "初始目录。", + "type": "char*" + }, + { + "name": "filter", + "desc": "过滤规则。", + "type": "char*" + }, + { + "name": "on_done", + "desc": "接受结果的回调函数。", + "type": "tk_on_done_t" + }, + { + "name": "on_done_ctx", + "desc": "用户数据。", + "type": "void*" + }, + { + "name": "cwd", + "desc": "当前路径。", + "type": "str_t" + }, + { + "name": "filename;", + "desc": "当前选择的文件。", + "type": "str_t" + }, + { + "name": "aborted", + "desc": "是否取消了选择。", + "type": "bool_t" + } + ], + "header": "file_browser/file_chooser.h", + "desc": "文件/目录选择器", + "name": "file_chooser_t", + "annotation": { + "scriptable": true + }, + "parent": "emitter_t", + "level": 2 }, { "type": "class", @@ -40815,6 +45006,6755 @@ }, "level": 2 }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建guage对象", + "name": "guage_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "guage对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为guage对象(供脚本语言使用)。", + "name": "guage_cast", + "return": { + "type": "widget_t*", + "desc": "guage对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image对象。" + }, + { + "type": "char*", + "name": "name", + "desc": "图片名称,该图片必须存在于资源管理器。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置背景图片的名称。", + "name": "guage_set_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image对象。" + }, + { + "type": "image_draw_type_t", + "name": "draw_type", + "desc": "显示方式。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置图片的显示方式。\n\n> 绘制方式的属性值和枚举值:\n[image\\_draw\\_type\\_name\\_value](https://github.com/zlgopen/awtk/blob/master/src/base/enums.c#L98)", + "name": "guage_set_draw_type", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "image", + "desc": "背景图片。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "draw_type", + "desc": "图片的绘制方式。", + "type": "image_draw_type_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "guage/guage.h", + "desc": "表盘控件。\n\n表盘控件就是一张图片。\n\nguage\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于guage\\_t控件。\n\n在xml中使用\"guage\"标签创建表盘控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[guage.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/guage.xml)\n\n在c代码中使用函数guage\\_create创建表盘控件。如:\n\n```c\nwidget_t* guage = guage_create(win, 10, 10, 200, 200);\nguage_set_image(guage, \"guage_bg\");\n```\n\n可用通过style来设置控件的显示风格,如背景和边框等。如:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:\n[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml)", + "name": "guage_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建image_animation对象", + "name": "image_animation_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "bool_t", + "name": "loop", + "desc": "是否循环播放。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否循环播放。", + "name": "image_animation_set_loop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "const char*", + "name": "image", + "desc": "图片前缀。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置图片前缀。", + "name": "image_animation_set_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "uint32_t", + "name": "interval", + "desc": "间隔时间(毫秒)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置播放间隔时间。", + "name": "image_animation_set_interval", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "uint32_t", + "name": "delay", + "desc": "延迟播放时间(毫秒)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置延迟播放时间(仅适用于自动播放)。", + "name": "image_animation_set_delay", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "bool_t", + "name": "auto_play", + "desc": "是否自动播放。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否自动播放。", + "name": "image_animation_set_auto_play", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "const char*", + "name": "sequence", + "desc": "播放序列。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置播放序列。比如image为\"fire\",sequence为\"12223\", 将依次播放\"fire1\", \"fire2\", \"fire2\", \"fire2\",\n\"fire3\"。", + "name": "image_animation_set_sequence", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "uint32_t", + "name": "start_index", + "desc": "图片起始序数。" + }, + { + "type": "uint32_t", + "name": "end_index", + "desc": "图片结束序数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置播放序列。比如image为\"fire\",start_index为0, end_index为99, 将依次播放\"fire0\", ...,\n\"fire99\"。\n\n若指定的图片不存在,则重复上一张图片。", + "name": "image_animation_set_range_sequence", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "播放。", + "name": "image_animation_play", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "停止(并重置index为-1)。", + "name": "image_animation_stop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "暂停。", + "name": "image_animation_pause", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "手动切换到下一张图片。", + "name": "image_animation_next", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置生成图片名的格式。\n\nXXX:生成图片名时,第一个参数是图片名前缀,第二个是序数,只能在此前提下设置格式。\n\n```\nconst char* format = image_animation->format ? image_animation->format : \"%s%d\";\ntk_snprintf(name, TK_NAME_LEN, format, image_animation->image, image_animation->index);\n```", + "name": "image_animation_set_format", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + }, + { + "type": "bool_t", + "name": "unload_after_paint", + "desc": "是否绘制完成后unload图片。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置绘制完成后unload图片,以释放内存空间。", + "name": "image_animation_set_unload_after_paint", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为image_animation对象(供脚本语言使用)。", + "name": "image_animation_cast", + "return": { + "type": "widget_t*", + "desc": "image_animation对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_animation对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "判断是否在播放。", + "name": "image_animation_is_playing", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是,否则表示否。" + } + } + ], + "events": [], + "properties": [ + { + "name": "image", + "desc": "图片名称的前缀。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "sequence", + "desc": "播放的序列,字符可选值为数字和英文大小写字母,字符可以重复。如:0123456789或者123123abcd。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "start_index", + "desc": "图片起始序数。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "end_index", + "desc": "图片结束序数。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "loop", + "desc": "是否循环播放。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "auto_play", + "desc": "是否自动播放。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "unload_after_paint", + "desc": "绘制完成后unload图片,以释放内存空间。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "format", + "desc": "索引到图片名转换时的格式,缺省为\"%s%d\"。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "interval", + "desc": "每张图片播放的时间(毫秒)。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "delay", + "desc": "自动播放时延迟播放的时间(毫秒)。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "image_animation/image_animation.h", + "desc": "图片动画控件,指定一个图片前缀,依次显示指定序列的图片,从而形成动画效果。\n\n图片序列可以用sequence指定,也可以用start\\_index和end\\_index指定一个范围。\n\nimage\\_animation\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于image\\_animation\\_t控件。\n\n在xml中使用\"image\\_animation\"标签创建图片动画控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[image_animation.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/image_animation.xml)\n\n在c代码中使用函数image\\_animation\\_create创建图片动画控件。如:\n\n```c\nimage_animation = image_animation_create(win, 10, 10, 200, 200);\nimage_animation_set_image(image_animation, \"ani\");\nimage_animation_set_interval(image_animation, 50);\nimage_animation_set_range_sequence(image_animation, 1, 9);\nimage_animation_play(image_animation);\n```\n\n> 完整示例请参考:\n[image_animation\ndemo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_animation.c)\n\n可用通过style来设置控件的显示风格,如背景颜色和边框等等,不过一般情况并不需要。", + "name": "image_animation_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建image_value对象", + "name": "image_value_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_value对象。" + }, + { + "type": "const char*", + "name": "image", + "desc": "图片前缀。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置图片前缀。", + "name": "image_value_set_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_value对象。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置格式。", + "name": "image_value_set_format", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_value对象。" + }, + { + "type": "float_t", + "name": "delta", + "desc": "增量。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置点击时加上的增量。", + "name": "image_value_set_click_add_delta", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_value对象。" + }, + { + "type": "float_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置值。", + "name": "image_value_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_min对象。" + }, + { + "type": "float_t", + "name": "min", + "desc": "最小值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置最小值。", + "name": "image_value_set_min", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_max对象。" + }, + { + "type": "float_t", + "name": "max", + "desc": "最大值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置最大值。", + "name": "image_value_set_max", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image_value对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为image_value对象(供脚本语言使用)。", + "name": "image_value_cast", + "return": { + "type": "widget_t*", + "desc": "image_value对象。" + } + } + ], + "events": [ + { + "name": "EVT_VALUE_WILL_CHANGE", + "desc": "值即将改变事件(click_add_delta为非0时,点击触发)。", + "type": "event_t" + }, + { + "name": "EVT_VALUE_CHANGED", + "desc": "值改变事件(click_add_delta为非0时,点击触发)。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "image", + "desc": "图片名称的前缀。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "format", + "desc": "数值到字符串转换时的格式,缺省为\"%d\"。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "click_add_delta", + "desc": "点击时加上一个增量。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "value", + "desc": "值。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "min", + "desc": "最小值(如果设置了click\\_add\\_delta,到达最小值后回到最大值)。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "max", + "desc": "最大值(如果设置了click\\_add\\_delta,到达最大值后回到最小值)。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "image_value/image_value.h", + "desc": "图片值控件。\n\n可以用图片来表示如电池电量、WIFI信号强度和其它各种数值的值。\n\n其原理如下:\n\n* 1.把value以format为格式转换成字符串。\n* 2.把每个字符与image(图片文件名前缀)映射成一个图片名。\n* 3.最后把这些图片显示出来。\n\n如果设置click\\_add\\_delta为非0,那么点击时自动增加指定的增量,值超过最大值时回到最小值,\n或者值超过最小值时回到最大值。\n\nimage\\_value\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于image\\_value\\_t控件。\n\n在xml中使用\"image\\_value\"标签创建图片值控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[image\\_value](https://github.com/zlgopen/awtk/blob/master/design/default/ui/image_value.xml)\n\n在c代码中使用函数image\\_value\\_create创建图片值控件。如:\n\n```c\nimage_value = image_value_create(win, 10, 10, 200, 200);\nimage_value_set_image(image_value, \"num_\");\nimage_value_set_value(image_value, 100);\n```\n\n> 完整示例请参考:\n[image_value demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image_value.c)\n\n可用通过style来设置控件的显示风格,如背景颜色和边框等等,不过一般情况并不需要。", + "name": "image_value_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建candidates对象", + "name": "candidates_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "candidates对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为candidates对象(供脚本语言使用)。", + "name": "candidates_cast", + "return": { + "type": "widget_t*", + "desc": "candidates对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "pre", + "desc": "是否为预候选字列表。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否为预候选字列表。\n\n> 为预候选字列表则注册EVT\\_IM\\_SHOW\\_PRE\\_CANDIDATES,否则注册EVT\\_IM\\_SHOW\\_CANDIDATES事件。", + "name": "candidates_set_pre", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "select_by_num", + "desc": "是否启用用数字选择候选字。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否启用用数字选择候选字。", + "name": "candidates_set_select_by_num", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "auto_hide", + "desc": "是否自动隐藏。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否自动隐藏。", + "name": "candidates_set_auto_hide", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "button_style", + "desc": "按钮的style名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置按钮的style名称。", + "name": "candidates_set_button_style", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "pre", + "desc": "是否为预候选字。\n\n> 预候选字: 在有的输入法中,比如T9硬键盘输入时,按下12两个键时,预候选字会显示可用的拼音列表。\n> 从预候选字列表中选择拼音,再查询拼音对应的候选字列表。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "select_by_num", + "desc": "是否启用用数字选择候选字。比如按下1选择第1个候选字,按下2选择第2个候选字。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "auto_hide", + "desc": "没有候选字时,是否自动隐藏控件。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "button_style", + "desc": "按钮的style名称。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "keyboard/candidates.h", + "desc": "输入法候选字词控件。\n\n如果希望启用用数字选择对应的候选字,请设置属性grab_keys=\"true\"。如:\n\n```xml\n\n```\n\n>相关文件: assets/default/raw/ui/kb_default.xml\n\n如果希望通过左右键切换不同的候选字,除了设置属性grab_keys=\"true\",还需要设置按钮的focused状态的style。\n\n```xml\n\n```\n\n>相关文件:assets/default/raw/styles/keyboard.xml", + "name": "candidates_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建lang_indicator对象", + "name": "lang_indicator_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "image", + "desc": "缺省获得焦点的子控件(可用控件名或类型)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置缺省获得焦点的子控件(可用控件名或类型)。", + "name": "lang_indicator_set_image", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "lang_indicator对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为lang_indicator对象(供脚本语言使用)。", + "name": "lang_indicator_cast", + "return": { + "type": "widget_t*", + "desc": "lang_indicator对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "image", + "desc": "如果希望用图片格式显示,本属性用于指定图片的前缀。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "keyboard/lang_indicator.h", + "desc": "输入法语言指示器。\n\n用于显示输入法的输入语言或类型,主要用于T9输入法。\n\nlang_indicator\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于lang_indicator\\_t控件。\n\n在xml中使用\"lang_indicator\"标签创建lang_indicator。如:\n\n```xml\n\n\n```\n\n可用通过style来设置控件的显示风格,如背景颜色等。如:\n\n```xml\n\n```", + "name": "lang_indicator_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建line_number对象", + "name": "line_number_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "top_margin", + "desc": "顶部边距。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置顶部边距。", + "name": "line_number_set_top_margin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "bottom_margin", + "desc": "顶部边距。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置顶部边距。", + "name": "line_number_set_bottom_margin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "line_height", + "desc": "行高。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置行高。", + "name": "line_number_set_line_height", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "yoffset", + "desc": "行高。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置y偏移。", + "name": "line_number_set_yoffset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "line_number对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为line_number对象(供脚本语言使用)。", + "name": "line_number_cast", + "return": { + "type": "widget_t*", + "desc": "line_number对象。" + } + } + ], + "events": [], + "properties": [], + "header": "mledit/line_number.h", + "desc": "行号。多行编辑器的行号。\n\nline\\_number\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于line\\_number\\_t控件。\n\n在xml中使用\"lin\\e_number\"标签创建行号控件,一般配合mledit使用。如:\n\n```xml\n\n\n\n\n```\n\n> 更多用法请参考:[mledit.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/mledit.xml)\n\n可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:\n[theme default](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L556)", + "name": "line_number_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建mledit对象", + "name": "mledit_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "readonly", + "desc": "只读。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器是否为只读。", + "name": "mledit_set_readonly", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "cancelable", + "desc": "是否为可撤销修。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器是否为可撤销修改。", + "name": "mledit_set_cancelable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "focus", + "desc": "是否为焦点。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置为焦点。", + "name": "mledit_set_focus", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "wrap_word", + "desc": "是否自动折行。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器是否自动折行。", + "name": "mledit_set_wrap_word", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "uint32_t", + "name": "max_lines", + "desc": "最大行数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器的最大行数。", + "name": "mledit_set_max_lines", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "char*", + "name": "tips", + "desc": "输入提示。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器的输入提示。", + "name": "mledit_set_tips", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "tr_tips", + "desc": "提示信息。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取翻译之后的文本,然后调用mledit_set_tips。", + "name": "mledit_set_tr_tips", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "char*", + "name": "keyboard", + "desc": "键盘名称(相应UI资源必须存在)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置自定义软键盘名称。", + "name": "mledit_set_keyboard", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "uint32_t", + "name": "cursor", + "desc": "光标位置。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器光标位置。", + "name": "mledit_set_cursor", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "uint32_t", + "name": "scroll_line", + "desc": "滚动行数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器滚动速度。", + "name": "mledit_set_scroll_line", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "open_im_when_focused", + "desc": "是否在获得焦点时打开输入法。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器是否在获得焦点时打开输入法。\n\n> * 设置默认焦点时,打开窗口时不弹出软键盘。\n> * 用键盘切换焦点时,编辑器获得焦点时不弹出软键盘。", + "name": "mledit_set_open_im_when_focused", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "widget对象。" + }, + { + "type": "bool_t", + "name": "close_im_when_blured", + "desc": "是否是否在失去焦点时关闭输入法。在失去焦点时关闭输入法。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置编辑器是否在失去焦点时关闭输入法。", + "name": "mledit_set_close_im_when_blured", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "mledit对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为mledit对象(供脚本语言使用)。", + "name": "mledit_cast", + "return": { + "type": "widget_t*", + "desc": "mledit对象。" + } + } + ], + "events": [ + { + "name": "EVT_VALUE_CHANGING", + "desc": "文本正在改变事件(编辑中)。", + "type": "event_t" + }, + { + "name": "EVT_VALUE_CHANGED", + "desc": "文本改变事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "readonly", + "desc": "编辑器是否为只读。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "top_margin", + "desc": "上边距。", + "type": "uint8_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "bottom_margin", + "desc": "下边距。", + "type": "uint8_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "left_margin", + "desc": "左边距。", + "type": "uint8_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "right_margin", + "desc": "右边距。", + "type": "uint8_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "tips", + "desc": "输入提示。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "tr_tips", + "desc": "保存用于翻译的提示信息。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "keyboard", + "desc": "自定义软键盘名称。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "wrap_word", + "desc": "是否自动折行。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "max_lines", + "desc": "最大行数。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "scroll_line", + "desc": "鼠标一次滚动行数。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "cancelable", + "desc": "是否支持撤销编辑。如果为TRUE,在失去焦点之前可以撤销所有修改(恢复获得焦点之前的内容)。\n\n> * 1.一般配合keyboard的\"cancel\"按钮使用。\n> * 2.为TRUE时,如果内容有变化,会设置编辑器的状态为changed,所以此时编辑器需要支持changed状态的style。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "open_im_when_focused", + "desc": "获得焦点时打开输入法。\n\n> 主要用于没有指针设备的情况,否则每次切换焦点时都打开输入法。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "close_im_when_blured", + "desc": "是否在失去焦点时关闭输入法(默认是)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "mledit/mledit.h", + "desc": "多行编辑器控件。\n\nmledit\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于mledit\\_t控件。\n\n在xml中使用\"mledit\"标签创建多行编辑器控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:[mledit.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/mledit.xml)\n\n在c代码中使用函数mledit\\_create创建多行编辑器控件。如:\n\n```c\nwidget_t* tc = mledit_create(win, 10, 10, 240, 240);\n```\n\n> 完整示例请参考:[mledit demo](\nhttps://github.com/zlgopen/awtk-c-demos/blob/master/demos/mledit.c)\n\ntime\\_clock一般不需要设置style。", + "name": "mledit_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建progress_circle对象", + "name": "progress_circle_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "progress_circle对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为progress_circle对象(供脚本语言使用)。", + "name": "progress_circle_cast", + "return": { + "type": "widget_t*", + "desc": "progress_circle对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置值。", + "name": "progress_circle_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "uint32_t", + "name": "max", + "desc": "最大值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置最大值。", + "name": "progress_circle_set_max", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "uint32_t", + "name": "line_width", + "desc": "环线的厚度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置环线的厚度。", + "name": "progress_circle_set_line_width", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "start_angle", + "desc": "起始角度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置起始角度。", + "name": "progress_circle_set_start_angle", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "unit", + "desc": "单位。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置单位。", + "name": "progress_circle_set_unit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "const char*", + "name": "line_cap", + "desc": "线帽类型(round:圆头,square:方头)。。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置线帽类型。", + "name": "progress_circle_set_line_cap", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "show_text", + "desc": "是否显示文本。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否显示文本。", + "name": "progress_circle_set_show_text", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "counter_clock_wise", + "desc": "是否为逆时针方向。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否为逆时针方向。", + "name": "progress_circle_set_counter_clock_wise", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [ + { + "name": "EVT_VALUE_WILL_CHANGE", + "desc": "值即将改变事件。", + "type": "event_t" + }, + { + "name": "EVT_VALUE_CHANGED", + "desc": "值改变事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "value", + "desc": "值(缺省为0)。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "max", + "desc": "最大值(缺省为100)。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "start_angle", + "desc": "起始角度(单位为度,缺省-90)。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "line_width", + "desc": "环线的厚度(缺省为8)。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "unit", + "desc": "单元(缺省无)。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "line_cap", + "desc": "线帽类型(round:圆头,square:方头)。", + "type": "char*", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "counter_clock_wise", + "desc": "是否为逆时针方向(缺省为FALSE)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "show_text", + "desc": "是否显示文本(缺省为TRUE)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "progress_circle/progress_circle.h", + "desc": "进度圆环控件。\n\nprogress\\_circle\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于progress\\_circle\\_t控件。\n\n在xml中使用\"progress\\_circle\"标签创建进度圆环控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[progress_circle.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/progress_circle.xml)\n\n在c代码中使用函数progress\\_circle\\_create创建进度圆环控件。如:\n\n```c\nprogress_circle = progress_circle_create(win, 10, 10, 200, 200);\nprogress_circle_set_max(progress_circle, 360);\nwidget_set_value(progress_circle, 128);\n```\n\n> 完整示例请参考:\n[progress_circle\ndemo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/progress_circle.c)\n\n可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L467)", + "name": "progress_circle_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建rich_text_view对象", + "name": "rich_text_view_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "rich_text_view对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为rich_text_view对象(供脚本语言使用)。", + "name": "rich_text_view_cast", + "return": { + "type": "widget_t*", + "desc": "rich_text_view对象。" + } + } + ], + "events": [], + "properties": [], + "header": "rich_text/rich_text_view.h", + "desc": "rich_text_view是一个专用容器,用来放rich text和 scroll bar,并在两者之间建立联系。\n\nrich_text_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于rich_text_view\\_t控件。\n\n在xml中使用\"rich_text_view\"标签创建rich_text_view。如:\n\n```xml\n\n\n...\n\n\n\n```\n\n可用通过style来设置控件的显示风格,如背景颜色等。如:\n\n```xml\n\n```", + "name": "rich_text_view_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建rich_text对象", + "name": "rich_text_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "文本。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置文本。", + "name": "rich_text_set_text", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "yslidable", + "desc": "是否允许滑动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否允许y方向滑动。", + "name": "rich_text_set_yslidable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "rich_text对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为rich_text对象(供脚本语言使用)。", + "name": "rich_text_cast", + "return": { + "type": "widget_t*", + "desc": "rich_text对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "line_gap", + "desc": "行间距。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "margin", + "desc": "边距。", + "type": "uint32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yslidable", + "desc": "标识控件是否允许上下拖动。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yoffset", + "desc": "y偏移。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true + } + }, + { + "name": "need_reset", + "desc": "标识控件是否需要重新绘图。", + "type": "bool_t", + "annotation": { + "readable": true + } + } + ], + "header": "rich_text/rich_text.h", + "desc": "图文混排控件,实现简单的图文混排。\n\nrich\\_text\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于rich\\_text\\_t控件。\n\n在xml中使用\"rich\\_text\"标签创建图文混排控件。如:\n\n```xml\nhello awtk!\" />\n```\n>\n\n> 更多用法请参考:\n[rich_text.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/rich_text.xml)\n\n在c代码中使用函数rich\\_text\\_create创建图文混排控件。如:\n\n```c\nwidget_t* rich_text = rich_text_create(win, 0, 0, 0, 0);\nwidget_set_text_utf8(rich_text,\n\"hello awtk!ProTip! The \"\n\"feed shows you events from people you follow and repositories you watch. \"\n\"nhello world. 确定取消中文字符测试。确定。取消。中文字符测试。\");\n\nwidget_set_self_layout_params(rich_text, \"center\", \"middle\", \"100%\", \"100%\");\n```\n\n> 完整示例请参考:\n[rich_text demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/rich_text.c)\n\n可用通过style来设置控件的显示风格,如背景颜色等等。而字体的大小和颜色则由文本内部的属性决定。\n\n目前支持image和font两个tag:\n\n* image 支持的属性有:\n* name 图片的名称。\n* w 图片的宽度。\n* h 图片的高度。\n\n* font 支持的属性有:\n* color 颜色。\n* size 大小。\n* align_v 垂直方向对齐的方式(top|middle|bottom)。\n* bold 粗体(暂不支持)\n* italic 斜体(暂不支持)\n* underline 下划线(暂不支持)", + "name": "rich_text_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建hscroll_label对象", + "name": "hscroll_label_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "lull", + "desc": "间歇时间(ms)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置lull。", + "name": "hscroll_label_set_lull", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "duration", + "desc": "滚动时间(ms)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置duration。", + "name": "hscroll_label_set_duration", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "only_focus", + "desc": "是否只有处于focus时才滚动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置only_focus。", + "name": "hscroll_label_set_only_focus", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "only_parent_focus", + "desc": "是否只有处于focus时才滚动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置only_parent_focus。", + "name": "hscroll_label_set_only_parent_focus", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "loop", + "desc": "是否循环滚动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置loop。", + "name": "hscroll_label_set_loop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "yoyo", + "desc": "是否往返滚动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置yoyo。", + "name": "hscroll_label_set_yoyo", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "ellipses", + "desc": "是否在文本超长时在行尾显示\"...\"。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置ellipses。", + "name": "hscroll_label_set_ellipses", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "xoffset", + "desc": "x偏移。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置x偏移(一般无需用户调用)。。", + "name": "hscroll_label_set_xoffset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "启动(一般无需用户调用)。", + "name": "hscroll_label_start", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "停止(一般无需用户调用)。", + "name": "hscroll_label_stop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "hscroll_label对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为hscroll_label对象(供脚本语言使用)。", + "name": "hscroll_label_cast", + "return": { + "type": "widget_t*", + "desc": "hscroll_label对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "only_focus", + "desc": "只有处于focus时才滚动(缺省否)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "only_parent_focus", + "desc": "只有父控件处于focus时才滚动(缺省否)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "loop", + "desc": "loop是否循环滚动(缺省FALSE)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yoyo", + "desc": "是否往返滚动(缺省FALSE)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "ellipses", + "desc": "文本显示不下时,在行尾显示省略号(缺省FALSE)。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "lull", + "desc": "滚动之间的间歇时间(ms),缺省3000ms。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "duration", + "desc": "完整的滚动一次需要的时间(ms),缺省5000ms。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "scriptable": true + } + }, + { + "name": "xoffset", + "desc": "偏移量。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "scriptable": true + } + }, + { + "name": "text_w", + "desc": "文本的宽度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "scriptable": true + } + } + ], + "header": "scroll_label/hscroll_label.h", + "desc": "可水平滚动的文本控件,方便实现长文本滚动。\n\n\nhscroll\\_label\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于hscroll\\_label\\_t控件。\n\n在xml中使用\"hscroll\\_label\"标签创建行号控件,一般配合mledit使用。如:\n\n```xml\n```\n\n> 更多用法请参考:[mledit.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/mledit.xml)\n\n可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[theme default](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml)", + "name": "hscroll_label_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建子控件布局对象。", + "name": "children_layouter_list_view_create", + "return": { + "type": "children_layouter_t*", + "desc": "返回创建子控件布局对象。" + } + } + ], + "events": [], + "properties": [], + "header": "scroll_view/children_layouter_list_view.h", + "desc": "listview的子控件布局算法实现。\n\n> 用法请参考:[listview子控件布局算法](\nhttps://github.com/zlgopen/awtk/blob/master/docs/children_layouter_list_view.md)", + "name": "children_layouter_list_view_t", + "parent": "children_layouter_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建list_item对象", + "name": "list_item_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "list_item对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为list_item对象(供脚本语言使用)。", + "name": "list_item_cast", + "return": { + "type": "widget_t*", + "desc": "list_item对象。" + } + } + ], + "events": [], + "properties": [], + "header": "scroll_view/list_item.h", + "desc": "列表项控件。\n\n列表项控件是一个简单的容器控件,一般作为列表视图中滚动视图的子控件。\n\nlist\\_item\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_item\\_t控件。\n\n在xml中使用\"list\\_item\"标签创建列表项控件。如:\n\n```xml\n\n\n\n\n\n\n...\n\n\n```\n\n> 更多用法请参考:[list\\_view\\_m.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_m.xml)\n\n在c代码中使用函数list\\_item\\_create创建列表项控件。如:\n\n```c\nwidget_t* list_item = list_item_create(scroll_view, 0, 0, 0, 0);\n```\n\n> 列表项控件大小一般由列表控制,不需指定xywh参数。\n\n可以用style来实现可点击或不可点击的效果。如:\n\n```xml\n\n```\n\n> 更多用法请参考:[theme default](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L372)", + "name": "list_item_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建list_view_h对象", + "name": "list_view_h_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "item_width", + "desc": "列表项的宽度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置列表项的宽度。", + "name": "list_view_h_set_item_width", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "spacing", + "desc": "列表项的间距。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置列表项的间距。", + "name": "list_view_h_set_spacing", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "list_view_h对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为list_view_h对象(供脚本语言使用)。", + "name": "list_view_h_cast", + "return": { + "type": "widget_t*", + "desc": "list_view_h对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "item_width", + "desc": "列表项的宽度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "spacing", + "desc": "间距。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "scroll_view/list_view_h.h", + "desc": "水平列表视图控件。\n\nlist\\_view\\_h\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_view\\_h\\_t控件。\n\n在xml中使用\"list\\_view\\_h\"标签创建水平列表视图控件。如:\n\n```xml\n\n\n\n...\n\n\n```\n\n> 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\n\n\n> 更多用法请参考:[list\\_view\\_h.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_h.xml)\n\n在c代码中使用函数list\\_view\\_h\\_create创建水平列表视图控件。如:\n\n```c\nwidget_t* list_view = list_view_h_create(win, 0, 0, 0, 0);\n```\n\n用代码构造列表视图是比较繁琐的事情,最好用XML来构造。\n如果需要动态修改,可以使用widget\\_clone来增加列表项,使用widget\\_remove\\_child来移出列表项。\n\n可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。", + "name": "list_view_h_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建list_view对象", + "name": "list_view_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "item_height", + "desc": "列表项的高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置列表项的高度。", + "name": "list_view_set_item_height", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "default_item_height", + "desc": "列表项的高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置列表项的缺省高度。", + "name": "list_view_set_default_item_height", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "auto_hide_scroll_bar", + "desc": "是否自动隐藏滚动条。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否自动隐藏滚动条。", + "name": "list_view_set_auto_hide_scroll_bar", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "list_view对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为list_view对象(供脚本语言使用)。", + "name": "list_view_cast", + "return": { + "type": "widget_t*", + "desc": "list_view对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "list_view对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "list_view重新初始化。", + "name": "list_view_reinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "item_height", + "desc": "列表项的高度。如果 item_height > 0,所有列表项使用固定高度,否则使用列表项自身的高度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "default_item_height", + "desc": "列表项的缺省高度。如果item_height <= 0 而且列表项自身的高度 <= 0,则使用缺省高度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "auto_hide_scroll_bar", + "desc": "如果不需要滚动条时,自动隐藏滚动条。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "scroll_view/list_view.h", + "desc": "列表视图控件。\n\n列表视图控件是一个可以垂直滚动的列表控件。\n\n如果不需要滚动,可以用view控件配置适当的layout参数作为列表控件。\n\n列表视图中的列表项可以固定高度,也可以使用不同高度。请参考[变高列表项](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_vh.xml)\n\n列表视图控件的中可以有滚动条,也可以没有滚动条。\n可以使用移动设备风格的滚动条,也可以使用桌面风格的滚动条。\n\nlist\\_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于list\\_view\\_t控件。\n\n在xml中使用\"list\\_view\"标签创建列表视图控件。如:\n\n```xml\n\n\n\n\n\n\n...\n\n\n```\n\n> 注意:列表项不是作为列表视图控件的直接子控件,而是作为滚动视图的子控件。\n\n\n> 更多用法请参考:[list\\_view\\_m.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_m.xml)\n\n在c代码中使用函数list\\_view\\_create创建列表视图控件。如:\n\n```c\nwidget_t* list_view = list_view_create(win, 0, 0, 0, 0);\n```\n\n用代码构造列表视图是比较繁琐的事情,最好用XML来构造。\n如果需要动态修改,可以使用widget\\_clone来增加列表项,使用widget\\_remove\\_child来移出列表项。\n\n可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。", + "name": "list_view_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建scroll_bar对象\n\n> 根据宏WITH_DESKTOP_STYLE决定创建desktop风格还是mobile风格的滚动条", + "name": "scroll_bar_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为scroll_bar对象(供脚本语言使用)。", + "name": "scroll_bar_cast", + "return": { + "type": "widget_t*", + "desc": "scroll_bar对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建mobile风格的scroll_bar对象", + "name": "scroll_bar_create_mobile", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建desktop风格的scroll_bar对象", + "name": "scroll_bar_create_desktop", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "virtual_size", + "desc": "虚拟高度。" + }, + { + "type": "int32_t", + "name": "row", + "desc": "每一行的高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置参数。", + "name": "scroll_bar_set_params", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + }, + { + "type": "int32_t", + "name": "duration", + "desc": "动画持续时间。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "滚动到指定的值。", + "name": "scroll_bar_scroll_to", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置值,并触发EVT_VALUE_CHANGED事件。", + "name": "scroll_bar_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "delta", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "在当前的值上增加一个值,并触发EVT_VALUE_CHANGED事件。", + "name": "scroll_bar_add_delta", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "delta", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "在当前的值上增加一个值,并滚动到新的值,并触发EVT_VALUE_CHANGED事件。", + "name": "scroll_bar_scroll_delta", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置值,但不触发EVT_VALUE_CHANGED事件。", + "name": "scroll_bar_set_value_only", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_bar控件。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "判断是否是mobile风格的滚动条。", + "name": "scroll_bar_is_mobile", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是mobile风格的,否则表示不是mobile风格的。" + } + } + ], + "events": [], + "properties": [ + { + "name": "virtual_size", + "desc": "虚拟宽度或高度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "value", + "desc": "当前的值。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "row", + "desc": "行的高度。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "animatable", + "desc": "滚动时是否启用动画。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "scroll_view/scroll_bar.h", + "desc": "滚动条控件。\n\n> 目前只支持垂直滚动。\n\nscroll\\_bar\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于scroll\\_bar\\_t控件。\n\n在xml中使用\"scroll\\_bar\"或\"scroll\\_bar\\_d\"或\"scroll\\_bar\\_m\"标签创建滚动条控件。如:\n\n```xml\n\n\n...\n\n\n\n```\n\n> 更多用法请参考:[list\\_view\\_m.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_m.xml)\n\n在c代码中使用函数scroll\\_bar\\_create创建列表项控件。如:\n\n```c\nwidget_t* scroll_bar = scroll_bar_create(list_view, 0, 0, 0, 0);\n```\n\n```xml\n\n```\n\n> 更多用法请参考:[theme default](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L350)", + "name": "scroll_bar_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建scroll_view对象", + "name": "scroll_view_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "scroll_view对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为scroll_view对象(供脚本语言使用)。", + "name": "scroll_view_cast", + "return": { + "type": "widget_t*", + "desc": "scroll_view对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "wh_t", + "name": "w", + "desc": "虚拟宽度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置虚拟宽度。", + "name": "scroll_view_set_virtual_w", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "wh_t", + "name": "h", + "desc": "虚拟高度。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置虚拟高度。", + "name": "scroll_view_set_virtual_h", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "xslidable", + "desc": "是否允许滑动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否允许x方向滑动。", + "name": "scroll_view_set_xslidable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "yslidable", + "desc": "是否允许滑动。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否允许y方向滑动。", + "name": "scroll_view_set_yslidable", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "xoffset", + "desc": "x偏移量。" + }, + { + "type": "int32_t", + "name": "yoffset", + "desc": "y偏移量。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置偏移量。", + "name": "scroll_view_set_offset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "float_t", + "name": "xspeed_scale", + "desc": "x偏移速度比例。。" + }, + { + "type": "float_t", + "name": "yspeed_scale", + "desc": "y偏移速度比例。。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置偏移速度比例。", + "name": "scroll_view_set_speed_scale", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "xoffset_end", + "desc": "x偏移量。" + }, + { + "type": "int32_t", + "name": "yoffset_end", + "desc": "y偏移量。" + }, + { + "type": "int32_t", + "name": "duration", + "desc": "时间。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "滚动到指定的偏移量。", + "name": "scroll_view_scroll_to", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "int32_t", + "name": "xoffset_delta", + "desc": "x偏移量。" + }, + { + "type": "int32_t", + "name": "yoffset_delta", + "desc": "y偏移量。" + }, + { + "type": "int32_t", + "name": "duration", + "desc": "时间。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "滚动到指定的偏移量。", + "name": "scroll_view_scroll_delta_to", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [ + { + "name": "EVT_SCROLL_START", + "desc": "开始滚动事件。", + "type": "event_t" + }, + { + "name": "EVT_SCROLL_END", + "desc": "结束滚动事件。", + "type": "event_t" + }, + { + "name": "EVT_SCROLL", + "desc": "滚动事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "virtual_w", + "desc": "虚拟宽度。", + "type": "wh_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "virtual_h", + "desc": "虚拟高度。", + "type": "wh_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "xoffset", + "desc": "x偏移量。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yoffset", + "desc": "y偏移量。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "xspeed_scale", + "desc": "x偏移速度比例。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yspeed_scale", + "desc": "y偏移速度比例。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "xslidable", + "desc": "是否允许x方向滑动。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "yslidable", + "desc": "是否允许y方向滑动。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "scroll_view/scroll_view.h", + "desc": "滚动视图。\n\nscroll\\_view\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于scroll\\_view\\_t控件。\n\n在xml中使用\"scroll\\_view\"标签创建滚动视图控件。如:\n\n```xml\n\n\n\n\n\n\n...\n\n\n```\n\n> 滚动视图一般作为列表视图的子控件使用。\n\n> 更多用法请参考:[list\\_view\\_m.xml](\nhttps://github.com/zlgopen/awtk/blob/master/design/default/ui/list_view_m.xml)\n\n在c代码中使用函数scroll\\_view\\_create创建列表视图控件。如:\n\n```c\nwidget_t* scroll_view = scroll_view_create(win, 0, 0, 0, 0);\n```\n\n可用通过style来设置控件的显示风格,如背景颜色和边框颜色等(一般情况不需要)。", + "name": "scroll_view_t", + "parent": "widget_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建slide_menu对象", + "name": "slide_menu_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "slide_menu对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换slide_menu对象(供脚本语言使用)。", + "name": "slide_menu_cast", + "return": { + "type": "widget_t*", + "desc": "slide_menu对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "slide_menu对象。" + }, + { + "type": "uint32_t", + "name": "value", + "desc": "当前项的索引。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置当前项。", + "name": "slide_menu_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "slide_menu对象。" + }, + { + "type": "align_v_t", + "name": "align_v", + "desc": "对齐方式。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置垂直对齐方式。", + "name": "slide_menu_set_align_v", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "slide_menu对象。" + }, + { + "type": "float_t", + "name": "min_scale", + "desc": "最小缩放比例,范围[0.5-1]。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置最小缩放比例。", + "name": "slide_menu_set_min_scale", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [ + { + "name": "EVT_VALUE_WILL_CHANGE", + "desc": "值(当前项)即将改变事件。", + "type": "event_t" + }, + { + "name": "EVT_VALUE_CHANGED", + "desc": "值(当前项)改变事件。", + "type": "event_t" + } + ], + "properties": [ + { + "name": "value", + "desc": "值。代表当前选中项的索引。", + "type": "int32_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "align_v", + "desc": "垂直对齐方式。", + "type": "align_v_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + }, + { + "name": "min_scale", + "desc": "最小缩放比例。", + "type": "float_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "slide_menu/slide_menu.h", + "desc": "左右滑动菜单控件。\n\n一般用一组按钮作为子控件,通过左右滑动改变当前的项。除了当菜单使用外,也可以用来切换页面。\n\nslide\\_menu\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于slide\\_menu\\_t控件。\n\n在xml中使用\"slide\\_menu\"标签创建左右滑动菜单控件。如:\n\n```xml\n\n\n```\n\n拖动对话框标题时移动对话框:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:\n[draggable.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/draggable.xml)\n\n在c代码中使用函数draggable\\_create创建按钮控件。如:\n\n```c\nwidget_t* draggable = draggable_create(target, 0, 0, 0, 0);\n```\n\n> draggable本身不可见,故无需style。", - "name": "draggable_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转window_event_t对象。主要给脚本语言使用。", - "name": "window_event_cast", - "return": { - "type": "window_event_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "window_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "void*", - "name": "target", - "desc": "事件目标。" - }, - { - "type": "uint32_t", - "name": "type", - "desc": "事件类型。" - }, - { - "type": "widget_t*", - "name": "widget", - "desc": "window对象。" - } - ], - "annotation": {}, - "desc": "初始化事件。", - "name": "window_event_init", - "return": { - "type": "event_t*", - "desc": "event对象。" - } - }, - { - "params": [ - { - "type": "pointer_event_t*", - "name": "evt", - "desc": "指针事件对象。" - }, - { - "type": "system_info_t*", - "name": "info", - "desc": "系统信息。" - } - ], - "annotation": {}, - "desc": "根据屏幕旋转方向修正pointer_event中的坐标。", - "name": "pointer_event_rotate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "window", - "desc": "canvas。", - "type": "widget_t*", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "base/events.h", - "desc": "窗口事件,由窗口管理器触发。", - "name": "window_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建color_picker对象", - "name": "color_picker_create", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "const char*", - "name": "color", - "desc": "颜色。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置颜色。", - "name": "color_picker_set_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "color_picker对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为color_picker对象(供脚本语言使用)。", - "name": "color_picker_cast", - "return": { - "type": "widget_t*", - "desc": "color_picker对象。" - } - } - ], - "events": [ - { - "name": "EVT_VALUE_WILL_CHANGE", - "desc": "值(颜色)即将改变事件。", - "type": "event_t" - }, - { - "name": "EVT_VALUE_CHANGED", - "desc": "值(颜色)改变事件。", - "type": "event_t" - } - ], - "properties": [ - { - "name": "value", - "desc": "颜色。", - "type": "const char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - } - ], - "header": "color_picker/color_picker.h", - "desc": "颜色选择器。\n\ncolor\\_picker\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于color\\_picker\\_t控件。\n\n在xml中使用\"color\\_picker\"标签创建颜色选择器控件。如:\n\n```xml\n\n\n\n\n\n\n```\n\n> 更多用法请参考:\n[color\\_picker](https://github.com/zlgopen/awtk/blob/master/design/default/ui/color_picker.xml)\n\n其中的子控件必须按下列规则命名:\n\n* r 红色分量。可以是spin_box、edit和slider。\n* g 绿色分量。可以是spin_box、edit和slider。\n* b 蓝色分量。可以是spin_box、edit和slider。\n* h Hue分量。可以是spin_box、edit、slider和color_component。\n* s Saturation分量。可以是spin_box、edit和slider。\n* v Value/Brightness分量。可以是spin_box、edit和slider。\n* sv Saturation和Value/Brightness分量。可以是color_component。\n* old 旧的值。可以是spin_box、edit和color_tile。\n* new 新的值。可以是spin_box、edit和color_tile。", - "name": "color_picker_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建color_component对象", - "name": "color_component_create", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "color_t", - "name": "c", - "desc": "颜色。" - } - ], - "annotation": {}, - "desc": "设置颜色。", - "name": "color_component_set_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "float", - "name": "h", - "desc": "色调。" - }, - { - "type": "float", - "name": "s", - "desc": "饱和度。" - }, - { - "type": "float", - "name": "v", - "desc": "明度。" - } - ], - "annotation": {}, - "desc": "设置颜色。", - "name": "color_component_set_hsv", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "color_component对象。" - } - ], - "annotation": {}, - "desc": "获取h分量。", - "name": "color_component_get_h", - "return": { - "type": "float", - "desc": "返回h分量。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "color_component对象。" - } - ], - "annotation": {}, - "desc": "获取s分量。", - "name": "color_component_get_s", - "return": { - "type": "float", - "desc": "返回s分量。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "color_component对象。" - } - ], - "annotation": {}, - "desc": "获取v分量。", - "name": "color_component_get_v", - "return": { - "type": "float", - "desc": "返回v分量。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "color_component对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为color_component对象(供脚本语言使用)。", - "name": "color_component_cast", - "return": { - "type": "widget_t*", - "desc": "color_component对象。" - } - } - ], - "events": [], - "properties": [], - "header": "color_picker/color_component.h", - "desc": "颜色选择器的颜色分量。\n控件的名称有严格规定:\nCOLOR_PICKER_CHILD_SV: 水平为Value/Brightness(递增),垂直为Saturation(递减)。\nCOLOR_PICKER_CHILD_H: 水平为同色,垂直为Hue(递减)。", - "name": "color_component_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转multi_gesture_event_t对象,主要给脚本语言使用。", - "name": "multi_gesture_event_cast", - "return": { - "type": "multi_gesture_event_t*", - "desc": "event对象。" - } - }, - { - "params": [ - { - "type": "multi_gesture_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "void*", - "name": "target", - "desc": "事件目标。" - }, - { - "type": "uint32_t", - "name": "touch_id", - "desc": "touch device id。" - }, - { - "type": "int32_t", - "name": "x", - "desc": "x的值。" - }, - { - "type": "int32_t", - "name": "y", - "desc": "y的值。" - }, - { - "type": "float", - "name": "rotation", - "desc": "旋转角度(幅度)增量。" - }, - { - "type": "float", - "name": "distance", - "desc": "两点间的距离增量。(-1,0)表示缩小,(0-1)表示增加。" - }, - { - "type": "uint32_t", - "name": "fingers", - "desc": "本事件用到手指数。" - } - ], - "annotation": {}, - "desc": "初始化事件。", - "name": "multi_gesture_event_init", - "return": { - "type": "event_t*", - "desc": "event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "touch_id", - "desc": "touch device id。", - "type": "int64_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "x", - "desc": "中心点x坐标。", - "type": "xy_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "y", - "desc": "中心点y坐标。", - "type": "xy_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "rotation", - "desc": "旋转角度(幅度)增量。", - "type": "float", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "distance", - "desc": "两点间的距离增量。(-1,0)表示缩小,(0-1)表示增加。", - "type": "float", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "fingers", - "desc": "本事件用到手指数。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "base/events.h", - "desc": "多点触摸手势事件。", - "name": "multi_gesture_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建canvas_widget对象", - "name": "canvas_widget_create", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "canvas_widget对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为canvas_widget对象(供脚本语言使用)。", - "name": "canvas_widget_cast", - "return": { - "type": "widget_t*", - "desc": "canvas_widget对象。" - } - } - ], - "events": [], - "properties": [], - "header": "canvas_widget/canvas_widget.h", - "desc": "画布控件。\n\n画布控件让开发者可以自己在控件上绘制需要的内容。\n\ncanvas\\_widget\\_t是[widget\\_t](widget_t.md)的子类控件,widget\\_t的函数均适用于canvas\\_widget\\_t控件。\n\n在xml中使用\"canvas\"标签创建画布控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[canvas_widget.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/vgcanvas.xml)\n\n在c代码中使用函数canvas\\_widget\\_create创建画布控件。如:\n\n```c\nwidget_t* canvas = canvas_widget_create(win, 0, 0, win->w, win->h);\n```\n\n> 创建之后,需要用widget\\_on注册EVT\\_PAINT事件,并在EVT\\_PAINT事件处理函数中绘制。\n\n```c\nwidget_on(canvas, EVT_PAINT, on_paint_event, canvas);\n```\n\n绘制时,可以通过canvas接口去绘制,也可以通过vgcanvas接口去绘制。\n先从evt获取canvas对象,再通过canvas\\_get\\_vgcanvas从canvas中获取vgcanvas对象。\n\n```c\n\nstatic ret_t on_paint_event(void* ctx, event_t* evt) {\nwidget_t* canvas_widget = WIDGET(ctx);\ncanvas_t* c = paint_event_cast(evt)->c;\nvgcanvas_t* vg = canvas_get_vgcanvas(c);\ncolor_t bg = color_init(0xe0, 0xe0, 0xe0, 0xff);\ncolor_t tc = color_init(0, 0, 0, 0xff);\nrect_t r = rect_init(canvas_widget->x, canvas_widget->y, canvas_widget->w, canvas_widget->h);\n\nvgcanvas_save(vg);\nvgcanvas_clip_rect(vg, r.x, r.y, r.w, r.h);\nvgcanvas_translate(vg, r.x, r.y);\n\n...\n\nvgcanvas_restore(vg);\n\nreturn RET_OK;\n}\n```\n\n> 完整示例请参考:\n[canvas demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/canvas.c)\n\n参考:\n\n* [canvas接口描述](canvas_t.md)\n* [vgcanvas接口描述](vgcanvas_t.md)", - "name": "canvas_widget_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "image对象。" - }, - { - "type": "char*", - "name": "name", - "desc": "图片名称,该图片必须存在于资源管理器。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件的图片名称。\n\n> 如果需要显示文件系统中的图片,只需将图片名称换成实际的文件名,并加上\"file://\"前缀即可。", - "name": "image_base_set_image", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "float_t", - "name": "rotation", - "desc": "旋转角度(幅度)。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件的旋转角度(仅在WITH_VGCANVAS定义时生效)。", - "name": "image_base_set_rotation", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "float_t", - "name": "scale_x", - "desc": "X方向缩放比例。" - }, - { - "type": "float_t", - "name": "scale_y", - "desc": "Y方向缩放比例。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件的缩放比例(仅在WITH_VGCANVAS定义时生效)。", - "name": "image_base_set_scale", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "float_t", - "name": "anchor_x", - "desc": "锚点X(0-1)。0在控件左边,0.5在控件中间,1在控件右边。" - }, - { - "type": "float_t", - "name": "anchor_y", - "desc": "锚点Y(0-1)。0在控件顶部,0.5在控件中间,1在控件底部。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件的锚点(仅在WITH_VGCANVAS定义时生效)。", - "name": "image_base_set_anchor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "bool_t", - "name": "selected", - "desc": "是否被选中。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件的选中状态。", - "name": "image_base_set_selected", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "bool_t", - "name": "selectable", - "desc": "是否可以被选中。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件是否可以被选中。", - "name": "image_base_set_selectable", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件对象。" - }, - { - "type": "bool_t", - "name": "clickable", - "desc": "是否可以被点击。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置控件是否可以被点击。", - "name": "image_base_set_clickable", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "image_base对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为image_base对象(供脚本语言使用)。", - "name": "image_base_cast", - "return": { - "type": "widget_t*", - "desc": "image_base对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "image", - "desc": "图片的名称。", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "anchor_x", - "desc": "锚点X(0-1)。0在控件左边,0.5在控件中间,1在控件右边。", - "type": "float_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "anchor_y", - "desc": "锚点Y(0-1)。0在控件顶部,0.5在控件中间,1在控件底部。", - "type": "float_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "scale_x", - "desc": "控件在X方向上的缩放比例。", - "type": "float_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "scale_y", - "desc": "控件在Y方向上的缩放比例。", - "type": "float_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "rotation", - "desc": "控件的旋转角度(幅度)。", - "type": "float_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "clickable", - "desc": "点击时,是否触发EVT_CLICK事件。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "selectable", - "desc": "是否设置选中状态。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "selected", - "desc": "当前是否被选中。", - "type": "bool_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "base/image_base.h", - "desc": "图片控件基类。\n\n本类把图片相关控件的公共行为进行抽象,放到一起方便重用。目前已知的具体实现如下图:\n\n```graphviz\n[default_style]\n\nimage_t -> image_base_t[arrowhead = \"empty\"]\nsvg_image_t -> image_base_t[arrowhead = \"empty\"]\ngif_image_t -> image_base_t[arrowhead = \"empty\"]\n```\n\n> 本类是一个抽象类,不能进行实例化。请在应用程序中使用具体的类,如image\\_t。\n\n如果需要显示文件系统中的图片,只需将图片名称换成实际的文件名,并加上\"file://\"前缀即可。如:\n\n```\n\n\n\n```", - "name": "image_base_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "im_commit_event_t*", - "name": "e", - "desc": "事件对象。" - }, - { - "type": "const char*", - "name": "text", - "desc": "文本。" - }, - { - "type": "bool_t", - "name": "replace", - "desc": "是否替代当前的内容。" - } - ], - "annotation": {}, - "desc": "初始化im_commit事件。", - "name": "im_commit_event_init", - "return": { - "type": "event_t*", - "desc": "返回事件对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "text", - "desc": "提交的文本。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "replace", - "desc": "是否替换原来的文本。", - "type": "bool_t", - "annotation": { - "readable": true - } - } - ], - "header": "base/input_method.h", - "desc": "输入法提交输入的文本事件。", - "name": "im_commit_event_t", - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "text", - "desc": "软键盘上的action按钮显示的文本。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "enable", - "desc": "软键盘上的action按钮启用。", - "type": "bool_t", - "annotation": { - "readable": true - } - } - ], - "header": "base/input_method.h", - "desc": "设置软键盘上的action按钮的信息事件。", - "name": "im_action_button_info_event_t", - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "candidates", - "desc": "可选的文本,多个文本以\\0分隔。如:里\\0李\\0力\\0离\\0", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "candidates_nr", - "desc": "可选的文本的个数。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "selected", - "desc": "缺省选中某个候选字,小于0不选择任何候选字。", - "type": "int32_t", - "annotation": { - "readable": true - } - } - ], - "header": "base/input_method.h", - "desc": "输入法请求显示候选字的事件。", - "name": "im_candidates_event_t", - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "compressor_options_t", - "name": "options", - "desc": "选项。" - } - ], - "annotation": {}, - "desc": "创建compressor对象。", - "name": "compressor_miniz_create", - "return": { - "type": "compressor_t*", - "desc": "返回compressor对象。" - } - } - ], - "events": [], - "properties": [], - "header": "compressors/compressor_miniz.h", - "desc": "基于miniz实现的compressor接口。", - "name": "compressor_miniz_t", - "parent": "compressor_t", - "annotation": { - "fake": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "base/lcd_profile.h", - "desc": "对现有LCD对象进行包装,实现对各个函数的时间统计,用于辅助定位性能瓶颈。", - "name": "lcd_profile_t", - "parent": "lcd_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "cast": true - }, - "desc": "获取全局window_manager对象", - "name": "window_manager", - "alias": "window_manager_instance", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_manager对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为window_manager对象(供脚本语言使用)。", - "name": "window_manager_cast", - "return": { - "type": "widget_t*", - "desc": "window_manager对象。" - } - }, - { - "params": [ - { - "type": "window_manager_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的窗口管理器。", - "name": "window_manager_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取最上面的主窗口。", - "name": "window_manager_get_top_main_window", - "return": { - "type": "widget_t*", - "desc": "返回窗口对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取最上面的窗口。", - "name": "window_manager_get_top_window", - "return": { - "type": "widget_t*", - "desc": "返回窗口对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取前一个的窗口。", - "name": "window_manager_get_prev_window", - "return": { - "type": "widget_t*", - "desc": "返回窗口对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指针当前的X坐标。", - "name": "window_manager_get_pointer_x", - "return": { - "type": "xy_t", - "desc": "返回指针当前的X坐标。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指针当前的Y坐标。", - "name": "window_manager_get_pointer_y", - "return": { - "type": "xy_t", - "desc": "返回指针当前的X坐标。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指针当前是否按下。", - "name": "window_manager_get_pointer_pressed", - "return": { - "type": "bool_t", - "desc": "返回指针当前是否按下。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取当前窗口动画是否正在播放。", - "name": "window_manager_is_animating", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示正在播放,FALSE表示没有播放。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "widget_t*", - "name": "window", - "desc": "窗口对象。" - } - ], - "annotation": {}, - "desc": "打开窗口。", - "name": "window_manager_open_window", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": {}, - "desc": "绘制。\n\n> 仅由主循环调用。", - "name": "window_manager_paint", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "event_t*", - "name": "e", - "desc": "事件对象。" - } - ], - "annotation": {}, - "desc": "分发输入事件。\n\n> 一般仅由主循环调用,特殊情况也可以用来注入事件。", - "name": "window_manager_dispatch_input_event", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "bool_t", - "name": "show_fps", - "desc": "是否显示FPS。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置是否显示FPS。", - "name": "window_manager_set_show_fps", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "uint32_t", - "name": "screen_saver_time", - "desc": "屏保时间(单位毫秒), 为0关闭屏保。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置屏保时间。", - "name": "window_manager_set_screen_saver_time", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "const char*", - "name": "cursor", - "desc": "图片名称(从图片管理器中加载)。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置鼠标指针。", - "name": "window_manager_set_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "请求关闭顶层窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", - "name": "window_manager_back", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "回到主窗口,关闭之上的全部窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", - "name": "window_manager_back_to_home", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "const char*", - "name": "target", - "desc": "目标窗口的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "回到指定的窗口,关闭之上的全部窗口。\n\n> 如果顶层窗口时模态对话框,用DIALOG\\_QUIT\\_NONE调用dialog\\_quit。", - "name": "window_manager_back_to", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "event_t*", - "name": "e", - "desc": "事件。" - }, - { - "type": "void*", - "name": "handle", - "desc": "native window句柄。" - } - ], - "annotation": {}, - "desc": "处理native window事件。", - "name": "window_manager_dispatch_native_window_event", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "bool_t", - "name": "ignore_user_input", - "desc": "是否忽略用户输入。" - } - ], - "annotation": {}, - "desc": "开始等待鼠标指针。", - "name": "window_manager_begin_wait_pointer_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - } - ], - "annotation": {}, - "desc": "结束等待鼠标指针。", - "name": "window_manager_end_wait_pointer_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "窗口管理器对象。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "调整原生窗口的大小。", - "name": "window_manager_resize", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "global_emitter", - "desc": "全局事情分发器。", - "type": "emitter_t*", - "annotation": { - "readable": true - } - } - ], - "header": "base/window_manager.h", - "desc": "窗口管理器。", - "name": "window_manager_t", - "parent": "widget_t", - "annotation": { - "scriptable": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - } - ], - "annotation": {}, - "desc": "窗口on_destroy函数的缺省实现。", - "name": "window_base_on_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - }, - { - "type": "event_t*", - "name": "e", - "desc": "event对象。" - } - ], - "annotation": {}, - "desc": "窗口on_event函数的缺省实现。", - "name": "window_base_on_event", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "native_window_t*", + "desc": "返回win对象。" } }, { "params": [ { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" + "type": "native_window_t*", + "name": "win", + "desc": "win对象。" }, { "type": "const rect_t*", - "name": "rect", - "desc": "rect对象。" + "name": "r", + "desc": "重绘区域。" } ], "annotation": {}, - "desc": "窗口on_invalidate函数的缺省实现。", - "name": "window_base_invalidate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - }, - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": {}, - "desc": "窗口on_paint_begin函数的缺省实现。", - "name": "window_base_on_paint_begin", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - }, - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": {}, - "desc": "窗口on_paint_end函数的缺省实现。", - "name": "window_base_on_paint_end", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。1" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - }, - { - "type": "canvas_t*", - "name": "c", - "desc": "canvas对象。" - } - ], - "annotation": {}, - "desc": "窗口on_paint_self函数的缺省实现。", - "name": "window_base_on_paint_self", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。g" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "value对象" - } - ], - "annotation": {}, - "desc": "窗口get_prop函数的缺省实现。", - "name": "window_base_get_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "const value_t*", - "name": "v", - "desc": "value对象" - } - ], - "annotation": {}, - "desc": "窗口set_prop函数的缺省实现。", - "name": "window_base_set_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "const widget_vtable_t*", - "name": "vt", - "desc": "vtable对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": {}, - "desc": "创建window base对象。", - "name": "window_base_create", - "return": { - "type": "widget_t*", - "desc": "窗口对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "window_base对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为window_base对象(供脚本语言使用)。", - "name": "window_base_cast", - "return": { - "type": "widget_t*", - "desc": "window_base对象。" - } - } - ], - "events": [ - { - "name": "EVT_WINDOW_WILL_OPEN", - "desc": "窗口即将打开事件。 如果有窗口动画,在窗口动画开始前触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。", - "type": "event_t" - }, - { - "name": "EVT_WINDOW_OPEN", - "desc": "窗口打开事件。 如果有窗口动画,在窗口动画完成时触发。如果没有窗口动画,在窗口被加载后的下一次循环中触发。", - "type": "event_t" - }, - { - "name": "EVT_WINDOW_TO_BACKGROUND", - "desc": "窗口被切换到后台事件。 打开新窗口时,当前窗口被切换到后台时,对当前窗口触发本事件。", - "type": "event_t" - }, - { - "name": "EVT_WINDOW_TO_FOREGROUND", - "desc": "窗口被切换到前台事件。 关闭当前窗口时,前一个窗口被切换到前台时,对前一个窗口触发本事件。", - "type": "event_t" - }, - { - "name": "EVT_WINDOW_CLOSE", - "desc": "窗口关闭事件。", - "type": "event_t" - } - ], - "properties": [ - { - "name": "theme", - "desc": "主题资源的名称。\n每个窗口都可以有独立的主题文件,如果没指定,则使用系统缺省的主题文件。\n主题是一个XML文件,放在assets/raw/styles目录下。\n请参考[主题](https://github.com/zlgopen/awtk/blob/master/docs/theme.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "disable_anim", - "desc": "禁用窗口动画。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "closable", - "desc": "收到EVT_REQUEST_CLOSE_WINDOW是否自动关闭窗口。\n\n如果关闭窗口时,需要用户确认:\n\n* 1.将closable设置为WINDOW\\_CLOSABLE\\_CONFIRM\n\n* 2.处理窗口的EVT\\_REQUEST\\_CLOSE\\_WINDOW事件\n\n> closable在XML中取值为:yes/no/confirm,缺省为yes。", - "type": "window_closable_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "open_anim_hint", - "desc": "打开窗口动画的名称。\n请参考[窗口动画](https://github.com/zlgopen/awtk/blob/master/docs/window_animator.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "close_anim_hint", - "desc": "关闭窗口动画的名称。\n请参考[窗口动画](https://github.com/zlgopen/awtk/blob/master/docs/window_animator.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "stage", - "desc": "窗口当前处于的状态。", - "type": "char*", - "annotation": { - "readable": true, - "get_prop": true - } - }, - { - "name": "theme_obj", - "desc": "窗口的常量主题数据。\n\n>\n把主题管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载主题资源的问题。", - "type": "theme_t*", - "annotation": { - "get_prop": true - } - }, - { - "name": "image_manager", - "desc": "获取图片管理器对象。\n\n>\n把图片管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载图片资源的问题。", - "type": "image_manager_t*", - "annotation": { - "get_prop": true - } - }, - { - "name": "font_manager", - "desc": "获取字体管理器对象。\n\n>\n把字体管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载字体资源的问题。", - "type": "font_manager_t*", - "annotation": { - "get_prop": true - } - }, - { - "name": "assets_manager", - "desc": "获取资源管理器对象。\n\n>\n把资源管理器对象与窗口关联起来,是为了解决UI设计器与被设计的窗口需要从不同的位置加载资源资源的问题。", - "type": "assets_manager_t*", - "annotation": { - "get_prop": true - } - }, - { - "name": "move_focus_prev_key", - "desc": "向前移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "move_focus_next_key", - "desc": "向后移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "move_focus_up_key", - "desc": "向上移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "move_focus_down_key", - "desc": "向下移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "move_focus_left_key", - "desc": "向左移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "move_focus_right_key", - "desc": "向右移动焦点的键值。\n\n请参考[控件焦点](https://github.com/zlgopen/awtk/blob/master/docs/widget_focus.md)", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "single_instance", - "desc": "单例。如果窗口存在,先关闭再打开。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - } - ], - "header": "base/window_base.h", - "desc": "窗口。\n\n本类把窗口相关的公共行为进行抽象,放到一起方便重用。目前已知的具体实现如下图:\n\n```graphviz\n[default_style]\n\nwindow_t -> window_base_t[arrowhead = \"empty\"]\npopup_t -> window_base_t[arrowhead = \"empty\"]\ndialog_t -> window_base_t[arrowhead = \"empty\"]\nsystem_bar_t -> window_base_t[arrowhead = \"empty\"]\ncalibration_win_t -> window_base_t[arrowhead = \"empty\"]\n```\n\n> 本类是一个抽象类,不能进行实例化。请在应用程序中使用具体的类,如window\\_t。", - "name": "window_base_t", - "parent": "widget_t", - "annotation": { - "scriptable": true, - "widget": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的控件工厂对象。", - "name": "widget_factory", - "alias": "widget_factory_instance", - "return": { - "type": "widget_factory_t*", - "desc": "返回控件工厂对象。" - } - }, - { - "params": [ - { - "type": "widget_factory_t*", - "name": "factory", - "desc": "控件工厂对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的控件工厂对象。", - "name": "widget_factory_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建控件工厂对象。", - "name": "widget_factory_create", - "return": { - "type": "widget_factory_t*", - "desc": "返回控件工厂对象。" - } - }, - { - "params": [ - { - "type": "widget_factory_t*", - "name": "factory", - "desc": "控件工厂对象。" - }, - { - "type": "const char*", - "name": "type", - "desc": "控件类型。" - }, - { - "type": "widget_create_t", - "name": "create", - "desc": "创建函数。" - } - ], - "annotation": {}, - "desc": "注册控件创建函数。", - "name": "widget_factory_register", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_factory_t*", - "name": "factory", - "desc": "控件工厂对象。" - }, - { - "type": "const char*", - "name": "type", - "desc": "控件类型。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "初始X坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "初始Y坐标。" - }, - { - "type": "xy_t", - "name": "w", - "desc": "初始宽度。" - }, - { - "type": "xy_t", - "name": "h", - "desc": "初始高度。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建指定类型的控件。", - "name": "widget_factory_create_widget", - "return": { - "type": "widget_t*", - "desc": "返回控件对象。" - } - }, - { - "params": [ - { - "type": "widget_factory_t*", - "name": "factory", - "desc": "控件工厂对象。" - } - ], - "annotation": {}, - "desc": "析构并释放控件工厂对象。", - "name": "widget_factory_destroy", + "desc": "请求重绘指定区域。", + "name": "native_window_invalidate", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -57290,1457 +58948,13 @@ ], "events": [], "properties": [], - "header": "base/widget_factory.h", - "desc": "控件工厂对象。\n\n提供通过类型创建控件的能力。\n用户注册自定义控件,可以获得内置控件同等待遇。", - "name": "widget_factory_t", - "parent": "emitter_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号8位整数类型属性描述。", - "name": "value_desc_int8_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "无符号8位整数类型属性描述。", - "name": "value_desc_uint8_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号16位整数类型属性描述。", - "name": "value_desc_int16_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "无符号16位整数类型属性描述。", - "name": "value_desc_uint16_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号32位整数类型属性描述。", - "name": "value_desc_int32_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "无符号32位整数类型属性描述。", - "name": "value_desc_uint32_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int64_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int64_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int64_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int64_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号64位整数类型属性描述。", - "name": "value_desc_int64_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "无符号64位整数类型属性描述。", - "name": "value_desc_uint64_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "float", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "float", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "float", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "float_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "单精度浮点数类型属性描述。", - "name": "value_desc_float_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "double", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "double", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "double", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "double", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "单精度浮点数类型属性描述。", - "name": "value_desc_double_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "bool_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "布尔类型属性描述。", - "name": "value_desc_bool_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "字符串类型属性描述。", - "name": "value_desc_string_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "min", - "desc": "最小长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "二进制类型属性描述。", - "name": "value_desc_binary_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "enums", - "desc": "枚举值(每一项用英文冒号分隔值和名称)。", - "type": "const char**", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "整数枚举类型属性描述。", - "name": "value_desc_int_enums_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建只读的style对象。", - "name": "style_const_create", - "return": { - "type": "style_t*", - "desc": "返回style对象。" - } - } - ], - "events": [], - "properties": [], - "header": "base/style_const.h", - "desc": "只读的style,从theme\\_t中获取数据。\n\ntools/theme_gen用于把XML的主题数据转换成常量数据。", - "name": "style_const_t", - "parent": "style_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置style的名称。", - "name": "style_mutable_set_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "state", - "desc": "控件状态。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "uint32_t", - "name": "val", - "desc": "值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定名称整数格式的值。", - "name": "style_mutable_set_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "state", - "desc": "控件状态。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "color_t", - "name": "val", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "设置指定名称的颜色值。", - "name": "style_mutable_set_color", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "state", - "desc": "控件状态。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "const char*", - "name": "val", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "设置指定名称字符串的值。", - "name": "style_mutable_set_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "tk_on_style_item_t", - "name": "on_style_item", - "desc": "回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "遍历。对每项调用回调函数on\\_style\\_item。", - "name": "style_mutable_foreach", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "state", - "desc": "控件状态。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "const value_t*", - "name": "v", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "获取指定名称的值。", - "name": "style_mutable_get_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "const char*", - "name": "state", - "desc": "控件状态。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "const value_t*", - "name": "v", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "设置指定名称的值。", - "name": "style_mutable_set_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - }, - { - "type": "style_t*", - "name": "other", - "desc": "style对象。" - } - ], - "annotation": {}, - "desc": "将other对象的数据拷贝到s对象。", - "name": "style_mutable_copy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - } - ], - "annotation": {}, - "desc": "清空s对象。", - "name": "style_mutable_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "style_t*", - "name": "s", - "desc": "style对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为style_mutable对象。", - "name": "style_mutable_cast", - "return": { - "type": "style_t*", - "desc": "style对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "控件" - }, - { - "type": "style_t*", - "name": "default_style", - "desc": "缺省的style。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建style\\_mutable对象。\n\n> 除了测试程序外不需要直接调用,widget会通过style\\_factory\\_create创建。", - "name": "style_mutable_create", - "return": { - "type": "style_t*", - "desc": "style对象。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "将自己注册到style\\_factory。", - "name": "style_mutable_register", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "name", - "desc": "名称。", - "type": "char*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "widget", - "desc": "与之关联的控件。", - "type": "widget_t*", - "annotation": { - "private": true - } - }, - { - "name": "default_style", - "desc": "缺省的style,在mutable中找不到时,再到default_style中找。", - "type": "style_t*", - "annotation": { - "private": true - } - }, - { - "name": "styles", - "desc": "控件在不同状态下的style。", - "type": "widget_state_style_t*", - "annotation": { - "private": true - } - } - ], - "header": "base/style_mutable.h", - "desc": "可变的style(可实时修改并生效,主要用于在designer中被编辑的控件,或者一些特殊控件)。\n\nstyle\\_mutable也对style\\_const进行了包装,当用户没修改某个值时,便从style\\_const中获取。", - "name": "style_mutable_t", - "parent": "style_t", + "header": "base/native_window.h", + "desc": "原生窗口。", + "name": "native_window_t", + "parent": "object_t", "annotation": { "scriptable": true }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建combo_box对象", - "name": "combo_box_create", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换combo_box对象(供脚本语言使用)。", - "name": "combo_box_cast", - "return": { - "type": "widget_t*", - "desc": "combo_box对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "const char*", - "name": "open_window", - "desc": "弹出窗口的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "点击按钮时可以打开popup窗口,本函数可设置窗口的名称。", - "name": "combo_box_set_open_window", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "重置所有选项。", - "name": "combo_box_reset_options", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取选项个数。", - "name": "combo_box_count_options", - "return": { - "type": "int32_t", - "desc": "返回选项个数。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "uint32_t", - "name": "index", - "desc": "选项的索引。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置第index个选项为当前选中的选项。", - "name": "combo_box_set_selected_index", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "bool_t", - "name": "localize_options", - "desc": "是否本地化(翻译)选项。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置是否本地化(翻译)选项。", - "name": "combo_box_set_localize_options", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置值。", - "name": "combo_box_set_value", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "uint32_t", - "name": "item_height", - "desc": "item的高度。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置item高度。", - "name": "combo_box_set_item_height", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "值。" - }, - { - "type": "const char*", - "name": "text", - "desc": "文本。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "追加一个选项。", - "name": "combo_box_append_option", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "const char*", - "name": "options", - "desc": "选项。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置选项。", - "name": "combo_box_set_options", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "combo_box_custom_open_popup_t", - "name": "open_popup", - "desc": "回调函数。" - } - ], - "annotation": {}, - "desc": "设置自定义的打开弹出窗口的函数。", - "name": "combo_box_set_custom_open_popup", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - }, - { - "type": "uint32_t", - "name": "index", - "desc": "选项的索引。" - } - ], - "annotation": {}, - "desc": "获取第index个选项。", - "name": "combo_box_get_option", - "return": { - "type": "combo_box_option_t*", - "desc": "返回index个选项。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取combo_box的值。", - "name": "combo_box_get_value", - "return": { - "type": "int32_t", - "desc": "返回值。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "combo_box对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取combo_box的文本。", - "name": "combo_box_get_text", - "alias": "combo_box_get_text_value", - "return": { - "type": "const char*", - "desc": "返回文本。" - } - } - ], - "events": [ - { - "name": "EVT_VALUE_WILL_CHANGE", - "desc": "值即将改变事件。", - "type": "event_t" - }, - { - "name": "EVT_VALUE_CHANGED", - "desc": "值改变事件。", - "type": "event_t" - } - ], - "properties": [ - { - "name": "open_window", - "desc": "为点击按钮时,要打开窗口的名称。", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "selected_index", - "desc": "当前选中的选项。", - "type": "int32_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "value", - "desc": "值。", - "type": "int32_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "localize_options", - "desc": "是否本地化(翻译)选项(缺省为TRUE)。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "options", - "desc": "设置可选项(冒号分隔值和文本,分号分隔选项,如:1:red;2:green;3:blue)。", - "type": "char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - }, - { - "name": "item_height", - "desc": "下拉选项的高度。如果open_window为空,则使用缺省高度。", - "type": "int32_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - } - ], - "header": "widgets/combo_box.h", - "desc": "下拉列表控件。\n\n点击右边的按钮,可弹出一个下拉列表,从中选择一项作为当前的值。\n\ncombo\\_box\\_t是[edit\\_t](edit_t.md)的子类控件,edit\\_t的函数均适用于combo\\_box\\_t控件。\n\n在xml中使用\"combo_box\"标签创建下拉列表控件。\n\n列表选项可以直接写在\"options\"属性中。如:\n\n```xml\n\n```\n\n列表选项也可以放在独立的窗口中,用属性\"open_window\"指定窗口的名称。如:\n\n```xml\n\n```\n\nlanguage.xml:\n\n```xml\n\n\n\n\n\n\n\n\n\n```\n\n> 更多用法请参考:[combo_box.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/combo_box.xml)\n\n\n\n如果在文本比较长时,希望在获得焦点时文本自动滚动,可以放入一个hscroll_label为子控件,并命名为\"value\"。如:\n\n```xml\n\n\n\n```\n\n* 2.combobox的弹出popup窗口的style名称为combobox_popup,可以在主题文件中设置。\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L422)", - "name": "combo_box_t", - "parent": "edit_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true - }, "level": 3 }, { @@ -59775,488 +59989,6 @@ }, "level": 3 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "timer_info_t*", - "name": "timer", - "desc": "timer_info对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为timer_info对象(供脚本语言使用)。", - "name": "timer_info_cast", - "return": { - "type": "timer_info_t*", - "desc": "timer_info对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "on_timer", - "desc": "定时器回调函数。", - "type": "timer_func_t", - "annotation": { - "readable": true - } - }, - { - "name": "ctx", - "desc": "定时器回调函数的上下文", - "type": "void*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "id", - "desc": "定时器的ID\n\n> 为TK\\_INVALID\\_ID时表示无效定时器。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "now", - "desc": "当前时间(相对时间,单位为毫秒)。", - "type": "uint64_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "start", - "desc": "起始时间(相对时间,单位为毫秒)。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "duration", - "desc": "时间间隔(单位为毫秒)。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "on_destroy", - "desc": "定时器销毁时的回调函数。", - "type": "tk_destroy_t", - "annotation": { - "readable": true - } - }, - { - "name": "on_destroy_ctx", - "desc": "定时器销毁时的回调函数上下文。", - "type": "void*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/timer_info.h", - "desc": "单个定时器的信息。", - "name": "timer_info_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建dialog对象。", - "name": "dialog_create", - "return": { - "type": "widget_t*", - "desc": "dialog对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "parent", - "desc": "父控件" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽度" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高度" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "创建dialog对象,同时创建title/client。", - "name": "dialog_create_simple", - "return": { - "type": "widget_t*", - "desc": "dialog对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换dialog对象(供脚本语言使用)。", - "name": "dialog_cast", - "return": { - "type": "widget_t*", - "desc": "dialog对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取title控件。", - "name": "dialog_get_title", - "return": { - "type": "widget_t*", - "desc": "title对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取client控件。", - "name": "dialog_get_client", - "return": { - "type": "widget_t*", - "desc": "client对象。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "dialog的名称。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true - }, - "desc": "从资源文件中加载并创建Dialog对象。\n\n本函数在ui\\_loader/ui\\_builder_default里实现。", - "name": "dialog_open", - "return": { - "type": "widget_t*", - "desc": "对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - }, - { - "type": "char*", - "name": "title", - "desc": "标题。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置对话框的标题文本。", - "name": "dialog_set_title", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "模态显示对话框。\ndialog_modal返回后,dialog对象将在下一个idle函数中回收。\n也就是在dialog_modal调用完成后仍然可以访问dialog中控件,直到本次事件结束。", - "name": "dialog_modal", - "return": { - "type": "dialog_quit_code_t", - "desc": "返回退出码。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - }, - { - "type": "uint32_t", - "name": "code", - "desc": "退出码,作为dialog_modal的返回值(参考:[dialog_quit_code_t](dialog_quit_code_t.md))。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "退出模态显示,关闭对话框。\n\n> 比如,在对话框中关闭按钮的事件处理函数中,调用本函数关闭对话框。", - "name": "dialog_quit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查对话框是否已经退出模态。", - "name": "dialog_is_quited", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示已经退出,否则表示没有。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "dialog对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查对话框是否为模态对话框。", - "name": "dialog_is_modal", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是模态对话框,否则表示不是。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "text", - "desc": "文本内容。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "显示时间(单位为毫秒)。" - } - ], - "annotation": { - "static": true, - "scriptable": true - }, - "desc": "显示『短暂提示信息』对话框。\n\n主题由dialog_toast.xml文件决定。", - "name": "dialog_toast", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "title", - "desc": "标题。" - }, - { - "type": "const char*", - "name": "text", - "desc": "文本内容。" - } - ], - "annotation": { - "static": true, - "scriptable": true - }, - "desc": "显示『提示信息』对话框。\n\n主题由dialog_info.xml文件决定。", - "name": "dialog_info", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "title", - "desc": "标题。" - }, - { - "type": "const char*", - "name": "text", - "desc": "文本内容。" - } - ], - "annotation": { - "static": true, - "scriptable": true - }, - "desc": "显示『警告』对话框。\n\n主题由dialog_warn.xml文件决定。", - "name": "dialog_warn", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "title", - "desc": "标题。" - }, - { - "type": "const char*", - "name": "text", - "desc": "文本内容。" - } - ], - "annotation": { - "static": true, - "scriptable": true - }, - "desc": "显示『确认』对话框。\n\n主题由dialog_confirm.xml文件决定。", - "name": "dialog_confirm", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示确认,否则表示取消。" - } - } - ], - "events": [], - "properties": [ - { - "name": "highlight", - "desc": "对话框高亮策略。\n\n> 请参考 [对话框高亮策略](https://github.com/zlgopen/awtk/blob/master/docs/dialog_highlight.md)", - "type": "const char*", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - } - ], - "header": "base/dialog.h", - "desc": "对话框。 对话框是一种特殊的窗口,大小和位置可以自由设置。\n\nAWTK中的对话框可以是模态的,也可以是非模态的。\n\n如果dialog有透明或半透效果则不支持窗口动画。\n\n> 由于浏览器中无法实现主循环嵌套,因此无法实现模态对话框。\n如果希望自己写的AWTK应用程序可以在浏览器(包括各种小程序)中运行或演示,\n请避免使用模态对话框。\n\n对话框通常由对话框标题和对话框客户区两部分组成:\n\n```graphviz\n[default_style]\n\ndialog_title_t -> dialog_t[arrowhead = \"ediamond\"]\ndialog_client_t -> dialog_t[arrowhead = \"ediamond\"]\n```\n\ndialog\\_t是[window\\_base\\_t](window_base_t.md)的子类控件,window\\_base\\_t的函数均适用于dialog\\_t控件。\n\n在xml中使用\"dialog\"标签创建对话框。如:\n\n```xml\n\n\n\n\n```\n\n如果你不需要对话框的标题,可以这样写:\n\n```xml\n\n\n```\n\n打开非模态对话框时,其用法与普通窗口一样。打开非模态对话框时,还需要调用dialog\\_modal。\n\n```c\nwidget_t* dlg = dialog_open(name);\n\nret = dialog_modal(dlg);\n```\n\n关闭模态对话框用dialog\\_quit\n\n```c\nstatic ret_t on_dialog_btn_click(void* ctx, event_t* evt) {\nwidget_t* win = widget_get_window(WIDGET(evt->target));\nint code = (char*)ctx - (char*)NULL;\n\ndialog_quit(win, code);\n\nreturn RET_OK;\n}\n```\n\n关闭非模态对话框用window\\_close。\n\n```c\nstatic ret_t on_dialog_btn_click(void* ctx, event_t* evt) {\nwidget_t* win = widget_get_window(WIDGET(evt->target));\nint code = (char*)ctx - (char*)NULL;\n\nwindow_close(win);\n\nreturn RET_OK;\n}\n```\n\n> 更多用法请参考:\n[dialog.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/)\n\n> 完整C代码示例请参考:\n\n* [非模态对话框](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog.c)\n\n* [模态对话框](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/dialog_modal.c)\n\n可用通过style来设置控件的显示风格,如字体的大小和颜色等等。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[theme default]\n(https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L324)", - "name": "dialog_t", - "parent": "window_base_t", - "annotation": { - "scriptable": true, - "design": true, - "widget": true, - "window": true - }, - "level": 3 - }, { "type": "class", "methods": [ @@ -60332,31 +60064,6 @@ }, "level": 3 }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建窗口管理器。", - "name": "window_manager_create", - "export": "none", - "return": { - "type": "window_manager_t*", - "desc": "返回窗口管理器对象。" - } - } - ], - "events": [], - "properties": [], - "header": "window_manager/window_manager_simple.h", - "desc": "简单窗口管理器(不支持窗口动画和对话框高亮策略)。", - "name": "window_manager_simple_t", - "parent": "window_manager_t", - "level": 3 - }, { "type": "class", "methods": [ @@ -60671,446 +60378,6 @@ }, "level": 3 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" - } - ], - "annotation": {}, - "desc": "写入数据。", - "name": "tk_ostream_write", - "return": { - "type": "int32_t", - "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" - } - }, - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - } - ], - "annotation": {}, - "desc": "设置偏移量。", - "name": "tk_ostream_seek", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "timeout." - } - ], - "annotation": {}, - "desc": "写入指定长度的数据。", - "name": "tk_ostream_write_len", - "return": { - "type": "int32_t", - "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" - } - }, - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" - }, - { - "type": "uint8_t", - "name": "byte", - "desc": "数据。" - } - ], - "annotation": {}, - "desc": "写入一个字节的数据。", - "name": "tk_ostream_write_byte", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" - } - ], - "annotation": {}, - "desc": "刷新数据。", - "name": "tk_ostream_flush", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/ostream.h", - "desc": "输出流的接口。", - "name": "tk_ostream_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "待装饰的对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建对象。", - "name": "object_locker_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/object_locker.h", - "desc": "对现有的object对象进行装饰,添加访问互斥功能。", - "name": "object_locker_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建对象。", - "name": "object_default_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_default_t*", - "name": "o", - "desc": "被克隆的对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "克隆对象。", - "name": "object_default_clone", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "for script gc", - "name": "object_default_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "清除全部属性。", - "name": "object_default_clear_props", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数。" - }, - { - "type": "const void*", - "name": "data", - "desc": "要比较的数据。" - } - ], - "annotation": {}, - "desc": "查找满足条件的属性,并返回它的值。", - "name": "object_default_find_prop", - "return": { - "type": "value_t*", - "desc": "返回属性的值。" - } - } - ], - "events": [], - "properties": [ - { - "name": "props_size", - "desc": "属性个数。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "props_capacity", - "desc": "属性数组的容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "props", - "desc": "属性数组。", - "type": "named_value_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/object_default.h", - "desc": "对象接口的缺省实现。\n\n内部使用有序数组保存所有属性,可以快速查找指定名称的属性。", - "name": "object_default_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "object_t*", - "name": "obj1", - "desc": "对象1。" - }, - { - "type": "object_t*", - "name": "obj2", - "desc": "对象2。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建对象。", - "name": "object_compositor_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/object_compositor.h", - "desc": "将两个对象包装为一个对象,优先访问第一个对象,如果访问失败则访问第二个对象。", - "name": "object_compositor_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建对象。", - "name": "object_array_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_array_t*", - "name": "o", - "desc": "被克隆的对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "克隆对象。", - "name": "object_array_clone", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "for script gc", - "name": "object_array_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "清除全部属性。", - "name": "object_array_clear_props", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [ - { - "name": "props_size", - "desc": "属性个数。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "props_capacity", - "desc": "属性数组的容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "props", - "desc": "属性数组。", - "type": "value_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/object_array.h", - "desc": "简单的动态数组,内部存放value对象。\n\n访问时属性名称为:\n\n* \"size\"/\"length\" 用于获取数组的长度。\n* index 用于访问属性,-1可以用来追加新元素。", - "name": "object_array_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, { "type": "class", "methods": [ @@ -61209,6 +60476,432 @@ }, "level": 3 }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "fd", + "desc": "可以用select等待的文件描述符。" + }, + { + "type": "event_source_on_event_t", + "name": "on_event", + "desc": "用户的事件处理函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "on_event函数的上下文。" + } + ], + "annotation": {}, + "desc": "创建fd事件源。", + "name": "event_source_fd_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_fd.h", + "desc": "fd事件源。用于文件、管道和套接字。", + "name": "event_source_fd_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "创建idle事件源。", + "name": "event_source_idle_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_idle.h", + "desc": "idle事件源。", + "name": "event_source_idle_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "创建timer事件源。", + "name": "event_source_timer_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_timer.h", + "desc": "timer事件源。", + "name": "event_source_timer_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "获取文件描述符。", + "name": "event_source_get_fd", + "return": { + "type": "int32_t", + "desc": "返回文件描述符。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "分发事件。", + "name": "event_source_dispatch", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + }, + { + "type": "void*", + "name": "tag", + "desc": "tag。" + } + ], + "annotation": {}, + "desc": "设置tag,方便通过tag一次移除多个事件源。", + "name": "event_source_set_tag", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "对于没有文件描述符的事件源,需要自己检查是否准备就绪。", + "name": "event_source_check", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "获取唤醒时间(ms)。", + "name": "event_source_get_wakeup_time", + "return": { + "type": "uint32_t", + "desc": "返回唤醒时间(ms)。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source.h", + "desc": "表示一个事件源。\n\n事件源有下列两种方式:\n\n* 对于有文件描述符的事件源(如socket),get_fd返回一个有效的文件描述符。\n* 对于定时器,则get_wakeup_time返回下次唤醒的时间。", + "name": "event_source_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "idle_info_t*", + "name": "idle", + "desc": "idle_info对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为idle_info对象(供脚本语言使用)。", + "name": "idle_info_cast", + "return": { + "type": "idle_info_t*", + "desc": "idle_info对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "on_idle", + "desc": "idle回调函数。", + "type": "idle_func_t", + "annotation": { + "readable": true + } + }, + { + "name": "ctx", + "desc": "idle回调函数上下文。", + "type": "void*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "id", + "desc": "idle的ID\n\n> 为TK\\_INVALID\\_ID时表示无效idle。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "on_destroy_ctx", + "desc": "idle销毁时的回调函数的上下文。", + "type": "tk_destroy_t", + "annotation": { + "readable": true + } + }, + { + "name": "on_destroy", + "desc": "idle销毁时的回调函数。", + "type": "tk_destroy_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/idle_info.h", + "desc": "单个idle的信息。", + "name": "idle_info_t", + "parent": "object_t", + "annotation": { + "scriptable": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + } + ], + "annotation": {}, + "desc": "获取输入流对象。", + "name": "tk_iostream_get_istream", + "return": { + "type": "tk_istream_t*", + "desc": "返回输入流对象。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + } + ], + "annotation": {}, + "desc": "获取输出流对象。", + "name": "tk_iostream_get_ostream", + "return": { + "type": "tk_ostream_t*", + "desc": "返回输出流对象。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + } + ], + "annotation": {}, + "desc": "读取数据。", + "name": "tk_iostream_read", + "return": { + "type": "int32_t", + "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "timeout." + } + ], + "annotation": {}, + "desc": "读取指定长度的数据。", + "name": "tk_iostream_read_len", + "return": { + "type": "int32_t", + "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + } + ], + "annotation": {}, + "desc": "写入数据。", + "name": "tk_iostream_write", + "return": { + "type": "int32_t", + "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "timeout." + } + ], + "annotation": {}, + "desc": "写入指定长度的数据。", + "name": "tk_iostream_write_len", + "return": { + "type": "int32_t", + "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/iostream.h", + "desc": "输入输出流的接口。", + "name": "tk_iostream_t", + "parent": "object_t", + "level": 3 + }, { "type": "class", "methods": [ @@ -61424,100 +61117,324 @@ "type": "class", "methods": [ { - "params": [ - { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - } - ], - "annotation": {}, - "desc": "获取输入流对象。", - "name": "tk_iostream_get_istream", + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建对象。", + "name": "object_array_create", "return": { - "type": "tk_istream_t*", - "desc": "返回输入流对象。" + "type": "object_t*", + "desc": "返回object对象。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" + "type": "object_array_t*", + "name": "o", + "desc": "被克隆的对象。" } ], - "annotation": {}, - "desc": "获取输出流对象。", - "name": "tk_iostream_get_ostream", + "annotation": { + "constructor": true + }, + "desc": "克隆对象。", + "name": "object_array_clone", "return": { - "type": "tk_ostream_t*", - "desc": "返回输出流对象。" + "type": "object_t*", + "desc": "返回object对象。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" + "type": "object_t*", + "name": "obj", + "desc": "对象。" } ], - "annotation": {}, - "desc": "读取数据。", - "name": "tk_iostream_read", + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "for script gc", + "name": "object_array_unref", "return": { - "type": "int32_t", - "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "timeout." + "type": "object_t*", + "name": "obj", + "desc": "对象。" } ], - "annotation": {}, - "desc": "读取指定长度的数据。", - "name": "tk_iostream_read_len", + "annotation": { + "scriptable": true + }, + "desc": "清除全部属性。", + "name": "object_array_clear_props", "return": { - "type": "int32_t", - "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "props_size", + "desc": "属性个数。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "props_capacity", + "desc": "属性数组的容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "props", + "desc": "属性数组。", + "type": "value_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/object_array.h", + "desc": "简单的动态数组,内部存放value对象。\n\n访问时属性名称为:\n\n* \"size\"/\"length\" 用于获取数组的长度。\n* index 用于访问属性,-1可以用来追加新元素。", + "name": "object_array_t", + "parent": "object_t", + "annotation": { + "scriptable": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "object_t*", + "name": "obj1", + "desc": "对象1。" + }, + { + "type": "object_t*", + "name": "obj2", + "desc": "对象2。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建对象。", + "name": "object_compositor_create", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/object_compositor.h", + "desc": "将两个对象包装为一个对象,优先访问第一个对象,如果访问失败则访问第二个对象。", + "name": "object_compositor_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建对象。", + "name": "object_default_create", + "return": { + "type": "object_t*", + "desc": "返回object对象。" } }, { "params": [ { - "type": "tk_iostream_t*", + "type": "object_default_t*", + "name": "o", + "desc": "被克隆的对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "克隆对象。", + "name": "object_default_clone", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "for script gc", + "name": "object_default_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "清除全部属性。", + "name": "object_default_clear_props", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数。" + }, + { + "type": "const void*", + "name": "data", + "desc": "要比较的数据。" + } + ], + "annotation": {}, + "desc": "查找满足条件的属性,并返回它的值。", + "name": "object_default_find_prop", + "return": { + "type": "value_t*", + "desc": "返回属性的值。" + } + } + ], + "events": [], + "properties": [ + { + "name": "props_size", + "desc": "属性个数。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "props_capacity", + "desc": "属性数组的容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "props", + "desc": "属性数组。", + "type": "named_value_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/object_default.h", + "desc": "对象接口的缺省实现。\n\n内部使用有序数组保存所有属性,可以快速查找指定名称的属性。", + "name": "object_default_t", + "parent": "object_t", + "annotation": { + "scriptable": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "待装饰的对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建对象。", + "name": "object_locker_create", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/object_locker.h", + "desc": "对现有的object对象进行装饰,添加访问互斥功能。", + "name": "object_locker_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_ostream_t*", "name": "stream", - "desc": "iostream对象。" + "desc": "ostream对象。" }, { "type": "const void*", @@ -61532,7 +61449,7 @@ ], "annotation": {}, "desc": "写入数据。", - "name": "tk_iostream_write", + "name": "tk_ostream_write", "return": { "type": "int32_t", "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" @@ -61541,9 +61458,30 @@ { "params": [ { - "type": "tk_iostream_t*", + "type": "tk_ostream_t*", "name": "stream", - "desc": "iostream对象。" + "desc": "ostream对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + } + ], + "annotation": {}, + "desc": "设置偏移量。", + "name": "tk_ostream_seek", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" }, { "type": "const void*", @@ -61563,18 +61501,55 @@ ], "annotation": {}, "desc": "写入指定长度的数据。", - "name": "tk_iostream_write_len", + "name": "tk_ostream_write_len", "return": { "type": "int32_t", "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + }, + { + "type": "uint8_t", + "name": "byte", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "写入一个字节的数据。", + "name": "tk_ostream_write_byte", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + } + ], + "annotation": {}, + "desc": "刷新数据。", + "name": "tk_ostream_flush", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } } ], "events": [], "properties": [], - "header": "tkc/iostream.h", - "desc": "输入输出流的接口。", - "name": "tk_iostream_t", + "header": "tkc/ostream.h", + "desc": "输出流的接口。", + "name": "tk_ostream_t", "parent": "object_t", "level": 3 }, @@ -61584,36 +61559,36 @@ { "params": [ { - "type": "idle_info_t*", - "name": "idle", - "desc": "idle_info对象。" + "type": "timer_info_t*", + "name": "timer", + "desc": "timer_info对象。" } ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为idle_info对象(供脚本语言使用)。", - "name": "idle_info_cast", + "desc": "转换为timer_info对象(供脚本语言使用)。", + "name": "timer_info_cast", "return": { - "type": "idle_info_t*", - "desc": "idle_info对象。" + "type": "timer_info_t*", + "desc": "timer_info对象。" } } ], "events": [], "properties": [ { - "name": "on_idle", - "desc": "idle回调函数。", - "type": "idle_func_t", + "name": "on_timer", + "desc": "定时器回调函数。", + "type": "timer_func_t", "annotation": { "readable": true } }, { "name": "ctx", - "desc": "idle回调函数上下文。", + "desc": "定时器回调函数的上下文", "type": "void*", "annotation": { "readable": true, @@ -61622,7 +61597,7 @@ }, { "name": "id", - "desc": "idle的ID\n\n> 为TK\\_INVALID\\_ID时表示无效idle。", + "desc": "定时器的ID\n\n> 为TK\\_INVALID\\_ID时表示无效定时器。", "type": "uint32_t", "annotation": { "readable": true, @@ -61630,25 +61605,50 @@ } }, { - "name": "on_destroy_ctx", - "desc": "idle销毁时的回调函数的上下文。", - "type": "tk_destroy_t", + "name": "now", + "desc": "当前时间(相对时间,单位为毫秒)。", + "type": "uint64_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "start", + "desc": "起始时间(相对时间,单位为毫秒)。", + "type": "uint64_t", + "annotation": { + "readable": true + } + }, + { + "name": "duration", + "desc": "时间间隔(单位为毫秒)。", + "type": "uint32_t", "annotation": { "readable": true } }, { "name": "on_destroy", - "desc": "idle销毁时的回调函数。", + "desc": "定时器销毁时的回调函数。", "type": "tk_destroy_t", "annotation": { "readable": true } + }, + { + "name": "on_destroy_ctx", + "desc": "定时器销毁时的回调函数上下文。", + "type": "void*", + "annotation": { + "readable": true + } } ], - "header": "tkc/idle_info.h", - "desc": "单个idle的信息。", - "name": "idle_info_t", + "header": "tkc/timer_info.h", + "desc": "单个定时器的信息。", + "name": "timer_info_t", "parent": "object_t", "annotation": { "scriptable": true @@ -61782,502 +61782,6 @@ }, "level": 3 }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "获取文件描述符。", - "name": "event_source_get_fd", - "return": { - "type": "int32_t", - "desc": "返回文件描述符。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "分发事件。", - "name": "event_source_dispatch", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - }, - { - "type": "void*", - "name": "tag", - "desc": "tag。" - } - ], - "annotation": {}, - "desc": "设置tag,方便通过tag一次移除多个事件源。", - "name": "event_source_set_tag", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "对于没有文件描述符的事件源,需要自己检查是否准备就绪。", - "name": "event_source_check", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "获取唤醒时间(ms)。", - "name": "event_source_get_wakeup_time", - "return": { - "type": "uint32_t", - "desc": "返回唤醒时间(ms)。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source.h", - "desc": "表示一个事件源。\n\n事件源有下列两种方式:\n\n* 对于有文件描述符的事件源(如socket),get_fd返回一个有效的文件描述符。\n* 对于定时器,则get_wakeup_time返回下次唤醒的时间。", - "name": "event_source_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "创建timer事件源。", - "name": "event_source_timer_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_timer.h", - "desc": "timer事件源。", - "name": "event_source_timer_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "创建idle事件源。", - "name": "event_source_idle_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_idle.h", - "desc": "idle事件源。", - "name": "event_source_idle_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int", - "name": "fd", - "desc": "可以用select等待的文件描述符。" - }, - { - "type": "event_source_on_event_t", - "name": "on_event", - "desc": "用户的事件处理函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "on_event函数的上下文。" - } - ], - "annotation": {}, - "desc": "创建fd事件源。", - "name": "event_source_fd_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_fd.h", - "desc": "fd事件源。用于文件、管道和套接字。", - "name": "event_source_fd_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建窗口管理器。", - "name": "window_manager_create", - "export": "none", - "return": { - "type": "window_manager_t*", - "desc": "返回窗口管理器对象。" - } - } - ], - "events": [], - "properties": [], - "header": "window_manager/window_manager_default.h", - "desc": "缺省窗口管理器。", - "name": "window_manager_default_t", - "parent": "window_manager_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "xy_t", - "name": "x", - "desc": "x坐标。" - }, - { - "type": "xy_t", - "name": "y", - "desc": "y坐标。" - }, - { - "type": "bool_t", - "name": "force", - "desc": "无论是否shared都move。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "移动窗口。", - "name": "native_window_move", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "wh_t", - "name": "w", - "desc": "宽。" - }, - { - "type": "wh_t", - "name": "h", - "desc": "高。" - }, - { - "type": "bool_t", - "name": "force", - "desc": "无论是否shared都resize。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "调整窗口大小。", - "name": "native_window_resize", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "最小化窗口。", - "name": "native_window_minimize", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "最大化窗口。", - "name": "native_window_maximize", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "恢复窗口大小。", - "name": "native_window_restore", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "窗口居中。", - "name": "native_window_center", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "bool_t", - "name": "show", - "desc": "是否显示。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "是否显示边框。", - "name": "native_window_show_border", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "bool_t", - "name": "fullscreen", - "desc": "是否全屏。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "是否全屏。", - "name": "native_window_set_fullscreen", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "鼠标光标的名称。" - }, - { - "type": "bitmap_t*", - "name": "img", - "desc": "鼠标光标的图片。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置鼠标光标。", - "name": "native_window_set_cursor", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - } - ], - "annotation": {}, - "desc": "获取canvas。", - "name": "native_window_get_canvas", - "return": { - "type": "canvas_t", - "desc": "返回canvas对象。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "params", - "desc": "参数。" - } - ], - "annotation": {}, - "desc": "创建win对象。", - "name": "native_window_create", - "return": { - "type": "native_window_t*", - "desc": "返回win对象。" - } - }, - { - "params": [ - { - "type": "native_window_t*", - "name": "win", - "desc": "win对象。" - }, - { - "type": "const rect_t*", - "name": "r", - "desc": "重绘区域。" - } - ], - "annotation": {}, - "desc": "请求重绘指定区域。", - "name": "native_window_invalidate", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "base/native_window.h", - "desc": "原生窗口。", - "name": "native_window_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, { "type": "class", "methods": [ @@ -62313,84 +61817,8 @@ "constructor": true, "scriptable": true }, - "desc": "创建system_bar对象。", - "name": "system_bar_create", - "return": { - "type": "widget_t*", - "desc": "system_bar对象。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "system_bar对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为system_bar对象(供脚本语言使用)。", - "name": "system_bar_cast", - "return": { - "type": "widget_t*", - "desc": "system_bar对象。" - } - } - ], - "events": [], - "properties": [], - "header": "widgets/system_bar.h", - "desc": "system\\_bar窗口。\n\nsystem\\_bar窗口是一种特殊的窗口,独占LCD顶部区域,用来显示当前窗口的标题和关闭按钮等内容。\n\n> system\\_bar窗口需要在打开第一个应用程序窗口之前打开。\n\nsystem_bar对两个子控件会做特殊处理:\n\n* 1.名为\"title\"的label控件,自动显示当前主窗口的name或text。\n* 2.名为\"close\"的button控件,点击之后向当前主窗口发送EVT\\_REQUEST\\_CLOSE\\_WINDOW消息。\n\nsystem\\_bar\\_t是[window\\_base\\_t](window_base_t.md)的子类控件,\nwindow\\_base\\_t的函数均适用于system\\_bar\\_t控件。\n\n在xml中使用\"system\\_bar\"标签创建system\\_bar窗口。如:\n\n```xml\n\n\n\n\n```\n\n* 2.combobox的弹出popup窗口的style名称为combobox_popup,可以在主题文件中设置。\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L422)", + "name": "combo_box_t", "parent": "edit_t", "annotation": { "scriptable": true, @@ -62429,6 +62228,231 @@ }, "level": 3 }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建image对象", + "name": "image_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image对象。" + }, + { + "type": "image_draw_type_t", + "name": "draw_type", + "desc": "绘制方式(仅在没有旋转和缩放时生效)。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置图片的绘制方式。", + "name": "image_set_draw_type", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "image对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为image对象(供脚本语言使用)。", + "name": "image_cast", + "return": { + "type": "widget_t*", + "desc": "image对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "draw_type", + "desc": "图片的绘制方式(仅在没有旋转和缩放时生效)。", + "type": "image_draw_type_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "widgets/image.h", + "desc": "图片控件。\n\n用来显示一张静态图片,目前支持bmp/png/jpg等格式。\n\n如果要显示gif文件,请用[gif\\_image](gif_image_t.md)。\n\n如果要显示svg文件,请用[svg\\_image](svg_image_t.md)。\n\n如果需要支持勾选效果,请设置**selectable**属性。\n\n如果需要支持点击效果,请设置**clickable**属性。\n\nimage\\_t是[image\\_base\\_t](image_base_t.md)的子类控件,image\\_base\\_t的函数均适用于image\\_t控件。\n\n在xml中使用\"image\"标签创建图片控件。如:\n\n```xml\n\n```\n\n> 更多用法请参考:\n[image.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/images.xml)\n\n在c代码中使用函数image\\_create创建图片控件。如:\n\n```c\nwidget_t* image = image_create(win, 10, 10, 128, 30);\nimage_set_image(image, \"earth\");\n```\n\n> 创建之后:\n>\n> 需要用widget\\_set\\_image设置图片名称。\n>\n> 可以用image\\_set\\_draw\\_type设置图片的绘制方式。\n\n> 绘制方式请参考[image\\_draw\\_type\\_t](image_draw_type_t.md)\n\n> 绘制方式的属性值和枚举值:\n[image\\_draw\\_type\\_name\\_value](https://github.com/zlgopen/awtk/blob/master/src/base/enums.c#L98)\n\n> 完整示例请参考:\n[image demo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/image.c)\n\n可用通过style来设置控件的显示风格,如背景和边框等。如:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:\n[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L313)", + "name": "image_t", + "parent": "image_base_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "widget_t*", + "name": "parent", + "desc": "父控件" + }, + { + "type": "xy_t", + "name": "x", + "desc": "x坐标" + }, + { + "type": "xy_t", + "name": "y", + "desc": "y坐标" + }, + { + "type": "wh_t", + "name": "w", + "desc": "宽度" + }, + { + "type": "wh_t", + "name": "h", + "desc": "高度" + } + ], + "annotation": { + "constructor": true, + "scriptable": true + }, + "desc": "创建overlay对象", + "name": "overlay_create", + "return": { + "type": "widget_t*", + "desc": "对象。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "控件对象。" + }, + { + "type": "bool_t", + "name": "click_through", + "desc": "是否启用点击穿透。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置是否启用点击穿透。", + "name": "overlay_set_click_through", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "widget_t*", + "name": "widget", + "desc": "overlay对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为overlay对象(供脚本语言使用)。", + "name": "overlay_cast", + "return": { + "type": "widget_t*", + "desc": "overlay对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "click_through", + "desc": "点击穿透。点击没有子控件的位置,是否穿透到底层窗口。\n\n缺省不启用。", + "type": "bool_t", + "annotation": { + "set_prop": true, + "get_prop": true, + "readable": true, + "persitent": true, + "design": true, + "scriptable": true + } + } + ], + "header": "widgets/overlay.h", + "desc": "overlay窗口。\n\noverlay窗口有点类似于非模态的dialog,但是它位置和大小是完全自由的,窗口管理器不会对它做任何限制。\n\n如果overlay窗口有透明或半透效果,则不支持窗口动画,但可以通过移动窗口位置来实现类似动画的效果。\n\noverlay\\_t是[window\\_base\\_t](window_base_t.md)的子类控件,window\\_base\\_t的函数均适用于overlay\\_t控件。\n\n在xml中使用\"overlay\"标签创建窗口。需要指定坐标和大小,可以指定主题和动画名称。如:\n\n```xml\n\n...\n\n```\n\n>\n更多用法请参考:[overlay.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/)\n\n在c代码中使用函数overlay\\_create创建窗口。如:\n\n```c\nwidget_t* overlay = overlay_create(NULL, 100, 100, 200, 300);\n```\n\n> 完整示例请参考:[overlay\ndemo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/)\n\n可用通过style来设置窗口的风格,如背景颜色或图片等。如:\n\n```xml\n\n```\n\n> 更多用法请参考:[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L0)", + "name": "overlay_t", + "parent": "window_base_t", + "annotation": { + "scriptable": true, + "design": true, + "widget": true, + "window": true + }, + "level": 3 + }, { "type": "class", "methods": [ @@ -62613,8 +62637,8 @@ "constructor": true, "scriptable": true }, - "desc": "创建overlay对象", - "name": "overlay_create", + "desc": "创建spin_box对象", + "name": "spin_box_create", "return": { "type": "widget_t*", "desc": "对象。" @@ -62625,69 +62649,31 @@ { "type": "widget_t*", "name": "widget", - "desc": "控件对象。" - }, - { - "type": "bool_t", - "name": "click_through", - "desc": "是否启用点击穿透。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置是否启用点击穿透。", - "name": "overlay_set_click_through", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "overlay对象。" + "desc": "spin_box对象。" } ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为overlay对象(供脚本语言使用)。", - "name": "overlay_cast", + "desc": "转换为spin_box对象(供脚本语言使用)。", + "name": "spin_box_cast", "return": { "type": "widget_t*", - "desc": "overlay对象。" + "desc": "spin_box对象。" } } ], "events": [], - "properties": [ - { - "name": "click_through", - "desc": "点击穿透。点击没有子控件的位置,是否穿透到底层窗口。\n\n缺省不启用。", - "type": "bool_t", - "annotation": { - "set_prop": true, - "get_prop": true, - "readable": true, - "persitent": true, - "design": true, - "scriptable": true - } - } - ], - "header": "widgets/overlay.h", - "desc": "overlay窗口。\n\noverlay窗口有点类似于非模态的dialog,但是它位置和大小是完全自由的,窗口管理器不会对它做任何限制。\n\n如果overlay窗口有透明或半透效果,则不支持窗口动画,但可以通过移动窗口位置来实现类似动画的效果。\n\noverlay\\_t是[window\\_base\\_t](window_base_t.md)的子类控件,window\\_base\\_t的函数均适用于overlay\\_t控件。\n\n在xml中使用\"overlay\"标签创建窗口。需要指定坐标和大小,可以指定主题和动画名称。如:\n\n```xml\n\n...\n\n```\n\n>\n更多用法请参考:[overlay.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/)\n\n在c代码中使用函数overlay\\_create创建窗口。如:\n\n```c\nwidget_t* overlay = overlay_create(NULL, 100, 100, 200, 300);\n```\n\n> 完整示例请参考:[overlay\ndemo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/)\n\n可用通过style来设置窗口的风格,如背景颜色或图片等。如:\n\n```xml\n\n```\n\n> 更多用法请参考:[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L0)", - "name": "overlay_t", - "parent": "window_base_t", + "properties": [], + "header": "widgets/spin_box.h", + "desc": "spinbox控件。\n\n一个特殊的数值编辑器,将edit\\_t和button\\_t进行组合,方便编辑数值。\n\n点击向上的按钮将数值增加一个step,点击向下的按钮将数值减小一个step。\nstep的值可以通过step属性进行设置。\n\nspin_box\\_t是[edit\\_t](edit_t.md)的子类控件,edit\\_t的函数均适用于spin\\_box\\_t控件。\n\n在xml中使用\"spin_box\"标签创建spinbox控件。如:\n\n```xml\n\n```\n\n>\n更多用法请参考:[spin_box.xml](https://github.com/zlgopen/awtk/blob/master/design/default/ui/spinbox.xml)\n\n在c代码中使用函数spin_box\\_create创建spinbox控件。如:\n\n```c\nwidget_t* spin_box = spin_box_create(win, 10, 10, 128, 30);\nedit_set_input_type(spin_box, type);\n```\n\n> 创建之后:\n>\n> 可以用edit相关函数去设置它的各种属性。\n\n> 完整示例请参考:[spin_box\ndemo](https://github.com/zlgopen/awtk-c-demos/blob/master/demos/spin_box.c)\n\n可用通过style来设置控件的显示风格,如背景和边框等。如:\n\n```xml\n\n\n\n```\n\n> 更多用法请参考:[theme\ndefault](https://github.com/zlgopen/awtk/blob/master/design/default/styles/default.xml#L128)", + "name": "spin_box_t", + "parent": "edit_t", "annotation": { "scriptable": true, "design": true, - "widget": true, - "window": true + "widget": true }, "level": 3 }, @@ -62726,11 +62712,11 @@ "constructor": true, "scriptable": true }, - "desc": "创建image对象", - "name": "image_create", + "desc": "创建system_bar对象。", + "name": "system_bar_create", "return": { "type": "widget_t*", - "desc": "对象。" + "desc": "system_bar对象。" } }, { @@ -62738,70 +62724,217 @@ { "type": "widget_t*", "name": "widget", - "desc": "image对象。" - }, - { - "type": "image_draw_type_t", - "name": "draw_type", - "desc": "绘制方式(仅在没有旋转和缩放时生效)。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置图片的绘制方式。", - "name": "image_set_draw_type", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "widget_t*", - "name": "widget", - "desc": "image对象。" + "desc": "system_bar对象。" } ], "annotation": { "cast": true, "scriptable": true }, - "desc": "转换为image对象(供脚本语言使用)。", - "name": "image_cast", + "desc": "转换为system_bar对象(供脚本语言使用)。", + "name": "system_bar_cast", "return": { "type": "widget_t*", - "desc": "image对象。" + "desc": "system_bar对象。" } } ], "events": [], - "properties": [ + "properties": [], + "header": "widgets/system_bar.h", + "desc": "system\\_bar窗口。\n\nsystem\\_bar窗口是一种特殊的窗口,独占LCD顶部区域,用来显示当前窗口的标题和关闭按钮等内容。\n\n> system\\_bar窗口需要在打开第一个应用程序窗口之前打开。\n\nsystem_bar对两个子控件会做特殊处理:\n\n* 1.名为\"title\"的label控件,自动显示当前主窗口的name或text。\n* 2.名为\"close\"的button控件,点击之后向当前主窗口发送EVT\\_REQUEST\\_CLOSE\\_WINDOW消息。\n\nsystem\\_bar\\_t是[window\\_base\\_t](window_base_t.md)的子类控件,\nwindow\\_base\\_t的函数均适用于system\\_bar\\_t控件。\n\n在xml中使用\"system\\_bar\"标签创建system\\_bar窗口。如:\n\n```xml\n\n\n\n